/* Aiki Notes — Design System (Pinterest-inspired)
   See DESIGN.md for token reference.
   Single accent: Aiki Teal #1a9aab
   Two-radius vocabulary: 16px (md) / 24px (lg) / pill
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* 汎用の非表示ユーティリティ。以前は .fab.hidden のように要素ごとに書いていたため、
   定義漏れの要素（.practice-video-btn など）で hidden が効いていなかった。 */
.hidden { display: none !important; }

:root {
  --c-primary: #1a9aab;
  --c-primary-pressed: #0e7a8b;
  --c-primary-deep: #034d59;
  --c-on-primary: #ffffff;

  --c-canvas: #ffffff;
  --c-surface-soft: #fbfbf9;
  --c-surface-card: #f6f6f3;
  --c-secondary-bg: #e5e5e0;
  --c-hairline: #dadad3;
  --c-hairline-soft: #e5e5e0;

  --c-accent-soft: #dff3f6;
  --c-accent-tint: #f0fafb;

  --c-ink: #0f1e2a;
  --c-body: #33332e;
  --c-mute: #62625b;
  --c-ash: #91918c;
  --c-stone: #c8c8c1;

  --c-success: #16a36b;
  --c-warn: #e0852f;
  --c-warn-soft: #fdf0dc;
  --c-danger: #d04848;

  --c-dojo-other: #8e98a3;

  --font-jp: 'Inter', -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Yu Gothic UI', 'Meiryo', sans-serif;
  --font-en: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-num: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-full: 9999px;

  --tabbar-h: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; overscroll-behavior: none; }
body {
  font-family: var(--font-jp);
  background: var(--c-surface-card);
  color: var(--c-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-weight: 400;
}

/* App frame */
.app-frame {
  max-width: 480px;
  margin: 0 auto;
  background: var(--c-surface-soft);
  /* min-height だと中身の分だけ枠自体が伸び、bottom:0 のタブバーが画面外へ流れる。
     高さを画面に固定し、スクロールは .view-area の内側だけで起こす。
     100dvh はアドレスバー伸縮に追従（未対応ブラウザは直前の 100vh にフォールバック）。 */
  height: 100vh;
  height: 100dvh;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
@media (min-width: 481px) {
  .app-frame {
    border-left: 1px solid var(--c-hairline-soft);
    border-right: 1px solid var(--c-hairline-soft);
  }
}
.status-spacer { height: var(--safe-top); background: var(--c-surface-soft); }

/* Header */
.app-hdr {
  background: var(--c-surface-soft);
  padding: 16px 20px 10px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.hdr-user-row { margin-bottom: 4px; }
.hdr-user {
  font-size: 12px;
  font-weight: 700;
  color: var(--c-primary-deep);
}
.app-hdr-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.page-title {
  font-family: var(--font-jp);
  font-size: 22px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
  color: var(--c-ink);
}
.icon-btn {
  background: var(--c-canvas);
  border: 1px solid var(--c-hairline-soft);
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--c-body);
  border-radius: var(--r-full);
}
.icon-btn:active { background: var(--c-surface-card); transform: scale(0.95); }

/* Views */
.view-area {
  flex: 1;
  /* flex アイテムの既定 min-height:auto を打ち消さないと、overflow-y:auto があっても
     コンテンツ高まで伸びてしまい枠外へはみ出す */
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 16px);
}
.view { display: none; padding: 8px 16px 24px; }
.view.active { display: block; animation: viewIn 0.25s ease; }
@keyframes viewIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* Brand hero */
.brand-hero { text-align: center; padding: 12px 0 18px; }
.brand-name {
  font-family: var(--font-en);
  font-size: 28px;
  font-weight: 800;
  color: var(--c-ink);
  letter-spacing: -0.02em;
  line-height: 1;
}
.brand-tag {
  font-size: 12px;
  color: var(--c-mute);
  margin-top: 6px;
  font-weight: 500;
}

/* Hero card */
.hero-card {
  background: linear-gradient(135deg, var(--c-primary) 0%, #137a8a 100%);
  border-radius: var(--r-lg);
  padding: 22px 24px;
  margin-bottom: 20px;
  color: var(--c-on-primary);
  box-shadow: 0 8px 24px rgba(26, 154, 171, 0.22);
  position: relative;
  overflow: hidden;
}
.hero-card::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(255,255,255,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.hero-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  position: relative;
}
.hero-target { font-size: 14px; font-weight: 700; color: rgba(255,255,255,0.95); }
.hero-sep { color: rgba(255,255,255,0.5); margin: 0 6px; font-weight: 400; }
.hero-edit-btn {
  background: rgba(255,255,255,0.18);
  border: none;
  color: #fff;
  padding: 5px 14px;
  font-size: 12px;
  font-family: var(--font-jp);
  font-weight: 700;
  cursor: pointer;
  border-radius: var(--r-full);
  backdrop-filter: blur(6px);
}
.hero-cd { text-align: center; padding: 8px 0 16px; position: relative; }
.hero-cd-label {
  font-family: var(--font-en);
  font-size: 11px;
  color: rgba(255,255,255,0.78);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 6px;
  font-weight: 700;
}
.hero-cd-value {
  font-family: var(--font-en);
  font-size: 64px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  letter-spacing: -0.03em;
}
.hero-cd-unit {
  font-family: var(--font-en);
  font-size: 14px;
  color: rgba(255,255,255,0.82);
  margin-left: 6px;
  letter-spacing: 0.06em;
  font-weight: 700;
  text-transform: uppercase;
}
.hero-link {
  background: none;
  border: none;
  color: rgba(255,255,255,0.92);
  font-size: 12px;
  font-family: var(--font-jp);
  cursor: pointer;
  margin-top: 8px;
  padding: 4px 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
}
.hero-progress {
  background: rgba(255,255,255,0.14);
  border-radius: var(--r-md);
  padding: 12px 14px;
  position: relative;
  backdrop-filter: blur(8px);
}
.hero-pg-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
  font-size: 13px;
}
.hero-pg-label { font-weight: 700; color: rgba(255,255,255,0.95); }
.hero-pg-num { font-family: var(--font-num); font-size: 14px; font-weight: 800; color: #fff; }
.hero-pg-bar {
  background: rgba(255,255,255,0.22);
  height: 5px;
  border-radius: var(--r-full);
  overflow: hidden;
}
.hero-pg-fill {
  background: #fff;
  height: 100%;
  width: 0%;
  transition: width 0.5s ease;
  border-radius: var(--r-full);
}
.hero-pg-sub {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  color: rgba(255,255,255,0.78);
  font-size: 12px;
}

/* Stats row */
.stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 24px;
}
@media (max-width: 359px) {
  .stats-row { grid-template-columns: 1fr 1fr; }
}
.stat-cell {
  background: var(--c-canvas);
  border: 1px solid var(--c-hairline-soft);
  border-radius: var(--r-md);
  padding: 14px 8px 12px;
  text-align: center;
}
.stat-num {
  font-family: var(--font-num);
  font-size: 22px;
  font-weight: 800;
  color: var(--c-ink);
  line-height: 1;
  letter-spacing: -0.02em;
}
.stat-label {
  font-size: 10px;
  color: var(--c-mute);
  margin-top: 6px;
  font-weight: 600;
}

/* Block */
.block { margin-bottom: 24px; }
.block-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
  padding: 0 2px;
}
.block-title {
  font-family: var(--font-jp);
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  color: var(--c-ink);
}
.block-sub {
  font-family: var(--font-en);
  font-size: 11px;
  color: var(--c-mute);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.block-link {
  background: none;
  border: none;
  color: var(--c-primary);
  font-size: 13px;
  font-family: var(--font-jp);
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

/* Calendar */
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-arrow {
  background: var(--c-canvas);
  border: 1px solid var(--c-hairline-soft);
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-full);
  cursor: pointer;
  color: var(--c-body);
  font-family: var(--font-en);
  font-size: 16px;
  font-weight: 700;
}
.cal-arrow:active { transform: scale(0.94); }
.cal-month-label {
  font-family: var(--font-en);
  font-size: 13px;
  font-weight: 700;
  color: var(--c-ink);
  min-width: 90px;
  text-align: center;
}
.calendar {
  background: var(--c-canvas);
  border-radius: var(--r-md);
  border: 1px solid var(--c-hairline-soft);
  padding: 14px;
}
.cal-dow-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 6px; }
.cal-dow {
  text-align: center;
  font-family: var(--font-en);
  font-size: 10px;
  font-weight: 700;
  color: var(--c-mute);
  letter-spacing: 0.08em;
}
.cal-dow.sun, .cal-dow.sat { color: var(--c-mute); }  /* 土日も色分けしない */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  font-family: var(--font-num);
  font-size: 13px;
  color: var(--c-body);
  font-weight: 500;
  background: transparent;
}
.cal-cell.other-month { color: var(--c-stone); }
/* 今日はリング表示（塗りと両立させる） */
.cal-cell.today { box-shadow: inset 0 0 0 2px var(--c-primary); font-weight: 700; }
/* 稽古日誌が入った日 = 濃く塗る（回数が多いほど濃い） */
.cal-cell.practiced {
  background: var(--c-primary);
  color: var(--c-on-primary);
  font-weight: 700;
}
.cal-cell.practiced.heavy {
  background: var(--c-primary-deep);
  color: var(--c-on-primary);
}

/* カレンダー: hacomono連動バッジ・凡例 */
.hacomono-badge {
  font-size: 11px; font-weight: 700; color: var(--c-primary-deep);
  background: var(--c-accent-soft); border-radius: var(--r-full);
  padding: 3px 10px; white-space: nowrap;
}
.cal-sub { font-size: 12px; color: var(--c-mute); margin: 2px 0 4px; }
.cal-legend {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px;
  margin-top: 10px; font-size: 11px; color: var(--c-mute);
}
.cal-legend-item { display: flex; align-items: center; gap: 5px; }
.cal-legend-swatch { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.cal-legend-swatch.s1 { background: var(--c-primary); }
.cal-legend-swatch.s2 { background: var(--c-primary-deep); }
.cal-legend-note { color: var(--c-ash); }

/* Segment toggle */
.seg-toggle {
  display: inline-flex;
  background: var(--c-secondary-bg);
  border-radius: var(--r-full);
  padding: 3px;
}
.seg-btn {
  background: none;
  border: none;
  padding: 5px 14px;
  font-size: 12px;
  font-family: var(--font-jp);
  font-weight: 700;
  color: var(--c-mute);
  cursor: pointer;
  border-radius: var(--r-full);
}
.seg-btn.active { background: var(--c-canvas); color: var(--c-ink); }

/* Time chart */
.chart-card {
  background: var(--c-canvas);
  border: 1px solid var(--c-hairline-soft);
  border-radius: var(--r-md);
  padding: 18px 16px 16px;
}
.chart-axis {
  display: flex;
  justify-content: flex-end;
  font-family: var(--font-num);
  font-size: 11px;
  color: var(--c-mute);
  margin-bottom: 4px;
  font-weight: 700;
}
.chart-axis-max { margin-right: 6px; }
.chart-area {
  position: relative;
  height: 160px;
  border-bottom: 1px solid var(--c-hairline-soft);
  padding-bottom: 2px;
}
.time-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 100%;
  gap: 6px;
}
.tc-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  min-width: 0;
}
.tc-total {
  font-family: var(--font-num);
  font-size: 10px;
  font-weight: 700;
  color: var(--c-ink);
  margin-bottom: 3px;
  white-space: nowrap;
}
.tc-total.zero { color: var(--c-stone); font-weight: 500; }
.tc-stack {
  width: 80%;
  max-width: 32px;
  display: flex;
  flex-direction: column-reverse;
  border-radius: var(--r-sm) var(--r-sm) 2px 2px;
  overflow: hidden;
  min-height: 4px;
  transition: height 0.4s ease;
}
.tc-stack.empty {
  background: var(--c-hairline-soft);
  height: 4px !important;
}
.tc-seg { width: 100%; min-height: 2px; }
.tc-label {
  font-family: var(--font-num);
  font-size: 10px;
  color: var(--c-mute);
  margin-top: 8px;
  font-weight: 600;
  white-space: nowrap;
  display: flex; flex-direction: column; align-items: center; line-height: 1.25;
}
.tc-wd { font-family: var(--font-jp); font-size: 9px; color: var(--c-mute); }

/* 稽古推移の3スタッツ（今日/今月/累計）— カード化 */
.trend-stats {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px;
  margin: 4px 0 14px;
}
.trend-cell {
  background: var(--c-canvas); border: 1px solid var(--c-hairline-soft);
  border-radius: var(--r-md); padding: 14px 8px 12px; text-align: center;
}
.trend-label { font-size: 11px; color: var(--c-mute); margin-bottom: 5px; font-weight: 600; }
.trend-num { font-family: var(--font-num); font-size: 22px; font-weight: 800; color: var(--c-ink); letter-spacing: -0.01em; line-height: 1.1; }

/* カレンダーのナビ行（タイトルと出席日数を block-head に出した分、月送りは別行） */
.cal-nav-row { justify-content: center; margin: 2px 0 10px; }
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--c-hairline-soft);
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--c-body);
  font-weight: 500;
}
.legend-dot { width: 10px; height: 10px; border-radius: var(--r-sm); }
.legend-time { font-family: var(--font-num); color: var(--c-ink); font-weight: 800; margin-left: 2px; }

/* Sessions list */
.sessions-list, .sessions-list-full { display: flex; flex-direction: column; gap: 8px; }
.session-card {
  background: var(--c-canvas);
  border-radius: var(--r-md);
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 12px;
  align-items: start;
  cursor: pointer;
  border: 1px solid var(--c-hairline-soft);
}
.session-card:active { transform: scale(0.98); }
.session-date {
  text-align: center;
  background: var(--c-accent-soft);
  padding: 8px 0 6px;
  border-radius: var(--r-sm);
}
.ses-month {
  font-family: var(--font-en);
  font-size: 9px;
  color: var(--c-primary-deep);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}
.ses-day {
  font-family: var(--font-num);
  font-size: 22px;
  font-weight: 800;
  color: var(--c-primary-deep);
  line-height: 1;
  margin: 2px 0;
}
.ses-year { font-family: var(--font-num); font-size: 9px; color: var(--c-primary-deep); font-weight: 700; }
.session-body { min-width: 0; }
.ses-dojo { font-size: 13px; font-weight: 700; color: var(--c-ink); }
.ses-teacher { font-size: 12px; color: var(--c-mute); margin-left: 6px; font-weight: 500; }
.ses-duration {
  font-family: var(--font-num);
  font-size: 10px;
  color: var(--c-primary-deep);
  background: var(--c-accent-soft);
  padding: 2px 8px;
  border-radius: var(--r-full);
  margin-left: 6px;
  font-weight: 700;
}
.ses-memo-snip {
  font-size: 13px;
  color: var(--c-body);
  margin-top: 4px;
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.ses-techs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.ses-tech-mini {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: var(--r-full);
  color: var(--c-primary-deep);
  background: var(--c-accent-soft);
  font-weight: 600;
}
.ses-empty, .mastered-empty {
  padding: 28px 20px;
  text-align: center;
  color: var(--c-mute);
  font-size: 13px;
  background: var(--c-canvas);
  border-radius: var(--r-md);
  border: 1px dashed var(--c-hairline);
  line-height: 1.6;
}

/* Practiced */
.mastered-list { display: flex; flex-direction: column; gap: 6px; }
.mastered-item {
  background: var(--c-canvas);
  border: 1px solid var(--c-hairline-soft);
  border-radius: var(--r-md);
  padding: 11px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}
.mastered-item:active { transform: scale(0.98); }
.mastered-main { min-width: 0; }
.mastered-name { font-size: 14px; font-weight: 700; color: var(--c-ink); }
.mastered-meta { font-size: 11px; color: var(--c-mute); margin-top: 2px; font-weight: 500; }
.mastered-date {
  font-family: var(--font-num);
  font-size: 12px;
  color: var(--c-primary-deep);
  font-weight: 800;
  margin-left: 12px;
  flex-shrink: 0;
  background: var(--c-accent-soft);
  padding: 4px 10px;
  border-radius: var(--r-full);
}

/* Library */
.lib-hdr { padding: 8px 0 12px; }
.search-wrap { position: relative; margin-bottom: 12px; }
#search-input {
  width: 100%;
  padding: 14px 80px 14px 18px;
  border-radius: var(--r-md);
  border: 1px solid var(--c-hairline-soft);
  background: var(--c-canvas);
  font-size: 15px;
  font-family: var(--font-jp);
  color: var(--c-ink);
}
#search-input:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px var(--c-accent-tint); }
.beta-badge {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--c-primary);
  color: #fff;
  font-family: var(--font-en);
  font-size: 9px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--r-full);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
}
.filters {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.filter-group { display: flex; gap: 6px; }
.chip, .chip-sub {
  background: var(--c-canvas);
  border: 1px solid var(--c-hairline-soft);
  border-radius: var(--r-full);
  padding: 6px 14px;
  font-size: 12px;
  cursor: pointer;
  color: var(--c-mute);
  font-family: var(--font-jp);
  font-weight: 700;
}
.chip.active, .chip-sub.active {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: #fff;
}
.kyu-current {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: var(--c-accent-soft);
  border-radius: var(--r-md);
  font-size: 13px;
  color: var(--c-primary-deep);
  margin-bottom: 12px;
  font-weight: 700;
}
.kyu-current-label {
  font-family: var(--font-en);
  font-size: 9px;
  color: var(--c-primary);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 800;
}
.kyu-sep { color: var(--c-stone); }
.kyu-change {
  margin-left: auto;
  background: #fff;
  border: 1px solid var(--c-primary);
  border-radius: var(--r-full);
  padding: 4px 12px;
  font-size: 11px;
  cursor: pointer;
  color: var(--c-primary);
  font-family: var(--font-jp);
  font-weight: 700;
}

/* Tech list */
.list { display: flex; flex-direction: column; gap: 4px; }
.tech-card {
  background: var(--c-canvas);
  border-radius: var(--r-md);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  border: 1px solid var(--c-hairline-soft);
}
.tech-card:active { transform: scale(0.98); }
.tech-card.check-o { border-left: 4px solid var(--c-success); padding-left: 12px; }
.tech-card.check-d { border-left: 4px solid var(--c-warn); padding-left: 12px; }
.tech-card.check-x { border-left: 4px solid var(--c-danger); padding-left: 12px; }
.tech-main { flex: 1; min-width: 0; }
/* 技名＋審査ラベル / ローマ字＋バッジ の2段。右側の要素は縮まず右端に寄せる */
.tech-line { display: flex; align-items: baseline; gap: 8px; }
.tech-line > :first-child { flex: 1; min-width: 0; }
.tech-line > :last-child { flex: none; }
.tech-line.sub { align-items: center; margin-top: 1px; }
.tech-kyu-label {
  display: inline-block;
  font-family: var(--font-en);
  font-size: 10px;
  font-weight: 800;
  color: var(--c-primary-deep);
  background: var(--c-accent-soft);
  padding: 1px 7px;
  border-radius: var(--r-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.tech-kyu-label.shitei {
  color: var(--c-warn);
  background: var(--c-warn-soft);
  text-transform: none;
}
.tech-no {
  display: inline-block;
  color: var(--c-mute);
  font-size: 11px;
  font-weight: 700;
  margin-right: 8px;
  font-family: var(--font-num);
  min-width: 20px;
}
.tech-name { font-weight: 700; font-size: 15px; color: var(--c-ink); line-height: 1.35; }
.tech-romaji {
  font-size: 11px;
  color: var(--c-mute);
  font-family: var(--font-en);
  margin-top: 0;
  font-weight: 500;
  line-height: 1.3;
}
.tech-badges { display: flex; gap: 4px; flex-wrap: nowrap; }
.badge {
  font-size: 10px;
  padding: 2px 8px;
  font-weight: 700;
  border-radius: var(--r-full);
  font-family: var(--font-jp);
}
.badge-pos { color: #fff; background: var(--c-primary); }
/* 動画がまだ無い立/座は淡く。バッジを足さずに「開いても動画は無い」と分かるようにする */
.badge-pos.off { color: var(--c-mute); background: var(--c-secondary-bg); }
.badge-play { font-size: 9px; margin-right: 3px; opacity: .9; }

/* 動画バッジは押せる。行の高さは変えず、::after で上下にタップ領域を広げる */
.badge-btn {
  position: relative;
  border: 0;
  font-family: inherit;
  font-size: 11px;
  padding: 4px 10px;
  cursor: pointer;
}
.badge-btn::after {
  content: '';
  position: absolute;
  left: -3px; right: -3px; top: -10px; bottom: -10px;
}
.badge-btn:active { transform: scale(0.94); }
.badge-hand { color: var(--c-body); background: var(--c-surface-card); font-family: var(--font-en); }
.badge-video-yes { color: #fff; background: var(--c-success); }
.badge-video-no { color: var(--c-mute); background: var(--c-surface-card); }
.badge-video-soon { color: #fff; background: var(--c-warn); }

.tech-right { margin-left: 12px; display: flex; align-items: center; gap: 8px; }
.tech-check {
  font-size: 14px;
  font-weight: 800;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-full);
  border: 1.5px solid var(--c-hairline);
  color: var(--c-mute);
  font-family: var(--font-num);
}
.tech-check.o { background: var(--c-success); color: #fff; border-color: var(--c-success); }
.tech-check.d { background: var(--c-warn); color: #fff; border-color: var(--c-warn); }
.tech-check.x { background: var(--c-danger); color: #fff; border-color: var(--c-danger); }

.empty {
  background: var(--c-canvas);
  border-radius: var(--r-md);
  padding: 40px 20px;
  text-align: center;
  color: var(--c-mute);
  font-size: 13px;
  border: 1px dashed var(--c-hairline);
}

.meta-card {
  background: var(--c-accent-soft);
  padding: 14px 16px;
  margin-top: 16px;
  border-radius: var(--r-md);
  font-size: 11px;
  color: var(--c-primary-deep);
}
.meta-title {
  font-family: var(--font-en);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin-bottom: 4px;
  color: var(--c-primary);
  text-transform: uppercase;
}
.meta-stats { font-family: var(--font-num); font-size: 14px; font-weight: 800; }
.meta-btn {
  display: inline-block;
  margin-top: 10px;
  padding: 8px 16px;
  background: var(--c-canvas);
  color: var(--c-primary);
  border: 1px solid var(--c-primary);
  border-radius: var(--r-full);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  font-family: var(--font-jp);
}
.meta-btn:active { transform: scale(0.97); }

/* FAB */
.fab {
  position: absolute;
  right: 18px;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 18px);
  width: 56px;
  height: 56px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--c-primary) 0%, #2eb8ca 100%);
  color: #fff;
  border: none;
  box-shadow: 0 6px 20px rgba(26, 154, 171, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
  transition: transform 0.15s;
}
.fab:active { transform: scale(0.9); }
.fab.hidden { display: none; }

/* Tab bar */
.tabbar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--c-hairline-soft);
  display: flex;
  align-items: stretch;
  z-index: 20;
}
.tab {
  flex: 1;
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--c-mute);
  font-family: var(--font-jp);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 0;
}
.tab.active { color: var(--c-primary); }

/* Sheet */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.modal.hidden { display: none; }
.modal-bg {
  position: absolute;
  inset: 0;
  background: rgba(15, 30, 42, 0.5);
  backdrop-filter: blur(4px);
}
.sheet {
  position: relative;
  background: var(--c-canvas);
  width: 100%;
  max-width: 480px;
  max-height: 92vh;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  animation: sheetUp 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  display: flex;
  flex-direction: column;
}
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--c-hairline);
  border-radius: var(--r-full);
  margin: 8px auto 0;
  flex-shrink: 0;
}
.sheet-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--c-surface-card);
  border: none;
  border-radius: var(--r-full);
  width: 32px;
  height: 32px;
  font-size: 18px;
  cursor: pointer;
  color: var(--c-body);
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  font-family: var(--font-en);
}
.sheet-body {
  padding: 24px 22px calc(32px + var(--safe-bottom));
  overflow-y: auto;
  /* -webkit-overflow-scrolling: touch は iframe を含むとスクロールが止まる不具合があるため使わない
     （iOS 13 以降は指定しなくても慣性スクロールが効く） */
  overscroll-behavior: contain;
  flex: 1;
}
.sheet-title {
  font-family: var(--font-jp);
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 22px;
  color: var(--c-ink);
  letter-spacing: -0.01em;
}

/* Tech detail */
.dt-head {
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--c-hairline-soft);
}
.dt-kyu-label {
  display: inline-block;
  font-family: var(--font-en);
  font-size: 10px;
  font-weight: 800;
  color: var(--c-primary);
  background: var(--c-accent-soft);
  padding: 3px 10px;
  border-radius: var(--r-full);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dt-name {
  font-size: 24px;
  font-weight: 800;
  color: var(--c-ink);
  margin: 0;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.dt-romaji {
  font-family: var(--font-en);
  font-size: 12px;
  color: var(--c-mute);
  margin-top: 4px;
  font-weight: 500;
}
.dt-badges { display: flex; gap: 4px; margin-top: 10px; flex-wrap: wrap; }
.dt-section { margin: 20px 0; }
.dt-section-title {
  font-family: var(--font-en);
  font-size: 11px;
  font-weight: 800;
  color: var(--c-mute);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
/* 座り技として審査に出るが動画がまだ無い技の注記 */
.dt-video-pending {
  border: 1px dashed var(--c-hairline);
  border-radius: var(--r-md);
  padding: 12px 14px;
  font-size: .85rem;
  color: var(--c-mute);
  text-align: center;
  margin-top: 4px;
}

/* 動画の切替タブ（立一 立二 座一 座二 解説）。押すとその場で再生する */
.dt-vtabs {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 10px;
  scrollbar-width: none; -ms-overflow-style: none;
}
.dt-vtabs::-webkit-scrollbar { display: none; }
.dt-vtab {
  flex: none; min-height: 44px; padding: 0 18px;
  border: 1px solid var(--c-hairline); border-radius: var(--r-full);
  background: var(--c-canvas); color: var(--c-body);
  font-size: 1rem; font-weight: 700; cursor: pointer;
  white-space: nowrap;
}
.dt-vtab.active {
  background: var(--c-primary); border-color: var(--c-primary); color: var(--c-on-primary);
}
.dt-vtab:active { transform: scale(0.97); }
.dt-vstage { margin-bottom: 8px; }

/* 再生前はサムネイルだけ。iframe はタップされてから差し込む */
.dt-video-poster { cursor: pointer; }
.dt-video-thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.dt-video-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 62px; height: 62px; border-radius: 50%;
  background: rgba(0, 0, 0, .62);
}
.dt-video-play::after {
  content: ''; position: absolute; left: 54%; top: 50%; transform: translate(-50%, -50%);
  border-style: solid; border-width: 11px 0 11px 18px;
  border-color: transparent transparent transparent #fff;
}

/* 手本動画は立ち技／座り技のラベル付きで並べる */
.dt-video-item { margin-bottom: 14px; }
.dt-video-item:last-child { margin-bottom: 0; }
.dt-video-label {
  font-size: .8rem; font-weight: 700; color: var(--c-primary-deep);
  margin-bottom: 6px;
}
.dt-video {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  background: var(--c-surface-card);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-bottom: 8px;
}
/* ショート（縦動画）は 9:16 の枠で出す。16:9 に入れると上下が黒帯になり、
   一度最大化しないと見えなかった。画面からはみ出さないよう高さを上限で抑え、
   幅は比率から決まる（横幅いっぱいにはしない）。 */
.dt-video.portrait {
  padding-bottom: 0;
  width: min(100%, calc(64vh * 9 / 16));   /* 高さが画面に収まるよう幅から決める */
  aspect-ratio: 9 / 16;
  height: auto;
  margin: 0 auto 8px;
  background: #000;
}
.dt-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.dt-video-link {
  display: block;
  padding: 12px 16px;
  background: var(--c-surface-card);
  border-radius: var(--r-md);
  color: var(--c-primary);
  text-decoration: none;
  font-size: 13px;
  margin-bottom: 8px;
  font-weight: 600;
}
.dt-video-status {
  padding: 14px 16px;
  background: var(--c-surface-card);
  border-radius: var(--r-md);
  color: var(--c-body);
  font-size: 13px;
  text-align: center;
  margin-bottom: 12px;
}
.dt-video-status strong { color: var(--c-warn); font-weight: 800; }
.yt-search-block {
  background: var(--c-canvas);
  border: 1px solid var(--c-hairline-soft);
  border-radius: var(--r-md);
  padding: 14px;
}
.yt-search-label {
  font-family: var(--font-en);
  font-size: 10px;
  font-weight: 800;
  color: var(--c-mute);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.yt-search-row { display: flex; flex-direction: column; gap: 6px; }
.yt-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--c-surface-card);
  border-radius: var(--r-md);
  color: var(--c-ink);
  text-decoration: none;
  font-family: var(--font-jp);
  font-size: 13px;
  font-weight: 600;
}
.yt-btn:active { transform: scale(0.98); }
.yt-btn-mark { color: #c00; font-size: 14px; width: 22px; text-align: center; flex-shrink: 0; }
.yt-btn-primary {
  background: var(--c-accent-soft);
  color: var(--c-primary-deep);
  font-weight: 800;
}

.dt-check-row { display: flex; gap: 8px; }
.check-btn {
  flex: 1;
  background: var(--c-canvas);
  border: 1.5px solid var(--c-hairline);
  border-radius: var(--r-md);
  padding: 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  color: var(--c-body);
  font-family: var(--font-jp);
}
.check-btn:active { transform: scale(0.97); }
.check-btn.active.o { background: var(--c-success); color: #fff; border-color: var(--c-success); }
.check-btn.active.d { background: var(--c-warn); color: #fff; border-color: var(--c-warn); }
.check-btn.active.x { background: var(--c-danger); color: #fff; border-color: var(--c-danger); }

.dt-memo {
  width: 100%;
  min-height: 100px;
  border: 1.5px solid var(--c-hairline);
  border-radius: var(--r-md);
  padding: 14px;
  font-family: var(--font-jp);
  font-size: 14px;
  color: var(--c-ink);
  resize: vertical;
  line-height: 1.6;
  background: var(--c-canvas);
}
.dt-memo:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px var(--c-accent-tint); }
.dt-memo-hint { font-size: 11px; color: var(--c-mute); margin-top: 6px; }

/* Related sessions */
.related-sessions-list { display: flex; flex-direction: column; gap: 8px; }
.related-session-item {
  background: var(--c-surface-card);
  border-radius: var(--r-md);
  padding: 12px 14px;
  cursor: pointer;
}
.related-session-item:active { background: var(--c-accent-soft); }
.rsi-head { display: flex; align-items: center; gap: 10px; font-size: 11px; }
.rsi-date { font-family: var(--font-num); font-weight: 800; color: var(--c-primary); }
.rsi-dojo { color: var(--c-body); font-weight: 500; }
.rsi-memo {
  font-size: 13px;
  color: var(--c-ink);
  margin-top: 6px;
  line-height: 1.6;
  white-space: pre-wrap;
}
.rsi-empty {
  font-size: 12px;
  color: var(--c-mute);
  text-align: center;
  padding: 20px;
  border-radius: var(--r-md);
  background: var(--c-surface-card);
  line-height: 1.6;
}

/* Form */
.field { display: block; margin-bottom: 16px; }
.field-label {
  display: block;
  font-family: var(--font-jp);
  font-size: 12px;
  font-weight: 700;
  color: var(--c-body);
  margin-bottom: 6px;
}
.field select, .field input[type="text"], .field input[type="date"], .field input[type="number"] {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid var(--c-hairline);
  border-radius: var(--r-md);
  font-size: 15px;
  font-family: var(--font-jp);
  background: var(--c-canvas);
  color: var(--c-ink);
}
.field select:focus, .field input:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px var(--c-accent-tint); }

.tech-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
  min-height: 30px;
  padding: 6px 0;
}
.tech-chip {
  background: var(--c-primary);
  color: #fff;
  padding: 5px 6px 5px 12px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--r-full);
  font-weight: 700;
}
.tech-chip.custom { background: var(--c-dojo-other); }
.tech-chip-x {
  background: rgba(255, 255, 255, 0.25);
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  width: 20px;
  height: 20px;
  border-radius: var(--r-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-weight: 800;
}
.tech-chip a {
  color: rgba(255,255,255,0.9);
  text-decoration: underline;
  text-underline-offset: 2px;
  margin-left: 4px;
  font-size: 10px;
}

.tech-picker { position: relative; }
#ses-tech-search {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--c-hairline);
  border-radius: var(--r-md);
  font-size: 14px;
  font-family: var(--font-jp);
  background: var(--c-canvas);
  color: var(--c-ink);
}
#ses-tech-search:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px var(--c-accent-tint); }
.tech-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 240px;
  overflow-y: auto;
  background: var(--c-canvas);
  border: 1.5px solid var(--c-primary);
  border-top: none;
  border-radius: 0 0 var(--r-md) var(--r-md);
  z-index: 10;
}
.tech-results.hidden { display: none; }
.tech-result-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--c-hairline-soft);
  cursor: pointer;
  font-size: 13px;
  color: var(--c-ink);
  font-weight: 600;
}
.tech-result-item:active { background: var(--c-accent-soft); }
.tech-result-meta {
  font-size: 10px;
  color: var(--c-mute);
  margin-left: 8px;
  font-family: var(--font-en);
  font-weight: 500;
}
.tech-result-empty { padding: 16px; text-align: center; color: var(--c-mute); font-size: 12px; }

.link-add-btn {
  background: none;
  border: none;
  color: var(--c-primary);
  font-family: var(--font-jp);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 8px 0 0;
  margin-top: 4px;
}
.custom-tech-block {
  margin-top: 12px;
  padding: 14px;
  background: var(--c-accent-soft);
  border-radius: var(--r-md);
}
.custom-tech-block.hidden { display: none; }
.ctb-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--c-primary-deep);
  margin-bottom: 10px;
}
.custom-tech-block input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--c-hairline);
  border-radius: var(--r-md);
  font-size: 14px;
  font-family: var(--font-jp);
  background: var(--c-canvas);
  color: var(--c-ink);
  margin-bottom: 8px;
}
.custom-tech-block input:focus { outline: none; border-color: var(--c-primary); }
.ctb-actions { display: flex; gap: 8px; }
.ctb-cancel, .ctb-save {
  flex: 1;
  padding: 10px;
  border-radius: var(--r-md);
  font-family: var(--font-jp);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: none;
}
.ctb-cancel { background: var(--c-canvas); color: var(--c-mute); border: 1px solid var(--c-hairline); }
.ctb-save { background: var(--c-primary); color: #fff; }

.session-actions { display: flex; gap: 8px; margin-top: 20px; }
.session-actions .primary-btn { flex: 1; margin-top: 0; }
.primary-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--c-primary) 0%, #2eb8ca 100%);
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  padding: 16px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  font-family: var(--font-jp);
  margin-top: 12px;
  box-shadow: 0 4px 12px rgba(26, 154, 171, 0.3);
  letter-spacing: 0.02em;
}
.primary-btn:active { transform: scale(0.98); }
.danger-btn {
  background: var(--c-canvas);
  color: var(--c-danger);
  border: 1.5px solid var(--c-danger);
  border-radius: var(--r-md);
  padding: 16px 20px;
  font-family: var(--font-jp);
  font-size: 14px;
  cursor: pointer;
  font-weight: 700;
}
.danger-btn.hidden { display: none; }

/* ---------- アカウント / クラウド同期 ---------- */
.cloud-account {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--c-hairline);
}
.cloud-account input[type="email"], .cloud-account input[type="text"] {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid var(--c-hairline);
  border-radius: var(--r-md);
  font-size: 15px;
  font-family: var(--font-jp);
  background: var(--c-canvas);
  color: var(--c-ink);
  margin-bottom: 8px;
}
.cloud-account input:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px var(--c-accent-tint); }
.cloud-otp-row { margin-top: 6px; }
.cloud-otp-row.hidden { display: none; }
.cloud-user { font-size: 14px; font-weight: 700; color: var(--c-body); margin-bottom: 4px; }
.cloud-user #cloud-user-email { color: var(--c-primary); }
.cloud-sync-status { font-size: 12px; color: var(--c-mute); margin-bottom: 12px; }
.cloud-msg { font-size: 12px; margin-top: 10px; min-height: 1em; }
.cloud-msg.ok { color: var(--c-primary); }
.cloud-msg.err { color: var(--c-danger); }
#cloud-loggedin.hidden, #cloud-loggedout.hidden { display: none; }
#cloud-logout { width: 100%; }
.demo-field { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--c-hairline); }
.set-exam-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.set-exam-row .field-label { margin-bottom: 0; }
.set-exam-row input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--c-primary); flex-shrink: 0; }

/* ---------- 審査モード トグル ---------- */
.hero-row-right { display: flex; align-items: center; gap: 10px; }
.exam-toggle { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; user-select: none; }
.exam-toggle-label { font-size: 11px; font-weight: 700; color: rgba(255,255,255,0.92); }
.exam-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.exam-toggle-track {
  width: 38px; height: 22px; border-radius: 999px;
  background: rgba(255,255,255,0.28); position: relative; transition: background .2s;
}
.exam-toggle-thumb {
  position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.exam-toggle input:checked + .exam-toggle-track { background: var(--c-warn); }
.exam-toggle input:checked + .exam-toggle-track .exam-toggle-thumb { transform: translateX(16px); }

/* 審査モード時の必要ペース */
.hero-pace {
  margin-top: 8px; font-size: 12px; font-weight: 700;
  color: #fff; background: rgba(255,255,255,0.16);
  border-radius: var(--r-sm); padding: 7px 10px; text-align: center;
}
.hero-pace.hidden { display: none; }

/* お祝い */
.hero-celebrate { text-align: center; padding: 6px 0 18px; }
.hero-celebrate.hidden { display: none; }
.celebrate-emoji { font-size: 44px; line-height: 1; }
.celebrate-text { font-size: 16px; font-weight: 800; color: #fff; margin: 8px 0 14px; }
.celebrate-btn { width: auto; padding: 11px 22px; margin-top: 0; background: #fff; color: var(--c-primary-pressed); box-shadow: none; }

/* ---------- 目標カード ---------- */
.goals-list { display: flex; flex-direction: column; gap: 8px; }
.goals-empty { font-size: 12px; color: var(--c-mute); line-height: 1.7; padding: 6px 2px; }
.goal-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--c-surface-card); border: 1px solid var(--c-hairline-soft);
  border-radius: var(--r-md); padding: 12px 14px;
}
.goal-card.exam { border-left: 4px solid var(--c-primary); }
.goal-card.event { border-left: 4px solid var(--c-warn); cursor: pointer; }
.goal-card.past { opacity: 0.5; }
.goal-icon { font-size: 22px; line-height: 1; }
.goal-main { flex: 1; min-width: 0; }
.goal-label { font-size: 14px; font-weight: 700; color: var(--c-ink); }
.goal-date { font-size: 11px; color: var(--c-mute); margin-top: 2px; }
.goal-cd { display: flex; align-items: baseline; gap: 3px; }
.goal-days { font-family: var(--font-num); font-size: 26px; font-weight: 800; color: var(--c-primary); line-height: 1; }
.goal-unit { font-size: 12px; font-weight: 700; color: var(--c-mute); }
.goal-past { font-size: 13px; font-weight: 700; color: var(--c-ash); }
.goal-hint { font-size: 12px; color: var(--c-mute); line-height: 1.7; margin-bottom: 14px; }

/* 予定はホームの主役ではないので、1行に畳んだ小さい表示にする */
.goals-list.compact { gap: 6px; }
.goals-list.compact .goal-card { padding: 8px 12px; gap: 9px; }
.goals-list.compact .goal-icon { font-size: 15px; }
.goals-list.compact .goal-label { font-size: 12.5px; }
.goals-list.compact .goal-date { font-size: 10.5px; margin-top: 1px; }
.goals-list.compact .goal-days { font-size: 17px; }
.goals-list.compact .goal-unit { font-size: 10.5px; }
.goals-list.compact .goals-empty { font-size: 11.5px; }

/* 入口（ログイン / 新規登録 / ゲスト） */
.wel-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.wel-icon {
  flex: none; width: 52px; height: 52px; border-radius: 14px;
  background: var(--c-primary); color: #fff; font-family: var(--font-en);
  font-size: 28px; font-weight: 800; display: flex; align-items: center; justify-content: center;
}
.wel-title { font-size: 20px; font-weight: 800; color: var(--c-ink); }
.wel-sub { font-size: 12px; font-weight: 700; color: var(--c-mute); margin-top: 2px; }
.wel-note {
  margin-top: 14px; padding: 10px 12px; background: var(--c-surface-card);
  border-radius: var(--r-md); font-size: 11.5px; line-height: 1.7; color: var(--c-mute);
}
.wel-note b { color: var(--c-ink); font-weight: 800; }
#modal-welcome .primary-btn + .primary-btn { margin-top: 10px; }
#modal-welcome .ctb-cancel { width: 100%; margin-top: 10px; }

/* 未ログイン時のログイン導線 */
.login-cta {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
  padding: 12px 14px; background: var(--c-accent-tint);
  border: 1px solid var(--c-primary); border-radius: var(--r-md);
}
.login-cta-body { flex: 1; min-width: 0; font-size: 11px; color: var(--c-mute); line-height: 1.55; font-weight: 700; }
.login-cta-body b { display: block; font-size: 12.5px; font-weight: 800; color: var(--c-primary-deep); margin-bottom: 2px; }
.login-cta-btn {
  flex: none; min-height: 40px; padding: 0 16px; border: none; border-radius: var(--r-full);
  background: var(--c-primary); color: var(--c-on-primary);
  font-family: inherit; font-size: 13px; font-weight: 800; cursor: pointer;
}

/* ---------- ホームのダッシュボード ---------- */
.dash-card {
  background: var(--c-canvas); border: 1px solid var(--c-hairline-soft);
  border-radius: var(--r-md); padding: 14px; margin-bottom: 18px;
}
.dash-id { display: flex; align-items: center; gap: 12px; }
.dash-avatar {
  flex: none; width: 46px; height: 46px; border-radius: var(--r-full);
  background: var(--c-accent-tint); display: flex; align-items: center;
  justify-content: center; font-size: 24px; line-height: 1;
}
.dash-id-body { flex: 1; min-width: 0; }
.dash-name { font-size: 15px; font-weight: 800; color: var(--c-ink); }
.dash-target { font-size: 11.5px; font-weight: 700; color: var(--c-mute); margin-top: 2px; }
.dash-kyu { flex: none; text-align: right; }
.dash-kyu-label { font-size: 10.5px; font-weight: 700; color: var(--c-mute); }
.dash-kyu-value {
  font-family: var(--font-num); font-size: 26px; font-weight: 800;
  color: var(--c-primary-deep); line-height: 1.15;
}
.dash-next {
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--c-hairline-soft);
  font-size: 11.5px; font-weight: 700; color: var(--c-mute);
}
.dash-scope { font-size: 12px; font-weight: 700; color: var(--c-mute); }
.dash-rate-row { display: flex; align-items: baseline; gap: 8px; padding: 0 2px 8px; }
.dash-rate { font-family: var(--font-num); font-size: 30px; font-weight: 800; color: var(--c-ink); line-height: 1; }
.dash-rate-sub { font-size: 12px; font-weight: 700; color: var(--c-mute); }
.dash-total { font-size: 11.5px; font-weight: 700; color: var(--c-mute); padding: 0 2px; }
/* ダッシュボードの帯・カウンタは審査タブと同じ見た目を使う（.exam-bar / .exam-stats） */
#block-dash-progress .exam-bar { margin: 0 2px; }
#block-dash-progress .exam-stats { padding: 12px 0 8px; }

/* 動画レール（横スクロール） */
.vid-rail {
  display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 8px;
  scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch;
}
.vid-rail::-webkit-scrollbar { display: none; }
.vid-empty { font-size: 12px; color: var(--c-mute); padding: 6px 2px; }
.vid-card {
  flex: none; width: 108px; border: none; background: none; padding: 0;
  cursor: pointer; text-align: left; font-family: inherit;
  display: flex; flex-direction: column; gap: 6px;
}
/* 縦横が混ざると行がガタつくので、枠は 4:5 で統一する。
   ショート（縦）は切り抜き、解説（横）は文字が入ったサムネなので全体を収める。 */
.vid-thumb {
  position: relative; display: block; width: 100%; aspect-ratio: 4 / 5;
  border-radius: var(--r-sm); overflow: hidden; background: #000;
}
.vid-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.vid-thumb.land { background: var(--c-secondary-bg); }
.vid-thumb.land img { object-fit: contain; }
.vid-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 34px; height: 34px; border-radius: 50%; background: rgba(0, 0, 0, .55);
}
.vid-play::after {
  content: ''; position: absolute; left: 55%; top: 50%; transform: translate(-50%, -50%);
  border-style: solid; border-width: 6px 0 6px 10px;
  border-color: transparent transparent transparent #fff;
}
.vid-card:active .vid-thumb { transform: scale(0.97); }
.vid-name {
  font-size: 12px; font-weight: 700; color: var(--c-ink); line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.7em;   /* 1行の技名でも日付の高さを揃える */
}
.vid-meta { font-size: 10.5px; font-weight: 700; color: var(--c-mute); }

/* ---------- 級別 達成リング ---------- */
.kyu-rings { display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 8px; -webkit-overflow-scrolling: touch; }
.kyu-ring {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: none; border: none; cursor: pointer; padding: 4px; font-family: var(--font-jp);
}
.kyu-ring .ring {
  width: 58px; height: 58px; border-radius: 50%;
  background: conic-gradient(var(--c-primary) calc(var(--pct) * 1%), var(--c-secondary-bg) 0);
  display: flex; align-items: center; justify-content: center; position: relative;
}
.kyu-ring .ring::after {
  content: ''; position: absolute; inset: 6px; background: var(--c-canvas); border-radius: 50%;
}
.ring-num { position: relative; z-index: 1; font-family: var(--font-num); font-size: 15px; font-weight: 800; color: var(--c-ink); }
.ring-num small { font-size: 9px; font-weight: 700; }
.ring-kyu { font-size: 12px; font-weight: 700; color: var(--c-body); }
.ring-sub { font-size: 10px; color: var(--c-ash); font-family: var(--font-num); }
.kyu-ring.current .ring { box-shadow: 0 0 0 3px var(--c-accent-soft); }
.kyu-ring.current .ring-kyu { color: var(--c-primary); }

/* ---------- 稽古ヒートマップ ---------- */
.heatmap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.hm-grid { display: flex; gap: 3px; min-width: max-content; }
.hm-col { display: flex; flex-direction: column; gap: 3px; }
.hm-cell { width: 11px; height: 11px; border-radius: 2px; background: var(--c-secondary-bg); display: inline-block; }
.hm-cell.lvl0 { background: var(--c-secondary-bg); }
.hm-cell.lvl1 { background: #b7e2e8; }
.hm-cell.lvl2 { background: #5fbecb; }
.hm-cell.lvl3 { background: var(--c-primary); }
.hm-cell.future { background: transparent; }
.hm-legend { display: flex; align-items: center; gap: 4px; margin-top: 8px; font-size: 10px; color: var(--c-ash); }
.hm-legend .hm-cell { width: 10px; height: 10px; }

/* セッションの自動取得バッジ・クラス名 */
.ses-src {
  display: inline-block; font-size: 10px; font-weight: 700; color: var(--c-primary);
  background: var(--c-accent-soft); border-radius: var(--r-sm); padding: 1px 6px; margin-left: 6px;
}
.ses-class {
  display: inline-block; font-size: 11px; font-weight: 600; color: var(--c-body);
  background: var(--c-surface-card); border-radius: var(--r-sm); padding: 1px 7px; margin-left: 6px;
}
.ses-media {
  display: inline-block; font-size: 11px; font-weight: 700; color: var(--c-mute); margin-left: 6px;
}

/* 稽古日誌の写真・動画プレビュー */
.media-previews { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.media-previews:empty { margin-bottom: 0; }
.media-thumb {
  position: relative; width: 76px; height: 76px; border-radius: var(--r-sm);
  overflow: hidden; background: var(--c-surface-card); border: 1px solid var(--c-hairline);
}
.media-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-thumb .media-vid {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 28px;
}
.media-del {
  position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%;
  background: rgba(0,0,0,0.55); color: #fff; border: none; font-size: 13px; line-height: 1; cursor: pointer;
}

/* ---------- 次の予約 ---------- */
.reservations-list { display: flex; flex-direction: column; gap: 8px; }
.resv-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--c-accent-tint); border: 1px solid var(--c-accent-soft);
  border-radius: var(--r-md); padding: 11px 14px;
}
.resv-date { text-align: center; min-width: 52px; }
.resv-md { font-family: var(--font-num); font-size: 14px; font-weight: 800; color: var(--c-primary-deep); }
.resv-wd { font-size: 10px; color: var(--c-mute); }
.resv-main { flex: 1; min-width: 0; }
.resv-klass { font-size: 14px; font-weight: 700; color: var(--c-ink); }
.resv-meta { font-size: 11px; color: var(--c-mute); margin-top: 2px; }
.resv-when { font-size: 12px; font-weight: 700; color: var(--c-primary); white-space: nowrap; }

/* ===== メンバー切替（親子アカウント） ===== */
.hdr-user-row { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.member-switch {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--c-accent-soft); color: var(--c-primary-deep);
  border: none; border-radius: var(--r-full);
  padding: 4px 10px; font-size: 12px; font-weight: 700;
  font-family: var(--font-jp); cursor: pointer; max-width: 55%;
}
.member-switch-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member-switch svg { flex: none; opacity: 0.7; }

.member-lead { font-size: 13px; color: var(--c-mute); margin: 0 0 12px; }
.member-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.member-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border: 1px solid var(--c-hairline-soft);
  border-radius: var(--r-md); cursor: pointer; background: var(--c-canvas);
}
.member-row.active { border-color: var(--c-primary); background: var(--c-accent-tint); }
.member-avatar {
  flex: none; width: 40px; height: 40px; border-radius: var(--r-full);
  background: var(--c-primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; font-family: var(--font-jp);
}
.member-info { flex: 1; min-width: 0; }
.member-name { font-size: 15px; font-weight: 700; color: var(--c-ink); display: flex; align-items: center; gap: 6px; }
.member-tag {
  font-size: 10px; font-weight: 700; color: var(--c-primary-deep);
  background: var(--c-accent-soft); border-radius: var(--r-full); padding: 1px 7px;
}
.member-sub { font-size: 12px; color: var(--c-mute); margin-top: 2px; }
.member-check { color: var(--c-primary); font-size: 18px; font-weight: 800; }

.member-add { border-top: 1px solid var(--c-hairline-soft); padding-top: 14px; }
.member-add-row { display: flex; gap: 8px; margin: 6px 0; }
.member-add-row input {
  flex: 1; min-width: 0; padding: 10px 12px;
  border: 1px solid var(--c-hairline); border-radius: var(--r-md);
  font-size: 15px; font-family: var(--font-jp);
}
.member-add-row .primary-btn { width: auto; white-space: nowrap; padding-left: 20px; padding-right: 20px; }

/* 招待バナー（会員限定・招待リンク） */
.cloud-invite-note {
  background: var(--c-accent-soft); color: var(--c-primary-deep);
  border-radius: var(--r-md); padding: 10px 12px;
  font-size: 13px; font-weight: 600; margin-bottom: 10px; line-height: 1.5;
}

/* ===== マイページ（審査リソース） ===== */
.mypage-lead { font-size: 13px; color: var(--c-mute); margin: 0 0 14px; }
.resource-list { display: flex; flex-direction: column; gap: 10px; }
.resource-loading { font-size: 13px; color: var(--c-mute); padding: 16px 0; }
.resource-card {
  border: 1px solid var(--c-hairline-soft); border-radius: var(--r-md);
  background: var(--c-canvas); overflow: hidden;
}
.resource-summary {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 14px; cursor: pointer; list-style: none; user-select: none;
}
.resource-summary::-webkit-details-marker { display: none; }
.resource-icon { font-size: 20px; flex: none; }
.resource-title { flex: 1; font-size: 15px; font-weight: 700; color: var(--c-ink); }
.resource-caret { color: var(--c-mute); font-size: 20px; transition: transform 0.2s; }
.resource-card[open] .resource-caret { transform: rotate(90deg); }
.resource-body { padding: 0 16px 16px; }

/* Markdown 本文 */
.md { font-size: 14px; color: var(--c-body); line-height: 1.75; }
.md h3 { font-size: 15px; font-weight: 800; color: var(--c-ink); margin: 16px 0 6px; }
.md h4 { font-size: 14px; font-weight: 700; color: var(--c-ink); margin: 12px 0 4px; }
.md p { margin: 8px 0; }
.md ul, .md ol { margin: 8px 0; padding-left: 1.4em; }
.md li { margin: 4px 0; }
.md a { color: var(--c-primary); word-break: break-all; }
.md strong { font-weight: 700; color: var(--c-ink); }
.md-table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 13px; }
.md-table th, .md-table td { border: 1px solid var(--c-hairline); padding: 6px 8px; text-align: left; }
.md-table th { background: var(--c-secondary-bg); font-weight: 700; color: var(--c-ink); }

/* 稽古推移トグル行（カードの下・グラフの上） */
.chart-toggle-row { display: flex; justify-content: flex-end; margin: 0 0 10px; }

/* ===== 課金（サブスク） ===== */
.member-actions { display: flex; align-items: center; gap: 8px; }
.sub-pill { font-size: 10px; font-weight: 700; border-radius: var(--r-full); padding: 1px 8px; margin-left: 4px; }
.sub-pill.paid { background: #e7f6ec; color: #16834a; }
.sub-pill.free { background: var(--c-secondary-bg); color: var(--c-mute); }
.sub-pill.warn { background: #fdeccf; color: #b5730a; }
.member-sub-btn {
  flex: none; border: 1px solid var(--c-primary); background: var(--c-primary); color: #fff;
  border-radius: var(--r-full); padding: 5px 12px; font-size: 12px; font-weight: 700;
  font-family: var(--font-jp); cursor: pointer;
}
.member-sub-btn.cancel { background: transparent; color: var(--c-mute); border-color: var(--c-hairline); }

.upsell-lead, .subscribe-lead { font-size: 14px; color: var(--c-body); margin: 0 0 14px; line-height: 1.6; }
.upsell-points { margin: 0 0 16px; padding-left: 1.2em; color: var(--c-body); font-size: 14px; }
.upsell-points li { margin: 5px 0; }
.upsell-price, #subscribe-price {
  font-size: 18px; font-weight: 800; color: var(--c-primary-deep);
  text-align: center; margin: 4px 0 16px;
}
.card-container {
  min-height: 90px; border: 1px solid var(--c-hairline); border-radius: var(--r-md);
  padding: 14px; margin: 6px 0 14px; background: var(--c-canvas);
}

/* ---------- 審査練習（抽選・読み上げ） ---------- */
.practice-scope {
  display: flex; align-items: center; gap: 8px;
  font-size: 1.05rem; font-weight: 700; color: var(--c-ink);
  margin-bottom: 6px;
}
.practice-scope-label { font-size: .8rem; font-weight: 600; color: var(--c-mute); }
.practice-scope-target { color: var(--c-primary-deep); }
/* 対象・審査の2つを並べる。狭い画面でも押しやすいよう均等幅にする */
.practice-kyu-select {
  flex: 1; min-width: 0; padding: 8px 10px; border-radius: var(--r-sm);
  border: 1px solid var(--c-hairline); background: var(--c-canvas);
  color: var(--c-ink); font-size: .95rem; font-weight: 600;
}
#practice-target { flex: 0 1 38%; }
.practice-lead { font-size: .85rem; color: var(--c-mute); margin-bottom: 16px; }

.practice-display {
  background: linear-gradient(135deg, var(--c-primary) 0%, #137a8a 100%);
  color: var(--c-on-primary);
  border-radius: var(--r-lg);
  padding: 32px 20px; text-align: center;
  min-height: 180px;
  display: flex; flex-direction: column; justify-content: center; gap: 10px;
  margin-bottom: 16px;
}
.practice-tech-name { font-size: 1.9rem; font-weight: 800; line-height: 1.3; }
.practice-tech-roman { font-size: 1rem; opacity: .85; font-style: italic; }
.practice-tech-meta { font-size: .85rem; opacity: .8; }
.practice-video-btn {
  margin: 8px auto 0; padding: 10px 18px; border: none; border-radius: var(--r-full);
  background: rgba(255,255,255,.2); color: var(--c-on-primary);
  font-size: .9rem; font-weight: 700; cursor: pointer;
}
.practice-video-btn:active { transform: scale(.96); }

.practice-actions { display: flex; gap: 10px; margin-bottom: 20px; }
.practice-btn {
  flex: 1; padding: 16px; border: 1px solid var(--c-hairline); border-radius: var(--r-md);
  background: var(--c-canvas); color: var(--c-ink);
  font-size: 1rem; font-weight: 700; cursor: pointer;
}
.practice-btn:active { transform: scale(.98); }
.practice-btn.primary { background: var(--c-primary); color: var(--c-on-primary); border-color: transparent; }
.practice-btn.running { background: var(--c-danger); color: #fff; border-color: transparent; }

.practice-settings { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }
.practice-toggle { display: flex; align-items: center; gap: 10px; font-size: .95rem; color: var(--c-body); }
.practice-toggle input { width: 20px; height: 20px; }
.practice-range { display: flex; align-items: center; gap: 12px; font-size: .9rem; color: var(--c-body); }
.practice-range-label { min-width: 120px; }
.practice-range input[type="range"] { flex: 1; }
.practice-range-val { min-width: 28px; text-align: right; font-weight: 700; color: var(--c-primary-deep); }

/* 技ライブラリの章（系統）チップ。横スクロールで基本動作〜自由技を切り替える */
.lib-chapters {
  display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 8px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.lib-chapters::-webkit-scrollbar { display: none; }
.chip-ch {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--c-hairline); background: var(--c-canvas);
  color: var(--c-body); border-radius: 999px; padding: 7px 14px;
  font-size: .85rem; font-weight: 600; white-space: nowrap; cursor: pointer;
}
.chip-ch.active { background: var(--c-primary); border-color: var(--c-primary); color: var(--c-on-primary); }
.chip-ch-n { font-size: .72rem; font-weight: 700; opacity: .65; }

/* 初回セットアップ・チュートリアル */
.ob-lead { font-size: .9rem; color: var(--c-body); line-height: 1.6; margin-bottom: 18px; }
/* アプリ内ブラウザ（LINE等）警告 */
.inapp-warn {
  display: flex; align-items: flex-start; gap: 8px;
  margin: 8px 16px 0; padding: 10px 12px;
  background: var(--c-warn-soft); border: 1px solid var(--c-warn);
  border-radius: var(--r-md);
}
.inapp-warn-body { flex: 1; font-size: 11.5px; line-height: 1.6; color: var(--c-body); }
.inapp-warn-body b { color: var(--c-ink); font-weight: 800; }
.inapp-warn-body b:first-child { display: block; font-size: 13px; margin-bottom: 2px; }
/* ホーム画面への追加手順のミニチュア */
.tut-demo-c { justify-content: center; }
.ins-icon {
  width: 46px; height: 46px; border-radius: var(--r-sm);
  background: var(--c-canvas); border: 1px solid var(--c-hairline);
  display: flex; align-items: center; justify-content: center; color: var(--c-primary);
}
.ins-row {
  width: 100%; background: var(--c-canvas); border: 1px solid var(--c-hairline);
  border-radius: 7px; padding: 9px 8px; font-size: 10.5px; font-weight: 700; color: var(--c-body);
  text-align: center; white-space: nowrap;
}
.ins-app { display: flex; align-items: center; gap: 7px; font-size: 10.5px; font-weight: 700; color: var(--c-body); }
.ins-app-icon {
  width: 34px; height: 34px; border-radius: 9px; background: var(--c-primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 19px; font-weight: 800;
  font-family: var(--font-en);
}

.ob-inapp {
  background: var(--c-warn-soft); border: 1px solid var(--c-warn);
  border-radius: var(--r-md); padding: 12px 14px; margin-bottom: 16px;
  font-size: 12px; line-height: 1.7; color: var(--c-body);
}
.ob-inapp b { color: var(--c-ink); font-weight: 800; }
.ob-inapp b:first-child { display: block; font-size: 13.5px; margin-bottom: 3px; }
.inapp-warn-close {
  flex: none; width: 28px; height: 28px; border: none; background: none;
  font-size: 18px; line-height: 1; color: var(--c-mute); cursor: pointer;
}

/* 審査タブの使い方。長文は読まれないので、実際の見た目のミニチュアを見せて
   文字は「見出し1行＋補足1行」に抑える。 */
.tut-lead { font-size: .85rem; font-weight: 700; color: var(--c-mute); line-height: 1.6; margin: -6px 0 16px; }
.tut-list { list-style: none; margin: 0 0 18px; padding: 0; }
.tut-card {
  display: flex; align-items: center; gap: 12px; margin-bottom: 10px;
  background: var(--c-surface-card); border: 1px solid var(--c-hairline-soft);
  border-radius: var(--r-md); padding: 10px 12px;
}
.tut-demo { flex: none; width: 132px; display: flex; align-items: center; gap: 4px; }
.tut-cap { flex: 1; min-width: 0; font-size: 11px; color: var(--c-mute); line-height: 1.5; font-weight: 700; }
.tut-cap b { display: block; font-size: 13px; font-weight: 800; color: var(--c-ink); }

/* ミニチュア部品 */
.tut-select {
  flex: 1; min-width: 0; background: var(--c-canvas); border: 1px solid var(--c-hairline);
  border-radius: 7px; font-size: 9.5px; font-weight: 700; color: var(--c-body);
  padding: 5px 4px; text-align: center; white-space: nowrap; overflow: hidden;
}
.tut-seg {
  display: flex; width: 100%; border: 1px solid var(--c-primary);
  border-radius: 7px; overflow: hidden; background: var(--c-canvas);
}
.tut-seg i {
  flex: 1; font-style: normal; font-size: 9.5px; font-weight: 800; color: var(--c-primary);
  padding: 5px 2px; text-align: center; white-space: nowrap;
}
.tut-seg i.on { background: var(--c-primary); color: var(--c-on-primary); }
.tut-seg em {
  font-style: normal; font-size: 8px; padding: 0 4px; border-radius: var(--r-full);
  background: var(--c-accent-tint); color: var(--c-primary-deep);
}
.tut-seg i.on em { background: rgba(255,255,255,.26); color: #fff; }
.tut-row {
  background: var(--c-canvas); border: 1px solid var(--c-hairline-soft);
  border-radius: 7px; padding: 6px 7px; gap: 5px;
}
.tut-no { font-family: var(--font-num); font-size: 9px; font-weight: 700; color: var(--c-ash); }
.tut-tech { flex: 1; min-width: 0; font-size: 10px; font-weight: 700; color: var(--c-ink); white-space: nowrap; overflow: hidden; }
.tut-mark {
  font-size: 8px; font-weight: 700; padding: 1px 4px; border-radius: var(--r-full);
  color: #fff; background: var(--c-primary);
}
.tut-mark.v { background: var(--c-success); }
.tut-cycle { justify-content: space-between; }
.tut-dot {
  width: 17px; height: 17px; border-radius: 50%; border: 2px dashed var(--c-stone); box-sizing: border-box;
}
.tut-dot.o { background: var(--c-success); border: none; }
.tut-dot.d { background: var(--c-warn); border: none; }
.tut-dot.x { background: var(--c-danger); border: none; }
.tut-arrow { font-size: 11px; font-weight: 800; color: var(--c-stone); }
.tut-bar {
  height: 9px; border-radius: var(--r-full); overflow: hidden;
  background: var(--c-hairline-soft); gap: 0;
}
.tut-bar-fill { height: 100%; }
.tut-bar-fill.o { width: 55%; background: var(--c-success); }
.tut-bar-fill.d { width: 20%; background: var(--c-warn); }
.tut-bar-fill.x { width: 12%; background: var(--c-danger); }
.tut-fold {
  width: 100%; background: var(--c-surface-soft); border: 1px solid var(--c-hairline);
  border-radius: 7px; padding: 6px 7px; font-size: 9.5px; font-weight: 700;
  color: var(--c-body); white-space: nowrap; overflow: hidden;
}

/* 審査科目リスト（審査タブの主役） */
/* 規定技 / 指定技 タブ */
.exam-seg {
  display: flex; margin: 12px 0 0; background: var(--c-canvas);
  border: 1px solid var(--c-primary); border-radius: var(--r-md); overflow: hidden;
}
.exam-seg-btn {
  flex: 1; min-height: 48px; border: none; background: none; cursor: pointer;
  font-family: inherit; font-size: 14px; font-weight: 800; color: var(--c-primary);
  display: flex; align-items: center; justify-content: center; gap: 7px;
}
.exam-seg-btn.on { background: var(--c-primary); color: var(--c-on-primary); }
.exam-seg-btn:disabled { color: var(--c-ash); opacity: .55; cursor: default; }
.exam-seg-badge {
  font-size: 11px; font-weight: 800; min-width: 22px; padding: 2px 7px;
  border-radius: var(--r-full); background: var(--c-accent-tint); color: var(--c-primary-deep);
}
.exam-seg-btn.on .exam-seg-badge { background: rgba(255,255,255,.24); color: #fff; }
.exam-seg-btn:disabled .exam-seg-badge { background: var(--c-hairline-soft); color: var(--c-ash); }

/* この範囲の習得実績 */
.exam-summary {
  margin-top: 14px; background: var(--c-canvas);
  border: 1px solid var(--c-hairline-soft); border-radius: var(--r-md); overflow: hidden;
}
.exam-summary-head {
  display: flex; align-items: baseline; justify-content: space-between; padding: 12px 14px 8px;
}
.exam-summary-title { font-size: 13px; font-weight: 800; color: var(--c-mute); }
.exam-summary-rate { font-size: 22px; font-weight: 800; color: var(--c-ink); font-family: var(--font-num); }
.exam-summary-rate small { font-size: 12px; font-weight: 700; color: var(--c-mute); margin-left: 3px; }
.exam-bar {
  display: flex; height: 8px; margin: 0 14px; border-radius: var(--r-full);
  overflow: hidden; background: var(--c-hairline-soft);
}
.exam-bar span { display: block; height: 100%; width: 0; }
.exam-bar .s-o { background: var(--c-success); }
.exam-bar .s-d { background: var(--c-warn); }
.exam-bar .s-x { background: var(--c-danger); }
.exam-stats { display: flex; padding: 12px 14px 14px; gap: 8px; }
.exam-stat { flex: 1; text-align: center; padding: 8px 4px; border-radius: var(--r-sm); background: var(--c-surface-card); }
.exam-stat-n { font-size: 20px; font-weight: 800; line-height: 1.2; font-family: var(--font-num); color: var(--c-ink); }
.exam-stat-l { font-size: 11px; font-weight: 700; color: var(--c-mute); }
.exam-stat.o .exam-stat-n { color: var(--c-success); }
.exam-stat.d .exam-stat-n { color: var(--c-warn); }
.exam-stat.x .exam-stat-n { color: var(--c-danger); }

.exam-list-head { display: flex; align-items: center; gap: 8px; margin: 16px 0 8px; }
/* めったに使わない操作（チェックの一括消去）は歯車の中に畳んでおく */
.exam-menu-wrap { margin-left: auto; position: relative; }
.exam-menu-btn {
  width: 40px; height: 40px; border-radius: var(--r-full);
  border: 1px solid var(--c-hairline); background: var(--c-canvas);
  font-size: 20px; line-height: 1; color: var(--c-mute); cursor: pointer;
}
.exam-menu-btn[aria-expanded="true"] { background: var(--c-accent-tint); border-color: var(--c-primary); }
.exam-menu {
  position: absolute; right: 0; top: 46px; z-index: 20; min-width: 210px;
  background: var(--c-canvas); border: 1px solid var(--c-hairline);
  border-radius: var(--r-md); box-shadow: 0 8px 24px rgba(15,30,42,.14); padding: 6px;
}
.exam-menu-item {
  display: block; width: 100%; min-height: 44px; padding: 0 12px; text-align: left;
  border: none; background: none; border-radius: var(--r-sm); cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 700; color: var(--c-body);
}
.exam-menu-item:active { background: var(--c-surface-card); }
.exam-menu-item.danger { color: var(--c-danger); }
.exam-count { font-size: .8rem; color: var(--c-mute); font-weight: 600; }
.exam-list { list-style: none; margin: 0; padding: 0; }
.exam-group {
  font-size: .75rem; font-weight: 800; color: var(--c-primary-deep);
  background: var(--c-accent-tint); padding: 5px 12px; border-radius: var(--r-full);
  margin: 12px 0 6px; display: inline-flex; align-items: center; gap: 6px;
}
/* その級（指定技グループを含む）に何本あるか */
.exam-group-count {
  font-size: .7rem; font-weight: 700;
  background: var(--c-primary); color: #fff;
  min-width: 18px; padding: 1px 6px; border-radius: var(--r-full); text-align: center;
}
.exam-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 12px; cursor: pointer;
  border-bottom: 1px solid var(--c-hairline-soft);
}
.exam-item:active { background: var(--c-accent-tint); }
.exam-no {
  flex: none; min-width: 26px; font-family: var(--font-num);
  font-size: 11px; font-weight: 700; color: var(--c-ash);
}
.exam-body { flex: 1; min-width: 0; }
.exam-name { display: block; font-size: 14px; font-weight: 700; color: var(--c-ink); line-height: 1.35; }
.exam-romaji { display: block; font-size: 10px; color: var(--c-mute); font-family: var(--font-en); line-height: 1.3; }
.exam-marks { flex: none; display: flex; gap: 3px; }
.exam-mark {
  font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: var(--r-full);
  color: #fff; background: var(--c-primary);
}
.exam-mark.suwari { background: var(--c-primary-deep); }
.exam-mark.video { background: var(--c-success); }
.exam-empty { padding: 14px; font-size: .85rem; color: var(--c-mute); text-align: center; }
/* 審査科目の中の「指定技から出題される枠」。技そのものは指定技タブにあるので開けない */
.exam-slot { cursor: default; background: var(--c-accent-tint); }
.exam-slot:active { background: var(--c-accent-tint); }
.exam-slot .exam-name { color: var(--c-primary-deep); }
.exam-mark.shitei { background: var(--c-primary-deep); }

/* 習得チェック：右端の丸を1タップするたび 未 → 覚えた → あいまい → まだ → 未 と回る。
   状態は行の左端の帯でも出しているので、色だけ見て流し読みできる。 */
.exam-item.s-o { box-shadow: inset 4px 0 0 var(--c-success); }
.exam-item.s-d { box-shadow: inset 4px 0 0 var(--c-warn); }
.exam-item.s-x { box-shadow: inset 4px 0 0 var(--c-danger); }
.exam-dot {
  flex: none; width: 44px; height: 44px; border: none; background: none;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.exam-dot i {
  display: block; width: 22px; height: 22px; border-radius: 50%;
  border: 2px dashed var(--c-stone); box-sizing: border-box;
}
.exam-dot:active i { transform: scale(0.9); }
.exam-item.s-o .exam-dot i { background: var(--c-success); border: none; }
.exam-item.s-d .exam-dot i { background: var(--c-warn); border: none; }
.exam-item.s-x .exam-dot i { background: var(--c-danger); border: none; }

/* 読み上げ練習（普段は畳んでおく） */
.practice-fold {
  margin-top: 20px; border: 1px solid var(--c-hairline);
  border-radius: var(--r-md); background: var(--c-surface-soft);
}
.practice-fold > summary {
  padding: 12px 14px; cursor: pointer; list-style: none;
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  font-weight: 700; color: var(--c-ink); font-size: .95rem;
}
.practice-fold > summary::-webkit-details-marker { display: none; }
.practice-fold > summary::after { content: '▾'; margin-left: auto; color: var(--c-mute); }
.practice-fold[open] > summary::after { content: '▴'; }
.practice-fold-hint { font-size: .78rem; color: var(--c-mute); font-weight: 500; }
.practice-fold > *:not(summary) { margin-left: 14px; margin-right: 14px; }
.practice-fold > *:last-child { margin-bottom: 14px; }

/* 出題する技のチェックリスト */
.practice-picker { margin-bottom: 20px; }
.practice-picker-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 8px;
}
.practice-picker-title { font-size: .85rem; color: var(--c-mute); margin: 0; font-weight: 600; }
.practice-picker-count { color: var(--c-primary-deep); font-weight: 700; margin-left: 4px; }
/* 出題する技の絞り込み（習熟度別）。チェックボックス一覧は 2026-08-06 に撤去 */
.practice-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.practice-filters .chip-sub { flex: none; }

.practice-history-title { font-size: .85rem; color: var(--c-mute); margin-bottom: 8px; }
.practice-history-list { list-style: none; margin: 0; padding: 0; font-size: .85rem; color: var(--c-body); }
.practice-history-list li { padding: 6px 4px; border-bottom: 1px solid var(--c-hairline-soft); }
