/* =========================================================================
   民法だワン — stylesheet
   Color : くらしの温かいグレー ＋ 約束の深緑 ＋ 迷子札の真鍮
   Type  : Klee One（ワン語・見出し／手書きの教科書体）
           Murecho（本文）／ Shippori Mincho（原文＝ここだけ明朝）
   ========================================================================= */

/* --- tokens : light ---------------------------------------------------- */
:root {
  --ground:      #EEF0EA;
  --surface:     #FFFFFF;
  --surface-2:   #F5F7F1;
  --ink:         #1B1F1B;
  --ink-2:       #4E554D;
  --ink-3:       #656C64;
  --line:        #D8DED3;
  --line-soft:   #E7EBE1;

  --sign:        #1D6A4A;   /* 約束の緑（リンク・強調） */
  --sign-ink:    #FFFFFF;
  --sign-soft:   #E2EFE8;
  --tag:         #A87C2A;   /* 迷子札の真鍮 */
  --tag-ink:     #FFF8EA;
  --alert:       #A8452F;
  --alert-soft:  #F6E9E4;
  --paw:         #B4714E;   /* 犬の肉球 */

  --shadow: 0 1px 2px rgba(27,31,27,.05), 0 6px 18px -8px rgba(27,31,27,.18);
  --radius: 14px;

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

/* --- tokens : dark (system) -------------------------------------------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground:    #151814;
    --surface:   #1D211C;
    --surface-2: #242923;
    --ink:       #E9EDE6;
    --ink-2:     #AAB2A6;
    --ink-3:     #8C948B;
    --line:      #333A31;
    --line-soft: #272D26;

    --sign:      #6DC69B;
    --sign-ink:  #0D2118;
    --sign-soft: #1A2E24;
    --tag:       #D6A648;
    --tag-ink:   #241B08;
    --alert:     #EE8E74;
    --alert-soft:#33211C;
    --paw:       #D9977A;

    --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:    #151814;
  --surface:   #1D211C;
  --surface-2: #242923;
  --ink:       #E9EDE6;
  --ink-2:     #AAB2A6;
  --ink-3:     #8C948B;
  --line:      #333A31;
  --line-soft: #272D26;

  --sign:      #6DC69B;
  --sign-ink:  #0D2118;
  --sign-soft: #1A2E24;
  --tag:       #D6A648;
  --tag-ink:   #241B08;
  --alert:     #EE8E74;
  --alert-soft:#33211C;
  --paw:       #D9977A;

  --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.85;
  -webkit-font-smoothing: antialiased;
}
:focus-visible { outline: 3px solid var(--tag); outline-offset: 2px; border-radius: 4px; }
a { color: var(--sign); }
.wrap { width: min(100% - 2.5rem, 46rem); margin-inline: auto; }

/* --- 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.3;
  letter-spacing: .02em;
  margin: 0;
  text-wrap: balance;
}
.sitetitle .paw-inline { color: var(--tag); }
.tagline { margin: 0; color: var(--ink-2); font-size: .95rem; max-width: 34rem; }
.mastfoot { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-top: .35rem; }
.theme-toggle {
  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); }
.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。文字も同じ実寸になるようにしてある。 */
/* --- リード（犬の綱）＝このサイトの背骨のモチーフ ----------------------- */
.leash {
  height: 13px;
  background: var(--tag);
  -webkit-mask: var(--leash-mask) left center/52px 13px repeat-x;
  mask: var(--leash-mask) left center/52px 13px repeat-x;
}

/* --- 検索パネル（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; }

.searchrow { display: flex; gap: .6rem; align-items: stretch; }
.searchbox { position: relative; display: flex; align-items: center; flex: 1 1 auto; }
.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); }

#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 2.3rem 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;
}
#chapter:focus { border-color: var(--sign); }

.activefilters { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.activefilters[hidden] { display: none; }
.activefilters .aflabel {
  font-family: var(--font-display); font-size: .74rem; 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; }

/* --- よく引かれる言葉10個 ----------------------------------------------- */
.filters { background: var(--surface); border-bottom: 1px solid var(--line); }
.filters .wrap { padding: 1rem 0 1.15rem; }
.chipbar-label {
  margin: 0 0 .55rem; font-family: var(--font-display); font-size: .8rem;
  letter-spacing: .06em; color: var(--ink-3);
  display: flex; align-items: center; gap: .4rem;
}
.chipbar-label::before {
  content: ""; width: 1em; height: 1em; background: var(--paw);
  -webkit-mask: var(--paw-mask) center/contain no-repeat; mask: var(--paw-mask) center/contain no-repeat;
}
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip {
  font: inherit; font-size: .89rem; line-height: 1.4; padding: .3rem .85rem;
  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); }
.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;
}

/* --- 結果ヘッダ --------------------------------------------------------- */
.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: 1.35rem; align-items: flex-start; padding: 1.35rem 1.35rem .9rem; }

/* 条番号バッジ＝迷子札（真鍮）に、たれ耳 */
.sign-badge {
  position: relative; flex: 0 0 auto;
  display: grid; place-items: center;
  min-width: 4.7rem; padding: .5rem .6rem;
  background: var(--tag); color: var(--tag-ink);
  border-radius: 10px;
  font-family: var(--font-display); font-weight: 600;
  font-size: .95rem; line-height: 1.15; text-align: center;
  font-feature-settings: "palt";
}
.sign-badge small { display: block; font-size: .6rem; opacity: .85; letter-spacing: .08em; }
.sign-badge::before, .sign-badge::after {
  content: ""; position: absolute; top: 4px;
  width: 15px; height: 26px; background: var(--tag);
  border-radius: 60% 60% 55% 55% / 35% 35% 65% 65%;
}
.sign-badge::before { left: -9px; transform: rotate(16deg); }
.sign-badge::after  { right: -9px; transform: rotate(-16deg); }

.card-title {
  margin: 0; font-family: var(--font-display); font-weight: 700;
  font-size: 1.16rem; line-height: 1.6; 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); }
.summary.todo { color: var(--ink-3); font-size: .9rem; }

.points { margin: 0 0 1rem; padding: 0; list-style: none; display: flex; flex-direction: column; gap: .3rem; }
.points li { position: relative; padding-left: 1.6rem; font-size: .93rem; color: var(--ink-2); }
.points li::before {
  content: ""; position: absolute; left: .1rem; top: .5em;
  width: 11px; height: 11px; background: var(--paw);
  -webkit-mask: var(--paw-mask) center/contain no-repeat; mask: var(--paw-mask) center/contain no-repeat;
}

.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.75;
}
.penalty .plabel {
  flex: 0 0 auto; font-family: var(--font-display); font-size: .74rem;
  color: var(--alert); letter-spacing: .04em; padding-top: .2em;
}

.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: .86rem; color: var(--sign);
  display: flex; align-items: center; gap: .45rem;
}
details.law > summary::-webkit-details-marker { display: none; }
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); }
.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; }

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

/* --- ホーム（検索していないとき） --------------------------------------- */
.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: 1.05rem; margin: 0; display: flex; align-items: center; gap: .6rem; }
.home-h::after {
  content: ""; flex: 1 1 auto; height: 16px; 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;
}

/* 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 6.2rem;
  font-family: var(--font-display); font-size: .8rem;
  color: var(--tag); letter-spacing: .02em;
}
.pick-t { font-size: .95rem; line-height: 1.65; 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: .92rem; cursor: pointer; text-align: left;
  background: var(--surface); color: var(--ink-2);
  border: 1px solid var(--line-soft); border-radius: 8px; padding: .6rem .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: .95rem;
  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); }
.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;
}

/* --- 0件のとき ---------------------------------------------------------- */
.empty { text-align: center; padding: 3.5rem 1rem; color: var(--ink-2); }
.empty .pawmark { color: var(--paw); font-size: 2.2rem; }
.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: 1.4rem 0 3rem; }
.disclaimer h2 { font-family: var(--font-display); font-size: .95rem; margin: 0 0 .6rem; color: var(--ink); }
.disclaimer p { margin: 0 0 .7rem; font-size: .84rem; color: var(--ink-3); line-height: 1.95; }

/* --- 犬が散歩していく足あと ---------------------------------------------- */
.pawtrail {
  display: flex; align-items: flex-end; justify-content: center;
  gap: clamp(.8rem, 2.6vw, 1.7rem); padding: 1.4rem 0 .1rem;
}
.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+5)  { opacity: .3; }
.trailcat { width: 38px; height: auto; flex: 0 0 auto; color: var(--ink-3); opacity: .8; margin-left: .4rem; }

/* --- リードの上を歩く犬 --------------------------------------------------- */
.road { position: relative; z-index: 2; }
.roadcat-wrap {
  position: absolute; left: 0; right: 0; bottom: 4px;
  width: min(100% - 2.5rem, 46rem); margin-inline: auto;
  display: flex; justify-content: flex-end; pointer-events: none;
}
.roadcat {
  width: 94px; height: 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; } }

/* --- マスク画像 ----------------------------------------------------------- */
:root {
  --paw-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cellipse cx='7.6' cy='11' rx='3.2' ry='4.5' transform='rotate(-18 7.6 11)'/%3E%3Cellipse cx='15' cy='7' rx='3.3' ry='4.8'/%3E%3Cellipse cx='22.6' cy='8.6' rx='3.3' ry='4.7' transform='rotate(14 22.6 8.6)'/%3E%3Cellipse cx='28' cy='15.6' rx='3' ry='4.2' transform='rotate(28 28 15.6)'/%3E%3Cpath d='M16 14.6c6.1 0 11 4.6 11 9.3 0 3.2-3.1 4.9-6.7 4.3-1.5-.3-2.9-.7-4.3-.7s-2.8.4-4.3.7C8.1 28.8 5 27.1 5 23.9c0-4.7 4.9-9.3 11-9.3z'/%3E%3C/svg%3E");
  --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='7.6' cy='11' rx='3.2' ry='4.5'/%3E%3Cellipse cx='15' cy='7' rx='3.3' ry='4.8'/%3E%3Cellipse cx='22.6' cy='8.6' rx='3.3' ry='4.7'/%3E%3Cellipse cx='28' cy='15.6' rx='3' ry='4.2'/%3E%3Cpath d='M16 14.6c6.1 0 11 4.6 11 9.3 0 3.2-3.1 4.9-6.7 4.3-1.5-.3-2.9-.7-4.3-.7s-2.8.4-4.3.7C8.1 28.8 5 27.1 5 23.9c0-4.7 4.9-9.3 11-9.3z'/%3E%3C/g%3E%3Cg transform='translate(46,17) rotate(12 16 16) scale(0.6)'%3E%3Cellipse cx='7.6' cy='11' rx='3.2' ry='4.5'/%3E%3Cellipse cx='15' cy='7' rx='3.3' ry='4.8'/%3E%3Cellipse cx='22.6' cy='8.6' rx='3.3' ry='4.7'/%3E%3Cellipse cx='28' cy='15.6' rx='3' ry='4.2'/%3E%3Cpath d='M16 14.6c6.1 0 11 4.6 11 9.3 0 3.2-3.1 4.9-6.7 4.3-1.5-.3-2.9-.7-4.3-.7s-2.8.4-4.3.7C8.1 28.8 5 27.1 5 23.9c0-4.7 4.9-9.3 11-9.3z'/%3E%3C/g%3E%3C/svg%3E");
  --leash-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 52 13'%3E%3Cpath d='M0 6.5 Q 13 0 26 6.5 T 52 6.5' fill='none' stroke='black' stroke-width='4' stroke-linecap='round'/%3E%3C/svg%3E");
}

@media (max-width: 640px) {
  .searchrow { flex-direction: column; }
  #chapter { max-width: none; padding-block: .6rem; }
  .card-head { flex-direction: column; gap: .9rem; }
  .sign-badge { min-width: 0; padding: .3rem .8rem; margin-left: .6rem; }
  .roadcat { width: 69px; 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: 56px;              /* 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 { width: 69px; 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 5.4rem; 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 { width: 33px; }
}

/* --- 小さめのスマホ ------------------------------------------------------- */
@media (max-width: 380px) {
  .sitetitle { font-size: 1.85rem; }
  .roadcat { width: 60px; }
  .pick-no { flex-basis: 4.9rem; }
  .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; }
