/* =====================================================================
   アセスメント様式編集（assessments#sheet_edit）— 画面用の読みやすさ上書き
   JIS X 8341-3（WCAG 2.0 レベルAA相当）対応 / 2026-08-16

   ■ なぜ assessment_sheet.css を直接書き換えず、別ファイルに分けているか
     assessment_sheet.css は
       ・画面   … assessments#sheet_edit
       ・印刷   … clients#print_all / assessments#print_guideline
     の**両方**から読み込まれている。
     しかも print_all の HTML には
       <link href="/assets/assessment_sheet-<ダイジェスト>.css">
     というファイル内容のハッシュ入り URL が焼き込まれるため、
     **assessment_sheet.css を1バイトでも触ると印刷帳票の HTML が変わる**。
     （print_all_pdf_dump_test の MD5 が変化してしまう）

     そこで「画面だけを読みやすくする上書き」は本ファイルに閉じ込め、
     sheet_edit のビューからのみ読み込む。印刷側は一切読み込まない。

   ■ ファイル全体を @media screen で包んでいる理由
     sheet_edit の画面をブラウザの印刷機能で刷ることもできるため、
     その場合でも従来の帳票レイアウト（210mm・小さめの字）に戻るようにする。
     ＝「画面の文字を大きくしても、紙に出るものは変えない」を構造で担保する。

   ■ 前提
     assessment_sheet.css の後に読み込むこと（同じ詳細度なら後勝ちで上書きする）。
   ===================================================================== */

@media screen {
  /* ---- 用紙の見た目をやめ、画面向けのカードにする ---- */
  .asx-sheet {
    width: auto;
    max-width: 62rem;
    padding: 1.25rem;
    border: 1px solid var(--gray-300);
    border-radius: 14px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    /* 明朝 → 本文と同じゴシック。小さい字の明朝は画面で最も読みにくい組み合わせ */
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 16px;
    line-height: 1.7;
  }

  .asx-group {
    border: 1.5px solid var(--gray-300);
    border-radius: 12px;
    overflow: hidden;
  }

  .asx-group-head {
    background: var(--navy);
    border-bottom: none;
    color: #fff;
    font-size: 19px;
    padding: 0.8rem 1.1rem;
    letter-spacing: 0.02em;
  }

  .asx-subhead {
    background: var(--gray-100);
    color: var(--gray-900);
    font-size: 16px;
    font-weight: 800;
    padding: 0.7rem 1.1rem;
    border-top: 1.5px solid var(--gray-300);
    border-bottom: none;
  }

  /* ---- 認定調査項目: 表 → 1項目1カード ---- */
  .asx-item-block {
    border-bottom: 1.5px solid var(--gray-200);
    padding: 1.1rem;
  }

  .asx-item-block:last-child {
    border-bottom: none;
  }

  .asx-item-top {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    margin-bottom: 0.8rem;
    flex-wrap: wrap;
  }

  /* 項目番号（1-1 等）。旧 .asx-code は 10.5px だった */
  .asx-code-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3rem;
    padding: 0.2rem 0.5rem;
    background: var(--navy);
    color: var(--gold-light);
    font-weight: 800;
    font-size: 14px;
    border-radius: 6px;
  }

  .asx-item-label {
    font-size: 18px;
    font-weight: 800;
    color: var(--gray-900);
  }

  .asx-item-hint {
    font-size: 13px;
    color: var(--gray-700);
    font-weight: 600;
  }

  /* ---- 選択肢（旧 10.5px・丸囲み15px） ---- */
  .asx-choices {
    gap: 0.55rem;
  }

  .asx-choice {
    font-size: 15px;
    font-weight: 600;
    min-height: 44px;
    border: 1.5px solid var(--gray-400);
    border-radius: 999px;
    padding: 0.5rem 1rem 0.5rem 0.5rem;
    background: #fff;
    color: var(--gray-800);
  }

  .asx-choice:hover {
    background: var(--gray-50);
    border-color: var(--navy);
  }

  .asx-choice .num {
    width: 1.9rem;
    height: 1.9rem;
    min-width: 1.9rem;
    margin-right: 0.6rem;
    border: 2px solid var(--gray-500);
    border-radius: 50%;
    font-size: 14px;
    font-weight: 800;
    color: var(--gray-700);
    background: #fff;
    flex-shrink: 0;
    position: relative;
  }

  /* 未選択のあいだはチェックマークを隠し、番号を出す */
  .asx-choice .asx-choice-check {
    display: none;
    width: 1.1rem;
    height: 1.1rem;
  }

  /* 選択中: 色の変化に加えてチェックマークでも示す（色覚に依存させない）
     ------------------------------------------------------------------
     ⚠ 2026-08-26 要望書 ②「1-1 麻痺等、1-2 拘縮 ⇒ 自動入力が間違っているケースあり。
        修正できない。」の原因はここだった。

        従来は
          .asx-choice.is-checked, .asx-choice:has(input:checked) { 選択中の見た目 }
        と OR で書いていた。`is-checked` は **サーバーが描画時に付ける静的クラス**で、
        利用者がクリックしても外れない。つまり
          「チェックを外す → :has() 側は消えるが .is-checked 側が残る → 見た目は選択中のまま」
        になり、**押しても何も起きないように見える**。
        とくに複数選択（麻痺・拘縮・関節）は、外しても他に変化が無いため完全な無反応に映る。

        直し方は2段構え:
          1. 実際の checked 状態（:has）を唯一の正とする  ← ここ
          2. :has() 非対応ブラウザ用に、静的クラスを @supports の中だけで使う ← 下
        さらに JS（sheet-edit#syncChoiceState）が is-checked を実際の状態へ追従させるので、
        フォールバック経路でもクリックに反応する。 */
  .asx-choice:has(input:checked) {
    background: var(--purple-bg, #f3ecff);
    border-color: var(--asx-purple);
    border-width: 2px;
    color: var(--gray-900);
    font-weight: 700;
  }

  .asx-choice:has(input:checked) .num {
    border-color: var(--asx-purple);
    background: var(--asx-purple);
    color: #fff;
  }

  .asx-choice:has(input:checked) .asx-choice-check {
    display: block;
  }

  .asx-choice:has(input:checked) .asx-choice-num {
    display: none;
  }

  /* :has() が使えないブラウザ向けのフォールバック。
     この場合だけサーバー描画のクラス（+ JS の追従）で選択中を示す。 */
  @supports not selector(:has(*)) {
    .asx-choice.is-checked {
      background: var(--purple-bg, #f3ecff);
      border-color: var(--asx-purple);
      border-width: 2px;
      color: var(--gray-900);
      font-weight: 700;
    }

    .asx-choice.is-checked .num {
      border-color: var(--asx-purple);
      background: var(--asx-purple);
      color: #fff;
    }

    .asx-choice.is-checked .asx-choice-check {
      display: block;
    }

    .asx-choice.is-checked .asx-choice-num {
      display: none;
    }
  }

  /* input は視覚的に隠してあるので、フォーカスはラベル側の枠で示す */
  .asx-choice:focus-within {
    outline: 3px solid var(--focus, #0b5fff);
    outline-offset: 2px;
  }

  .asx-choice-clear {
    border: 1.5px solid var(--gray-400);
    background: #fff;
    color: var(--gray-700);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    padding: 0.4rem 0.9rem;
    min-height: 38px;
  }

  .asx-choice-clear:hover {
    background: #fef2f2;
    color: var(--red-ink);
    border-color: #fecaca;
  }

  /* ---- 援助の現状・希望・計画（旧: 8px 見出しの5列テーブル） ---- */
  .asx-care-row-label {
    font-size: 13px;
    font-weight: 800;
    color: var(--asx-purple);
    letter-spacing: 0.04em;
    margin: 1rem 0 0.5rem;
  }

  .asx-care-chips {
    display: flex;
    gap: 0.9rem;
    flex-wrap: wrap;
  }

  .asx-care-chip {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }

  .asx-care-chip label {
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-700);
  }

  .asx-care-chip .asx-sel {
    min-width: 8rem;
  }

  /* ---- セレクト（旧 13px・高さ不足） ---- */
  .asx-sel {
    border: 2px solid var(--gray-500);
    border-radius: 8px;
    padding: 0.5rem 0.7rem;
    font-size: 15px;
    font-weight: 600;
    min-height: 44px;
    background: var(--asx-edit-bg);
    color: var(--gray-900);
    font-family: 'Noto Sans JP', sans-serif;
  }

  .asx-sel:focus {
    outline: 3px solid var(--focus, #0b5fff);
    outline-offset: 1px;
    border-color: var(--asx-purple);
  }

  /* ---- 援助内容の表（care_sections）は表のまま。字だけ大きくする ---- */
  .asx-care-cols th,
  .asx-care-cols td {
    border: 1px solid var(--gray-300);
    padding: 0.65rem 0.6rem;
    font-size: 15px;
  }

  .asx-care-cols thead th {
    background: var(--gray-200);
    font-size: 14px;
    font-weight: 800;
    color: var(--gray-900);
    font-family: 'Noto Sans JP', sans-serif;
  }

  .asx-care-cols tbody tr:nth-child(even) td {
    background: var(--gray-50);
  }

  .asx-care-label {
    text-align: left;
    font-weight: 700;
    font-size: 15px;
    color: var(--gray-900);
    background: transparent;
  }

  .asx-care-cols .asx-sel {
    min-width: 5.5rem;
  }

  /* ---- 特記・解決すべき課題（旧: 9.5px の薄いグレー見出し + 明朝 11.5px） ---- */
  .asx-note-cell {
    padding: 1.1rem;
    border-top: 2px solid var(--gray-300);
    background: var(--gray-50);
  }

  .asx-note-label {
    display: block;
    font-size: 15px;
    font-weight: 800;
    /* 旧 #8a8a8a は白背景に対して 3.5:1 で AA 未達だった */
    color: var(--gray-800);
    padding: 0;
    margin-bottom: 0.5rem;
    font-family: 'Noto Sans JP', sans-serif;
  }

  .asx-ta {
    border: 2px solid var(--gray-400);
    border-radius: 10px;
    background: #fff;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: var(--gray-900);
    padding: 0.8rem 1rem;
    min-height: 4.5em;
  }

  .asx-ta:hover {
    border-color: var(--asx-purple);
    background: #fff;
  }

  .asx-ta:focus {
    background: #fff;
    outline: 3px solid var(--focus, #0b5fff);
    outline-offset: 1px;
    border-color: var(--asx-purple);
  }

  .asx-ta::placeholder {
    color: var(--gray-700);
  }

  /* ---- extra ブロック（コミュニケーション・排泄用具・食事・医療） ---- */
  .asx-extra {
    padding: 1.1rem;
    border-top: 2px dashed var(--gray-300);
  }

  .asx-extra-title {
    font-size: 17px;
    font-weight: 800;
    color: var(--navy);
    margin: 0 0 0.8rem;
    font-family: 'Noto Sans JP', sans-serif;
  }

  .asx-field-row {
    gap: 0.6rem;
    margin-bottom: 0.9rem;
  }

  .asx-field-label {
    font-size: 15px;
    font-weight: 700;
    color: var(--gray-800);
    min-width: 12rem;
  }

  .asx-pill {
    font-size: 15px;
    font-weight: 600;
    padding: 0.5rem 1rem;
    min-height: 40px;
    border: 1.5px solid var(--gray-400);
    background: #fff;
    color: var(--gray-800);
  }

  .asx-pill:has(input:checked) {
    background: var(--purple-bg, #f3ecff);
    border-color: var(--asx-purple);
    border-width: 2px;
    color: var(--gray-900);
  }

  .asx-pill:focus-within {
    outline: 3px solid var(--focus, #0b5fff);
    outline-offset: 2px;
  }

  .asx-inline-note {
    font-size: 15px;
    font-family: 'Noto Sans JP', sans-serif;
    border-bottom: 2px solid var(--gray-400);
    min-height: 36px;
    color: var(--gray-900);
  }

  .asx-2axis th,
  .asx-2axis td {
    font-size: 15px;
    padding: 0.5rem 0.6rem;
    border-color: var(--gray-300);
  }

  .asx-2axis thead th {
    background: var(--gray-200);
    color: var(--gray-900);
    font-family: 'Noto Sans JP', sans-serif;
  }

  .asx-2axis input[type="checkbox"] {
    width: 22px;
    height: 22px;
  }

  /* ---- 上部バー・凡例・目次 ---- */
  .asx-topbar {
    padding: 1rem 1.1rem;
    border: 1.5px solid var(--gray-300);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  }

  .asx-topbar-title h1 {
    font-size: 22px;
  }

  .asx-topbar-title p {
    font-size: 15px;
    color: var(--gray-700);
    font-weight: 500;
  }

  .asx-completeness-label {
    font-size: 14px;
    color: var(--gray-800);
    font-weight: 700;
  }

  .asx-completeness-pct {
    font-size: 17px;
  }

  .asx-completeness-bar {
    height: 0.7rem;
    background: var(--gray-300);
  }

  .asx-completeness-fill {
    /* 旧グラデーションは薄く、進捗の端が背景と見分けにくかった */
    background: linear-gradient(90deg, #C0A062, #8a6a2a);
  }

  .asx-btn {
    font-size: 15px;
    font-weight: 700;
    padding: 0.65rem 1.1rem;
    min-height: 44px;
  }

  .asx-btn-ghost {
    color: var(--gray-800);
    border-color: var(--gray-400);
  }

  .asx-btn-lg {
    font-size: 17px;
    padding: 0.9rem 1.8rem;
    min-height: 52px;
  }

  .asx-btn:focus-visible {
    outline: 3px solid var(--focus, #0b5fff);
    outline-offset: 2px;
  }

  .asx-lg-title {
    font-size: 15px;
    font-weight: 800;
  }

  .asx-legend-item {
    font-size: 14px;
    color: var(--gray-800);
    font-weight: 600;
  }

  .asx-swatch {
    width: 1.4rem;
    height: 1.1rem;
    border: 1.5px solid var(--gray-400);
  }

  .asx-toc a {
    font-size: 14px;
    font-weight: 700;
    padding: 0.55rem 1rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    border: 1.5px solid var(--gray-400);
    color: var(--gray-800);
  }

  .asx-toc a:hover {
    background: var(--gold-bg);
    border-color: var(--gold-ink);
    color: var(--gold-ink);
  }

  .asx-page-label {
    font-size: 13px;
    color: var(--gray-700);
    font-weight: 600;
    padding: 0.5rem 1.1rem;
  }

  /* ---- 疾患別ケアの選択 ---- */
  .asx-tekicare-note {
    font-size: 15px;
    color: var(--gray-800);
  }

  .asx-tekicare-hint {
    color: var(--amber-ink);
    font-weight: 700;
  }

  .asx-tekicare-choices .asx-choice {
    font-size: 15px;
    padding: 0.6rem 1rem 0.6rem 0.8rem;
    min-height: 44px;
    border: 1.5px solid var(--gray-400);
  }

  .asx-tekicare-choices .asx-choice .lbl::before {
    width: 1.3rem;
    height: 1.3rem;
    margin-right: 0.6rem;
    border: 2px solid var(--gray-500);
  }

  /* ---- AIまとめカード ---- */
  .asx-ai-card h3 {
    font-size: 18px;
  }

  .asx-ai-card p {
    font-size: 15px;
    color: var(--gray-800);
    line-height: 1.7;
  }

  /* ---- 「疾患別ケアの選択はここから移動しました」の案内（2026-08-21 要望書 D-1）----
     この様式の最上部に選択欄があった時期を知っている人が迷子にならないための1行。
     ⚠ 印刷では出さない（ビュー側に no-print・このファイル自体も screen 限定）。
     ⚠ assessment_sheet.css ではなく本ファイルに置くこと。
       あちらは print_all に digest 付き URL が焼き込まれており、
       1バイト触るだけで帳票出力の MD5 が変わる。 */
  .asx-moved-note {
    max-width: 62rem;
    margin: 0 auto 14px;
    padding: 10px 14px;
    background: var(--gray-50);
    border: 1px dashed var(--gray-300);
    border-radius: 9px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--gray-800);
  }

  .asx-moved-note-label {
    font-weight: 700;
    color: var(--navy);
  }

  .asx-moved-note a {
    color: var(--gold-ink);
    font-weight: 600;
    text-decoration: underline;
  }

  /* ---- 転記状況バー（要望書 C-4「自立（空欄）も転記して欲しい」）----
     「自立」は選択肢1番なので転記済みでも画面では目立たない。
     群ごとに埋まり具合を出して、空欄が残っているのかどうかを一目で分かるようにする。 */
  .asx-fill-status {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.3rem 0.8rem;
    margin: 0 0 0.7rem;
    padding: 0.5rem 0.7rem;
    border-radius: 6px;
    background: #fdf7e7;
    border: 1px solid #e6d5a8;
    font-size: 13px;
    line-height: 1.5;
  }

  .asx-fill-status.is-complete {
    background: #eefaf1;
    border-color: #b7e0c4;
  }

  .asx-fill-count {
    font-weight: 700;
    color: var(--navy);
  }

  .asx-fill-note {
    color: var(--gray-700);
  }

  /* ---- ◯/△ の凡例（要望書 C-5「〇や△の意味がよく分からない」）---- */
  .asx-care-legend {
    margin: 0 0 0.8rem;
    padding: 0.4rem 0.7rem;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    background: #fff;
    font-size: 13px;
    line-height: 1.6;
  }

  .asx-care-legend > summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--navy);
    min-height: 26px;
    display: flex;
    align-items: center;
  }

  .asx-care-legend ul {
    margin: 0.4rem 0 0.2rem;
    padding-left: 1.2rem;
    color: var(--gray-700);
  }

  /* ---- 狭い画面 ---- */
  @media (max-width: 640px) {
    .asx-sheet {
      padding: 0.8rem;
    }

    .asx-item-block {
      padding: 0.9rem 0.7rem;
    }

    /* セレクトを全幅にして、指でも押しやすくする */
    .asx-care-chips {
      gap: 0.6rem;
    }

    .asx-care-chip {
      flex: 1 1 8.5rem;
    }

    .asx-care-chip .asx-sel {
      min-width: 100%;
      width: 100%;
    }

    .asx-field-label {
      min-width: 100%;
    }
  }
}

/* =====================================================================
   ページ（番号）ごとの編集 / 保存後にページへ戻る（2026-08-30 要望書）

     「居宅ガイドラインは、ページ（番号）毎に編集できるようにして欲しい」
     「編集して更新ボタンを押すと、一番上に戻ってしまう。編集していたページにとどまって欲しい」

   既存の目次（.asx-toc）を、押した1面だけを表示する切り替えボタンに作り替える。
   ⚠ 本ファイル全体が @media screen なので、印刷には一切影響しない。
   ⚠ ページを隠すのは display:none だが、**フォームの値は隠れていても送信される**。
     1ページずつ直して保存しても、他のページの入力内容は失われない。
   ===================================================================== */
@media screen {
  .asx-toc {
    align-items: center;
  }

  .asx-toc-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--asx-ink, #1f2937);
    margin-right: 0.15rem;
    white-space: nowrap;
  }

  .asx-toc-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #9ca3af;
    color: #374151;
    cursor: pointer;
    line-height: 1.4;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
  }

  .asx-toc-btn:hover {
    background: #f5f0ff;
    border-color: #7c3aed;
    color: #6d28d9;
  }

  .asx-toc-btn:focus-visible {
    outline: 2px solid #7c3aed;
    outline-offset: 2px;
  }

  .asx-toc-btn.is-active {
    background: #7c3aed;
    border-color: #7c3aed;
    color: #fff;
    font-weight: 700;
  }

  .asx-toc-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.2rem;
    height: 1.2rem;
    padding: 0 0.25rem;
    border-radius: 999px;
    background: #e5e7eb;
    color: #374151;
    font-size: 0.75rem;
    font-weight: 700;
  }

  .asx-toc-btn.is-active .asx-toc-num {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
  }

  /* 表示中でないページ（1ページずつ表示のとき） */
  .sheet-page-hidden {
    display: none !important;
  }

  /* ---------------------------------------------------------------
     各ページ下部の操作バー（2026-09-06 ライブFB (c)(d)）

       「入力し終えた位置で保存して、そのまま次のページへ進みたい」

     上部のバーまで戻らないと保存できないのが従来。13面もあるので、
     1面書くたびに画面の一番上まで戻る操作が発生していた。
     ⚠ 印刷には出ない（.no-print + 本ファイルは @media screen）。
     --------------------------------------------------------------- */
  .sheet-page-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    margin-top: 1.1rem;
    padding-top: 0.9rem;
    border-top: 2px dashed var(--gray-300, #d1d5db);
  }

  .sheet-page-foot-pos {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--gray-700, #374151);
    margin-right: auto;
  }

  /* タップ領域は最小 44px 四方（JIS X 8341-3 / WCAG 2.5.5 相当）。
     訪問先ではスマートフォンで入力するため、ここは削らない。 */
  .sheet-page-foot .asx-btn {
    min-height: 44px;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .sheet-page-foot .asx-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
  }

  @media (max-width: 640px) {
    .sheet-page-foot {
      gap: 0.5rem;
    }

    .sheet-page-foot-pos {
      flex: 1 0 100%;
      margin-right: 0;
    }

    /* 指の届く幅にする（横に3つ並べると1つあたりが細くなりすぎる） */
    .sheet-page-foot .asx-btn {
      flex: 1 1 45%;
      justify-content: center;
    }

    .sheet-page-foot .sheet-page-foot-next {
      flex-basis: 100%;
    }
  }
}

/* =====================================================================
   援助セル（家族実施 / サービス実施 / 希望 / 要援助→計画）の
   ワンタップ・ボタン化 と 「×（実施していない）」の追加（2026-09-06 ライブFB）

     「プルダウンだと選ぶのに時間がかかる。受診頻度の丸囲みと同じように押したい」
     「実施していない、を表す選択肢が無い（空欄と区別できない）」

   ■ 設計
     ・記号だけのボタンにしない。◯実施 / △時々 / ×なし と短い言葉を必ず添える
       （2026-08-16 FB「〇や△の意味がよく分からない」を再発させない）
     ・「未選択」ボタンは置かない。未選択は選択肢ではなく「まだ答えていない」状態。
       解除は同じボタンの再タップで行う（sheet-edit#toggleCareChoice）
     ・タップ領域は最小 44px 四方（JIS X 8341-3 / WCAG 2.5.5 相当）

   ⚠ 本ファイル全体が @media screen なので、印刷帳票には一切影響しない。
      印刷側（editable: false）は従来どおり記号1文字だけを出す。
   ===================================================================== */
@media screen {
  .asx-care-chip-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-700);
  }

  .asx-care-btns {
    display: inline-flex;
    gap: 0.3rem;
    flex-wrap: wrap;
  }

  /* 1つも選ばれていない列は、選び忘れが目で分かるように枠を弱く点線にする */
  .asx-care-btns:not(.is-filled) .asx-care-btn {
    border-style: dashed;
  }

  .asx-care-btn {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.05rem;
    min-width: 3.1rem;
    min-height: 44px;
    padding: 0.25rem 0.45rem;
    border: 2px solid var(--gray-400, #9ca3af);
    border-radius: 10px;
    background: #fff;
    color: var(--gray-800, #1f2937);
    cursor: pointer;
    line-height: 1.15;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
  }

  .asx-care-btn:hover {
    background: #f5f0ff;
    border-color: var(--asx-purple, #7c3aed);
  }

  /* input は隠すがフォーカスは受け取れる位置に置く（読み上げ・キーボード操作のため） */
  .asx-care-btn-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    inset: 0;
    cursor: pointer;
  }

  .asx-care-btn:focus-within {
    outline: 3px solid var(--focus, #0b5fff);
    outline-offset: 2px;
  }

  /* サーバー描画の is-checked と、クリック後の :has(:checked) の二段構え
     （:has 非対応ブラウザでも初期表示は正しく出る） */
  .asx-care-btn.is-checked,
  .asx-care-btn:has(.asx-care-btn-input:checked) {
    background: var(--purple-bg, #f3ecff);
    border-color: var(--asx-purple, #7c3aed);
    color: #111827;
    font-weight: 800;
    box-shadow: inset 0 0 0 1px var(--asx-purple, #7c3aed);
  }

  .asx-care-btn-mark {
    font-size: 17px;
    font-weight: 800;
  }

  .asx-care-btn-word {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--gray-700, #374151);
  }

  .asx-care-btn.is-checked .asx-care-btn-word,
  .asx-care-btn:has(.asx-care-btn-input:checked) .asx-care-btn-word {
    color: #4c1d95;
  }

  /* 援助内容の表（care_sections）は列が狭いので、ボタンを2列で折り返す */
  .asx-care-cols .asx-care-btns {
    gap: 0.2rem;
  }

  .asx-care-cols .asx-care-btn {
    min-width: 2.8rem;
    padding: 0.2rem 0.3rem;
  }

  /* 咀嚼「問題なし」のときに押せなくなる程度欄（sheet-edit#applySoshakuLock） */
  .asx-pill.is-locked {
    opacity: 0.45;
    cursor: not-allowed;
    background: var(--gray-100, #f3f4f6);
    border-style: dashed;
  }

  @media (max-width: 640px) {
    .asx-care-btn {
      min-width: 2.9rem;
    }
  }
}
