/* 授業セット（先生の入力ページ /manabi/sensei/set/ と、子どもが開くセットのページ /manabi/set/）。
   色・角丸・影は manabi.css の :root のトークンだけを使う（正本は manabi/DESIGN.md）。 */

.pk__inner, .ps__inner { display: grid; gap: 16px; padding-block: 8px 48px; max-width: 920px; }
.pk__for { display: inline-block; margin-left: 12px; padding: 2px 12px; vertical-align: middle; font-size: 15px; font-weight: 700;
  font-family: var(--font-body); background: var(--wood-light); border: 2px solid var(--ink); border-radius: var(--radius-pill); }
.pk__lead, .ps__lead { font-size: 16px; line-height: 1.8; max-width: 46em; }
.pk__note, .ps-teacher__note { font-size: 14px; color: var(--ink-soft); }
.pk__h2 { font-size: 22px; margin-top: 20px; }
.pk__status { min-height: 1.6em; font-size: 15px; font-weight: 700; }
.pk__status[data-kind="error"] { color: var(--fig-red); }

/* hidden の付いた箱は、下の display の指定より優先して隠す */
.pk__inner [hidden], .ps__inner [hidden] { display: none !important; }

/* 入力 */
.pk-form { display: grid; gap: 18px; padding: 20px; background: var(--panel); border: 2px solid var(--ink); border-radius: var(--radius-m); box-shadow: 0 4px 0 var(--ink); }
.pk-form__row { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.pk-field { display: grid; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.pk-field__label { font-family: var(--font-head); font-weight: 900; font-size: 16px; padding: 0; }
.pk-field__help { font-size: 13px; line-height: 1.7; color: var(--ink-soft); }
.pk-field__help strong { color: var(--ink); }
.pk-field select, .pk-field input[type="text"] {
  width: 100%; min-width: 0; min-height: 48px; padding: 8px 12px; font: inherit; font-size: 16px; color: var(--ink);
  background: var(--paper); border: 2px solid var(--ink); border-radius: var(--radius-s);
}
.pk-minutes__list { display: flex; flex-wrap: wrap; gap: 8px; }
.pk-chip { position: relative; }
.pk-chip input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.pk-chip span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; font-weight: 700;
  background: var(--paper); border: 2px solid var(--ink); border-radius: var(--radius-pill); cursor: pointer; }
.pk-chip input:checked + span { background: var(--wood); }
.pk-chip input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 3px; }
.pk-used summary { cursor: pointer; font-weight: 700; }
.pk-used__list { display: grid; gap: 4px 16px; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); margin-top: 8px;
  max-height: 320px; overflow: auto; padding: 8px; background: var(--paper); border: 1.5px solid var(--grid); border-radius: var(--radius-s); }
.pk-used__list label { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; line-height: 1.5; }
.pk-used__list input { margin-top: 3px; flex: none; }
.pk-form__submit { margin: 0; }
.pk-form__submit .m-btn[disabled] { opacity: .6; cursor: progress; }

/* できたセット（先生） */
.pk-result { display: grid; gap: 12px; }
.pk-result__meta { font-weight: 700; }
.pk-ai { padding: 10px 14px; font-size: 14px; background: var(--wood-light); border: 2px solid var(--ink); border-radius: var(--radius-s); }
.pk-items, .ps-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; counter-reset: pk; }
.pk-item { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: start; padding: 12px 14px;
  background: var(--panel); border: 2px solid var(--ink); border-radius: var(--radius-m); }
.pk-item__no, .ps-item__no { display: grid; place-items: center; width: 40px; height: 40px; font-family: var(--font-head); font-weight: 900; font-size: 20px;
  background: var(--wood); border: 2px solid var(--ink); border-radius: 50%; }
.pk-item__role { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.pk-item__title { font-family: var(--font-head); font-weight: 900; font-size: 18px; line-height: 1.4; overflow-wrap: anywhere; }
.pk-item__desc { font-size: 14px; line-height: 1.6; }
.pk-share { display: grid; gap: 12px; padding: 16px; background: var(--panel); border: 2px solid var(--ink); border-radius: var(--radius-m); }
.pk-share__buttons, .ps-teacher__buttons { display: flex; flex-wrap: wrap; gap: 12px; }
.pk-btn--sub { background: var(--panel); font-size: 16px; min-height: 46px; padding: 0 18px; cursor: pointer; }
.pk-list { margin: 0; padding-left: 1.3em; font-size: 15px; line-height: 1.8; display: grid; gap: 6px; }

/* セットのページ（子ども） */
.ps__shelf { font-family: var(--font-head); font-weight: 900; font-size: 20px; }
.ps-item a { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 220px); gap: 16px; align-items: center; padding: 14px 16px;
  color: var(--ink); text-decoration: none; background: var(--panel); border: 2.5px solid var(--ink); border-radius: var(--radius-m); box-shadow: 0 4px 0 var(--ink);
  transition: transform var(--t), box-shadow var(--t), background-color var(--t); }
.ps-item a:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--ink); background: #FFFDF7; color: var(--ink); }
.ps-item a:active { transform: translateY(3px); box-shadow: var(--lift-press); }
.ps-item__no { width: 52px; height: 52px; font-size: 26px; }
.ps-item__body { display: grid; gap: 4px; min-width: 0; }
.ps-item__role { font-size: 15px; font-weight: 700; color: var(--ink-soft); }
.ps-item__title { font-family: var(--font-head); font-weight: 900; font-size: clamp(20px, 2.6vw, 26px); line-height: 1.35; overflow-wrap: anywhere; }
.ps-item__min { font-size: 14px; font-weight: 700; }
.ps-item__thumb { aspect-ratio: 16 / 9; overflow: hidden; border: 2px solid var(--ink); border-radius: var(--radius-s); background: var(--fig-sky); }
.ps-item__thumb img { width: 100%; height: 100%; object-fit: cover; }
.ps__done { font-weight: 700; }
.ps-empty { display: grid; gap: 8px; padding: 16px; background: var(--panel); border: 2px solid var(--ink); border-radius: var(--radius-m); }
.ps-teacher { display: grid; gap: 10px; margin-top: 24px; padding: 16px; border: 2px dashed var(--ink-soft); border-radius: var(--radius-m); }
.ps-teacher__title { font-size: 18px; }

@media (max-width: 640px) {
  .pk-form { padding: 16px; }
  .pk-form__row { grid-template-columns: minmax(0, 1fr); }
  .ps-item a { grid-template-columns: auto minmax(0, 1fr); }
  .ps-item__thumb { grid-column: 1 / -1; }
  .pk-share__buttons .m-btn, .ps-teacher__buttons .m-btn { flex: 1 1 100%; justify-content: center; }
}
