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

:root {
  --bg-a: #eef6ff;
  --bg-b: #fff2dc;
  --ink: #22303f;
  --muted: #4f5f72;
  --card: rgba(255, 255, 255, 0.88);
  --line: #d6dde7;
  --brand: #e66234;
  --brand-2: #2b6cb0;
  --ok: #15803d;
  --bad: #b42318;
  --shadow: 0 18px 40px rgba(30, 41, 59, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Cabin', sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 10%, rgba(43, 108, 176, 0.2), transparent 35%),
    radial-gradient(circle at 90% 20%, rgba(230, 98, 52, 0.2), transparent 45%),
    linear-gradient(130deg, var(--bg-a), var(--bg-b));
}

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 75% 80%, rgba(21, 128, 61, 0.1), transparent 45%),
    radial-gradient(circle at 20% 70%, rgba(43, 108, 176, 0.12), transparent 40%);
  z-index: -1;
}

h1,
h2,
h3 {
  margin: 0 0 0.55rem;
  font-family: 'Lexend', sans-serif;
}

p {
  margin: 0;
  line-height: 1.5;
  color: var(--muted);
}

.app-shell {
  width: min(980px, 94vw);
  margin: 2rem auto 2.5rem;
  display: grid;
  gap: 1rem;
}

.card {
  border: 1px solid var(--line);
  background: var(--card);
  backdrop-filter: blur(2px);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 1.2rem;
}

.hero {
  padding: 1.4rem;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 0.5rem;
  font-size: 0.86rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-2);
  font-weight: 700;
}

.hero h1 {
  font-size: clamp(1.35rem, 2.1vw, 2rem);
}

.planner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.7rem;
  margin-bottom: 1rem;
}

.metric {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  padding: 0.8rem;
}

.metric-label {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.control-row {
  display: grid;
  grid-template-columns: 130px minmax(220px, 1fr) auto auto;
  gap: 0.6rem;
  align-items: center;
}

label {
  font-weight: 700;
  color: var(--ink);
}

select,
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.58rem 0.66rem;
  font-size: 0.98rem;
  color: var(--ink);
  background: #fff;
}

.day-note {
  margin-top: 0.8rem;
  font-size: 0.94rem;
}

.btn {
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0.6rem 0.95rem;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(120deg, var(--brand), #f28a40);
  color: #fff;
}

.btn-ghost {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.btn:hover {
  filter: brightness(0.98);
}

.session-top,
.review-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.timer-wrap {
  display: grid;
  justify-items: center;
  background: rgba(43, 108, 176, 0.12);
  border-radius: 12px;
  padding: 0.5rem 0.8rem;
  min-width: 124px;
}

.timer-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand-2);
  font-weight: 700;
}

.timer-value {
  font-size: 1.45rem;
  color: var(--brand-2);
  font-weight: 700;
}

.progress-wrap {
  margin: 0.85rem 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.progress-track {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: #e7ecf2;
  overflow: hidden;
}

.progress-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  transition: width 160ms ease;
}

.question-list {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.75rem;
}

.question-item {
  border-bottom: 1px dashed var(--line);
  padding-bottom: 0.75rem;
}

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

.question-prompt {
  color: var(--ink);
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.answer-input {
  max-width: 170px;
}

.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

.review-list {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.85rem;
}

.score-pill {
  font-weight: 700;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  color: #0f5132;
  background: #d1fae5;
}

.review-item {
  border: 1px solid var(--line);
  border-left-width: 5px;
  border-radius: 12px;
  padding: 0.75rem 0.8rem;
  background: #fff;
}

.review-item h3 {
  font-size: 1rem;
  margin-bottom: 0.4rem;
}

.review-item.correct {
  border-left-color: var(--ok);
}

.review-item.wrong {
  border-left-color: var(--bad);
}

.explanation {
  margin-top: 0.35rem;
  color: var(--ink);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0.7rem;
  margin-top: 0.8rem;
}

.dashboard-card {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 0.75rem;
}

.dashboard-card h3 {
  font-size: 1rem;
  margin-bottom: 0.55rem;
}

.trend-chart {
  height: 170px;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding: 8px 6px;
  background:
    linear-gradient(to top, rgba(43, 108, 176, 0.08), rgba(43, 108, 176, 0.02)),
    repeating-linear-gradient(
      to top,
      transparent 0,
      transparent 24%,
      rgba(79, 95, 114, 0.12) 25%
    );
  overflow-x: auto;
}

.trend-bar {
  min-width: 18px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
  transition: transform 120ms ease;
}

.trend-bar:hover {
  transform: translateY(-2px);
}

.trend-empty {
  color: var(--muted);
  font-size: 0.92rem;
}

.stack-list {
  display: grid;
  gap: 0.5rem;
}

.stack-row {
  display: grid;
  gap: 0.3rem;
}

.stack-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--ink);
}

.stack-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #e7ecf2;
  overflow: hidden;
}

.stack-fill {
  height: 100%;
  border-radius: 999px;
}

.stack-fill.ok {
  background: linear-gradient(120deg, #22c55e, #16a34a);
}

.stack-fill.warn {
  background: linear-gradient(120deg, #f97316, #ef4444);
}

.hidden {
  display: none;
}

@media (max-width: 860px) {
  .control-row {
    grid-template-columns: 1fr;
  }

  .session-top,
  .review-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .timer-wrap {
    min-width: 0;
  }
}
