/* =========================================================================
   道路交通法だニャン — stylesheet
   Color : アスファルト（ニュートラル）＋ 案内標識の青 ＋ センターラインの黄
   Type  : Zen Maru Gothic（猫語・見出し） / Zen Kaku Gothic New（本文） /
           Zen Old Mincho（条文原文＝ここだけ明朝で「原文である」ことを示す）
   ========================================================================= */

/* --- tokens : light ---------------------------------------------------- */
:root {
  --ground:      #EAEEEC;
  --surface:     #FFFFFF;
  --surface-2:   #F2F5F3;
  --ink:         #191D1A;
  --ink-2:       #4C5450;
  --ink-3:       #646B67;
  --line:        #D5DBD7;
  --line-soft:   #E4E9E6;

  --sign:        #0B5CA8;   /* 案内標識の青 */
  --sign-ink:    #FFFFFF;
  --sign-soft:   #E3EDF7;
  --center:      #C98F0E;   /* センターラインの黄（文字用に沈めた値） */
  --center-pure: #E9B62A;   /* 塗り用 */
  --alert:       #B33325;   /* 規制標識の赤 */
  --alert-soft:  #F7E7E4;
  --paw:         #C96C80;

  --shadow: 0 1px 2px rgba(25,29,26,.05), 0 6px 18px -8px rgba(25,29,26,.18);
  --radius: 14px;

  --font-display: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "ヒラギノ丸ゴ ProN", sans-serif;
  --font-body: "Zen Kaku Gothic New", "Hiragino Sans", "Noto Sans JP", sans-serif;
  --font-law: "Zen Old Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
}

/* --- tokens : dark (system) -------------------------------------------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground:    #14181A;
    --surface:   #1D2225;
    --surface-2: #232A2D;
    --ink:       #E8EDEA;
    --ink-2:     #AAB4AF;
    --ink-3:     #8B948F;
    --line:      #313A3C;
    --line-soft: #272F31;

    --sign:      #6FB0EC;
    --sign-ink:  #0C1B28;
    --sign-soft: #1B2B3A;
    --center:      #EFC352;
    --center-pure: #EFC352;
    --alert:     #EF8074;
    --alert-soft:#33211F;
    --paw:       #E79BAA;

    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -10px rgba(0,0,0,.6);
  }
}

/* --- tokens : dark (explicit) ------------------------------------------ */
:root[data-theme="dark"] {
  --ground:    #14181A;
  --surface:   #1D2225;
  --surface-2: #232A2D;
  --ink:       #E8EDEA;
  --ink-2:     #AAB4AF;
  --ink-3:     #8B948F;
  --line:      #313A3C;
  --line-soft: #272F31;

  --sign:      #6FB0EC;
  --sign-ink:  #0C1B28;
  --sign-soft: #1B2B3A;
  --center:      #EFC352;
  --center-pure: #EFC352;
  --alert:     #EF8074;
  --alert-soft:#33211F;
  --paw:       #E79BAA;

  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -10px rgba(0,0,0,.6);
}

/* --- base -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

/* --- スマホでの基本 ------------------------------------------------------- */
html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 5.5rem;      /* sticky の検索窓のぶん */
}
body { -webkit-tap-highlight-color: rgba(0,0,0,.06); }
button, select, input { touch-action: manipulation; }


body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

:focus-visible {
  outline: 3px solid var(--center-pure);
  outline-offset: 2px;
  border-radius: 4px;
}

a { color: var(--sign); }

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

/* --- センターライン（黄色の破線）＝このサイトの背骨のモチーフ ---------- */
.centerline {
  height: 6px;
  background-image: repeating-linear-gradient(
    to right,
    var(--center-pure) 0 34px,
    transparent 34px 60px
  );
}

/* --- header ------------------------------------------------------------ */
.masthead {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.masthead .wrap {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding: 2.75rem 0 2.25rem;
}
.sitetitle {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2rem, 7vw, 3.1rem);
  line-height: 1.25;
  letter-spacing: .01em;
  margin: 0;
  text-wrap: balance;
}
.sitetitle .paw-inline { color: var(--paw); }
.tagline {
  margin: 0;
  color: var(--ink-2);
  font-size: .95rem;
  max-width: 34rem;
}
.theme-toggle {
  align-self: flex-start;
  margin-top: .35rem;
  background: none;
  border: 1px solid var(--line);
  color: var(--ink-2);
  border-radius: 999px;
  padding: .2rem .8rem;
  font: inherit;
  font-size: .78rem;
  cursor: pointer;
}
.theme-toggle:hover { border-color: var(--sign); color: var(--sign); }

/* --- 検索パネル（sticky） ---------------------------------------------- */
.console {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 6px 20px -18px rgba(0,0,0,.9);
}
.console .wrap {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  padding: .9rem 0;
}

/* 選択中のタグを検索バーの下に常時表示（sticky の中） */
.activefilters { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.activefilters[hidden] { display: none; }
.activefilters .aflabel {
  font-family: var(--font-display);
  font-size: .72rem; color: var(--ink-3); letter-spacing: .08em; margin-right: .2rem;
}
.activefilters button {
  font: inherit; font-size: .78rem; line-height: 1.5;
  background: var(--sign); color: var(--sign-ink);
  border: 0; border-radius: 999px; padding: .1rem .3rem .1rem .65rem;
  cursor: pointer; display: inline-flex; align-items: center; gap: .3rem;
}
.activefilters button::after { content: "\00d7"; font-size: 1rem; line-height: 1; opacity: .75; }
.activefilters button:hover::after { opacity: 1; }

/* タグ棚は通常フロー（スクロールで流れていく） */
.filters {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.filters .wrap { padding: 1rem 0 1.15rem; }

.searchbox { position: relative; display: flex; align-items: center; }
.searchbox svg {
  position: absolute; left: 1rem;
  width: 20px; height: 20px;
  color: var(--ink-3);
  pointer-events: none;
}
#q {
  width: 100%;
  padding: .95rem 6rem .95rem 3rem;
  font: inherit;
  font-size: 1.05rem;
  color: var(--ink);
  background: var(--surface-2);
  border: 1.5px solid var(--line);
  border-radius: 999px;
}
#q::placeholder { color: var(--ink-3); }
#q:focus { border-color: var(--sign); background: var(--surface); }
.clear-btn {
  position: absolute; right: .5rem;
  border: 0; background: var(--line-soft); color: var(--ink-2);
  font: inherit; font-size: .8rem;
  padding: .4rem .9rem; border-radius: 999px; cursor: pointer;
}
.clear-btn[hidden] { display: none; }
.clear-btn:hover { background: var(--sign); color: var(--sign-ink); }

.chip {
  font: inherit;
  font-size: .84rem;
  line-height: 1.4;
  padding: .22rem .72rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.chip:hover { border-color: var(--sign); color: var(--sign); }
.chip[aria-pressed="true"] {
  background: var(--sign);
  border-color: var(--sign);
  color: var(--sign-ink);
}

/* --- 結果ヘッダ --------------------------------------------------------- */
.resultbar {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  padding: 1.75rem 0 .25rem;
}
.count {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--ink-2);
}
.count b { color: var(--ink); font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.linkbtn {
  border: 0; background: none; font: inherit; font-size: .84rem;
  color: var(--sign); cursor: pointer; padding: 0;
  text-decoration: underline; text-underline-offset: 3px;
}

/* --- 条文カード --------------------------------------------------------- */
.results { display: flex; flex-direction: column; gap: 1rem; padding-bottom: 1rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: rise .32s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) {
  .card { animation: none; }
}

.card-head {
  display: flex; gap: 1rem; align-items: flex-start;
  padding: 1.25rem 1.35rem .9rem;
}

/* 条番号バッジ＝案内標識のかたち */
.sign-badge {
  flex: 0 0 auto;
  display: grid; place-items: center;
  min-width: 4.5rem;
  padding: .5rem .55rem;
  background: var(--sign);
  color: var(--sign-ink);
  border-radius: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .95rem;
  line-height: 1.15;
  text-align: center;
  font-feature-settings: "palt";
}
.sign-badge small { display: block; font-size: .6rem; opacity: .8; letter-spacing: .08em; }

.card-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.16rem;
  line-height: 1.55;
  text-wrap: balance;
}
.card-meta {
  margin: .25rem 0 0;
  font-size: .74rem;
  color: var(--ink-3);
  letter-spacing: .02em;
}

.card-body { padding: 0 1.35rem 1.1rem; }
.summary { margin: 0 0 .9rem; color: var(--ink); }

.points { margin: 0 0 1rem; padding: 0; list-style: none;
  display: flex; flex-direction: column; gap: .3rem; }
.points li {
  position: relative;
  padding-left: 1.5rem;
  font-size: .93rem;
  color: var(--ink-2);
}
.points li::before {
  content: "";
  position: absolute; left: .25rem; top: .62em;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--paw);
}

.penalty {
  display: flex; gap: .6rem;
  background: var(--alert-soft);
  border-radius: 10px;
  padding: .65rem .85rem;
  font-size: .87rem;
  color: var(--ink-2);
  line-height: 1.7;
}
.penalty .plabel {
  flex: 0 0 auto;
  font-family: var(--font-display);
  font-size: .72rem;
  color: var(--alert);
  letter-spacing: .06em;
  padding-top: .25em;
}

/* タグ表示 */
.card-tags { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .9rem; }
.card-tags button {
  font: inherit; font-size: .76rem;
  color: var(--ink-3); background: var(--surface-2);
  border: 1px solid var(--line-soft); border-radius: 6px;
  padding: .05rem .5rem; cursor: pointer;
}
.card-tags button:hover { color: var(--sign); border-color: var(--sign); }

/* 原文（明朝） */
details.law {
  border-top: 1px dashed var(--line);
  margin-top: 1.1rem;
}
details.law > summary {
  list-style: none;
  cursor: pointer;
  padding: .8rem 0 .1rem;
  font-family: var(--font-display);
  font-size: .84rem;
  color: var(--sign);
  display: flex; align-items: center; gap: .45rem;
}
details.law > summary::-webkit-details-marker { display: none; }
details.law > summary::before {
  content: "▸"; font-size: .8em; transition: transform .15s;
}
details.law[open] > summary::before { transform: rotate(90deg); }
.lawtext {
  font-family: var(--font-law);
  font-size: .95rem;
  line-height: 2.05;
  color: var(--ink-2);
  background: var(--surface-2);
  border-left: 3px solid var(--line);
  border-radius: 0 8px 8px 0;
  padding: .9rem 1.05rem;
  margin: .5rem 0 .6rem;
}
.lawnote { font-size: .76rem; color: var(--ink-3); margin: 0 0 .9rem; }
.lawnote a { color: var(--sign); }

mark {
  background: color-mix(in srgb, var(--center-pure) 45%, transparent);
  color: inherit;
  border-radius: 3px;
  padding: 0 .1em;
}

/* --- 0件のとき ---------------------------------------------------------- */
.empty {
  text-align: center;
  padding: 3.5rem 1rem;
  color: var(--ink-2);
}
.empty .pawmark { color: var(--paw); }
.empty p { font-family: var(--font-display); margin: .8rem 0 .2rem; font-size: 1.05rem; }
.empty small { color: var(--ink-3); }

/* --- footer ------------------------------------------------------------- */
.disclaimer {
  background: var(--surface);
  border-top: 1px solid var(--line);
  margin-top: 2rem;
}
.disclaimer .wrap { padding: 2rem 0 3rem; }
.disclaimer h2 {
  font-family: var(--font-display);
  font-size: .9rem; margin: 0 0 .6rem; color: var(--ink);
}
.disclaimer p { margin: 0 0 .6rem; font-size: .84rem; color: var(--ink-3); line-height: 1.9; }

@media (max-width: 640px) {
  .card-head { flex-direction: column; gap: .7rem; }
  .sign-badge { min-width: 0; padding: .3rem .7rem; }
}

/* =========================================================================
   全355条スケール用の追加パーツ
   ========================================================================= */

.searchrow { display: flex; gap: .6rem; align-items: stretch; }
.searchrow .searchbox { flex: 1 1 auto; }

#chapter {
  flex: 0 0 auto;
  max-width: 15rem;
  font: inherit; font-size: .88rem;
  color: var(--ink-2);
  background: var(--surface-2);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 0 1.1rem;
  cursor: pointer;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: right 1.15rem center, right .85rem center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 2.3rem;
}
#chapter:focus { border-color: var(--sign); }

/* --- ホーム（検索していないとき） --------------------------------------- */
.home { display: flex; flex-direction: column; gap: 2.25rem; }
.home-block { display: flex; flex-direction: column; gap: .85rem; }
.home-h {
  font-family: var(--font-display);
  font-size: 1rem; margin: 0;
  display: flex; align-items: center; gap: .6rem;
}
.home-h::after {
  content: ""; flex: 1 1 auto; height: 3px;
  background-image: repeating-linear-gradient(to right, var(--center-pure) 0 14px, transparent 14px 26px);
  opacity: .7;
}

/* 1列。ぱっと見で読めることを優先する */
.picks { display: flex; flex-direction: column; gap: .4rem; }
.pick {
  display: flex; align-items: baseline; gap: .8rem; text-align: left;
  font: inherit; cursor: pointer;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px;
  padding: .7rem .85rem;
  transition: border-color .12s, transform .12s;
}
.pick:hover { border-color: var(--sign); transform: translateY(-1px); }
.pick-no {
  flex: 0 0 5.2rem;
  font-family: var(--font-display); font-size: .78rem;
  color: var(--sign); letter-spacing: .02em;
}
.pick-t { font-size: .95rem; line-height: 1.6; color: var(--ink); }

.chapters { display: flex; flex-direction: column; gap: .3rem; }
.chapbtn {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  font: inherit; font-size: .9rem; cursor: pointer; text-align: left;
  background: var(--surface); color: var(--ink-2);
  border: 1px solid var(--line-soft); border-radius: 8px;
  padding: .55rem .9rem;
}
.chapbtn:hover { border-color: var(--sign); color: var(--sign); }
.chapbtn b {
  font-family: var(--font-display); font-size: .8rem;
  color: var(--ink-3); font-variant-numeric: tabular-nums;
}
.chapbtn b::after { content: "条"; font-size: .85em; margin-left: .1em; }

/* --- もっと見る --------------------------------------------------------- */
.morebtn {
  width: 100%; font: inherit; font-family: var(--font-display); font-size: .92rem;
  cursor: pointer; margin-top: 1rem;
  background: var(--surface); color: var(--sign);
  border: 1px dashed var(--line); border-radius: 12px; padding: .9rem;
}
.morebtn:hover { border-color: var(--sign); background: var(--sign-soft); }

.summary.todo { color: var(--ink-3); font-size: .9rem; }

@media (max-width: 640px) {
  .searchrow { flex-direction: column; }
  #chapter { max-width: none; padding-block: .6rem; }
}


/* =========================================================================
   猫要素 ── 道路のうえを歩く猫
   ========================================================================= */

/* 肉球（マスクで色をトークンから取る） */
:root {
  --paw-trail: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 88 40'%3E%3Cg transform='translate(4,2) rotate(-14 16 16) scale(0.6)'%3E%3Cellipse cx='9' cy='10' rx='3.1' ry='4.1'/%3E%3Cellipse cx='16' cy='7.6' rx='3.1' ry='4.3'/%3E%3Cellipse cx='23' cy='10' rx='3.1' ry='4.1'/%3E%3Cellipse cx='27.4' cy='16.6' rx='2.7' ry='3.4'/%3E%3Cpath d='M16 14.5c4.6 0 8.4 3.5 8.4 7.4 0 3.2-2.6 4.9-5.6 4.9-1.1 0-1.9-.4-2.8-.4s-1.7.4-2.8.4c-3 0-5.6-1.7-5.6-4.9 0-3.9 3.8-7.4 8.4-7.4z'/%3E%3C/g%3E%3Cg transform='translate(46,17) rotate(12 16 16) scale(0.6)'%3E%3Cellipse cx='9' cy='10' rx='3.1' ry='4.1'/%3E%3Cellipse cx='16' cy='7.6' rx='3.1' ry='4.3'/%3E%3Cellipse cx='23' cy='10' rx='3.1' ry='4.1'/%3E%3Cellipse cx='27.4' cy='16.6' rx='2.7' ry='3.4'/%3E%3Cpath d='M16 14.5c4.6 0 8.4 3.5 8.4 7.4 0 3.2-2.6 4.9-5.6 4.9-1.1 0-1.9-.4-2.8-.4s-1.7.4-2.8.4c-3 0-5.6-1.7-5.6-4.9 0-3.9 3.8-7.4 8.4-7.4z'/%3E%3C/g%3E%3C/svg%3E");
  --paw-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cellipse cx='9' cy='10' rx='3.1' ry='4.1'/%3E%3Cellipse cx='16' cy='7.6' rx='3.1' ry='4.3'/%3E%3Cellipse cx='23' cy='10' rx='3.1' ry='4.1'/%3E%3Cellipse cx='27.4' cy='16.6' rx='2.7' ry='3.4'/%3E%3Cpath d='M16 14.5c4.6 0 8.4 3.5 8.4 7.4 0 3.2-2.6 4.9-5.6 4.9-1.1 0-1.9-.4-2.8-.4s-1.7.4-2.8.4c-3 0-5.6-1.7-5.6-4.9 0-3.9 3.8-7.4 8.4-7.4z'/%3E%3C/svg%3E");
}

.mastfoot { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-top: .35rem; }
.sister { font-size: .78rem; color: var(--ink-3); text-decoration: none; }
.sister:hover { color: var(--sign); text-decoration: underline; text-underline-offset: 3px; }

/* 猫は縦長・犬は横長。同じ高さでそろえると犬が2割ほど大きく見えるので、
   実測した塗り面積がそろう比（犬 = 猫の1.114倍の倍率）で指定している。
   猫 height 84px ＝ 犬 width 94px。文字も同じ実寸になるようにしてある。 */
/* --- センターラインにすわる猫 ------------------------------------------- */
.road { position: relative; z-index: 2; }
.roadcat-wrap {
  position: absolute; left: 0; right: 0; bottom: 2px;
  width: min(100% - 2.5rem, 46rem);
  margin-inline: auto;
  display: flex; justify-content: flex-end;
  pointer-events: none;
}
.roadcat {
  height: 84px; width: auto;
  color: var(--ink);
  margin-right: 2.5rem;
  animation: sitdown .5s cubic-bezier(.2,.9,.3,1) both;
}
@keyframes sitdown { from { transform: translateY(10px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .roadcat { animation: none; } }

/* --- 話題のワード10個 ---------------------------------------------------- */
.chipbar-label {
  margin: 0 0 .55rem;
  font-family: var(--font-display);
  font-size: .78rem;
  letter-spacing: .06em;
  color: var(--ink-3);
  display: flex; align-items: center; gap: .4rem;
}
.chipbar-label::before {
  content: ""; width: .95em; height: .95em;
  background: var(--paw); -webkit-mask: var(--paw-mask) center/contain no-repeat; mask: var(--paw-mask) center/contain no-repeat;
}
.filters .chip { font-size: .89rem; padding: .3rem .85rem; }

/* 選ばれたチップには肉球がつく */
.chip[aria-pressed="true"]::before {
  content: ""; display: inline-block;
  width: .8em; height: .8em; margin-right: .35em; vertical-align: -.08em;
  background: currentColor;
  -webkit-mask: var(--paw-mask) center/contain no-repeat; mask: var(--paw-mask) center/contain no-repeat;
}

/* --- 条番号バッジに猫耳 --------------------------------------------------- */
.sign-badge { position: relative; }
.sign-badge::before, .sign-badge::after {
  content: "";
  position: absolute; top: -7px;
  width: 0; height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 10px solid var(--sign);
}
.sign-badge::before { left: 12px; transform: rotate(-14deg); }
.sign-badge::after  { right: 12px; transform: rotate(14deg); }

/* --- ニャンポイントの点を肉球に ------------------------------------------ */
.points li::before {
  width: 11px; height: 11px;
  top: .48em; left: .1rem;
  border-radius: 0;
  background: var(--paw);
  -webkit-mask: var(--paw-mask) center/contain no-repeat; mask: var(--paw-mask) center/contain no-repeat;
}
.points li { padding-left: 1.6rem; }

/* --- 見出しの罫線を足あとに --------------------------------------------- */
.home-h::after {
  height: 16px;
  background-image: none;
  background: var(--paw);
  opacity: .45;
  -webkit-mask: var(--paw-trail) left center/40px 18px repeat-x;
  mask: var(--paw-trail) left center/40px 18px repeat-x;
}

/* --- 原文をひらくボタンにも肉球 ------------------------------------------ */
details.law > summary::before {
  content: ""; width: .85em; height: .85em;
  background: currentColor;
  -webkit-mask: var(--paw-mask) center/contain no-repeat; mask: var(--paw-mask) center/contain no-repeat;
  transition: transform .15s;
}
details.law[open] > summary::before { transform: rotate(90deg); }

/* --- もっと見るボタン ---------------------------------------------------- */
.morebtn::before {
  content: ""; display: inline-block;
  width: .95em; height: .95em; margin-right: .45em; vertical-align: -.12em;
  background: currentColor;
  -webkit-mask: var(--paw-mask) center/contain no-repeat; mask: var(--paw-mask) center/contain no-repeat;
}

/* --- フッタへ歩いていく足あと -------------------------------------------- */
.pawtrail {
  display: flex; align-items: flex-end; justify-content: center;
  gap: clamp(.8rem, 2.6vw, 1.7rem);
  padding: 1.4rem 0 .1rem;
}
.trailcat {
  height: 34px; width: auto; flex: 0 0 auto;
  color: var(--ink-3);
  opacity: .8;
  margin-left: .4rem;
}
.pawtrail i {
  width: 15px; height: 15px; flex: 0 0 auto;
  background: var(--paw);
  opacity: .55;
  -webkit-mask: var(--paw-mask) center/contain no-repeat; mask: var(--paw-mask) center/contain no-repeat;
}
.pawtrail i:nth-child(odd)  { transform: translateY(-6px) rotate(-12deg); }
.pawtrail i:nth-child(even) { transform: translateY(6px) rotate(10deg); }
.pawtrail i:nth-child(n+6)  { opacity: .3; }
.pawtrail i:nth-child(n+8)  { opacity: .18; }

/* --- 0件のときの猫 -------------------------------------------------------- */
.empty .pawmark { font-size: 2.2rem; }

@media (max-width: 640px) {
  .roadcat { height: 62px; margin-right: 1.25rem; }
  .roadcat-wrap { width: calc(100% - 2.5rem); }
}

.resultbar[hidden] { display: none; }
/* --- シルエットの中の一文字（アイコン） ------------------------------------ */
.roadcat text, .trailcat text {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 62px;              /* viewBox の座標系 */
  text-anchor: middle;
  dominant-baseline: central;
  fill: var(--surface);         /* 影の色が反転しても、字はいつも抜き色になる */
  font-feature-settings: "palt";
}

/* =========================================================================
   スマホ（〜640px）。ほとんどの人がここで見る前提で詰める
   ========================================================================= */
@media (max-width: 640px) {
  .wrap { width: calc(100% - 2rem); }

  /* ヘッダー：高さを詰めて、猫がすわる場所を下にあける */
  .masthead .wrap { padding: 1.6rem 0 3.4rem; gap: .45rem; }
  .sitetitle { font-size: clamp(1.9rem, 8.6vw, 2.5rem); line-height: 1.3; }
  .tagline { font-size: .88rem; line-height: 1.8; }
  .mastfoot { margin-top: .15rem; }
  .sister { font-size: .75rem; }
  .roadcat { height: 62px; margin-right: 1rem; }
  .roadcat-wrap { width: calc(100% - 2rem); }

  /* 検索窓：消すボタンを丸い×にして、プレースホルダを隠さない */
  .console .wrap { padding: .7rem 0; gap: .45rem; }
  #q { font-size: 16px; padding: .82rem 3.1rem .82rem 2.7rem; }
  .searchbox svg { left: .85rem; width: 18px; height: 18px; }
  .clear-btn {
    right: .45rem; width: 2.05rem; height: 2.05rem; padding: 0;
    display: grid; place-items: center; border-radius: 50%; font-size: 0;
  }
  .clear-btn::before { content: "\00d7"; font-size: 1.2rem; line-height: 1; }
  .activefilters button { padding: .18rem .35rem .18rem .7rem; }

  /* キーワード：指で押しやすい高さに */
  .filters .wrap { padding: .8rem 0 1rem; }
  .chipbar-label { font-size: .76rem; margin-bottom: .45rem; }
  .chip { padding: .42rem .85rem; font-size: .86rem; }

  /* 身近な条文：1行に「条番号＋見出し」を収める */
  .home { gap: 1.8rem; }
  .home-block { gap: .7rem; }
  .home-h { font-size: .98rem; }
  .picks { gap: .35rem; }
  .pick { flex-direction: row; align-items: baseline; gap: .6rem; padding: .62rem .8rem; }
  .pick-no { flex: 0 0 4.7rem; font-size: .72rem; }
  .pick-t { font-size: .9rem; line-height: 1.6; }
  .chapbtn { padding: .55rem .8rem; font-size: .88rem; }

  /* 条文カード */
  .resultbar { padding: 1.3rem 0 .2rem; }
  .count b { font-size: 1.35rem; }
  .card-head { flex-direction: column; gap: .75rem; padding: 1.05rem 1rem .75rem; }
  .card-body { padding: 0 1rem 1rem; }
  .card-title { font-size: 1.06rem; line-height: 1.62; }
  .card-meta { font-size: .73rem; line-height: 1.7; }
  .m-path { display: none; }              /* 章・節はスマホでは出さない */
  .resultbar { padding: 1.2rem 0 .2rem; gap: .3rem; align-items: baseline; }
  .linkbtn { font-size: .8rem; }
  .summary { font-size: .95rem; }
  .points li { font-size: .89rem; padding-left: 1.45rem; }
  .penalty { font-size: .85rem; padding: .6rem .75rem; }
  .lawtext { font-size: .91rem; line-height: 1.95; padding: .8rem .9rem; }
  .card-tags button { padding: .3rem .6rem; font-size: .78rem; }
  .card-tags { gap: .35rem; }
  details.law > summary { padding: .75rem 0 .1rem; }

  .morebtn { padding: .95rem; font-size: .92rem; }
  .empty { padding: 2.8rem .5rem; }

  /* フッター：ホームバーのぶんを空ける */
  .disclaimer .wrap { padding-bottom: calc(2.6rem + env(safe-area-inset-bottom)); }
  .pawtrail { gap: clamp(.7rem, 4.5vw, 1.4rem); }
  .pawtrail i { width: 13px; height: 13px; }
  .trailcat { height: 30px; }
}

/* --- 小さめのスマホ ------------------------------------------------------- */
@media (max-width: 380px) {
  .sitetitle { font-size: 1.85rem; }
  .roadcat { height: 54px; }
  .pick-no { flex-basis: 4.3rem; }
  .chip { font-size: .83rem; padding: .4rem .72rem; }
}

/* =========================================================================
   条文ごとの静的ページ（make_pages.py が出力する）
   検索エンジンに中身を見せるためのページ。SPA と同じトークンを使う
   ========================================================================= */
.pagehead .wrap { padding: 1.1rem 0 .9rem; display: flex; flex-wrap: wrap;
  align-items: baseline; gap: .5rem 1rem; }
.backhome { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem;
  color: var(--ink); text-decoration: none; }
.backhome:hover { color: var(--sign); }
.crumbs { font-size: .76rem; color: var(--ink-3); }
.crumbs a { color: inherit; text-decoration: none; }
.crumbs a:hover { color: var(--sign); text-decoration: underline; text-underline-offset: 3px; }
.page-main { padding: 1.6rem 0 2.4rem; display: flex; flex-direction: column; gap: 1.4rem; }
.page-main .card-title { font-size: clamp(1.25rem, 4.6vw, 1.7rem); line-height: 1.5; }

.prevnext { display: flex; gap: .7rem; }
.prevnext a {
  flex: 1 1 0; min-width: 0; display: block;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: .8rem .95rem; text-decoration: none; color: var(--ink); font-size: .86rem;
  line-height: 1.6;
}
.prevnext a:hover { border-color: var(--sign); }
.prevnext a[hidden] { display: none; }
.prevnext b { display: block; font-family: var(--font-display); font-size: .78rem;
  color: var(--ink-3); font-weight: 700; margin-bottom: .15rem; }
.prevnext .nx { text-align: right; }

.related { background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 1.1rem 1.2rem; }
.related h2 { font-family: var(--font-display); font-size: .95rem; margin: 0 0 .7rem; }
.related ul { margin: 0; padding: 0; list-style: none; display: flex;
  flex-direction: column; gap: .5rem; }
.related a { display: flex; gap: .7rem; text-decoration: none; color: var(--ink);
  font-size: .88rem; line-height: 1.6; align-items: baseline; }
.related a:hover { color: var(--sign); }
.related .rno { flex: 0 0 5.2rem; font-family: var(--font-display); font-size: .78rem;
  color: var(--sign); }
.tosearch { font-size: .84rem; color: var(--ink-2); margin: 0; text-align: center; }
.tosearch a { color: var(--sign); }

.chaplist { display: flex; flex-direction: column; gap: 1.5rem; }
.chapsec h2 { font-family: var(--font-display); font-size: 1rem; margin: 0 0 .6rem;
  padding-bottom: .4rem; border-bottom: 2px solid var(--line); }
.chapsec ul { margin: 0; padding: 0; list-style: none;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: .35rem .9rem; }
.chapsec a { display: flex; gap: .6rem; text-decoration: none; color: var(--ink);
  font-size: .85rem; line-height: 1.7; align-items: baseline; }
.chapsec a:hover { color: var(--sign); }
.chapsec .rno { flex: 0 0 5rem; font-family: var(--font-display); font-size: .76rem;
  color: var(--sign); }
.card-tags a {
  font-size: .74rem; padding: .2rem .55rem; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--ink-3);
  text-decoration: none;
}
.card-tags a:hover { color: var(--sign); border-color: var(--sign); }
@media (max-width: 640px) {
  .page-main { padding: 1.2rem 0 1.8rem; gap: 1.1rem; }
  .prevnext { flex-direction: column; }
  .prevnext .nx { text-align: left; }
}

.cardlink { margin: .9rem 0 0; font-size: .82rem; text-align: right; }
.cardlink a { color: var(--sign); text-decoration: none; }
.cardlink a:hover { text-decoration: underline; text-underline-offset: 3px; }
.disclaimer a { color: inherit; }
