:root {
  --ink: #263238;
  --paper: #f0f4f8;
  --paper-strong: #ffffff;
  --green: #00a676;
  --yellow: #ffcf56;
  --rose: #ef476f;
  --line: rgba(38, 50, 56, 0.14);
  --muted: rgba(38, 50, 56, 0.68);
  --shadow: 0 18px 46px rgba(38, 50, 56, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  min-height: 100%;
  margin: 0;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
  background:
    linear-gradient(rgba(38, 50, 56, 0.038) 1px, transparent 1px),
    linear-gradient(90deg, rgba(38, 50, 56, 0.038) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
}

.side {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 28px;
  padding: 24px;
  border-right: 1px solid var(--line);
  background: rgba(240, 244, 248, 0.92);
  backdrop-filter: blur(18px);
}

.brand {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 12px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand img {
  width: 46px;
  height: 46px;
}

.brand strong {
  display: block;
  font-size: 18px;
  line-height: 1;
}

.brand small,
.side__note small,
.metric small,
.session__meta,
.assignment small,
.resource-row span,
.block small,
.rail__body span {
  color: var(--muted);
}

.nav {
  display: grid;
  align-content: start;
  gap: 8px;
}

.nav__item {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.nav__item:hover,
.nav__item.is-active {
  border-color: var(--line);
  background: var(--paper-strong);
}

.nav__item.is-active {
  box-shadow: inset 4px 0 0 var(--green);
}

.side__note {
  display: grid;
  gap: 6px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
}

.side__note strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.main {
  min-width: 0;
  padding: 28px clamp(16px, 3vw, 42px) 42px;
}

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

.eyebrow,
.mono,
.version,
.session__time,
.tag,
.chip,
.resource-row header span {
  margin: 0;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.eyebrow {
  color: var(--green);
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(28px, 4vw, 52px);
  line-height: 0.98;
  max-width: 780px;
}

h2 {
  margin-bottom: 0;
  font-size: 22px;
  line-height: 1.15;
}

h3 {
  margin-bottom: 7px;
  font-size: 16px;
  line-height: 1.25;
}

.search {
  display: grid;
  gap: 6px;
  min-width: min(320px, 100%);
}

.search label {
  font-size: 12px;
  color: var(--muted);
}

.search input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--paper-strong);
  color: var(--ink);
  outline: none;
}

.search input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(0, 166, 118, 0.14);
}

.status-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  margin-bottom: 18px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  font-size: 13px;
  color: var(--muted);
}

.status-line.is-ok {
  color: #087b5c;
}

.status-line.is-warn {
  color: #936600;
}

.pulse {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(0, 166, 118, 0.32);
  animation: ping 1.8s infinite;
}

.status-line.is-warn .pulse {
  background: var(--yellow);
}

.workspace {
  display: grid;
  gap: 18px;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
  box-shadow: var(--shadow);
}

.metric {
  display: grid;
  gap: 8px;
  min-height: 124px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.86);
}

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

.metric strong {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 0.95;
}

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

.notebook-grid__main,
.notebook-grid__side,
.assignment-list,
.detail-sheet,
.calendar-board,
.report {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.notebook-grid__main,
.assignment-list,
.calendar-board,
.report {
  padding: 18px;
}

.notebook-grid__side {
  padding: 14px;
}

.section-head,
.lane__head,
.resource-row header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-head {
  margin-bottom: 16px;
}

.version {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  white-space: nowrap;
}

.lanes {
  display: grid;
  grid-template-columns: repeat(4, minmax(168px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.lane {
  min-width: 168px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(240, 244, 248, 0.76);
}

.lane__head {
  min-height: 48px;
  padding: 10px;
  border-bottom: 1px dashed var(--line);
}

.lane__head span {
  font-size: 12px;
  color: var(--muted);
}

.lane__body {
  display: grid;
  gap: 8px;
  min-height: 220px;
  padding: 10px;
  align-content: start;
}

.session {
  display: grid;
  gap: 8px;
  width: 100%;
  min-height: 152px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
  color: var(--ink);
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.session:hover,
.block:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 166, 118, 0.45);
  box-shadow: 0 12px 24px rgba(38, 50, 56, 0.12);
}

.session.is-selected {
  outline: 2px solid rgba(0, 166, 118, 0.28);
}

.session--conflict,
.block--conflict {
  background: linear-gradient(135deg, #fff, rgba(239, 71, 111, 0.13));
  border-color: rgba(239, 71, 111, 0.38);
}

.session--watch,
.block--watch {
  background: linear-gradient(135deg, #fff, rgba(255, 207, 86, 0.22));
  border-color: rgba(255, 207, 86, 0.72);
}

.session__time {
  color: var(--green);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.chip,
.tag {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-style: normal;
}

.chip--resource {
  background: rgba(0, 166, 118, 0.12);
}

.chip--status {
  background: rgba(255, 207, 86, 0.26);
}

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

.rail__step {
  display: grid;
  grid-template-columns: 34px 1fr 48px;
  align-items: center;
  gap: 10px;
  min-height: 82px;
  padding: 12px;
  border-radius: 8px;
  background: var(--paper);
}

.rail__number {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  color: var(--green);
}

.bar {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(38, 50, 56, 0.12);
}

.bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--yellow));
}

.assignment-list {
  display: grid;
  gap: 10px;
}

.assignment {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 116px;
  gap: 14px;
  align-items: center;
  min-height: 130px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(240, 244, 248, 0.62);
}

.assignment p {
  margin-bottom: 8px;
  color: var(--muted);
}

.assignment--blocked {
  border-color: rgba(239, 71, 111, 0.42);
}

.assignment__score {
  display: grid;
  justify-items: end;
  gap: 7px;
}

.assignment__score strong {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 30px;
}

.assignment__score span {
  color: var(--muted);
  font-size: 12px;
}

.assignment__score button,
.primary-action {
  min-height: 36px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  background: var(--ink);
  color: var(--paper);
}

.assignment__score button:disabled,
.primary-action:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.detail-sheet {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 1px;
  overflow: hidden;
  background: var(--line);
}

.detail-sheet__main,
.detail-sheet__side {
  min-height: 280px;
  padding: 22px;
  background: rgba(255, 255, 255, 0.9);
}

.detail-sheet__main h2 {
  margin-top: 8px;
  font-size: clamp(26px, 4vw, 42px);
}

.facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 10px;
  margin: 24px 0;
}

.facts div {
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.facts dt {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.facts dd {
  margin: 0;
  font-weight: 700;
}

.mini-task {
  display: grid;
  gap: 6px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
}

.mini-task span {
  color: var(--muted);
}

.calendar-board {
  display: grid;
  gap: 12px;
}

.legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

.legend i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--rose);
}

.resource-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 12px;
  min-height: 96px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(240, 244, 248, 0.72);
}

.resource-row header {
  align-items: start;
  flex-direction: column;
  justify-content: center;
}

.resource-row__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(170px, 1fr);
  gap: 10px;
  overflow-x: auto;
}

.block {
  display: grid;
  gap: 5px;
  min-height: 72px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
  color: var(--ink);
  text-align: left;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.block span {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  color: var(--green);
}

.report__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
}

.report-line {
  display: grid;
  gap: 10px;
  min-height: 156px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.report-line b {
  align-self: end;
}

.callout {
  margin-top: 14px;
  padding: 16px;
  border-left: 5px solid var(--green);
  border-radius: 8px;
  background: rgba(0, 166, 118, 0.1);
}

.callout p {
  margin-bottom: 0;
  color: var(--muted);
}

.empty,
.loading {
  margin: 0;
  padding: 18px;
  color: var(--muted);
}

@keyframes ping {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 166, 118, 0.32);
  }
  70% {
    box-shadow: 0 0 0 9px rgba(0, 166, 118, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 166, 118, 0);
  }
}

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

  .side {
    position: static;
    height: auto;
    grid-template-columns: 1fr;
    padding: 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav {
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    overflow-x: auto;
  }

  .side__note {
    display: none;
  }

  .notebook-grid,
  .detail-sheet {
    grid-template-columns: 1fr;
  }

  .metric-strip,
  .report__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .topbar {
    display: grid;
  }

  .metric-strip,
  .report__grid,
  .facts {
    grid-template-columns: 1fr;
  }

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

  .assignment__score {
    justify-items: start;
  }

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

  .section-head {
    align-items: start;
    flex-direction: column;
  }
}
