/* 対策タブ（優先順位と弱点の可視化）。
   配色は style.css のトークンをそのまま使う。
   状態色は 仕上がり=good／もう一歩=warning／要復習=critical／未着手=muted の4段階で固定。 */

.plan-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
}

.plan-h {
  font-size: 0.95rem;
  margin: 0 0 10px;
  color: var(--seq-600);
}

.plan-sub {
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin: -4px 0 12px;
}

.plan-note {
  font-size: 0.74rem;
  line-height: 1.7;
  color: var(--muted);
  margin: 0 4px 8px;
}

/* ---- 予想得点 ---- */

.score-big {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-bottom: 10px;
}

.score-num {
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1;
  color: var(--seq-450);
  font-variant-numeric: tabular-nums;
}

.score-den {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.score-gap {
  flex-basis: 100%;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--critical);
}

.score-gap.ok {
  color: var(--good-text);
}

.score-track {
  position: relative;
  height: 12px;
  background: var(--gridline);
  border-radius: 6px;
  margin: 18px 0 22px;
}

.score-fill {
  height: 100%;
  background: var(--seq-450);
  border-radius: 6px;
  transition: width 0.4s ease;
}

.score-mark {
  position: absolute;
  top: -5px;
  width: 2px;
  height: 22px;
  background: var(--text-secondary);
  transform: translateX(-1px);
}

.score-mark span {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.68rem;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.score-mark.max {
  background: var(--good);
}

.score-mark.max span {
  color: var(--good-text);
  font-weight: 700;
}

.score-caption {
  font-size: 0.76rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 14px;
}

.cat-rows {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--gridline);
  padding-top: 12px;
}

.cat-row {
  display: grid;
  grid-template-columns: 6.2em 1fr auto;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
}

.cat-name {
  color: var(--text-secondary);
  white-space: nowrap;
}

.cat-track {
  position: relative;
  height: 8px;
  background: var(--gridline);
  border-radius: 4px;
}

.cat-fill {
  height: 100%;
  background: var(--seq-300);
  border-radius: 4px;
}

.cat-fill.ok {
  background: var(--good);
}

.cat-target {
  position: absolute;
  top: -3px;
  width: 2px;
  height: 14px;
  background: var(--text-primary);
  transform: translateX(-1px);
}

.cat-val {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cat-val b {
  font-size: 0.9rem;
}

.cat-val span {
  color: var(--muted);
  font-size: 0.72rem;
}

/* ---- いまやるべき5つ ---- */

.todo-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: todo;
}

.todo-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0 10px 12px;
  border-bottom: 1px solid var(--gridline);
  border-left: 4px solid var(--muted);
  counter-increment: todo;
}

.todo-item:last-child {
  border-bottom: none;
}

.todo-item.status-weak { border-left-color: var(--critical); }
.todo-item.status-mid { border-left-color: var(--warning); }
.todo-item.status-good { border-left-color: var(--good); }
.todo-item.status-untouched { border-left-color: var(--muted); }

.todo-main {
  flex: 1;
  min-width: 0;
}

.todo-title {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
}

.todo-title::before {
  content: counter(todo) ". ";
  color: var(--seq-450);
}

.todo-meta {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 3px;
  line-height: 1.5;
}

.todo-cat {
  display: inline-block;
  background: var(--seq-100);
  color: var(--seq-600);
  border-radius: 3px;
  padding: 0 5px;
  margin-right: 6px;
  font-size: 0.68rem;
}

.todo-btn {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--seq-450);
  background: var(--seq-450);
  color: #fff;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

/* ---- 論点マップ ---- */

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.map-legend .lg::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: -1px;
  background: var(--muted);
}

.map-legend .lg.good::before { background: var(--good); }
.map-legend .lg.mid::before { background: var(--warning); }
.map-legend .lg.weak::before { background: var(--critical); }

.map-cat {
  margin-bottom: 14px;
}

.map-cat-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 0.82rem;
  font-weight: 600;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--gridline);
  margin-bottom: 8px;
}

.map-cat-sum {
  font-size: 0.68rem;
  font-weight: 400;
  color: var(--muted);
}

.map-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 6px;
}

.tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
  padding: 8px 10px 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  border-left-width: 5px;
  border-left-color: var(--muted);
  background: var(--page);
  color: var(--text-primary);
  font-family: inherit;
  cursor: pointer;
  min-height: 48px;
}

.tile.status-weak { border-left-color: var(--critical); }
.tile.status-mid { border-left-color: var(--warning); }
.tile.status-good { border-left-color: var(--good); }
.tile.status-untouched { border-left-color: var(--muted); }

/* 年間の出題数が多い論点ほど文字を太く */
.tile.imp3 .tile-t { font-weight: 700; }
.tile.imp2 .tile-t { font-weight: 600; }
.tile.imp1 .tile-t { font-weight: 400; color: var(--text-secondary); }

.tile-t {
  font-size: 0.78rem;
  line-height: 1.35;
}

.tile-m {
  font-size: 0.66rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.tile:hover {
  border-color: var(--seq-450);
  border-left-color: inherit;
}

/* ---- ドリルの絞り込み表示 ---- */

.drill-filter-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--seq-100);
  color: var(--seq-600);
  border-radius: 8px;
  padding: 8px 8px 8px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  margin: -6px 0 12px;
}

.drill-filter-chip button {
  min-width: 36px;
  min-height: 36px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--seq-600);
  font-size: 1rem;
  cursor: pointer;
}

.mode-row {
  flex-wrap: wrap;
}

@media (max-width: 600px) {
  .cat-row {
    grid-template-columns: 5.4em 1fr auto;
    gap: 8px;
  }

  .map-tiles {
    grid-template-columns: repeat(2, 1fr);
  }

  .todo-item {
    flex-wrap: wrap;
  }

  .todo-btn {
    flex-basis: 100%;
    margin-left: 0;
  }
}
