/* ============================================================
   心野まるっとラボ — 共通スタイル
   画風の一次設定（illustration-guide.md §2）に準拠：
   クリーム／ベージュ／木の茶色／淡い緑／柔らかな空色／
   暖かな黄色／淡いピンク／紺色のアクセント
   ============================================================ */

/* ---------- 1. トークン（朝＝ライト） ---------- */
:root {
  --wood:       #6b4f3a;
  --green:      #9fb894;
  --sky:        #a9c9dd;
  --sun:        #f2c879;
  --pink:       #f0c3c0;
  --navy:       #2e3a55;

  --bg:          #fbf6ec;
  --bg-panel:    #fffdf8;
  --bg-sunken:   #f5ecdc;
  --fg:          #3c3128;
  --fg-soft:     #6f6155;
  --line:        #e2d6c1;
  --accent:      #6b4f3a;
  --accent-soft: #f0e2c9;
  --on-accent:   #fffdf8;
  --shadow:      0 2px 4px rgba(107, 79, 58, .05), 0 10px 30px rgba(107, 79, 58, .07);
  --shadow-lift: 0 4px 8px rgba(107, 79, 58, .07), 0 18px 44px rgba(107, 79, 58, .12);

  --radius:   18px;
  --radius-s: 12px;

  --serif: "Shippori Mincho B1", "Yu Mincho", "YuMincho", "Hiragino Mincho ProN", serif;
  --sans:  "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Yu Gothic", "Meiryo", system-ui, sans-serif;

  --wrap: 1080px;
  color-scheme: light;
}

/* ---------- 2. トークン（夜＝ダーク） ---------- */
/* 夜ふみの色：藍／木の影／暖色の灯り（illustration-guide.md §2） */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:          #1c2231;
    --bg-panel:    #232b3c;
    --bg-sunken:   #171d2a;
    --fg:          #ede4d6;
    --fg-soft:     #aca090;
    --line:        #37415a;
    --accent:      #f2c879;
    --accent-soft: #2f3a52;
    --on-accent:   #23252b;
    --shadow:      0 2px 4px rgba(0, 0, 0, .22), 0 10px 30px rgba(0, 0, 0, .32);
    --shadow-lift: 0 4px 8px rgba(0, 0, 0, .28), 0 18px 44px rgba(0, 0, 0, .42);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg:          #1c2231;
  --bg-panel:    #232b3c;
  --bg-sunken:   #171d2a;
  --fg:          #ede4d6;
  --fg-soft:     #aca090;
  --line:        #37415a;
  --accent:      #f2c879;
  --accent-soft: #2f3a52;
  --on-accent:   #23252b;
  --shadow:      0 2px 4px rgba(0, 0, 0, .22), 0 10px 30px rgba(0, 0, 0, .32);
  --shadow-lift: 0 4px 8px rgba(0, 0, 0, .28), 0 18px 44px rgba(0, 0, 0, .42);
  color-scheme: dark;
}

/* ---------- 3. ベース ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background-color: var(--bg);
  /* 和紙の粒子感 */
  background-image:
    radial-gradient(1100px 520px at 12% -10%, rgba(242, 200, 121, .16), transparent 60%),
    radial-gradient(900px 480px at 92% 4%, rgba(169, 201, 221, .18), transparent 60%);
  background-attachment: fixed, fixed;
  background-repeat: no-repeat, no-repeat;
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.95;
  letter-spacing: .02em;
  -webkit-font-smoothing: antialiased;
}
/* キャラクターの壁紙（いちばん下に敷く固定レイヤー）
   朝はしっかり、夜はうんと薄く。夜に濃いとクリーム色の柄が浮いてしまう。 */
body::after {
  content: "";
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: -2; pointer-events: none;
  background-image: url("/assets/pattern.png");
  background-repeat: repeat;
  background-size: 220px 220px;
  opacity: .35;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body::after { opacity: .09; }
}
:root[data-theme="dark"] body::after { opacity: .09; }

/* 和紙の粒子（壁紙の上、本文の下に敷く固定レイヤー） */
body::before {
  content: "";
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: -1; pointer-events: none;
  opacity: .05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/><feColorMatrix type='saturate' values='0'/></filter><rect width='180' height='180' filter='url(%23n)'/></svg>");
}

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.5; letter-spacing: .04em; margin: 0; }
p { margin: 0 0 1.1em; }
/* figure はブラウザ既定で左右に40pxのマージンが付く。
   丸アイコンを3つ横に並べると 240px を余白に食われて潰れるため、必ず消す。 */
figure { margin: 0; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }

/* 読みものの1段組み用。--wrap を上書きするだけで .wrap の式に乗ります。
   ⚠ 定義を忘れると 1080px のままになり、左寄せの文章と
   中央ぞろえの要素が別の列に見えてしまいます。 */
.wrap--narrow { --wrap: 680px; }
.center { text-align: center; }
.muted { color: var(--fg-soft); }
.small { font-size: .84rem; line-height: 1.8; }

:where(a, button, summary):focus-visible {
  outline: 2.5px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- 4. ヘッダー ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header__in {
  display: flex; align-items: center; gap: 1rem;
  min-height: 62px;
}
.brand {
  display: flex; align-items: center; gap: .5rem;
  font-family: var(--serif); font-size: 1.02rem; letter-spacing: .06em;
  text-decoration: none; white-space: nowrap; margin-right: auto;
}
.brand__mark { font-size: 1.15rem; }

/* min-width:0 が無いと、flexアイテムがリンクの合計幅より縮まず、
   狭い画面でヘッダーごと横にはみ出す（内部スクロールが効かなくなる） */
.nav { display: flex; align-items: center; gap: .15rem; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  padding: .4rem .68rem; border-radius: 999px;
  font-size: .86rem; text-decoration: none; color: var(--fg-soft);
  white-space: nowrap; transition: background .2s, color .2s;
}
.nav a:hover, .nav a[aria-current="page"] { background: var(--accent-soft); color: var(--fg); }

.theme-toggle {
  flex: none;
  border: 1px solid var(--line); background: var(--bg-panel); color: var(--fg);
  border-radius: 999px; padding: .38rem .8rem;
  font-family: var(--sans); font-size: .82rem; cursor: pointer;
  transition: background .2s, transform .2s;
}
.theme-toggle:hover { background: var(--accent-soft); transform: translateY(-1px); }

/* 320px幅ではロゴ173+間16+ナビ0+間16+ボタン101=306px となり、枠280pxを超える。
   ロゴとボタンは縮まない設定なので、狭い画面でだけ小さくして収める。 */
@media (max-width: 400px) {
  /* 狭い画面では、ヘッダーを2段にする。
     1段に詰めると nav が 106px 必要なのに 81px しかもらえず、
     「アプリ置き場」が「アプリ置き」で切れていた。
     文字を削るより、行を増やすほうが読める。 */
  .site-header__in { gap: .5rem; flex-wrap: wrap; row-gap: .45rem; }
  .brand { font-size: .92rem; flex: 1 1 100%; }
  /* nav は「縮んでよい」ままにする。
     トップはリンクが5本あり、縮まないと 484px になって画面からはみ出す。
     ブランドが1行を占めたぶん、リンク1本のページでは縮まずに全部出る。 */
  .nav   { min-width: 0; margin-right: auto; }
  .theme-toggle { font-size: .74rem; padding: .32rem .6rem; }
}

/* ---------- 5. セクション ---------- */
.section { padding: clamp(3.2rem, 7vw, 5.6rem) 0; }
.section--sunken { background: color-mix(in srgb, var(--bg-sunken) 70%, transparent); }

.section__label {
  display: inline-block; margin-bottom: .5rem;
  font-size: .74rem; letter-spacing: .28em;
  color: var(--fg-soft);
}
.section__title { font-size: clamp(1.5rem, 3.6vw, 2.05rem); margin-bottom: .5rem; }
.section__lead { max-width: 40em; color: var(--fg-soft); margin-bottom: 2.4rem; }

/* ---------- 6. ヒーロー ---------- */
.hero { padding: clamp(3rem, 8vw, 5.5rem) 0 clamp(2rem, 5vw, 3.5rem); text-align: center; }
.hero__eyebrow {
  font-size: .78rem; letter-spacing: .3em; color: var(--fg-soft); margin-bottom: 1.1rem;
}
.hero__title {
  font-size: clamp(1.9rem, 6vw, 3.2rem); line-height: 1.35; margin-bottom: 1.2rem;
}
.hero__title .ruby { display: block; font-size: .4em; letter-spacing: .3em; color: var(--fg-soft); margin-bottom: .7rem; }
.hero__lead { max-width: 33em; margin: 0 auto 2rem; color: var(--fg-soft); }
/* 狭い画面でも4行を保つ。16pxのままだと360pxで5行、320pxで6行になる。
   いちばん長い2行目（20文字）が入る大きさまで、幅に応じて段階的に縮める。 */
@media (max-width: 400px) {
  .hero__lead { font-size: clamp(.82rem, 4.1vw, .94rem); letter-spacing: 0; }
}
/* ラボのいつもの風景（任意画像。無ければJSがブロックごと消す） */
.hero__scene {
  margin: clamp(2.4rem, 5vw, 3.4rem) auto 0;
  max-width: 900px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--bg-panel);
}
.hero__scene img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

.hero__cast {
  display: flex; justify-content: center; align-items: flex-start; gap: clamp(.6rem, 3vw, 2.5rem);
  margin: 3rem auto 0; max-width: 720px;
}
.hero__cast .portrait { flex: 1 1 0; max-width: 210px; }

.badges { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; }
.badge {
  border: 1px solid var(--line); background: var(--bg-panel);
  border-radius: 999px; padding: .34rem .9rem; font-size: .8rem; color: var(--fg-soft);
}

/* ---------- 7. ポートレート（画像 or 代替枠） ---------- */
.portrait { text-align: center; }
.portrait__frame {
  position: relative; aspect-ratio: 1; border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .55), transparent 55%),
    var(--accent-soft);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: grid; place-items: center; overflow: hidden;
}
.portrait__frame img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.portrait__frame .fallback { font-size: clamp(2.2rem, 6vw, 3.2rem); line-height: 1; }
.portrait__name { margin-top: .85rem; font-family: var(--serif); font-size: 1rem; }
.portrait__role { font-size: .78rem; color: var(--fg-soft); }

/* ---------- 8. カード ---------- */
.grid { display: grid; gap: 1.2rem; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(248px, 1fr)); }

.card {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.6rem;
  box-shadow: var(--shadow);
  transition: transform .25s, box-shadow .25s;
}
a.card { text-decoration: none; display: block; }
a.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
/* カードの上端いっぱいに載せる画像（padding を打ち消して縁まで広げる） */
.card__img {
  display: block;
  width: calc(100% + 3.2rem);
  margin: -1.5rem -1.6rem 1.2rem;
  border-radius: var(--radius) var(--radius) 0 0;
  object-fit: cover;
  background: var(--bg-sunken);
}
.card__img--wide   { aspect-ratio: 3 / 2; }
.card__img--square { aspect-ratio: 1 / 1; }

/* セクションの帯（アプリ置き場・ためし読みなど） */
.banner {
  margin: 0 0 clamp(1.8rem, 4vw, 2.6rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--bg-panel);
}
.banner img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }

.card__eyebrow { font-size: .74rem; letter-spacing: .18em; color: var(--fg-soft); margin-bottom: .45rem; }
.card__title { font-size: 1.08rem; margin-bottom: .55rem; }
.card__body { font-size: .9rem; color: var(--fg-soft); margin: 0; }
.card__foot { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }

.chip {
  font-size: .74rem; padding: .2rem .62rem; border-radius: 999px;
  background: var(--bg-sunken); border: 1px solid var(--line); color: var(--fg-soft);
}
.chip--free   { background: color-mix(in srgb, var(--green) 26%, var(--bg-panel)); }
.chip--paid   { background: color-mix(in srgb, var(--sun) 30%, var(--bg-panel)); }
.chip--member { background: color-mix(in srgb, var(--pink) 34%, var(--bg-panel)); }

/* ---------- 9. キャラクター ---------- */
.chara {
  display: grid; grid-template-columns: 150px 1fr; gap: 1.6rem; align-items: start;
  background: var(--bg-panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.7rem; box-shadow: var(--shadow);
}
.chara__name { font-size: 1.25rem; margin-bottom: .1rem; }
.chara__role { font-size: .8rem; color: var(--fg-soft); margin-bottom: .9rem; letter-spacing: .12em; }
.chara__quote {
  margin: 1rem 0 0; padding: .75rem 1rem;
  border-left: 3px solid var(--accent);
  background: var(--bg-sunken); border-radius: 0 var(--radius-s) var(--radius-s) 0;
  font-size: .9rem;
}
.deflist { display: grid; grid-template-columns: auto 1fr; gap: .3rem 1rem; font-size: .86rem; margin: 1rem 0 0; }
.deflist dt { color: var(--fg-soft); white-space: nowrap; }
.deflist dd { margin: 0; }
@media (max-width: 640px) {
  .chara { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .chara__body { text-align: left; width: 100%; }
  .chara .portrait { width: 150px; }
}

/* ---------- 10. ボタン ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .7rem 1.5rem; border-radius: 999px;
  font-family: var(--sans); font-size: .92rem; text-decoration: none;
  border: 1px solid var(--accent); background: var(--accent);
  color: var(--on-accent);
  transition: transform .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.btn--ghost { background: transparent; color: var(--fg); border-color: var(--line); }
.btn-row { display: flex; flex-wrap: wrap; gap: .7rem; }
.hero .btn-row { justify-content: center; }

/* ---------- 11. フッター ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 3rem 0 2.4rem;
  background: color-mix(in srgb, var(--bg-sunken) 60%, transparent);
}
.sign { font-size: .88rem; line-height: 2.1; margin: 0 0 1.6rem; }
.footer-grid { display: flex; flex-wrap: wrap; gap: 1.5rem 2.5rem; justify-content: space-between; align-items: flex-start; }
.footer-links { display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; font-size: .86rem; }
.footer-links a { color: var(--fg-soft); text-decoration: none; }
.footer-links a:hover { color: var(--fg); text-decoration: underline; }

/* ---------- 12. アプリ置き場 ---------- */
.app-card { display: flex; flex-direction: column; height: 100%; }
.app-card__icon {
  width: 52px; height: 52px; border-radius: 15px;
  display: grid; place-items: center; font-size: 1.6rem;
  background: var(--accent-soft); border: 1px solid var(--line);
  margin-bottom: .95rem;
}
.app-card__body { flex: 1; }
.app-state {
  border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 2.4rem 1.5rem; text-align: center; color: var(--fg-soft);
}
/* トップの「用途から探す」で絞り込んだときに出る帯 */
.app-filter {
  margin: 0 0 1.2rem; font-size: .88rem; color: var(--fg-soft);
  background: var(--bg-sunken); border: 1px solid var(--line);
  border-radius: var(--radius-s); padding: .7rem 1rem;
}
.app-filter b { color: var(--fg); font-weight: 600; }
.app-filter a { color: var(--fg-soft); }
.status-dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--green); display: inline-block; }
.status-dot--wip { background: var(--sun); }

/* ---------- 13. 表 ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: .88rem; }
th, td { padding: .7rem .9rem; text-align: left; border-bottom: 1px solid var(--line); }
th { font-family: var(--serif); font-weight: 600; color: var(--fg-soft); font-size: .82rem; letter-spacing: .1em; }

/* ---------- 14. 注記ボックス ---------- */
.note-box {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-panel); padding: 1.3rem 1.5rem;
  font-size: .88rem; color: var(--fg-soft); box-shadow: var(--shadow);
}
.note-box code {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  background: var(--bg-sunken); padding: .1rem .4rem; border-radius: 5px; font-size: .92em;
}

/* ============================================================
   15. アプリ売り場（トップページ）
   中身は apps.json から script.js が生成します。
   品数が足りないセクションは、JSが自動で隠します。
   ============================================================ */

.hero--shop { padding-bottom: clamp(1.5rem, 4vw, 2.5rem); }

/* ---- いちばん推している1本 ---- */
.shop-hero {
  display: grid; grid-template-columns: 1.1fr 1fr; align-items: stretch;
  margin: clamp(2.2rem, 5vw, 3.2rem) auto 0; max-width: 940px;
  text-align: left;
  background: var(--bg-panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-lift);
  overflow: hidden; text-decoration: none; color: inherit;
  transition: transform .25s, box-shadow .25s;
}
.shop-hero:hover { transform: translateY(-3px); }
.shop-hero__media { background: var(--bg-sunken); }
.shop-hero__media img { width: 100%; height: 100%; min-height: 200px; object-fit: cover; display: block; }
.shop-hero__media .ph { height: 100%; min-height: 200px; display: grid; place-items: center; font-size: 3rem; }
.shop-hero__body { padding: clamp(1.4rem, 3vw, 2.1rem); display: flex; flex-direction: column; gap: .55rem; justify-content: center; }
.shop-hero__name { font-family: var(--serif); font-size: clamp(1.25rem, 3vw, 1.6rem); line-height: 1.5; }
.shop-hero__tag { color: var(--fg-soft); font-size: .95rem; margin: 0; }
@media (max-width: 760px) { .shop-hero { grid-template-columns: 1fr; } }

/* ---- 値段 ---- */
.price { font-family: var(--serif); font-size: 1.35rem; line-height: 1.3; }
.price small { font-family: var(--sans); font-size: .78rem; color: var(--fg-soft); margin-left: .5rem; }
.price--free { color: var(--accent); }

/* ---- 横スクロールの棚 ---- */
.rail-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; }
.rail-head .section__title { margin-bottom: 0; }
.rail-nav { display: flex; gap: .4rem; flex: none; }
.rail-btn {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  border: 1px solid var(--line); background: var(--bg-panel); color: var(--fg);
  cursor: pointer; font-size: .95rem; line-height: 1;
  transition: background .2s, opacity .2s;
}
.rail-btn:hover:not([disabled]) { background: var(--accent-soft); }
.rail-btn[disabled] { opacity: .28; cursor: default; }
@media (max-width: 640px) { .rail-nav { display: none; } }

.rail {
  display: flex; gap: 1rem; overflow-x: auto; scroll-behavior: smooth;
  scroll-snap-type: x proximity; padding-bottom: 1rem;
  scrollbar-width: thin;
}
.rail > * { flex: 0 0 clamp(228px, 68vw, 288px); scroll-snap-align: start; }

/* ---- 商品カード ---- */
.pcard {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg-panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  text-decoration: none; color: inherit;
  transition: transform .25s, box-shadow .25s;
}
.pcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.pcard__media { position: relative; background: var(--bg-sunken); }
.pcard__media img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.pcard__media .ph { aspect-ratio: 16 / 9; display: grid; place-items: center; font-size: 2.4rem; }
.pcard__badges { position: absolute; top: .6rem; left: .6rem; display: flex; gap: .3rem; }
.pcard__badges span {
  background: var(--accent); color: var(--on-accent);
  font-size: .7rem; letter-spacing: .06em; padding: .22rem .6rem; border-radius: 999px;
}
.pcard__body { padding: 1rem 1.1rem 1.15rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.pcard__name { font-family: var(--serif); font-size: 1.02rem; line-height: 1.5; }
.pcard__tag { font-size: .86rem; color: var(--fg-soft); margin: 0; flex: 1; }
.pcard__foot { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; margin-top: .5rem; }
.pcard__foot .price { font-size: 1.12rem; }

/* ---- カテゴリ ---- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(208px, 1fr)); gap: 1rem; }
.cat-tile {
  display: flex; align-items: center; gap: .9rem; padding: 1.1rem 1.2rem;
  background: var(--bg-panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  text-decoration: none; color: inherit;
  transition: transform .2s, box-shadow .2s;
}
.cat-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.cat-tile__icon {
  width: 46px; height: 46px; border-radius: 14px; flex: none;
  display: grid; place-items: center; font-size: 1.4rem;
  background: var(--accent-soft); border: 1px solid var(--line);
}
.cat-tile__name { font-family: var(--serif); font-size: 1rem; }
.cat-tile__n { font-size: .78rem; color: var(--fg-soft); }

/* ---- ラボの推し順 ---- */
.rank-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .9rem; }
.rank-item {
  display: grid; grid-template-columns: auto 104px 1fr; gap: 1rem; align-items: center;
  padding: .9rem 1.2rem .9rem .9rem;
  background: var(--bg-panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  text-decoration: none; color: inherit; transition: box-shadow .2s, transform .2s;
}
.rank-item:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.rank-no { font-family: var(--serif); font-size: 1.45rem; color: var(--accent); min-width: 1.5em; text-align: center; }
.rank-thumb { width: 104px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-s); background: var(--bg-sunken); display: block; }
.rank-thumb--ph { display: grid; place-items: center; font-size: 1.5rem; }
.rank-body { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.rank-name { font-family: var(--serif); font-size: 1.02rem; }
.rank-tag { font-size: .84rem; color: var(--fg-soft); margin: 0; }
.rank-body .price { font-size: 1.02rem; margin-top: .2rem; }
@media (max-width: 560px) {
  .rank-item { grid-template-columns: auto 1fr; padding: .9rem 1rem; }
  .rank-thumb { display: none; }
}

/* ---- ラボの話へ切り替わる場所 ---- */
.lab-intro { border-top: 1px solid var(--line); }

/* 2件以下のときは横スクロールをやめて普通に並べる */
.rail--few { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 288px)); overflow-x: visible; }

/* ---------- カードの下の、小さなもう1本のリンク ---------- */
/* 🔴 カード本体が <a> なので、中にリンクを入れ子にできません。
   span で出して shop.js の wireSub() で押せるようにしています。 */
.pcard__sub {
  display: inline-block; cursor: pointer;
  font-size: .76rem; line-height: 1;
  padding: .38rem .6rem; margin-left: .5rem;
  color: var(--fg-soft); text-decoration: underline;
  text-underline-offset: 3px; border-radius: 999px;
}
.pcard__sub:hover, .pcard__sub:focus-visible {
  color: var(--fg); background: var(--accent-soft); text-decoration: none;
}
.shop-hero .pcard__sub { margin-left: .8rem; font-size: .8rem; }
