:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #18202a;
  --muted: #667085;
  --line: #d9dee7;
  --accent: #147d64;
  --accent-strong: #0f624f;
  --accent-soft: #e7f4ef;
  --warn: #9a3412;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
  --shadow-lift: 0 14px 34px rgba(15, 23, 42, 0.13);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 320px;
  background: linear-gradient(180deg, #f9fbfc 0%, var(--bg) 46%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

.shell {
  width: min(1240px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 32px 0 44px;
}

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

.topbar-side {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topnav {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
}

.topnav a {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
  transition: background-color 160ms ease, color 160ms ease;
}

.topnav a:hover,
.topnav a[aria-current="page"] {
  background: var(--text);
  color: #ffffff;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.15;
  font-weight: 760;
}

.lead {
  max-width: 620px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.status {
  min-width: 88px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.search-wrap {
  flex: 1;
}

input[type="search"] {
  width: 100%;
  height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  outline: none;
}

input[type="search"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(20, 125, 100, 0.12);
}

button,
.download {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, background-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

button {
  padding: 0 12px;
}

button:hover,
.download:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

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

.card {
  min-height: 286px;
  display: flex;
  flex-direction: column;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: card-enter 340ms ease both;
  animation-delay: calc(var(--index, 0) * 22ms);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
  will-change: transform;
}

.card:hover {
  border-color: rgba(20, 125, 100, 0.36);
  box-shadow: var(--shadow-lift);
  transform: translateY(-3px);
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.25;
}

.download {
  flex: 0 0 auto;
  min-width: 54px;
  padding: 0 10px;
  font-size: 13px;
  background: #fbfdfc;
}

.slug {
  margin: 7px 0 0;
  color: var(--accent-strong);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.desc {
  min-height: 62px;
  margin: 12px 0 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.meta {
  display: grid;
  gap: 8px;
  margin: auto 0 14px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: linear-gradient(180deg, #fbfcfd, #f7faf9);
}

.meta div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

dt {
  color: var(--muted);
  font-size: 12px;
}

dd {
  margin: 0;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
  text-align: right;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.actions button {
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  font-size: 13px;
  white-space: normal;
}

.actions button[data-scope="user"] {
  border-color: var(--text);
  background: var(--text);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(24, 32, 42, 0.12);
}

.actions button[data-scope="user"]:hover {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
  color: #ffffff;
}

.actions button[data-scope="project"] {
  border-color: var(--text);
  background: var(--surface);
  color: var(--text);
}

.actions button[data-scope="project"]:hover {
  border-color: var(--accent-strong);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.actions button[data-copied="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
  box-shadow: none;
}

.actions button[data-copied="false"] {
  border-color: var(--warn);
  background: #fff7ed;
  color: var(--warn);
  box-shadow: none;
}

.empty {
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  text-align: center;
}

.course-shell {
  width: min(1280px, calc(100vw - 40px));
}

.course-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.course-sidebar {
  position: sticky;
  top: 18px;
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.sidebar-nav,
.sidebar-group,
.sidebar-node-list,
.sidebar-node-group,
.sidebar-step-list {
  display: grid;
}

.sidebar-nav {
  gap: 12px;
}

.sidebar-group {
  gap: 8px;
}

.sidebar-node-list {
  gap: 8px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
}

.sidebar-node-group {
  gap: 5px;
}

.sidebar-step-list {
  gap: 3px;
  padding-left: 11px;
}

.sidebar-link {
  display: block;
  border-radius: 6px;
  color: var(--muted);
  line-height: 1.35;
  text-decoration: none;
  transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.sidebar-link:hover,
.sidebar-link[aria-current="true"] {
  background: var(--accent-soft);
  color: var(--accent-strong);
  transform: translateX(1px);
}

.sidebar-day {
  padding: 7px 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 780;
}

.sidebar-node {
  padding: 5px 7px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

.sidebar-step {
  padding: 4px 7px;
  font-size: 12px;
}

.course-days {
  display: grid;
  gap: 24px;
}

.day-section {
  animation: card-enter 340ms ease both;
  animation-delay: calc(var(--index, 0) * 30ms);
  scroll-margin-top: 18px;
}

.day-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0 12px;
  border-bottom: 2px solid var(--text);
}

.day-kicker,
.node-time,
.step-meta {
  margin: 0 0 5px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: uppercase;
}

.day-head h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.2;
}

.day-count {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
}

.node-list {
  display: grid;
  gap: 22px;
  padding-top: 18px;
}

.node-section {
  display: grid;
  gap: 12px;
  animation: card-enter 320ms ease both;
  animation-delay: calc(var(--index, 0) * 24ms);
  scroll-margin-top: 18px;
}

.node-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.node-head h3 {
  margin: 0;
  font-size: 21px;
  line-height: 1.25;
}

.step-list {
  display: grid;
  gap: 14px;
}

.step-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 1)),
    var(--surface);
  box-shadow: var(--shadow);
  animation: card-enter 300ms ease both;
  animation-delay: calc(var(--index, 0) * 18ms);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
  scroll-margin-top: 18px;
}

.step-card:hover {
  border-color: rgba(20, 125, 100, 0.34);
  box-shadow: var(--shadow-lift);
  transform: translateY(-2px);
}

.step-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.step-head h4 {
  margin: 0;
  font-size: 18px;
  line-height: 1.32;
}

.prompt-count {
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f9fafb;
  color: var(--muted);
  font-size: 12px;
}

.resource-panel {
  display: grid;
  gap: 8px;
  padding: 11px;
  border: 1px solid #cdd8e3;
  border-radius: 8px;
  background: #f8fbfd;
}

.resource-panel > p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 740;
}

.resource-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.resource-link {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid #a7b8c8;
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
  transition: border-color 160ms ease, color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.resource-link:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.resource-link span {
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 11px;
}

.prompt-list {
  display: grid;
  gap: 12px;
}

.prompt-block {
  overflow: hidden;
  border: 1px solid #cfd6df;
  border-radius: 8px;
  background: #101820;
}

.prompt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 11px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: #172331;
}

.prompt-head h5 {
  margin: 0;
  color: #f8fafc;
  font-size: 13px;
  line-height: 1.35;
}

.prompt-head button {
  min-height: 32px;
  flex: 0 0 auto;
  border-color: rgba(255, 255, 255, 0.28);
  background: #ffffff;
  color: #101820;
  font-size: 12px;
  font-weight: 720;
}

.prompt-head button:hover {
  border-color: #ffffff;
  background: #e7f4ef;
  color: var(--accent-strong);
}

.prompt-head button[data-copied="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.prompt-head button[data-copied="false"] {
  border-color: var(--warn);
  background: #fff7ed;
  color: var(--warn);
}

pre {
  margin: 0;
  max-height: 420px;
  overflow: auto;
  padding: 14px;
  color: #e8edf2;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.prompt-empty {
  margin: 0;
  padding: 0 14px 14px;
  color: #aab7c4;
  font-size: 13px;
  line-height: 1.5;
}

.prompt-empty {
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  color: var(--muted);
}

.day-empty {
  text-align: left;
}

@keyframes card-enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}

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

@media (max-width: 700px) {
  .shell {
    width: min(100vw - 20px, 560px);
    padding-top: 18px;
  }

  .topbar,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-side {
    align-items: stretch;
    flex-direction: column;
  }

  .topnav {
    justify-content: stretch;
  }

  .topnav a {
    flex: 1;
    justify-content: center;
  }

  h1 {
    font-size: 28px;
  }

  .status {
    text-align: left;
  }

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

  .card {
    min-height: 276px;
  }

  .course-shell {
    width: min(100vw - 20px, 620px);
  }

  .day-head,
  .step-head,
  .prompt-head {
    align-items: stretch;
    flex-direction: column;
  }

  .day-count,
  .prompt-count,
  .prompt-head button {
    width: 100%;
  }

  .prompt-head button {
    justify-content: center;
  }

  .resource-list {
    display: grid;
    grid-template-columns: 1fr;
  }

  .resource-link {
    justify-content: space-between;
  }
}
