/* ドリルファインダー */
.search-bar { display: flex; gap: 8px; }
.search-box { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 12px; background: #fff; border: 1px solid #bccada; border-radius: 10px; color: var(--ink-3); }
.search-box:focus-within { outline: 2px solid var(--aqua); border-color: var(--aqua); }
.search-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 16px; color: var(--ink); }
.f-open { flex: none; padding: 9px 12px; min-height: 48px; }
.badge { min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--gold); color: var(--night); font-size: 12px; line-height: 20px; text-align: center; }
.quick { display: flex; gap: 7px; overflow-x: auto; margin: 10px -16px 0; padding: 2px 16px 6px; scrollbar-width: none; }
.quick::-webkit-scrollbar { display: none; }
.quick .chip { flex: none; }
.res-head { display: flex; align-items: center; justify-content: space-between; margin: 8px 0 8px; }
.res-head b { font-size: 21px; font-weight: 600; }
.sort { font-size: 12.5px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.sort-sel { min-height: 36px; border: 1px solid #c3d0de; border-radius: 8px; background: #fff; padding: 2px 6px; font-size: 13.5px; color: var(--ink); }
.search-cols { display: block; }
.f-aside { display: none; }
.f-group { margin-top: 18px; }
.f-group:first-child { margin-top: 0; }
.f-group h3 { font-size: 13px; color: var(--ink-2); margin-bottom: 7px; }

.dgrid { display: grid; gap: 10px; }
.dcard { position: relative; display: flex; background: #fff; border: 1px solid var(--hair); border-radius: 12px; overflow: hidden; }
.dcard-link { flex: 1; min-width: 0; display: flex; color: inherit; padding-right: 46px; }
.dcard:hover { border-color: #a9bdd2; }
.ph { display: block; flex: none; background: linear-gradient(160deg, #0b5fb0, #0aa6c9); overflow: hidden; }
.ph img { width: 100%; height: 100%; object-fit: cover; }
.dcard .ph { width: 104px; min-height: 104px; }
.dcard-body { min-width: 0; padding: 9px 2px 9px 11px; }
.dcard-block { font-size: 11.5px; color: var(--ink-3); display: flex; gap: 6px; line-height: 1.4; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.dcard-block .num { color: var(--gold-ink); font-weight: 600; }
.dcard h3 { font-size: 15px; font-weight: 700; line-height: 1.4; margin: 2px 0 5px; }
.dcard-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 9px; font-size: 12px; color: var(--ink-2); line-height: 1.4; }
.dcard-acts { position: absolute; top: 0; right: 0; bottom: 0; display: flex; flex-direction: column; justify-content: space-between; padding: 3px 1px; }
.fav.is-on, .dock-fav.is-on { color: var(--gold-ink); }
.fav.is-on svg, .dock-fav.is-on svg { fill: var(--gold); stroke: var(--gold-ink); }
.add.is-on { color: var(--blue); }
.lv { display: inline-flex; align-items: center; gap: 2px; }
.lv i { width: 6px; height: 6px; border-radius: 50%; background: var(--tile-2); box-shadow: inset 0 0 0 1px #b3c3d4; }
.lv i.on { background: var(--blue); box-shadow: none; }
.lv em { font-style: normal; margin-left: 3px; }

/* 詳細 */
.page.drill { padding: 0 0 16px; max-width: 1120px; }
.ph.hero { width: 100%; aspect-ratio: 3 / 2; }
.drill-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--night); color: #fff; }
.drill-facts > div { padding: 9px 4px; text-align: center; border-left: 1px solid rgba(255, 255, 255, .13); min-width: 0; }
.drill-facts > div:first-child { border-left: 0; }
.drill-facts .wide { grid-column: 1 / -1; border-left: 0; border-top: 1px solid rgba(255, 255, 255, .13); display: flex; justify-content: center; gap: 10px; align-items: baseline; }
.drill-facts span { display: block; font-size: 11px; color: #b9c9db; line-height: 1.4; }
.drill-facts b { display: block; font-size: 14px; font-weight: 600; line-height: 1.4; }
.lane-block { margin: 14px 16px 0; padding: 14px 12px 12px; }
.lane { width: 100%; height: auto; }
.lane-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 14px; font-size: 12px; color: var(--ink-2); margin-top: 6px; }
.lane-legend span { display: inline-flex; align-items: center; gap: 5px; }
.lane-legend i { width: 14px; height: 8px; border-radius: 2px; }
.lane-legend p { flex-basis: 100%; color: var(--ink-3); }
.drill-main { padding: 18px 16px 0; }
.drill-head h2 { font-size: 23px; line-height: 1.4; font-weight: 700; letter-spacing: .04em; }
.en { color: var(--ink-3); font-size: 13px; }
.purpose { margin-top: 8px; font-size: 15px; }
.cue { margin: 16px 0 0; padding: 13px 15px; background: var(--night); color: #fff; font-size: 16.5px; line-height: 1.65; border-radius: 4px 12px 12px 4px; border-left: 4px solid var(--gold); }
.cue span { display: block; font-size: 11.5px; color: #d9c083; margin-bottom: 2px; }
.sec { margin-top: 24px; }
.sec h3, .safety h3 { font-size: 15.5px; font-weight: 700; letter-spacing: .05em; padding-bottom: 6px; border-bottom: 2px solid var(--night); margin-bottom: 4px; display: flex; justify-content: space-between; align-items: baseline; }
.sec h3 small { font-size: 14px; font-weight: 600; color: var(--gold-ink); }
.steps { list-style: none; counter-reset: s; margin: 0; padding: 0; }
.steps li { counter-increment: s; position: relative; padding: 10px 0 10px 40px; border-bottom: 1px solid var(--hair); }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 11px; width: 27px; height: 27px; border-radius: 50%; background: var(--blue); color: #fff; font-size: 14px; font-weight: 600; line-height: 27px; text-align: center; }
.err { padding: 10px 0; border-bottom: 1px solid var(--hair); }
.err-e { font-weight: 700; color: var(--danger); }
.err-f { color: var(--ink-2); margin-top: 2px; }
.lvls { margin: 0; }
.lvls > div { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--hair); }
.lvls dt { flex: none; width: 44px; font-weight: 700; color: var(--blue); }
.lvls dd { margin: 0; color: var(--ink-2); }
.menu { width: 100%; border-collapse: collapse; font-size: 14px; }
.menu th { text-align: left; font-size: 12px; color: var(--ink-3); font-weight: 600; padding: 7px 8px 4px 0; }
.menu td { padding: 9px 8px 9px 0; border-top: 1px solid var(--hair); vertical-align: top; }
.menu td:nth-child(1), .menu td:nth-child(2) { white-space: nowrap; font-weight: 600; }
.checks { list-style: none; margin: 0; padding: 0; }
.checks li { display: flex; gap: 9px; padding: 9px 0; border-bottom: 1px solid var(--hair); }
.checks svg { color: var(--aqua); margin-top: 3px; }
.safety { margin-top: 24px; padding: 13px 15px; background: var(--gold-wash); border-radius: 10px; }
.safety h3 { border: 0; padding: 0; color: var(--gold-ink); font-size: 14px; }
.pns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }
.pn { display: block; padding: 10px 12px; background: #fff; border: 1px solid var(--hair); border-radius: 10px; color: var(--ink); min-width: 0; }
.pn-off { color: var(--ink-3); background: var(--tile); }
.pn-label { display: block; font-size: 11.5px; color: var(--ink-3); }
.pn b { font-size: 13.5px; font-weight: 600; line-height: 1.45; display: block; }
.dock { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar) + var(--safe-b)); z-index: 35; display: grid; grid-template-columns: 2fr 3fr; gap: 8px; padding: 8px 12px; background: rgba(255, 255, 255, .97); border-top: 1px solid var(--hair); }
.dock .btn { padding: 8px 6px; font-size: 14px; min-width: 0; }
.drill { padding-bottom: 76px !important; }

/* レッスン */
.lesson-empty, .ls { margin-top: 14px; }
.ls { list-style: none; padding: 0; background: #fff; border: 1px solid var(--hair); border-radius: 12px; overflow: hidden; }
.li { display: flex; align-items: center; background: #fff; border-top: 1px solid var(--hair); padding: 4px 2px; }
.li:first-child { border-top: 0; }
.li.dragging { position: relative; z-index: 2; background: var(--gold-wash); box-shadow: inset 0 0 0 1px var(--gold); }
.drag { flex: none; width: 34px; height: 48px; border: 0; background: none; color: var(--ink-3); display: flex; align-items: center; justify-content: center; touch-action: none; cursor: grab; }
.li-no { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--night); color: #fff; font-size: 12.5px; text-align: center; line-height: 24px; margin-right: 8px; }
.li-main { flex: 1; min-width: 0; color: inherit; line-height: 1.4; }
.li-main b { display: block; font-size: 14px; font-weight: 600; }
.li-main span { display: block; font-size: 11.5px; color: var(--ink-3); }
.li-acts { display: flex; flex: none; }
.li-acts .icon-btn { width: 34px; }
.sub-title { font-size: 15.5px; font-weight: 700; margin: 26px 0 8px; letter-spacing: .05em; }
.row-open { flex: 1; min-width: 0; border: 0; background: none; padding: 0; text-align: left; cursor: pointer; }
.row-open b { display: block; font-weight: 600; line-height: 1.45; }
.row-open span { display: block; font-size: 12.5px; color: var(--ink-3); }

@media (min-width: 720px) {
  .dgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page.drill { padding: 22px 28px 90px; }
  .ph.hero { border-radius: 12px 12px 0 0; }
  .drill-facts { border-radius: 0 0 12px 12px; }
  .lane-block { margin: 14px 0 0; }
  .drill-main { padding: 18px 0 0; }
}
@media (min-width: 1024px) {
  .search-cols { display: grid; grid-template-columns: 268px minmax(0, 1fr); gap: 22px; align-items: start; margin-top: 12px; }
  .f-aside { display: block; position: sticky; top: 84px; background: #fff; border: 1px solid var(--hair); border-radius: 12px; padding: 14px; max-height: calc(100dvh - 104px); overflow: auto; }
  .f-open, .quick { display: none; }
  .res-head { margin-top: 0; }
  .drill-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 32px; align-items: start; }
  .drill-side { position: sticky; top: 84px; }
  .drill-main { padding-top: 0; }
  .dock { left: 232px; bottom: 0; grid-template-columns: 200px 300px; justify-content: end; padding-right: 28px; }
}

/* A4印刷 */
@media print {
  .pl-total { display: flex; gap: 6mm; font-size: 9pt; white-space: nowrap; }
  .pl-total b { font-size: 18pt; font-weight: 600; margin-right: .7mm; }
  .pl-item { display: grid; grid-template-columns: 15mm minmax(0, 1fr) 52mm; gap: 4mm; padding: 3.2mm 0; border-bottom: .25mm solid #c9d5e2; break-inside: avoid; page-break-inside: avoid; }
  .pl-item:first-of-type { margin-top: 3mm; }
  .pl-no b { display: block; width: 9mm; height: 9mm; border-radius: 50%; background: #0b2340; color: #fff; text-align: center; line-height: 9mm; font-size: 12pt; }
  .pl-no span { display: block; font-size: 7.5pt; color: #5f7186; margin-top: 1mm; white-space: nowrap; }
  .pl-body h2 { font-size: 12.5pt; line-height: 1.35; font-weight: 700; }
  .pl-body h2 small { display: block; font-size: 8pt; font-weight: 400; color: #5f7186; }
  .pl-cue { font-size: 9.5pt; margin: 1mm 0; padding-left: 2mm; border-left: .7mm solid #c29a45; }
  .pl-body table { width: 100%; border-collapse: collapse; font-size: 9.5pt; }
  .pl-body td { padding: .7mm 2.5mm .7mm 0; border-top: .2mm solid #dbe4ed; }
  .pl-body td:nth-child(-n+2) { white-space: nowrap; font-weight: 600; }
  .pl-safe { font-size: 8pt; color: #7a5c1c; margin-top: 1mm; }
  .pl-lane p { font-size: 9pt; font-weight: 600; text-align: right; }
  .pl-memo { margin-top: 3mm; break-inside: avoid; }
  .pl-memo h2 { font-size: 10pt; }
  .pl-memo p { white-space: pre-wrap; font-size: 9.5pt; }
}
