/* =========================================================================
   労働基準法だペン — 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:        #10695E;   /* 安全衛生の青緑 */
  --sign-ink:    #FFFFFF;
  --sign-soft:   #DFEFEB;
  --center:      #4E7F77;   /* タイムカードの目盛り（文字用に沈めた値） */
  --center-pure: #4E8079;   /* 塗り用 */
  --alert:       #B33325;   /* 規制標識の赤 */
  --alert-soft:  #F7E7E4;
  --paw:         #4E8079;

  --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:      #5FC7B6;
    --sign-ink:  #0C1B28;
    --sign-soft: #12302C;
    --center:      #EFC352;
    --center-pure: #4E8079;
    --alert:     #EF8074;
    --alert-soft:#33211F;
    --paw:       #4E8079;

    --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:      #5FC7B6;
  --sign-ink:  #0C1B28;
  --sign-soft: #12302C;
  --center:      #EFC352;
  --center-pure: #4E8079;
  --alert:     #EF8074;
  --alert-soft:#33211F;
  --paw:       #4E8079;

  --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: 10px;
  background-image: repeating-linear-gradient(
    to right,
    var(--center-pure) 0 3px,
    transparent 3px 30px
  );
}

/* --- 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;
}

.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); }

/* --- 結果ヘッダ --------------------------------------------------------- */
.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; }

/* --- 条文カード --------------------------------------------------------- */
.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; }

/* --- ホーム（検索していないとき） --------------------------------------- */
.home { display: flex; flex-direction: column; gap: 2.25rem; }

/* 1列。ぱっと見で読めることを優先する */

.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; }
}

/* =========================================================================
   ペンギン要素 ── 目盛りのうえに立つペンギン
   ========================================================================= */

/* 肉球（マスクで色をトークンから取る） */
:root {
  --paw-trail: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M16 4C18 10 21 17 22.6 23.2 21 24.4 19.4 23.8 18.3 22.4c-.7 1.9-1.6 3.4-2.3 4.1-.7-.7-1.6-2.2-2.3-4.1-1.1 1.4-2.7 2-4.3.8C11 17 14 10 16 4Z'/%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%3Cpath d='M16 4C18 10 21 17 22.6 23.2 21 24.4 19.4 23.8 18.3 22.4c-.7 1.9-1.6 3.4-2.3 4.1-.7-.7-1.6-2.2-2.3-4.1-1.1 1.4-2.7 2-4.3.8C11 17 14 10 16 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; }

/* 3サイトで塗り面積がそろうように倍率を決めてある（ペンギン = ペンギンの1.108倍）。
   ペンギン height 84px ＝ 犬 width 94px ＝ ペンギン height 84px。 */
/* --- 目盛りのうえに立つペンギン ------------------------------------------- */
.road { position: relative; z-index: 2; }
.roadpen-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;
}
.roadpen {
  height: 93px; 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) { .roadpen { animation: none; } }

/* --- 話題のワード10個 ---------------------------------------------------- */

/* 選ばれたチップには肉球がつく */

/* --- 条番号バッジ（ペンギンに耳はないので、飾りは付けない） --------------- */

/* --- ペンポイントの点を肉球に ------------------------------------------ */
.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; }

/* --- 見出しの罫線を足あとに --------------------------------------------- */

/* --- 原文をひらくボタンにも肉球 ------------------------------------------ */
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;
}
.trailpen {
  height: 38px; 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) {
  .roadpen { height: 69px; margin-right: 1.25rem; }
  .roadpen-wrap { width: calc(100% - 2.5rem); }
}

.resultbar[hidden] { display: none; }
/* --- シルエットの中の一文字（アイコン） ------------------------------------ */
.roadpen text, .trailpen 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; }
  .roadpen { height: 69px; margin-right: 1rem; }
  .roadpen-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; }

  /* キーワード：指で押しやすい高さに */
  .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; }
  .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; }
  .trailpen { height: 33px; }
}

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

.disclaimer a { color: inherit; }

/* --- Xでシェア ----------------------------------------------------------- */
.share { display: flex; justify-content: flex-end; margin-top: 1rem; }
.card-body .share { margin-top: 1.1rem; }
.xshare {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .5rem 1rem; border-radius: 999px;
  background: var(--ink); color: var(--surface);
  font-family: var(--font-display); font-weight: 700; font-size: .8rem;
  text-decoration: none; border: 0; cursor: pointer; line-height: 1;
  transition: opacity .12s;
}
.xshare:hover { opacity: .82; }
.xshare svg { width: 14px; height: 14px; fill: currentColor; flex: 0 0 auto; }

/* 章を開いているときに、それを件数の行に出す（しぼりこみの欄をなくしたぶん） */
.inwhat {
  display: inline-block; margin-right: .55rem; padding: .15rem .6rem;
  border-radius: 999px; background: var(--tag-soft, var(--line));
  font-family: var(--font-display); font-size: .74rem; font-weight: 700;
  color: var(--ink-2); vertical-align: .12em;
}

/* =========================================================================
   話題のキーワード ／ 特に身近な条文
   2サイトで寸法を完全にそろえてある。ちがうのは色トークン（--sign）だけ。
   片方だけ直すとすぐズレるので、まとめてここに置く
   ========================================================================= */
.filters .wrap { padding: 1rem 0 1.15rem; }
.chipbar-label { margin: 0 0 .5rem; font-size: 1rem; color: var(--ink); }
.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); }

.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;
}
.picks { display: flex; flex-direction: column; gap: .45rem; }
.pick {
  display: flex; align-items: baseline; gap: .9rem; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: .75rem 1rem; font: inherit; cursor: pointer;
  transition: border-color .12s, transform .12s;
}
.pick:hover { border-color: var(--sign); transform: translateX(2px); }
.pick-no {
  flex: 0 0 6.2rem;
  font-family: var(--font-display); font-size: .8rem;
  color: var(--sign); letter-spacing: .02em;
}
.pick-t { font-size: .95rem; line-height: 1.65; color: var(--ink); }

@media (max-width: 640px) {
  .filters .wrap { padding: .8rem 0 1rem; }
  .chipbar-label { font-size: .9rem; margin-bottom: .45rem; }
  .chip { padding: .42rem .85rem; font-size: .86rem; }
  .home-block { gap: .7rem; }
  .home-h { font-size: .98rem; }
  .picks { gap: .35rem; }
  .pick { gap: .6rem; padding: .62rem .8rem; }
  .pick-no { flex: 0 0 4.7rem; font-size: .72rem; }
  .pick-t { font-size: .9rem; line-height: 1.6; }
}
@media (max-width: 380px) {
  .chip { font-size: .83rem; padding: .4rem .72rem; }
  .pick-no { flex-basis: 4.3rem; }
}
