/* Termina — 共通スタイル
 * 方針:
 *   - スマホファースト。片手・縦持ち・親指到達を最優先
 *   - タブバーは下部固定。ボディは padding-bottom で被り回避
 *   - 依存ゼロ（Web フォントも読み込まない。OS フォントを使う）
 */

:root {
  color-scheme: light dark;
  --tab-height: 68px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  --fg: #1a1a1a;
  --fg-muted: #666;
  --bg: #ffffff;
  --bg-card: #ffffff;
  --border: #e4e4e4;
  --accent: #2b7cff;
  --danger: #c62828;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fg: #eee;
    --fg-muted: #999;
    --bg: #111;
    --bg-card: #1a1a1a;
    --border: #333;
    --accent: #6aa4ff;
    --danger: #ff6b6b;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, "Hiragino Sans", "Yu Gothic UI", "Segoe UI", sans-serif;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

/* ── ヘッダー ─────────────────────────────── */
.app-header {
  padding: 12px 16px 4px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}
.brand {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0.02em;
}
.route-debug {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--fg-muted);
}

/* ── メイン本体 ─────────────────────────────── */
.main {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px 16px calc(var(--tab-height) + var(--safe-bottom) + 24px);
}

.placeholder {
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 20px 16px;
  color: var(--fg-muted);
}
.placeholder h2 { margin: 0 0 8px; color: var(--fg); font-size: 18px; }
.placeholder p { margin: 6px 0; }
.placeholder .hint {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 13px;
}

/* ── タブバー（下部固定） ────────────────────── */
.tab-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding-bottom: var(--safe-bottom);
  z-index: 20;
}
.tab-bar a {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: var(--tab-height);
  padding: 6px 2px;
  text-decoration: none;
  color: var(--fg-muted);
  font-size: 11px;
  -webkit-tap-highlight-color: transparent;
}
.tab-bar a .icon { font-size: 20px; line-height: 1.1; }
.tab-bar a .label { margin-top: 2px; }
.tab-bar a.active { color: var(--accent); font-weight: 600; }
.tab-bar a:active { background: rgba(127,127,127,0.08); }

/* Inbox の未整形件数バッジ（Step 4.5 で件数を流し込む） */
.tab-bar .badge {
  position: absolute;
  top: 6px;
  right: 22%;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  font-weight: 700;
}

/* ── 汎用 ───────────────────────────────── */
.card {
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

/* ── 用語カード (Step 3) ─────────────────────── */
.cat-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 0 0 10px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
  flex-shrink: 0;
  padding: 8px 14px;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--fg);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}
.cat-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 600;
}

.search-input {
  width: 100%;
  padding: 10px 14px;
  margin: 4px 0 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
  color: var(--fg);
  font-size: 16px; /* iOS の自動ズームを防ぐため 16px 以上 */
  font-family: inherit;
}
.search-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.empty {
  color: var(--fg-muted);
  text-align: center;
  padding: 30px 0;
  font-size: 13px;
  line-height: 1.9;
}

.term-card {
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: 12px;
  margin-bottom: 10px;
  overflow: hidden;
}
.term-card summary {
  position: relative;
  padding: 14px 40px 14px 16px;
  min-height: 56px;
  cursor: pointer;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  -webkit-tap-highlight-color: transparent;
}
.term-card summary::-webkit-details-marker { display: none; }
.term-card summary::before {
  content: "▸";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--fg-muted);
  transition: transform 0.15s;
}
.term-card[open] summary::before {
  transform: translateY(-50%) rotate(90deg);
}
.term-card summary:active {
  background: rgba(127,127,127,0.06);
}

.term-card .term-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
}
.term-card .cat-chip {
  font-size: 10px;
  color: var(--fg-muted);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 4px;
  align-self: center;
}
.term-card .term {
  font-size: 17px;
  font-weight: 700;
}
.term-card .term-en {
  color: var(--fg-muted);
  font-size: 12px;
  font-weight: 400;
}
.term-card .one-liner {
  color: var(--fg-muted);
  font-size: 13px;
}
.term-card .term-body {
  padding: 4px 16px 16px;
  border-top: 1px solid var(--border);
}
.term-card .term-body section {
  margin-top: 14px;
}
.term-card .term-body h4 {
  margin: 0 0 4px;
  font-size: 11px;
  color: var(--fg-muted);
  font-weight: 700;
  letter-spacing: 0.05em;
}
.term-card .term-body p {
  margin: 0;
  white-space: pre-wrap; /* YAML の \n を改行として保持 */
  font-size: 14px;
  line-height: 1.75;
}
.term-card .term-body ul {
  margin: 0;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.75;
}
.term-card .term-body .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.term-card .tag {
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(127,127,127,0.15);
  font-size: 12px;
  color: var(--fg-muted);
}

/* ── 習熟度ピッカー / 自分メモ (Step 4) ─────────────── */
.level-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  margin-left: 4px;
  align-self: center;
}

.level-picker {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.level-picker button {
  flex: 1 1 70px;
  min-height: 44px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--fg);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.level-picker button.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 700;
}

.note-area {
  width: 100%;
  min-height: 60px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--fg);
  font-family: inherit;
  font-size: 16px; /* iOS 自動ズーム防止 */
  line-height: 1.6;
  resize: vertical;
  margin-top: 6px;
}
.note-area:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.note-status {
  display: inline-block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--accent);
  min-height: 14px;
}

/* 自作カード chip */
.term-card .user-chip {
  font-size: 10px;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 1px 6px;
  border-radius: 4px;
  align-self: center;
  font-weight: 600;
}

/* ── Inbox (Step 4.5) ─────────────────────── */
.capture form {
  display: flex;
  gap: 8px;
}
.capture #capture-input {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
  color: var(--fg);
  font-family: inherit;
  font-size: 16px; /* iOS ズーム防止 */
}
.capture #capture-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.capture button[type="submit"] {
  min-width: 68px;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.capture-more {
  margin: 8px 0 4px;
  font-size: 12px;
  color: var(--fg-muted);
}
.capture-more summary {
  cursor: pointer;
  padding: 4px 0;
  list-style: none;
}
.capture-more summary::-webkit-details-marker { display: none; }
.capture-more summary::before { content: "▸ "; }
.capture-more[open] summary::before { content: "▾ "; }
.capture-more input {
  display: block;
  width: 100%;
  margin: 6px 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--fg);
  font-size: 14px;
  font-family: inherit;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tab-height) + var(--safe-bottom) + 20px);
  transform: translateX(-50%);
  padding: 8px 16px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  font-size: 13px;
  z-index: 30;
  pointer-events: none;
  animation: toast-in 0.15s ease-out;
}
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

.shape h3 {
  margin: 28px 0 10px;
  font-size: 14px;
  color: var(--fg-muted);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.count-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: rgba(127, 127, 127, 0.18);
  color: var(--fg);
  font-size: 11px;
  font-weight: 700;
}

.inbox-item {
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.inbox-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.inbox-raw {
  font-size: 16px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.inbox-time {
  font-size: 11px;
  color: var(--fg-muted);
  flex-shrink: 0;
}
.inbox-memo {
  font-size: 13px;
  color: var(--fg-muted);
  margin-top: 6px;
  white-space: pre-wrap;
}
.inbox-source {
  font-size: 11px;
  color: var(--fg-muted);
  margin-top: 4px;
  overflow-wrap: anywhere;
}
.inbox-source a { color: var(--fg-muted); }

.inbox-actions {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.inbox-actions button {
  flex: 1 1 90px;
  min-height: 42px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--fg);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}
.inbox-actions button[data-action="promote"] {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 700;
}
.inbox-actions button[data-action="drop"] {
  color: var(--danger);
  border-color: var(--danger);
}

.promote-form {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}
.promote-form-el label {
  display: block;
  margin-top: 10px;
  font-size: 12px;
  color: var(--fg-muted);
  font-weight: 600;
}
.promote-form-el input,
.promote-form-el select,
.promote-form-el textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--fg);
  font-family: inherit;
  font-size: 16px;
}
.promote-form-el textarea {
  min-height: 60px;
  resize: vertical;
  line-height: 1.6;
}
.promote-actions {
  display: flex;
  gap: 6px;
  margin-top: 14px;
}
.promote-actions button {
  flex: 1;
  min-height: 46px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--fg);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
}
.promote-actions button[type="submit"] {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 700;
}

/* ── テスト画面 (Step 5) ─────────────────────── */
.quiz-menu h2 {
  margin: 4px 0 4px;
  font-size: 18px;
}
.quiz-hint {
  font-size: 13px;
  color: var(--fg-muted);
  margin: 0 0 16px;
}
.mode-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mode-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
  color: var(--fg);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  min-height: 68px;
}
.mode-btn:active { background: rgba(127,127,127,0.06); }
.mode-title { font-size: 15px; font-weight: 700; }
.mode-desc  { font-size: 12px; color: var(--fg-muted); line-height: 1.5; }

.quiz-warn {
  margin-top: 14px;
  padding: 10px 12px;
  background: rgba(255, 200, 100, 0.15);
  border: 1px solid rgba(200, 130, 50, 0.4);
  border-radius: 8px;
  font-size: 13px;
  color: var(--fg);
}

#quiz-stage {
  margin-top: 4px;
}

.quiz-progress {
  position: relative;
  height: 6px;
  border-radius: 3px;
  background: rgba(127, 127, 127, 0.2);
  overflow: hidden;
  margin-bottom: 20px;
}
.quiz-progress-bar {
  height: 100%;
  background: var(--accent);
  transition: width 0.2s;
}
.quiz-progress-label {
  position: absolute;
  top: 10px;
  right: 0;
  font-size: 11px;
  color: var(--fg-muted);
}

.quiz-mode-tag {
  margin: 20px 0 6px;
  font-size: 11px;
  color: var(--fg-muted);
  font-weight: 700;
  letter-spacing: 0.05em;
}
.quiz-prompt {
  font-size: 16px;
  line-height: 1.75;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
  white-space: pre-wrap;
}
.quiz-prompt-term {
  font-size: 26px;
  font-weight: 700;
  padding: 24px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
  text-align: center;
}
.quiz-prompt-term .term-en {
  display: block;
  font-size: 13px;
  color: var(--fg-muted);
  font-weight: 400;
  margin-top: 4px;
}
.quiz-instruction {
  font-size: 13px;
  color: var(--fg-muted);
  margin: 12px 0 10px;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}
.quiz-opt {
  min-height: 56px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
  color: var(--fg);
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}
.quiz-opt:disabled { cursor: default; }
.quiz-opt.correct {
  background: #1f9d54;
  border-color: #1f9d54;
  color: #fff;
}
.quiz-opt.wrong {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.quiz-reveal {
  display: block;
  width: 100%;
  margin-top: 16px;
  min-height: 52px;
  border: 1px solid var(--accent);
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.reveal-content {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
}
.reveal-content p { margin: 0; line-height: 1.75; white-space: pre-wrap; }
.reveal-block { margin-top: 12px; }
.reveal-block h5 {
  margin: 0 0 4px;
  font-size: 11px;
  color: var(--fg-muted);
  font-weight: 700;
  letter-spacing: 0.05em;
}

.self-instruction {
  margin: 16px 0 8px;
  font-size: 13px;
  font-weight: 700;
}
.self-grade {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.self-grade .grade {
  min-height: 52px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
  color: var(--fg);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.self-grade .grade-0 { border-color: var(--danger); color: var(--danger); }
.self-grade .grade-2 { border-color: var(--accent); color: var(--accent); }
.self-grade .grade-3 { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── クイズ結果サマリ ─────────────── */
.quiz-summary-title { margin: 8px 0 6px; font-size: 18px; }
.quiz-score {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  margin: 4px 0 18px;
}
.quiz-result-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.quiz-result-list li {
  padding: 10px 12px;
  margin-bottom: 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
}
.quiz-result-list li.ok { border-left: 4px solid #1f9d54; }
.quiz-result-list li.ng { border-left: 4px solid var(--danger); }
.result-head { font-weight: 700; }
.result-mark { margin-right: 6px; }
.result-one-liner { font-size: 12px; color: var(--fg-muted); margin-top: 4px; }
.quiz-restart {
  display: block;
  width: 100%;
  margin-top: 20px;
  min-height: 52px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--fg);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

/* ── 読み物 (Step 6) ─────────────────────────── */
.read-title {
  margin: 4px 0 4px;
  font-size: 18px;
}
.read-hint {
  font-size: 13px;
  color: var(--fg-muted);
  margin: 0 0 12px;
}
.read-list {
  list-style: none;
  padding: 0;
  margin: 8px 0;
}
.read-list-item {
  border-bottom: 1px solid var(--border);
}
.read-list-item a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 6px;
  color: var(--fg);
  text-decoration: none;
  min-height: 52px;
  -webkit-tap-highlight-color: transparent;
}
.read-list-item a:active { background: rgba(127,127,127,0.06); }
.read-list-title { font-size: 15px; }
.read-list-slug { font-size: 10px; color: var(--fg-muted); }

.back-link {
  display: inline-block;
  padding: 8px 12px;
  margin: 0 0 12px -8px;
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
}
.back-link:active { background: rgba(127,127,127,0.06); border-radius: 6px; }

.read-body {
  font-size: 15px;
  line-height: 1.85;
  padding-bottom: 40px;
  overflow-wrap: anywhere;
}
.read-body h1 { font-size: 22px; margin: 0 0 12px; }
.read-body h2 {
  font-size: 18px;
  margin: 32px 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.read-body h3 { font-size: 16px; margin: 24px 0 6px; }
.read-body h4 { font-size: 14px; margin: 20px 0 4px; color: var(--fg-muted); }
.read-body h5 { font-size: 12px; margin: 18px 0 4px; color: var(--fg-muted); letter-spacing: 0.05em; }
.read-body p { margin: 8px 0 12px; }
.read-body strong { font-weight: 700; }
.read-body em { font-style: italic; }
.read-body code {
  background: rgba(127,127,127,0.15);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: "Menlo", "Consolas", "Yu Gothic UI", monospace;
}
.read-body pre {
  background: rgba(127,127,127,0.1);
  padding: 12px 14px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 12px;
  line-height: 1.55;
  border: 1px solid var(--border);
}
.read-body pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}
.read-body ul, .read-body ol {
  margin: 8px 0 12px;
  padding-left: 24px;
}
.read-body li { margin: 4px 0; }
.read-body a {
  color: var(--accent);
  text-decoration: underline;
}
.read-body blockquote {
  margin: 12px 0;
  padding: 8px 14px;
  border-left: 4px solid var(--border);
  color: var(--fg-muted);
  background: rgba(127,127,127,0.05);
}
.read-body hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}
.read-body table {
  border-collapse: collapse;
  width: 100%;
  margin: 12px 0;
  font-size: 13px;
  display: block;
  overflow-x: auto;
}
.read-body th, .read-body td {
  border: 1px solid var(--border);
  padding: 6px 10px;
  text-align: left;
  vertical-align: top;
}
.read-body th {
  background: rgba(127,127,127,0.1);
  font-weight: 700;
}

/* ── 進捗 (#/progress) ─────────────────────────────── */
.prog-section {
  margin: 24px 0;
}
.prog-section h2 {
  margin: 0 0 6px;
  font-size: 17px;
}
.prog-note {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--fg-muted);
  line-height: 1.5;
}

/* ヒートマップ */
.heatmap {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  font-size: 13px;
}
.heat-row {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr 0.8fr;
  align-items: stretch;
  border-top: 1px solid var(--border);
}
.heat-row:first-child { border-top: 0; }
.heat-head {
  background: rgba(127,127,127,0.06);
  font-weight: 700;
}
.heat-cat {
  padding: 10px 8px 10px 12px;
  border-right: 1px solid var(--border);
  align-self: center;
}
.heat-cell {
  padding: 10px 8px;
  border-right: 1px solid var(--border);
  text-align: center;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.heat-cell:last-child { border-right: 0; }
.heat-cell.head { font-weight: 700; color: var(--fg-muted); }
.heat-cell small { color: var(--fg-muted); font-size: 11px; }
.heat-cell-unseen { color: var(--fg-muted); }

/* ①止まり */
.level1-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}
.level1-list li {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.level1-list .tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(127,127,127,0.1);
  color: var(--fg-muted);
}
.level1-list a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

/* エクスポート/インポート */
.prog-io {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.prog-btn {
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--fg);
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
}
.prog-btn:hover { border-color: var(--accent); }
.prog-btn-file { display: inline-flex; align-items: center; }
.prog-status {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--fg-muted);
  min-height: 1.2em;
}
