:root {
  --ink: #171733;
  --muted: #62627a;
  --line: #dddded;
  --paper: #ffffff;
  --soft: #f6f5ff;
  --team: #5b5fc7;
  --team-dark: #41459a;
  --accent: #00a6a6;
  --warn: #e47d2c;
  --ok: #2e8f55;
  --shadow: 0 18px 50px rgba(31, 32, 68, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(180deg, #fbfbff 0%, #f2f4fb 60%, #ffffff 100%);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

a {
  color: inherit;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 56px);
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: white;
  background: var(--team);
  border-radius: 10px;
  font-weight: 800;
}

.brand small,
footer span {
  display: block;
  color: var(--muted);
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

nav a {
  padding: 8px 12px;
  color: var(--muted);
  text-decoration: none;
  border-radius: 999px;
}

nav a:hover {
  color: var(--team-dark);
  background: var(--soft);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.7fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  min-height: 78vh;
  padding: clamp(42px, 8vw, 96px) clamp(18px, 5vw, 72px);
}

.hero h1 {
  max-width: 860px;
  margin: 0;
  font-size: clamp(2.2rem, 6vw, 5.5rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.hero p {
  max-width: 720px;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.28rem);
  line-height: 1.6;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--team-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.hero-actions,
.composer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 750;
  text-decoration: none;
}

.button.primary {
  color: white;
  background: var(--team);
}

.button.primary:hover {
  background: var(--team-dark);
}

.button.secondary,
.button.small {
  color: var(--team-dark);
  background: white;
  border-color: var(--line);
}

.button.small {
  min-height: 36px;
  padding: 0 12px;
  font-size: 0.9rem;
}

.snapshot {
  padding: 22px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.snapshot-header {
  display: flex;
  gap: 7px;
  margin-bottom: 18px;
}

.snapshot-header span {
  width: 12px;
  height: 12px;
  background: #d8d8ec;
  border-radius: 50%;
}

.snapshot-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.snapshot-row.active {
  color: var(--team-dark);
}

.progress-shell {
  height: 10px;
  margin: 18px 0 8px;
  overflow: hidden;
  background: #ecebfb;
  border-radius: 999px;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--team), var(--accent));
  transition: width 250ms ease;
}

.intro-grid,
.route-grid,
.term-grid,
.role-grid,
.pilot-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding: 0 clamp(18px, 5vw, 72px) 54px;
}

.intro-grid article,
.term-grid article,
.role-grid article,
.pilot-board article,
.info-panel,
.route-card,
.quiz-card,
.route-detail,
.planner,
.sources ul {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(31, 32, 68, 0.08);
}

.intro-grid article,
.term-grid article,
.role-grid article,
.pilot-board article,
.route-card {
  padding: 24px;
}

.terms-section {
  padding-top: 16px;
}

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

.term-grid h3 {
  margin: 0 0 10px;
  color: var(--team-dark);
}

.term-grid p,
.field-help,
.role-grid p,
.pilot-board p,
.pilot-board li {
  color: var(--muted);
  line-height: 1.6;
}

.guide-section {
  background: linear-gradient(180deg, rgba(246, 245, 255, 0.5), rgba(255, 255, 255, 0));
}

.instruction-layout,
.calendar-plan {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 22px;
  align-items: start;
}

.step-list {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: guide-step;
}

.step-list li {
  position: relative;
  min-height: 86px;
  padding: 20px 20px 20px 74px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(31, 32, 68, 0.08);
  color: var(--muted);
  line-height: 1.65;
  counter-increment: guide-step;
}

.step-list li::before {
  content: counter(guide-step);
  position: absolute;
  top: 20px;
  left: 20px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: white;
  background: var(--team);
  border-radius: 8px;
  font-weight: 800;
}

.step-list strong,
.role-grid h3,
.pilot-board h3,
.timeline h3,
.info-panel h3 {
  color: var(--ink);
}

.step-list span,
.role-grid span,
.pilot-board span,
.timeline span,
.notice-sample {
  color: var(--team-dark);
  font-weight: 750;
}

.info-panel {
  position: sticky;
  top: 92px;
  padding: 22px;
}

.notice-sample {
  padding: 16px;
  background: var(--soft);
  border-left: 4px solid var(--team);
  border-radius: 8px;
  line-height: 1.65;
}

.role-grid,
.pilot-board {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 0;
}

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

.pilot-board ul,
.info-panel ul {
  padding-left: 20px;
}

.calendar-section {
  background: #fbfbff;
}

.timeline {
  display: grid;
  gap: 14px;
}

.timeline article {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 16px;
  padding: 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(31, 32, 68, 0.08);
}

.timeline article > span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: white;
  background: var(--accent);
  border-radius: 8px;
}

.timeline h3,
.timeline p,
.role-grid h3,
.role-grid p,
.pilot-board h3,
.pilot-board p {
  margin-top: 0;
}

.timeline p,
.info-panel p,
.info-panel li {
  color: var(--muted);
  line-height: 1.65;
}

.mini-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: white;
  background: var(--team);
  border-radius: 8px;
  font-weight: 800;
}

.section {
  padding: 66px clamp(18px, 5vw, 72px);
}

.section-heading {
  max-width: 820px;
  margin-bottom: 26px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 3rem);
  line-height: 1.05;
}

.section-heading p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.7;
}

.teams-shell {
  display: grid;
  grid-template-columns: 64px 260px minmax(0, 1fr) 300px;
  min-height: 650px;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.rail {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 10px;
  background: #f0f0f8;
}

.rail-button {
  width: 44px;
  height: 44px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.rail-button.active,
.rail-button:hover {
  color: white;
  background: var(--team);
}

.team-list {
  padding: 18px;
  background: #fafaff;
  border-right: 1px solid var(--line);
}

.team-list h3,
.team-list h4,
.workspace h3,
.coach h3,
.route-card h3,
.quiz-card h3 {
  margin-top: 0;
}

.team-item,
.channel {
  display: block;
  width: 100%;
  margin: 6px 0;
  padding: 10px 12px;
  color: var(--ink);
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.team-item.selected,
.channel.selected,
.team-item:hover,
.channel:hover {
  background: #e9e8fb;
}

.channels {
  margin-top: 24px;
}

.workspace {
  min-width: 0;
  padding: 22px;
}

.workspace-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

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

.tab {
  padding: 8px 12px;
  color: var(--muted);
  background: white;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}

.tab.active {
  color: white;
  background: var(--team);
  border-color: var(--team);
}

.composer {
  margin: 22px 0;
  padding: 18px;
  background: var(--soft);
  border-radius: 8px;
}

.composer label,
.plan-form label {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--muted);
  font-weight: 700;
}

textarea,
input,
select {
  width: 100%;
  padding: 12px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.field-help {
  margin: -2px 0 14px;
  font-size: 0.92rem;
}

.feed {
  display: grid;
  gap: 14px;
}

.post {
  padding: 16px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.tag {
  display: inline-flex;
  padding: 3px 8px;
  color: var(--team-dark);
  background: #ecebfb;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
}

.coach {
  padding: 22px;
  background: #fbfbff;
  border-left: 1px solid var(--line);
}

.coach p {
  color: var(--muted);
  line-height: 1.65;
}

.tip-box {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  padding: 14px;
  background: white;
  border-left: 4px solid var(--accent);
  border-radius: 8px;
}

.route-card {
  cursor: pointer;
}

.route-card:hover {
  border-color: var(--team);
  transform: translateY(-2px);
}

.route-detail {
  display: none;
  margin-top: 18px;
  padding: 24px;
}

.route-detail.show {
  display: block;
}

.route-detail ol,
.plan-output ul,
.sources ul {
  line-height: 1.8;
}

.planner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 22px;
  padding: 24px;
}

.plan-output {
  padding: 8px 8px 8px 0;
}

.plan-form {
  padding: 18px;
  background: var(--soft);
  border-radius: 8px;
}

.quiz-card {
  max-width: 780px;
  padding: 26px;
}

.answers {
  display: grid;
  gap: 10px;
}

.answer {
  padding: 14px;
  text-align: left;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.answer.correct {
  border-color: var(--ok);
  background: #ecfff4;
}

.answer.wrong {
  border-color: var(--warn);
  background: #fff4ec;
}

.feedback {
  min-height: 28px;
  color: var(--muted);
  font-weight: 700;
}

.sources ul {
  max-width: 820px;
  padding: 22px 22px 22px 42px;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 28px clamp(18px, 5vw, 72px);
  border-top: 1px solid var(--line);
}

@media (max-width: 1100px) {
  .teams-shell {
    grid-template-columns: 58px minmax(190px, 250px) minmax(0, 1fr);
  }

  .coach {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .planner,
  .hero,
  .instruction-layout,
  .calendar-plan {
    grid-template-columns: 1fr;
  }

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

  .info-panel {
    position: static;
  }
}

@media (max-width: 760px) {
  .topbar,
  footer,
  .workspace-top {
    align-items: stretch;
    flex-direction: column;
  }

  .intro-grid,
  .route-grid,
  .term-grid,
  .role-grid,
  .pilot-board {
    grid-template-columns: 1fr;
  }

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

  .rail {
    flex-direction: row;
    overflow-x: auto;
  }

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

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