/* CareKarada 独自の画面部品 */
.panel-inner { max-width: 760px; margin: 0 auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 14px; }
.app-footer { padding: 6px 16px 18px; }
.nowrap { white-space: nowrap; }
.series-foot { text-align: center; color: var(--muted); font-size: .8rem; letter-spacing: .04em; margin: 0; }
.copy-area { min-height: 240px; font-size: .9rem; }

/* ① からだの図（スマホ：縦一列／PC：左に図・右に操作） */
.fig-layout { display: grid; gap: 14px; padding: 14px 12px; max-width: 1280px; margin: 0 auto; grid-template-columns: minmax(0, 1fr); }
.fig-main, .fig-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
@media (min-width: 960px) {
  .fig-layout { grid-template-columns: minmax(0, 1fr) 400px; align-items: start; padding: 16px 20px; }
  .fig-side { position: sticky; top: 92px; }
  .fig-wrap svg { max-height: calc(100vh - 340px); min-height: 380px; }
}
.viewer { padding: 10px; }
.pair-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 6px; }
.pair-btn { flex-direction: column; gap: 0; }
.pair-btn .cnt { font-size: .74rem; font-weight: normal; min-height: 1em; }
.pair-btn[aria-pressed="true"] { background: var(--theme); color: #fff; }
.pair-btn[aria-pressed="true"] .cnt { color: #fff; }
.fig-wrap { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.fig-wrap svg { display: block; width: 100%; height: auto; margin: 0 auto; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.fig-wrap .fig { cursor: crosshair; }
.fig-wrap .mark { cursor: pointer; }

/* 選んだ印の操作 */
.sel-bar { border: 2px solid #f0b400; background: #fffaf0; display: flex; flex-direction: column; gap: 10px; }
.sel-head { display: flex; align-items: center; gap: 10px; }
.sel-text { flex: 1; min-width: 0; }
.sel-move { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; align-items: center; }
.sel-move > span { grid-column: 1 / -1; }
.sel-move .btn { font-size: 1.2rem; }
.row-buttons.three { grid-template-columns: 1fr 1fr; }
.row-buttons.three > :last-child { grid-column: 1 / -1; }

.hemi-box summary { cursor: pointer; min-height: 48px; display: flex; align-items: center; font-weight: 700; color: var(--theme-dark); }
.hemi-box .field:first-child { margin-top: 6px; }

/* 印を付ける小窓 */
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.type-btn {
  display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 6px 10px; text-align: left;
  border: 2px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; line-height: 1.25; font-size: .92rem;
}
.type-btn svg { flex: none; }
.type-btn[aria-checked="true"] { border-color: var(--theme); background: var(--theme-light); font-weight: 700; box-shadow: inset 0 0 0 1px var(--theme); }
.type-btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ② 一覧 */
.mark-item { flex-wrap: wrap; }
.mark-num { width: 30px; height: 30px; flex: none; border: 2px solid var(--text); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .9rem; }
.item-memo { font-size: .88rem; overflow-wrap: anywhere; }
.mark-actions { display: flex; gap: 6px; flex-basis: 100%; justify-content: flex-end; flex-wrap: wrap; }
.mark-actions .btn { min-width: 48px; min-height: 48px; }
@media (min-width: 700px) {
  .mark-actions { flex-basis: auto; }
}

/* スマホ幅で「使い方」ボタンが下の行に落ちないように */
@media (max-width: 400px) {
  .brand { gap: 6px; }
  .brand-name { font-size: 1.1rem; }
  .brand-kana { font-size: .74rem; }
  #btn-help { padding: 4px 8px; }
}
