
  /* 暗いバーのカウンターで開くための単一テーマ。明るい背景は使わない。 */
  :root {
    --ground:  #0E0F12;
    --panel:   #16181D;
    --panel2:  #1E2027;
    --rule:    #2A2D35;
    --ink:     #ECEBE8;
    --muted:   #9A9892;
    --faint:   #6E6C68;
    --amber:   #D99A3C;
    --amber-d: #8A6224;
    --amber-bg:#241C0F;
    --sea:     #14161B;

    --serif: "Zen Old Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
    --sans:  "Noto Sans JP", "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
    --mono:  "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  }

  * { box-sizing: border-box; }

  body {
    background: var(--ground);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.8;
    margin: 0;
    padding-inline: 16px;
    padding-block: 0 4rem;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
  }

  .wrap { max-width: 34rem; margin-inline: auto; }

  button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
  :focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; border-radius: 2px; }
  /* SVG内はブラウザ既定の青い矩形が出るので、輪郭の変化で示す */
  svg :focus { outline: none; }
  svg .rg:focus-visible { outline: none; stroke: var(--ink); stroke-width: 2.4; }
  svg .js-hit:focus-visible { outline: none; stroke: var(--ink); stroke-width: 2; }

  /* ---------- age gate ---------- */
  /* 確認済みのときは、JSが走る前の一瞬も出さない（ページ最上部の即時スクリプトで付く） */
  html.age-ok #gate { display: none !important; }
  #gate { position: fixed; inset: 0; z-index: 50; background: var(--ground);
          display: flex; align-items: center; justify-content: center; padding: 24px; }
  #gate .g-inner { max-width: 21rem; display: flex; flex-direction: column; gap: 1.1rem; text-align: center; }
  #gate .g-mark { font-family: var(--serif); font-size: 1.7rem; font-weight: 900; color: var(--amber); }
  #gate .g-q { font-size: 1.05rem; font-weight: 700; }
  #gate .g-note { font-size: .82rem; color: var(--muted); line-height: 1.8; }
  #gate .g-btns { display: flex; flex-direction: column; gap: .6rem; margin-top: .4rem; }
  #gate .g-yes { background: var(--amber); color: #17130A; font-weight: 700; padding: .95rem; border-radius: 4px; }
  #gate .g-no { color: var(--muted); font-size: .88rem; padding: .7rem; }
  #gate .g-deny { font-size: .9rem; color: var(--muted); }

  /* ---------- header / search ---------- */
  header.top { padding-block: 1.5rem .8rem; display: flex; flex-direction: column; gap: .15rem; }
  .brand { font-family: var(--serif); font-weight: 900; font-size: 1.35rem; letter-spacing: .02em; }
  .brand span { color: var(--amber); }
  .tag { font-size: .76rem; color: var(--faint); }

  .searchbar { position: sticky; top: 0; z-index: 20; background: var(--ground);
               padding-block: .5rem .6rem; }
  .searchbar input {
    width: 100%; background: var(--panel); border: 1px solid var(--rule); color: var(--ink);
    font-family: var(--sans); font-size: 16px; padding: .8rem .9rem; border-radius: 4px;
  }
  .searchbar input::placeholder { color: var(--faint); }

  /* ---------- tabs ---------- */
  .tabs { display: flex; gap: .3rem; border-bottom: 1px solid var(--rule); margin-bottom: .2rem; }
  .tab {
    flex: 1; text-align: center; font-size: .82rem; color: var(--muted);
    padding: .7rem .2rem .6rem; border-bottom: 2px solid transparent; margin-bottom: -1px;
  }
  .tab[aria-selected="true"] { color: var(--amber); border-bottom-color: var(--amber); font-weight: 700; }

  /* ---------- map ---------- */
  .mapwrap { padding-block: 1rem .2rem; }
  .mapswitch { display: grid; grid-template-columns: repeat(auto-fit, minmax(7.2rem, 1fr));
               gap: .4rem; margin-bottom: .7rem; }
  .othernote { font-size: .88rem; color: var(--muted); line-height: 1.95; margin: 0 0 .2rem;
               border-left: 2px solid var(--amber-d); padding-left: .9rem; }
  .msw { flex: 1; font-size: .82rem; color: var(--muted); padding: .5rem;
         border: 1px solid var(--rule); border-radius: 4px; background: var(--panel); }
  .msw[aria-pressed="true"] { background: var(--amber-bg); border-color: var(--amber-d); color: var(--amber); font-weight: 700; }
  .jl { fill: var(--amber); fill-opacity: .30; stroke: #5A5348; stroke-width: 1.2; }
  .js-hit { fill: transparent; cursor: pointer; }
  .js-dot { fill: var(--amber); stroke: #0E0F12; stroke-width: 1.4; pointer-events: none; }
  .js-g[data-on="1"] .js-dot { r: 6.5; stroke: var(--ink); stroke-width: 2; }
  .js-label { font-family: var(--sans); font-size: 8.5px; fill: var(--ink); pointer-events: none;
              paint-order: stroke; stroke: #0E0F12; stroke-width: 2.5px; stroke-linejoin: round; }
  .js-g[data-on="1"] .js-label { fill: var(--amber); }
  .dot-key { width: 9px; height: 9px; border-radius: 50%; background: var(--amber); display: inline-block; }
  .dot-key.faint { background: var(--amber-d); }
  .w-dot { fill: var(--amber); stroke: #0E0F12; stroke-width: 1.2; pointer-events: none; }
  .w-g[data-own="1"] .w-dot { fill: var(--amber-d); }
  .w-label { font-family: var(--sans); font-size: 8px; fill: var(--ink); pointer-events: none;
             paint-order: stroke; stroke: #0E0F12; stroke-width: 2.5px; stroke-linejoin: round; }
  .w-g[data-own="1"] .w-label { fill: var(--muted); }

  /* ---------- 用語 ---------- */
  .chip.term { cursor: pointer; border-style: dashed; }
  .chip.term::after { content: " ?"; color: var(--amber); font-size: .68rem; }
  .termbox { background: var(--panel); border: 1px solid var(--rule); border-radius: 4px;
             padding: .9rem 1rem 1rem; margin-bottom: 1.2rem; display: flex; flex-direction: column; gap: .7rem; }
  .termbox dl { margin: 0; }
  .termbox dt { font-weight: 700; font-size: .88rem; color: var(--amber); }
  .termbox dd { margin: .1rem 0 0; font-size: .86rem; color: var(--muted); line-height: 1.85; }

  /* ---------- 飲み比べ ---------- */
  .cmp { display: flex; flex-direction: column; gap: .1rem; }
  .cmp-item { border-top: 1px solid var(--rule); padding-block: .55rem .2rem; }
  .cmp-item:last-child { border-bottom: 1px solid var(--rule); padding-bottom: .55rem; }
  .cmp-lead { font-size: .82rem; color: var(--faint); line-height: 1.8; margin: -.3rem 0 .7rem; }
  .cmp-why { font-size: .74rem; color: var(--amber); letter-spacing: .02em; }
  .cmp-note { font-size: .74rem; color: var(--faint); padding-top: .2rem; }
  .cmp .row { border-bottom: none; padding-block: .4rem .5rem; }

  /* ---------- 価格の根拠 ---------- */
  .why { font-size: .74rem; color: var(--amber); text-align: right; padding-top: .5rem; }
  .whybox { font-size: .78rem; color: var(--faint); line-height: 1.85; margin-top: .7rem;
            padding-top: .7rem; border-top: 1px dotted var(--rule); }

  /* ---------- 味のスライダー ---------- */
  .mixer { background: var(--panel); border: 1px solid var(--rule); border-radius: 4px;
           padding: 1rem 1rem 1.1rem; margin-top: 1.4rem; }
  .mixer h3 { font-family: var(--sans); font-size: .95rem; font-weight: 700; margin: 0 0 .2rem; }
  .mixer .mx-note { font-size: .76rem; color: var(--faint); margin: 0 0 .9rem; }
  .mx-row { display: grid; grid-template-columns: 4.6rem 1fr 1.5rem; gap: .7rem; align-items: center; margin-bottom: .5rem; }
  .mx-row label { font-size: .8rem; color: var(--muted); }
  .mx-row output { font-family: var(--mono); font-size: .76rem; color: var(--amber); text-align: right; font-variant-numeric: tabular-nums; }
  .mx-row input[type=range] { width: 100%; accent-color: var(--amber); height: 24px; }
  .mx-actions { display: flex; gap: .5rem; margin-top: .8rem; }
  .mx-actions button { flex: 1; font-size: .82rem; padding: .55rem; border: 1px solid var(--rule);
                       border-radius: 4px; background: var(--panel2); color: var(--muted); }
  .mapcard { background: var(--sea); border: 1px solid var(--rule); border-radius: 4px; padding: .6rem .4rem .2rem; }
  svg.map { display: block; width: 100%; max-width: 100%; height: auto; max-height: 54vh; }
  #mapPoint svg.map { max-height: 66vh; }
  .rg { cursor: pointer; stroke: #5A5348; stroke-width: 1.2; transition: opacity .18s ease; }
  .rg:hover { opacity: .85; }
  .rg[data-on="1"] { stroke: var(--ink); stroke-width: 2.4; }
  .rlabel { font-family: var(--sans); font-size: 9px; fill: var(--ink); pointer-events: none;
            paint-order: stroke; stroke: #0E0F12; stroke-width: 2.5px; stroke-linejoin: round; }
  .legend { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem .6rem;
            font-size: .7rem; color: var(--faint); padding: .5rem .6rem .7rem; }
  .legend > span { white-space: nowrap; }
  .legend .l-hint { color: var(--amber); margin-left: auto; }
  .legend .ramp { display: flex; gap: 2px; }
  .legend .ramp i { width: 14px; height: 8px; border-radius: 1px; background: var(--amber); display: block; }

  .countries { display: grid; grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr)); gap: .4rem; margin-top: .6rem; }
  .cbtn { text-align: left; background: var(--panel); border: 1px solid var(--rule); border-radius: 4px; padding: .6rem .7rem; }
  .cbtn .c-n { display: block; font-family: var(--serif); font-weight: 700; font-size: .95rem; line-height: 1.5; }
  .cbtn .c-l { display: block; font-size: .72rem; color: var(--faint); line-height: 1.5; }
  .cbtn[data-on="1"] { border-color: var(--amber-d); background: var(--amber-bg); }
  .cbtn[data-on="1"] .c-n { color: var(--amber); }

  .rpanel { margin-top: 1.1rem; scroll-margin-top: 4.6rem; }
  #moodOut { scroll-margin-top: 4.6rem; }
  .rpanel .r-h { font-family: var(--serif); font-size: 1.3rem; font-weight: 900; }
  .rpanel .r-lead { font-size: .78rem; color: var(--amber); letter-spacing: .04em; margin-bottom: .5rem; }
  .rpanel .r-t { font-size: .92rem; color: var(--muted); line-height: 1.9; margin: 0 0 1rem;
                 border-left: 2px solid var(--amber-d); padding-left: .9rem; }

  /* ---------- moods ---------- */
  .moods { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: .45rem; padding-block: 1rem .4rem; }
  .mood { text-align: left; background: var(--panel); border: 1px solid var(--rule); border-radius: 4px; padding: .75rem .8rem .8rem; }
  .mood .m-l { display: block; font-size: .92rem; font-weight: 700; line-height: 1.5; }
  .mood .m-n { display: block; font-size: .72rem; color: var(--faint); line-height: 1.5; }
  .mood[data-on="1"] { border-color: var(--amber-d); background: var(--amber-bg); }
  .mood[data-on="1"] .m-l { color: var(--amber); }

  /* ---------- today ---------- */
  .today { padding-block: 1.2rem .4rem; display: flex; flex-direction: column; gap: 1rem; }
  .tcard { background: var(--panel); border: 1px solid var(--rule); border-radius: 4px; padding: 1.2rem 1.2rem 1.3rem; }
  .tcard .t-eyebrow { font-family: var(--mono); font-size: .66rem; letter-spacing: .12em; color: var(--faint); text-transform: uppercase; }
  .tcard .t-name { font-family: var(--serif); font-size: 1.5rem; font-weight: 900; line-height: 1.4; margin-block: .3rem .1rem; }
  .tcard .t-meta { font-size: .76rem; color: var(--muted); margin-bottom: .8rem; }
  .tcard .t-desc { font-size: .9rem; color: var(--muted); line-height: 1.9; margin: 0 0 1rem; }
  .tcard .t-go { display: block; text-align: center; text-decoration: none; background: var(--amber-bg); border: 1px solid var(--amber-d);
                 color: var(--amber); padding: .7rem; border-radius: 4px; font-size: .86rem; font-weight: 700; }
  .reroll { font-size: .84rem; color: var(--muted); text-align: center; padding: .5rem; }

  /* ---------- list ---------- */
  .count { font-family: var(--mono); font-size: .7rem; color: var(--faint); padding-block: .9rem .5rem; letter-spacing: .05em; }
  .count:not(:empty)::after { content: " ／ タップで銘柄ページへ"; }
  .list { display: flex; flex-direction: column; gap: .45rem; }
  /* 押せることが見た目で分かるように、1件ずつカードにして「›」を出す */
  .row {
    width: 100%; text-align: left; text-decoration: none; color: inherit;
    display: grid; grid-template-columns: 1fr auto auto; gap: .15rem .9rem;
    padding: .8rem .9rem; align-items: center;
    background: var(--panel); border: 1px solid var(--rule); border-radius: 6px;
    transition: border-color .15s ease, background .15s ease;
  }
  .row::after { content: "›"; grid-row: 1 / span 2; grid-column: 3;
                font-size: 1.15rem; line-height: 1; color: var(--faint); padding-left: .1rem; }
  .row:active { background: var(--panel2); border-color: var(--amber-d); }
  .row:active::after { color: var(--amber); }
  @media (hover: hover) { .row:hover { border-color: var(--amber-d); } .row:hover::after { color: var(--amber); } }
  .row .r-name { font-family: var(--serif); font-size: 1.05rem; font-weight: 700; line-height: 1.45; }
  .row .r-meta { font-size: .76rem; color: var(--muted); grid-column: 1; }
  .row .r-price { grid-row: 1 / span 2; grid-column: 2; font-family: var(--mono); font-size: .8rem;
                  color: var(--amber); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .row .r-price small { display: block; color: var(--faint); font-size: .66rem; letter-spacing: .04em; }
  .empty { color: var(--muted); font-size: .9rem; padding-block: 2rem; text-align: center; }

  /* ---------- detail ---------- */
  .back { display: inline-flex; align-items: center; gap: .4rem; font-size: .82rem; color: var(--muted); padding-block: 1.1rem .4rem; }
  .d-name { font-family: var(--serif); font-size: 1.85rem; font-weight: 900; line-height: 1.35; margin: .2rem 0 .2rem; text-wrap: balance; }
  .d-en { font-family: var(--mono); font-size: .74rem; color: var(--faint); letter-spacing: .03em; }
  .chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-block: .9rem 1.2rem; }
  .chip { font-size: .74rem; padding: .25rem .6rem; background: var(--panel); border: 1px solid var(--rule);
          border-radius: 3px; color: var(--muted); white-space: nowrap; }
  .chip b { color: var(--ink); font-weight: 500; }
  .desc { font-size: 1rem; line-height: 1.95; border-left: 2px solid var(--amber-d); padding-left: 1rem; margin-bottom: 1.6rem; }
  h2.sec { font-family: var(--mono); font-size: .68rem; letter-spacing: .13em; text-transform: uppercase;
           color: var(--faint); margin: 0 0 .8rem; font-weight: 600; }
  section.d { margin-bottom: 1.8rem; }

  .bars { display: flex; flex-direction: column; gap: .5rem; }
  .bar { display: grid; grid-template-columns: 4.6rem 1fr 1.7rem; gap: .7rem; align-items: center; }
  .bar .b-label { font-size: .8rem; color: var(--muted); }
  .bar .b-track { display: block; height: 8px; background: var(--panel2); border-radius: 4px; overflow: hidden; }
  .bar .b-fill { display: block; height: 8px; min-width: 4px; background: var(--amber); border-radius: 4px; }
  .bar .b-val { font-family: var(--mono); font-size: .74rem; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
  .aroma { font-size: .86rem; color: var(--muted); margin-top: .9rem; }

  .pricebox { background: var(--panel); border: 1px solid var(--rule); border-radius: 4px; padding: 1.1rem 1.1rem 1.2rem; }
  .prow { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
          font-size: .88rem; padding-block: .38rem; border-bottom: 1px dotted var(--rule); }
  .prow:last-of-type { border-bottom: none; }
  .prow .k { color: var(--muted); }
  .prow .v { font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
  .punch { margin-top: .9rem; padding-top: .9rem; border-top: 1px solid var(--rule);
           display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
  .punch .k { font-weight: 700; font-size: .92rem; }
  .punch .v { font-family: var(--serif); font-size: 1.6rem; font-weight: 700; color: var(--amber); font-variant-numeric: tabular-nums; }
  .punch .v small { font-family: var(--sans); font-size: .85rem; font-weight: 400; }
  .pnote { font-size: .78rem; color: var(--faint); margin-top: .8rem; line-height: 1.7; }

  .sim { display: flex; flex-direction: column; }
  .sim .row:first-child { border-top: 1px solid var(--rule); }

  .buy { display: block; text-align: center; background: var(--amber-bg); border: 1px solid var(--amber-d);
         color: var(--amber); text-decoration: none; padding: .9rem; border-radius: 4px; font-size: .9rem; font-weight: 700; }
  .buynote { font-size: .72rem; color: var(--faint); text-align: center; margin-top: .6rem; }

  footer { margin-top: 2.5rem; padding-top: 1.2rem; border-top: 1px solid var(--rule);
           font-size: .72rem; color: var(--faint); line-height: 1.8; }

  [hidden] { display: none !important; }
  @media (prefers-reduced-motion: no-preference) { .b-fill { transition: width .35s ease; } }

/* ---------- 銘柄ページ専用 ---------- */
.crumb { font-size: .78rem; color: var(--muted); padding-block: 1.4rem .3rem; }
.crumb a { color: var(--amber); text-decoration: none; }
.crumb span { color: var(--faint); margin-inline: .3rem; }
.backnav { padding-block: 1.6rem .4rem; }
.backnav a { color: var(--muted); text-decoration: none; font-size: .86rem; }
.pgroup { font-family: var(--mono); font-size: .66rem; letter-spacing: .1em;
          color: var(--faint); text-transform: uppercase; padding-block: .5rem .2rem; }
.pgroup:first-child { padding-top: 0; }
.prow .k small { display: block; font-size: .68rem; color: var(--faint); }
.cheap { font-size: .66rem; color: var(--amber); border: 1px solid var(--amber-d);
         border-radius: 2px; padding: .05em .4em .1em; margin-left: .35rem; white-space: nowrap; }
.buys { display: flex; flex-direction: column; gap: .5rem; }
.buy.alt { background: var(--panel); border-color: var(--rule); color: var(--muted); }

/* こんな人に向く：説明の前に置く（買うリンクの直下ではなく） */
.who { font-size: .92rem; line-height: 1.7; color: var(--ink);
       margin: .9rem 0 0; }
.who span { display: block; font-family: var(--mono); font-size: .64rem;
            letter-spacing: .12em; color: var(--amber); margin-bottom: .15rem; }

/* ---------- ページが変わったことを分かりやすくする ---------- */
.topbar { position: fixed; inset: 0 0 auto 0; z-index: 60;
          display: flex; align-items: center; gap: .6rem;
          padding: .55rem max(1.1rem, calc((100% - 640px) / 2));
          background: rgba(14,15,18,.92); backdrop-filter: blur(8px);
          border-bottom: 1px solid var(--rule);
          transform: translateY(-104%); transition: transform .22s ease; }
.topbar.show { transform: none; }
.tb-back { color: var(--amber); text-decoration: none; font-size: 1rem;
           line-height: 1; padding: .2rem .35rem .3rem 0; }
.tb-name { font-family: var(--serif); font-size: .95rem; font-weight: 700;
           color: var(--ink); flex: 1 1 auto; overflow: hidden;
           text-overflow: ellipsis; white-space: nowrap; }
.tb-price { font-family: var(--mono); font-size: .78rem; color: var(--muted); }

@keyframes d-enter { from { opacity: 0; transform: translateY(14px); } }
@keyframes d-line  { from { transform: scaleX(0); } }
.d-head { animation: d-enter .34s cubic-bezier(.2,.7,.3,1) both; }
.d-name { position: relative; }
.d-name::after { content: ""; position: absolute; left: 0; bottom: -.28rem;
                 width: 2.2rem; height: 2px; background: var(--amber);
                 transform-origin: left; animation: d-line .5s .12s ease both; }
@media (prefers-reduced-motion: reduce) {
  .d-head, .d-name::after { animation: none; }
  .topbar { transition: none; }
}
