/* PatternMastery plan.css - Study Plans page (uses chrome.css tokens) */

.plan-main { max-width: 1080px; margin: 0 auto; padding: 32px 24px 80px; }

/* ── Hero ─────────────────────────────────────────────────── */
.plan-hero p.pm-sub { max-width: 760px; }
.plan-trust {
  margin: 14px 0 0; padding: 12px 16px; border-radius: var(--r-md);
  background: var(--bg-card); border: 1px solid var(--border);
  font-size: 13px; color: var(--muted); max-width: 760px; line-height: 1.55;
}
.plan-trust strong { color: var(--accent); }

/* ── Plan picker ──────────────────────────────────────────── */
.plan-picker {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 24px 0 0;
}
@media (max-width: 900px) { .plan-picker { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .plan-picker { grid-template-columns: 1fr; } }
.plan-card {
  text-align: left; cursor: pointer; font-family: inherit;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 16px 16px 14px; color: var(--text);
  display: flex; flex-direction: column; gap: 4px; transition: border-color .15s, background .15s;
}
.plan-card:hover { border-color: var(--border-strong); background: var(--bg-hover); }
.plan-card[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.plan-card .pc-label { font-weight: 800; font-size: 15px; letter-spacing: -0.01em; }
.plan-card .pc-tag { color: var(--accent); font-size: 12px; font-weight: 600; }
.plan-card .pc-desc { color: var(--muted); font-size: 12.5px; line-height: 1.5; margin-top: 4px; }
.plan-card .pc-pace {
  margin-top: 8px; font-family: var(--font-mono); font-size: 11.5px; color: var(--faint);
}

/* ── Controls row: tier chips + start ─────────────────────── */
.plan-controls {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  margin: 18px 0 0; padding: 14px 16px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-lg);
}
.plan-controls .ctl-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.tier-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tier-chip {
  font-family: var(--font-mono); font-size: 11.5px; cursor: pointer;
  padding: 4px 10px; border-radius: 999px; color: var(--muted);
  background: var(--bg-elev); border: 1px solid var(--border);
  transition: color .12s, border-color .12s;
}
.tier-chip:hover { color: var(--text); border-color: var(--border-strong); }
.tier-chip[aria-pressed="true"] { color: #1a1a1f; background: var(--accent); border-color: var(--accent); font-weight: 700; }
.plan-controls .spacer { flex: 1; }
.plan-summary { font-size: 12.5px; color: var(--muted); }
.plan-summary strong { color: var(--text); }
.plan-summary .warn-heavy { color: var(--warn); font-weight: 700; }

/* ── Progress strip (active plan) ─────────────────────────── */
.plan-progress {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin: 14px 0 0; padding: 12px 16px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-lg);
  font-size: 13px;
}
.plan-progress .pp-day { font-weight: 800; color: var(--accent); white-space: nowrap; }
.plan-progress .pp-bar { flex: 1; min-width: 140px; height: 7px; background: var(--bg-hover); border-radius: 999px; overflow: hidden; }
.plan-progress .pp-bar .fill { height: 100%; background: var(--accent); transition: width .3s ease; }
.plan-progress .pp-count { font-family: var(--font-mono); font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ── Day grid (the ad-style curriculum) ───────────────────── */
.day-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 22px 0 0;
}
@media (max-width: 980px) { .day-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 780px) { .day-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .day-grid { grid-template-columns: repeat(2, 1fr); } }

.day-card {
  position: relative; text-align: center; cursor: pointer; font-family: inherit; color: var(--text);
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 14px 10px 12px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  transition: border-color .15s, transform .15s, background .15s;
  opacity: 0; transform: translateY(8px);
  animation: dayIn .35s ease forwards;
}
@media (prefers-reduced-motion: reduce) {
  .day-card { animation: none; opacity: 1; transform: none; }
}
@keyframes dayIn { to { opacity: 1; transform: translateY(0); } }
.day-card:hover { border-color: var(--border-strong); background: var(--bg-hover); transform: translateY(-2px); }
.day-card .dc-day {
  font-size: 10.5px; font-weight: 800; letter-spacing: .08em; color: var(--faint); text-transform: uppercase;
}
.day-card .dc-icon { font-size: 26px; line-height: 1; }
.day-card .dc-title { font-size: 12.5px; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; }
.day-card .dc-sub { font-size: 10.5px; color: var(--muted); line-height: 1.35; min-height: 2.7em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.day-card .dc-count { font-family: var(--font-mono); font-size: 10.5px; color: var(--faint); }

.day-card.review { background: var(--bg-elev); border-style: dashed; }
.day-card.done { border-color: rgba(122, 220, 130, .55); }
.day-card.done .dc-day { color: #7adc82; }
.day-card .dc-check {
  position: absolute; top: 8px; right: 8px; width: 18px; height: 18px; border-radius: 50%;
  background: #7adc82; color: #10241a; font-size: 11px; font-weight: 900;
  display: none; align-items: center; justify-content: center;
}
.day-card.done .dc-check { display: flex; }
.day-card.partial .dc-check { display: flex; background: var(--warn); color: #241a10; }

.day-card.today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.day-card.today::after {
  content: "You are here"; position: absolute; top: -9px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #1a1a1f; font-size: 9px; font-weight: 800;
  padding: 2px 8px; border-radius: 999px; letter-spacing: .04em; white-space: nowrap;
}

.day-more { grid-column: 1 / -1; text-align: center; margin-top: 6px; }

/* ── Day detail (expanded) ────────────────────────────────── */
.day-detail {
  grid-column: 1 / -1; background: var(--bg-elev); border: 1px solid var(--border-strong);
  border-radius: var(--r-lg); padding: 16px 18px; text-align: left;
}
.day-detail h3 { margin: 0 0 4px; font-size: 15px; }
.day-detail .dd-sub { color: var(--muted); font-size: 12.5px; margin: 0 0 12px; }
.day-detail .dd-list { display: flex; flex-direction: column; gap: 6px; }
.day-detail .dd-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-md);
  color: var(--text); font-size: 13.5px;
}
.day-detail .dd-item:hover { border-color: var(--border-strong); background: var(--bg-hover); text-decoration: none; }
.day-detail .dd-item .pm { font-family: var(--font-mono); font-size: 11px; color: var(--faint); min-width: 52px; }
.day-detail .dd-item .t { flex: 1; font-weight: 600; }
.day-detail .dd-item .meta { font-size: 11px; color: var(--muted); }
.day-detail .dd-item .done-mark { color: #7adc82; font-weight: 800; }
.day-detail .dd-close { margin-top: 12px; }

.plan-empty { color: var(--muted); font-size: 14px; padding: 24px 0; }
