/* Notera's reference-inspired layer. Shared by the React workspace and sign-in.
   Document previews remain paper-white; semantic safety states keep their meaning. */
@font-face {
  font-family: "Notera Display";
  src: url("/static/fonts/BarlowCondensed-Bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root[data-default-theme] {
  --font-ui: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: "Notera Display", "Arial Narrow", sans-serif;
  --blue: #23617e;
  --violet: #7045b2;
  --green: #286a42;
  --yellow: #806414;
  --pink: #a83267;
  --diagram-grid: #17171c12;
  --accent-wash: #9c7be014;
  --radius-sm: 6px;
  --radius: 9px;
  --radius-lg: 12px;
}

:root[data-default-theme][data-theme="dark"] {
  --ink: #f0eff1;
  --muted: #a4a3ad;
  --ground: #101011;
  --surface: #151517;
  --soft: #1a1a1d;
  --raised: #242428;
  --document-ground: #202023;
  --brand: #ecebf0;
  --brand-hover: #ffffff;
  --on-brand: #17171a;
  --brand-2: #1c2931;
  --brand-border: #476578;
  --accent-text: #a5d8f3;
  --secondary: #7f7d89;
  --on-secondary: #e7e5ec;
  --secondary-soft: #282333;
  --line: #303034;
  --control-line: #777580;
  --focus: #a5d8f3;
  --success: #99d9ab;
  --success-soft: #1c3023;
  --danger: #ffafbb;
  --danger-soft: #3a2029;
  --warn: #332d1a;
  --warn-text: #e9d080;
  --blue: #a5d8f3;
  --violet: #bba2fa;
  --green: #99d9ab;
  --yellow: #e9d080;
  --pink: #f195bd;
  --diagram-grid: #ffffff0d;
  --accent-wash: #9c7be00b;
}

body {
  -webkit-font-smoothing: antialiased;
}
::selection {
  background: var(--secondary-soft);
  color: var(--ink);
}
.topbar {
  min-height: 78px;
  padding: 14px clamp(20px, 3vw, 48px);
}
.brandtext strong {
  font-size: 25px;
  letter-spacing: -0.06em;
}
.brandtext .brand-description {
  font-size: 12px;
  letter-spacing: 0.015em;
}
.topbar > .local-label {
  margin-right: 24px;
}
.local-label > span {
  box-shadow: 0 0 0 4px var(--success-soft);
}
.theme-toggle {
  background: transparent;
  border-color: var(--line);
}
.theme-toggle > span {
  display: none;
}
.account {
  font-size: 12px;
}
.account button {
  border-color: var(--line);
}
.button {
  font-weight: 600;
}
.button.secondary {
  border-color: var(--control-line);
  background: transparent;
}
.button.secondary:hover:not(:disabled) {
  background: var(--soft);
}

#root .workspace-shell {
  max-width: 1680px;
  grid-template-columns: 194px minmax(0, 1fr);
  padding: 28px clamp(20px, 3vw, 48px) 40px;
  column-gap: 42px;
}
.navline {
  padding-right: 22px;
  gap: 20px;
}
.nav-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  margin-left: 12px;
}
.nav-label span {
  color: var(--violet);
  font-size: 16px;
  margin-left: 6px;
}
.tabs {
  gap: 6px;
}
.tab {
  font-size: 13px;
  padding: 12px;
  gap: 11px;
}
.tab[aria-current="page"] {
  color: var(--violet);
  background: var(--secondary-soft);
  border-color: var(--line);
}
.tab[data-section="learning"] svg {
  color: var(--green);
}
.tab[data-section="exams"] svg {
  color: var(--yellow);
}
.sidebar-note {
  padding: 20px 12px 0;
  margin-bottom: 12px;
}
.sidebar-note svg {
  color: var(--green);
}
.sidebar-note strong {
  font-size: 12px;
}
.sidebar-note p,
.sidebar-note .hint {
  font-size: 11px;
}
#root .task-pane {
  background: transparent;
  border: 0;
  max-height: none;
  overflow: visible;
}
#root .task-content {
  padding: 0;
}
.page-heading h1 {
  font-family: var(--font-display);
  font-size: 40px;
  line-height: 1.05;
}

.workspace-welcome {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 68px);
  align-items: center;
  padding: 25px 0 48px;
  margin-bottom: 36px;
  border-bottom: 1px solid var(--line);
}
.welcome-copy {
  min-width: 0;
}
.welcome-kicker {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--green);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.welcome-kicker > span {
  width: 6px;
  height: 6px;
  border: 1px solid currentColor;
  border-radius: 2px;
}
.welcome-copy h1,
.intro-copy h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(52px, 5.3vw, 82px);
  line-height: 0.98;
  letter-spacing: -0.025em;
  margin: 20px 0;
  text-wrap: initial;
}
.welcome-copy h1 em,
.intro-copy h1 em {
  color: var(--blue);
  font-style: normal;
  position: relative;
}
.welcome-copy > p:not(.welcome-kicker) {
  color: var(--muted);
  max-width: 43ch;
  font-size: 14px;
  line-height: 1.8;
  margin-block: 22px;
}
.welcome-link {
  display: inline-flex;
  align-items: center;
  gap: 20px;
  color: var(--ink);
  font-size: 12px;
  text-decoration: none;
  border-bottom: 1px solid var(--control-line);
  padding: 8px 0;
  min-height: 44px;
}
.welcome-link > span {
  color: var(--blue);
  font-size: 22px;
}
.welcome-link:hover {
  color: var(--blue);
}
.welcome-diagram {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 20px 65px #00000015;
  transform: rotate(-1deg);
}
.diagram-toolbar {
  height: 32px;
  display: flex;
  align-items: center;
  padding: 0 13px;
  gap: 5px;
  border-bottom: 1px solid var(--line);
}
.diagram-toolbar > span {
  width: 5px;
  height: 5px;
  background: var(--control-line);
  opacity: 0.7;
  border-radius: 50%;
}
.diagram-toolbar small {
  color: var(--muted);
  font-size: 8px;
  margin-left: 10px;
  letter-spacing: 0.035em;
}
.diagram-canvas {
  padding: 30px 26px 23px;
  position: relative;
  background-image: radial-gradient(var(--diagram-grid) 1px, transparent 1px);
  background-size: 14px 14px;
  border-radius: 0 0 8px 8px;
}
.diagram-node {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--control-line);
  border-radius: 5px;
  padding: 13px;
  max-width: 310px;
}
.diagram-node > div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.diagram-node small {
  color: var(--muted);
  font-size: 7px;
  line-height: 1.4;
  letter-spacing: 0.08em;
}
.diagram-node strong {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.9;
}
.diagram-node div > span {
  color: var(--muted);
  font-size: 8px;
  line-height: 1.5;
}
.node-icon {
  color: var(--violet);
  font-size: 24px;
  line-height: 1;
}
.diagram-node > i {
  margin-left: auto;
  color: var(--green);
  font-size: 14px;
  font-style: normal;
}
.node-prepare {
  margin-right: 32px;
  border-color: var(--violet);
}
.node-review {
  margin-left: 36px;
  border-color: var(--yellow);
}
.node-review .node-icon {
  color: var(--yellow);
}
.node-approve {
  margin-left: 12px;
  margin-right: 20px;
  border-color: var(--green);
}
.node-approve .node-icon {
  color: var(--green);
}
.diagram-connector {
  height: 27px;
  width: 32px;
  margin-left: 48px;
  border-left: 1px solid var(--violet);
  border-bottom: 1px solid var(--violet);
  position: relative;
}
.connector-first span {
  position: absolute;
  left: 10px;
  top: 3px;
  width: 170px;
  font: 8px/1.5 monospace;
  color: var(--muted);
}
.connector-second {
  margin-left: 70px;
  border-color: var(--green);
  border-bottom: 0;
}
.diagram-note {
  position: absolute;
  right: -10px;
  top: 8px;
  background: var(--violet);
  color: var(--ground);
  font: 8px/1.4 monospace;
  padding: 3px 6px;
  transform: rotate(3deg);
}
.diagram-annotation {
  display: block;
  margin: 11px 12px 0 0;
  color: var(--green);
  font:
    italic 11px/1.4 Georgia,
    serif;
  text-align: right;
}

#root .class-collection-heading {
  align-items: center;
  margin-bottom: 23px;
  scroll-margin-top: 24px;
}
.class-collection-heading .eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 9px;
  letter-spacing: 0.1em;
}
.section-marker {
  color: var(--green);
  background: var(--success-soft);
  border: 1px solid var(--green);
  border-radius: 3px;
  padding: 1px 4px;
  font-size: 9px;
}
.class-collection-heading h2 {
  font-family: var(--font-display);
  font-size: 40px;
  line-height: 1.1;
  margin: 9px 0;
  letter-spacing: -0.015em;
}
.heading-period {
  color: var(--green);
}
.class-collection-heading .hint {
  font-size: 12px;
}
#root .class-home-content {
  width: 100%;
}
#root .teaching-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 0 0 28px;
  padding: 18px 0;
  border-block: 1px solid var(--line);
}
.teaching-overview > div {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  border-right: 1px solid var(--line);
}
.teaching-overview > div:first-child {
  padding-left: 0;
}
.teaching-overview > div:last-child {
  border-right: 0;
}
.overview-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--violet);
  background: var(--accent-wash);
  font-size: 21px;
}
.teaching-overview > div:nth-child(2) .overview-icon {
  color: var(--blue);
}
.teaching-overview > div:nth-child(3) .overview-icon {
  color: var(--green);
}
.teaching-overview > div > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.teaching-overview strong {
  font-size: 25px;
  line-height: 1.1;
  font-weight: 500;
  letter-spacing: -0.04em;
}
.teaching-overview div > div > span {
  font-size: 10px;
  color: var(--muted);
}
#root .class-home-toolbar {
  gap: 16px;
}
#root .class-search {
  position: relative;
  width: min(100%, 340px);
}
.class-search svg {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  height: 17px;
  width: 17px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.5;
  pointer-events: none;
}
#root .class-search input {
  padding-left: 40px;
  margin-top: 0;
  background: var(--surface);
  border-color: var(--control-line);
}
#root .class-home-count {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 23px 0 14px;
  font-size: 10px;
  max-width: none;
}
.class-home-count > span {
  font: 9px/1.8 monospace;
}
#root .class-card-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 16px;
}
#root .class-tile {
  --tile-accent: var(--violet);
  grid-template-columns: 40px minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  align-items: start;
  column-gap: 13px;
  row-gap: 18px;
  background: var(--surface);
  border-radius: 7px;
  padding: 23px;
  min-height: 205px;
  position: relative;
  overflow: hidden;
}
.class-tile::before {
  content: "";
  position: absolute;
  width: 38px;
  top: 0;
  left: 23px;
  height: 2px;
  background: var(--tile-accent);
}
#root .class-tile:nth-child(3n + 2) {
  --tile-accent: var(--green);
}
#root .class-tile:nth-child(3n) {
  --tile-accent: var(--blue);
}
#root .class-tile:hover {
  border-color: var(--control-line);
  background: var(--soft);
}
#root .class-tile .class-initial {
  width: 40px;
  height: 40px;
  color: var(--tile-accent);
  background: var(--accent-wash);
  border-color: var(--line);
  font-size: 17px;
}
#root .class-tile-info {
  min-width: 0;
  padding-top: 2px;
}
#root .class-tile h2 {
  font-size: 15px;
  line-height: 1.4;
  font-weight: 600;
}
#root .class-tile p {
  font-size: 11px;
  margin-top: 7px;
}
.class-roster-state {
  grid-column: 1 / -1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--yellow);
  align-self: end;
}
.class-roster-state.is-verified {
  color: var(--green);
}
#root .class-tile > .button {
  grid-column: 1 / -1;
  width: 100%;
  justify-content: space-between;
  margin: 0;
  padding: 11px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
}
.class-tile > .button::after {
  content: "↗";
  color: var(--tile-accent);
}
.class-tile-actions .button {
  padding: 8px;
}
.empty-state {
  background: var(--surface);
}
#root .workflow-guide {
  grid-template-columns: 1fr;
  gap: 28px;
  margin-top: 42px;
  padding-top: 32px;
}
.workflow-guide h2 {
  font-family: var(--font-display);
  font-size: 34px;
  line-height: 1.1;
}
.workflow-guide h2 em {
  color: var(--violet);
  font-style: normal;
}
.workflow-guide .eyebrow {
  color: var(--violet);
}
#root .workflow-guide .hint {
  max-width: none;
  font-size: 12px;
}
#root .workflow-guide ol {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.workflow-guide li {
  position: relative;
  gap: 12px;
}
.workflow-guide li > span {
  color: var(--green);
  border-color: var(--green);
  border-radius: 5px;
  font-family: monospace;
}
.workflow-guide li:nth-child(2) > span {
  color: var(--violet);
  border-color: var(--violet);
}
.workflow-guide li:nth-child(3) > span {
  color: var(--yellow);
  border-color: var(--yellow);
}
.workflow-guide li p {
  line-height: 1.7;
  font-size: 11px;
}
.workflow-guide li strong {
  font-size: 12px;
}

/* Sign-in uses the same visual language without changing authentication. */
.login-page {
  background-image: radial-gradient(var(--diagram-grid) 1px, transparent 1px);
  background-size: 22px 22px;
}
.login-shell {
  max-width: 1120px;
  border-radius: 10px;
  box-shadow: 0 24px 100px #00000020;
}
.login-intro {
  background: var(--ground);
  position: relative;
  gap: 42px;
  padding: 48px;
}
.login-intro::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 45%;
  height: 2px;
  background: var(--blue);
}
.intro-copy .eyebrow {
  color: var(--green);
  font-size: 10px;
}
.intro-copy h1 {
  font-size: clamp(56px, 5.2vw, 76px);
}
.intro-copy > p:not(.eyebrow) {
  font-size: 13px;
  line-height: 1.8;
  max-width: 40ch;
}
.login-steps {
  gap: 0;
  margin-top: 30px;
}
.login-steps li {
  position: relative;
  padding: 0 0 25px;
  gap: 16px;
}
.login-steps li:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 29px;
  bottom: 4px;
  border-left: 1px dashed var(--line);
}
.login-steps li > span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border: 1px solid var(--violet);
  border-radius: 5px;
  color: var(--violet);
  font: 10px monospace;
  padding: 0;
}
.login-steps li:nth-child(2) > span {
  color: var(--yellow);
  border-color: var(--yellow);
}
.login-steps li:nth-child(3) > span {
  color: var(--green);
  border-color: var(--green);
}
.login-steps strong {
  font-size: 12px;
  line-height: 1.7;
}
.login-steps p {
  font-size: 11px;
  line-height: 1.7;
}
.intro-footer {
  font-size: 10px;
}
.intro-footer > span {
  color: var(--violet);
  font-size: 20px;
  margin-right: 6px;
}
.login-card {
  padding: 42px;
}
.login-card h2 {
  font-family: var(--font-display);
  font-size: 40px;
  line-height: 1.1;
  margin-top: 36px;
}
.login-card .local-label {
  font-size: 10px;
}
.login-card > .hint {
  font-size: 12px;
}
.login-card label {
  font-size: 12px;
}
.login-card input {
  background: var(--ground);
}
.login-note {
  font-size: 11px;
  border-left: 2px solid var(--violet);
  border-top: 0;
  padding: 0 0 0 14px;
  margin-top: 24px;
}
.login-note strong {
  color: var(--violet);
}
.login-note p {
  line-height: 1.7;
}

@media (max-width: 1199px) {
  #root .workspace-shell {
    grid-template-columns: 166px minmax(0, 1fr);
    column-gap: 28px;
    padding-inline: 24px;
  }
  .navline {
    padding-right: 16px;
  }
  .workspace-welcome {
    gap: 24px;
  }
  .welcome-copy h1 {
    font-size: 62px;
  }
  .diagram-canvas {
    padding-inline: 18px;
  }
  .diagram-node {
    padding: 10px;
    gap: 8px;
  }
  #root .workspace-shell:has(#exam-workspace:not([hidden])) {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 999px) {
  .workspace-welcome {
    grid-template-columns: 1fr;
  }
  .welcome-copy h1 {
    font-size: 72px;
  }
  .welcome-copy > p:not(.welcome-kicker) {
    max-width: 50ch;
  }
  .welcome-diagram {
    width: min(100%, 460px);
    justify-self: center;
    margin-block: 8px;
    transform: none;
  }
  .diagram-node {
    max-width: none;
  }
  .teaching-overview > div {
    padding-inline: 12px;
    gap: 10px;
  }
  .overview-icon {
    display: none;
  }
  #root .workflow-guide ol {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .login-intro {
    padding: 32px;
  }
  .login-card {
    padding: 30px;
  }
}
@media (max-width: 760px) {
  .topbar {
    min-height: 70px;
    padding: 12px 20px;
    gap: 12px;
    flex-wrap: nowrap;
  }
  .brandtext {
    flex-basis: auto;
  }
  .brandtext strong {
    font-size: 23px;
  }
  .topbar-actions {
    gap: 8px;
  }
  .account button {
    padding-inline: 10px;
  }
  #root .workspace-shell {
    display: block;
    padding: 18px 20px 40px;
  }
  .navline {
    gap: 0;
    padding: 0;
  }
  .tabs {
    flex-wrap: wrap;
    gap: 4px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 16px;
  }
  .tab {
    font-size: 12px;
    gap: 7px;
    padding: 10px;
  }
  .tab svg {
    width: 16px;
    height: 16px;
  }
  .workspace-welcome {
    padding: 14px 0 32px;
    margin-bottom: 28px;
    gap: 24px;
  }
  .welcome-copy h1 {
    font-size: clamp(54px, 12vw, 72px);
  }
  .welcome-copy > p:not(.welcome-kicker) {
    font-size: 13px;
    line-height: 1.8;
  }
  .welcome-kicker {
    font-size: 9px;
  }
  #root .class-collection-heading {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 16px;
    align-items: end;
  }
  .class-collection-heading h2 {
    font-size: 36px;
  }
  .class-collection-heading .hint {
    max-width: 35ch;
  }
  .class-collection-heading > .button {
    width: auto;
  }
  .teaching-overview strong {
    font-size: 24px;
  }
  .teaching-overview div > div > span {
    font-size: 9px;
  }
  #root .class-home-toolbar {
    flex-direction: row;
    align-items: center;
  }
  #root .class-home-toolbar > .button {
    flex-shrink: 0;
    padding-inline: 10px;
  }
  .class-home-count > span {
    display: none;
  }
  .login-page {
    padding: 20px;
  }
  .login-shell {
    max-width: 500px;
  }
  .login-intro {
    padding: 28px;
    gap: 28px;
  }
  .intro-copy h1 {
    font-size: 64px;
  }
  .login-card {
    padding: 28px;
  }
  .login-card h2 {
    margin-top: 24px;
  }
}
@media (max-width: 400px) {
  #root .workspace-shell {
    padding-inline: 16px;
  }
  .topbar {
    padding-inline: 16px;
  }
  .tab {
    padding: 9px 7px;
    gap: 5px;
  }
  .tab svg {
    width: 14px;
  }
  .diagram-canvas {
    padding-inline: 14px;
  }
  .diagram-node strong {
    font-size: 12px;
  }
  .diagram-node div > span {
    font-size: 7px;
  }
  .node-prepare {
    margin-right: 14px;
  }
  .node-review {
    margin-left: 20px;
  }
  .node-approve {
    margin-inline: 4px;
  }
  #root .class-home-toolbar {
    flex-wrap: wrap;
  }
  #root .class-search {
    width: 100%;
  }
  .login-page {
    padding: 12px;
  }
  .login-intro,
  .login-card {
    padding: 24px;
  }
  .intro-copy h1 {
    font-size: 56px;
  }
}
