:root {
  color-scheme: light;
  --bg: #f1f4f3;
  --panel: #ffffff;
  --ink: #17201e;
  --ink-soft: #35413e;
  --muted: #68736f;
  --line: #d9dfdc;
  --line-strong: #bdc8c3;
  --surface-subtle: #edf2f0;
  --accent: #0e766d;
  --accent-dark: #075b54;
  --orange: #b45309;
  --blue: #215f9a;
  --green: #4d7c0f;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.view-switch {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #ffffff;
}

.view-switch button {
  min-width: 84px;
  border: 0;
  border-radius: 0;
  color: var(--muted);
}

.view-switch button + button {
  border-left: 1px solid var(--line);
}

.view-switch button.active {
  background: var(--ink);
  color: #ffffff;
}

.language-toggle {
  min-width: 82px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
}

.status {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--muted);
  background: #ffffff;
  font-size: 13px;
  white-space: nowrap;
}

.layout {
  display: grid;
  grid-template-columns: minmax(320px, 460px) minmax(0, 1fr);
  min-height: calc(100vh - 77px);
}

.sidebar {
  border-right: 1px solid var(--line);
  background: var(--panel);
  min-width: 0;
}

.filters {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.filter-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

input:not([type="checkbox"]):not([type="radio"]),
select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

input:focus,
select:focus,
textarea:focus,
button:focus {
  outline: 2px solid rgba(14, 118, 109, 0.3);
  outline-offset: 2px;
}

.list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}

button {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 10px;
  background: #ffffff;
  color: var(--accent-dark);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  border-color: var(--accent);
}

.topic-list {
  height: calc(100vh - 272px);
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.topic-item {
  border-bottom: 1px solid var(--line);
}

.topic-button {
  width: 100%;
  display: grid;
  gap: 6px;
  border: 0;
  border-radius: 0;
  padding: 13px 18px;
  text-align: left;
  background: transparent;
  color: var(--ink);
}

.topic-button:hover,
.topic-button.active {
  background: var(--surface-subtle);
}

.topic-title {
  font-size: 15px;
  font-weight: 800;
}

.topic-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 2px 8px;
  background: #ffffff;
  color: var(--muted);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
}

.pill.subject {
  color: var(--accent-dark);
}

.detail {
  padding: 24px;
  overflow: auto;
}

.topic-card {
  max-width: 980px;
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
}

.empty {
  margin: 0;
  color: var(--muted);
}

.topic-card h2 {
  margin: 0 0 10px;
  font-size: 34px;
  line-height: 1.1;
}

.description {
  color: #344046;
  font-size: 17px;
  line-height: 1.6;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0;
}

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

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
}

.section {
  margin-top: 24px;
}

.section h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.section ul {
  margin: 0;
  padding-left: 20px;
}

.standard-list {
  display: grid;
  gap: 10px;
  padding: 0 !important;
  list-style: none;
}

.standard-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
}

.standard-heading {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

.standard-item p {
  margin: 8px 0;
  color: #344046;
  line-height: 1.55;
}

.standard-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  color: var(--muted);
  font-size: 12px;
}

.section li {
  margin: 7px 0;
  line-height: 1.45;
}

.link-button {
  display: inline;
  border: 0;
  padding: 0;
  color: var(--blue);
  background: transparent;
  font-weight: 700;
  text-align: left;
}

.link-button:hover {
  text-decoration: underline;
}

.standard-list li {
  margin: 0;
}

.standard-list code {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 7px;
  background: #ffffff;
  font-size: 12px;
}

.learning-tabs {
  display: flex;
  min-height: 44px;
  margin-top: 26px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}

.learning-tab {
  flex: 0 0 auto;
  min-height: 44px;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  padding: 10px 16px;
  background: transparent;
  color: var(--muted);
}

.learning-tab:hover,
.learning-tab.active {
  border-bottom-color: var(--accent);
  color: var(--accent-dark);
}

.learning-panel {
  padding-top: 4px;
}

.learning-section {
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.learning-section:last-child {
  border-bottom: 0;
}

.learning-section h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.learning-section ul,
.learning-section ol {
  margin: 0;
  padding-left: 22px;
}

.learning-section li {
  margin: 8px 0;
  line-height: 1.55;
}

.lesson-copy,
.assessment-question {
  margin: 0;
  color: #344046;
  font-size: 16px;
  line-height: 1.65;
}

.panel-note {
  margin: 18px 0 2px;
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 12px;
  color: var(--muted);
  line-height: 1.55;
}

.resource-list {
  margin-top: 16px;
  border-top: 1px solid var(--line);
}

.resource-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  border-bottom: 1px solid var(--line);
  padding: 13px 4px;
  color: var(--ink);
  text-decoration: none;
}

.resource-item:hover {
  color: var(--accent-dark);
  background: rgba(14, 118, 109, 0.04);
}

.resource-main {
  display: grid;
  gap: 4px;
}

.resource-main span {
  color: var(--muted);
  font-size: 13px;
}

.resource-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.response-label {
  margin-top: 18px;
}

.response-guidance {
  display: grid;
  gap: 3px;
  margin-top: 14px;
  border-left: 3px solid var(--blue);
  padding: 10px 12px;
  background: #f4f8fb;
  color: var(--ink);
  line-height: 1.55;
}

.response-guidance span {
  color: var(--muted);
  font-size: 14px;
}

textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 12px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  line-height: 1.5;
}

.evidence-requirements {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 22px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
}

.evidence-requirements li::marker {
  color: var(--accent);
}

.check-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border-bottom: 1px solid var(--line);
  padding: 12px 2px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  text-transform: none;
}

.check-row input {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--accent);
}

.human-evidence-confirmation {
  margin-top: 14px;
  border: 1px solid rgba(14, 118, 109, 0.35);
  border-radius: 6px;
  padding: 12px;
  background: rgba(14, 118, 109, 0.06);
}

.status-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.independence-options {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.status-options label {
  position: relative;
  text-transform: none;
}

.status-options input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.status-options span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 9px;
  background: #ffffff;
  color: var(--muted);
  text-align: center;
  cursor: pointer;
}

.status-options input:checked + span {
  border-color: var(--accent);
  background: rgba(14, 118, 109, 0.08);
  color: var(--accent-dark);
}

.status-options input:focus + span {
  outline: 2px solid rgba(14, 118, 109, 0.3);
  outline-offset: 2px;
}

.readiness {
  margin: 14px 0 0;
  border-left: 3px solid var(--orange);
  padding-left: 10px;
  color: var(--orange);
  line-height: 1.5;
}

.readiness.ready {
  border-left-color: var(--green);
  color: var(--green);
}

.readiness.blocked {
  border-left-color: #b42318;
  color: #b42318;
}

.assessment-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
}

.assessment-buttons {
  display: flex;
  gap: 8px;
}

.updated-at {
  color: var(--muted);
  font-size: 13px;
}

.primary-action {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.primary-action:hover {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
}

.progress-pill.status-mastered,
.status-text.status-mastered {
  color: var(--green);
}

.progress-pill.status-needs_practice,
.status-text.status-needs_practice {
  color: var(--orange);
}

.progress-pill.status-learning,
.status-text.status-learning {
  color: var(--blue);
}

@media (max-width: 1100px) {
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 880px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions {
    width: 100%;
    justify-content: space-between;
  }

  .view-switch {
    order: 2;
  }

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

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .topic-list {
    height: 360px;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

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

  .independence-options {
    grid-template-columns: 1fr;
  }

  .resource-item,
  .assessment-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .assessment-buttons {
    width: 100%;
  }

  .assessment-buttons button {
    flex: 1;
  }
}

@media (max-width: 520px) {
  .top-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .language-toggle {
    align-self: flex-end;
  }

  .view-switch {
    order: 0;
    width: 100%;
  }

  .status {
    white-space: normal;
  }

  .detail {
    padding: 12px;
  }

  .topic-card {
    padding: 18px;
  }

  .learning-tab {
    flex: 1 0 auto;
    padding: 10px 8px;
    font-size: 14px;
  }

}
