:root {
  --bg: #f4f0e8;
  --ink: #17211d;
  --muted: #68736e;
  --line: #d8d0c2;
  --panel: #fffaf1;
  --panel-strong: #f8efe0;
  --green: #2f6f5e;
  --green-dark: #1f5347;
  --blue: #316c90;
  --red: #b85c4b;
  --yellow: #d7a541;
  --shadow: 0 18px 60px rgba(38, 35, 28, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(47, 111, 94, 0.12), transparent 32%),
    linear-gradient(315deg, rgba(49, 108, 144, 0.16), transparent 34%),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  border-right: 1px solid rgba(23, 33, 29, 0.12);
  background: rgba(255, 250, 241, 0.82);
  backdrop-filter: blur(18px);
  z-index: 100; 
  overflow-y: auto; 
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 34px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  color: #fff;
  background: var(--green);
  font-weight: 800;
  letter-spacing: 0;
  box-shadow: 0 10px 26px rgba(47, 111, 94, 0.24);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 1.08rem;
  line-height: 1.2;
}

h2 {
  margin-top: 4px;
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 0.96;
  letter-spacing: 0;
}

h3 {
  line-height: 1.18;
  letter-spacing: 0;
}

.eyebrow,
.panel-label {
  color: var(--green-dark);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  font-weight: 700;
}

.nav-button:hover,
.nav-button.active {
  color: var(--ink);
  border-color: rgba(47, 111, 94, 0.2);
  background: rgba(47, 111, 94, 0.09);
}

.nav-icon {
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  height: 28px;
  border-radius: 7px;
  background: rgba(23, 33, 29, 0.08);
  font-size: 0.78rem;
  font-weight: 900;
}

.sidebar-panel {
  margin-top: 32px;
  padding: 16px;
  border: 1px solid rgba(23, 33, 29, 0.1);
  border-radius: 8px;
  background: var(--panel);
}

.streak-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 12px 0;
}

.streak-line strong {
  font-size: 2rem;
  line-height: 1;
}

.small-progress {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(23, 33, 29, 0.12);
}

.small-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--green);
  transition: width 200ms ease;
}

.main {
  min-width: 0;
  padding: 32px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.date-pill {
  flex: 0 0 auto;
  border: 1px solid rgba(23, 33, 29, 0.12);
  border-radius: 999px;
  padding: 10px 14px;
  color: var(--green-dark);
  background: rgba(255, 250, 241, 0.72);
  font-weight: 800;
}

.hero-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 440px);
  gap: 24px;
  align-items: stretch;
  margin-bottom: 20px;
  overflow: hidden;
  border: 1px solid rgba(23, 33, 29, 0.12);
  border-radius: 8px;
  background:
    radial-gradient(circle at 18% 20%, rgba(215, 165, 65, 0.24), transparent 28%),
    linear-gradient(135deg, #fffaf1, #e8f0eb);
  box-shadow: var(--shadow);
}

.hero-copy {
  display: grid;
  align-content: center;
  gap: 12px;
  padding: 34px;
}

.hero-copy h3 {
  max-width: 720px;
  font-size: clamp(1.7rem, 3.4vw, 3.2rem);
}

.hero-copy p:last-child {
  max-width: 56ch;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.6;
}

.learning-map {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 28px;
  background:
    linear-gradient(140deg, rgba(49, 108, 144, 0.18), transparent),
    rgba(255, 250, 241, 0.5);
}

.learning-map span {
  display: grid;
  place-items: center;
  min-height: 82px;
  border: 1px solid rgba(23, 33, 29, 0.12);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 250, 241, 0.76);
  color: var(--ink);
  font-weight: 900;
  text-align: center;
  box-shadow: 0 10px 28px rgba(23, 33, 29, 0.08);
}

.learning-map span:nth-child(2),
.learning-map span:nth-child(5) {
  background: rgba(49, 108, 144, 0.12);
}

.learning-map span:nth-child(3),
.learning-map span:nth-child(6) {
  background: rgba(215, 165, 65, 0.14);
}

.controls-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(132px, 1fr)) minmax(170px, 230px);
  gap: 12px;
  align-items: end;
  margin-bottom: 28px;
}

.control-group,
.journal-editor {
  display: grid;
  gap: 7px;
}

label,
.input-label {
  color: var(--green-dark);
  font-size: 0.86rem;
  font-weight: 800;
}

select,
input,
textarea {
  width: 100%;
  border: 1px solid rgba(23, 33, 29, 0.16);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  background: rgba(255, 250, 241, 0.86);
  outline: none;
}

textarea {
  resize: vertical;
  line-height: 1.5;
}

select:focus,
input:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(47, 111, 94, 0.16);
}

.primary-action,
.secondary-action,
.tiny-button,
.prompt-button {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 10px 14px;
  font-weight: 900;
}

.primary-action {
  color: #fff;
  background: var(--green);
}

.primary-action:hover {
  background: var(--green-dark);
}

.secondary-action,
.tiny-button,
.prompt-button {
  color: var(--green-dark);
  border-color: rgba(47, 111, 94, 0.22);
  background: rgba(255, 250, 241, 0.72);
}

.secondary-action:hover,
.tiny-button:hover,
.prompt-button:hover {
  background: rgba(47, 111, 94, 0.1);
}

.tiny-button {
  min-width: 68px;
  min-height: 34px;
  padding: 7px 10px;
  font-size: 0.82rem;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin: 26px 0 14px;
}

.api-status {
  min-height: 24px;
  margin: -16px 0 22px;
  color: var(--green-dark);
  font-weight: 800;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.section-heading h3 {
  margin-top: 4px;
  font-size: 1.35rem;
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.skill-card,
.practice-card,
.metric-card,
.saved-section,
.journal-editor,
.journal-prompts {
  border: 1px solid rgba(23, 33, 29, 0.12);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.84);
  box-shadow: 0 12px 34px rgba(23, 33, 29, 0.08);
}

.skill-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 238px;
  padding: 18px;
}

.skill-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.skill-badge {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: #fff;
  background: var(--blue);
  font-weight: 900;
}

.skill-time {
  color: var(--green-dark);
  font-weight: 900;
}

.skill-card h4 {
  margin: 16px 0 8px;
  font-size: 1.18rem;
}

.skill-card p {
  color: var(--muted);
  line-height: 1.5;
}

.skill-card.completed {
  border-color: rgba(47, 111, 94, 0.42);
  background: rgba(232, 240, 235, 0.92);
}

.skill-card.completed .skill-badge {
  background: var(--green);
}

.skill-card .secondary-action {
  margin-top: 18px;
}

.practice-layout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.practice-card {
  min-height: 280px;
  padding: 18px;
}

.wide-card {
  grid-column: span 2;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.practice-card h3 {
  margin-bottom: 12px;
  font-size: 1.18rem;
}

.practice-card p {
  line-height: 1.55;
}

.example-line {
  margin-top: 14px;
  padding-left: 12px;
  border-left: 3px solid var(--yellow);
  color: var(--muted);
}

.passage {
  color: #29342f;
}

.quiz-options {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  border: 0;
}

.quiz-options label,
.checklist label {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--ink);
  font-weight: 650;
  line-height: 1.4;
}

.quiz-options input,
.checklist input {
  width: auto;
  margin-top: 3px;
}

.feedback {
  min-height: 24px;
  margin-top: 10px;
  color: var(--green-dark);
  font-weight: 800;
}

.question-line {
  margin-bottom: 14px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}

.checklist {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.journal-wrap {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
}

.journal-prompts {
  align-self: start;
  display: grid;
  gap: 10px;
  padding: 18px;
}

.prompt-button {
  height: auto;
  min-height: 48px;
  text-align: left;
}

.journal-editor {
  padding: 18px;
}

.progress-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.metric-card {
  display: grid;
  gap: 5px;
  padding: 20px;
}

.metric-card strong {
  font-size: 2.4rem;
  line-height: 1;
}

.saved-section {
  margin-top: 16px;
  padding: 18px;
}

.saved-words,
.journal-list {
  display: grid;
  gap: 10px;
}

.saved-word,
.journal-item {
  border: 1px solid rgba(23, 33, 29, 0.11);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.42);
}

.saved-word strong,
.journal-item strong {
  display: block;
  margin-bottom: 4px;
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
    padding: 18px;
    border-right: 0;
    border-bottom: 1px solid rgba(23, 33, 29, 0.12);
  }

  .brand {
    margin-bottom: 16px;
  }

  .nav-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .sidebar-panel {
    margin-top: 16px;
  }

  .skill-grid,
  .practice-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .main {
    padding: 18px;
  }

  .topbar,
  .section-heading {
    display: grid;
  }

  h2 {
    font-size: 2.25rem;
  }

  .hero-band,
  .controls-row,
  .journal-wrap,
  .progress-grid {
    grid-template-columns: 1fr;
  }

  .learning-map {
    grid-template-columns: 1fr;
  }

  .skill-grid,
  .practice-layout {
    grid-template-columns: 1fr;
  }

  .wide-card {
    grid-column: auto;
  }

  .nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 460px) {
  .nav-button {
    justify-content: center;
    min-height: 54px;
    padding: 8px;
    font-size: 0.82rem;
  }

  .nav-icon {
    display: none;
  }

  .hero-copy,
  .learning-map {
    padding: 20px;
  }

  .date-pill {
    width: 100%;
    text-align: center;
  }
}
