@font-face {
  font-family: DM Sans;
  src: url(/fonts/dm.woff2) format("woff2");
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
}
@font-face {
  font-family: Instrument Serif;
  src: url(/fonts/serif.woff2) format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Instrument Serif;
  src: url(/fonts/serif-italic.woff2) format("woff2");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}

:root {
  --paper: #f6f7f1;
  --surface: #fff;
  --ink: #172820;
  --muted: #53635a;
  --line: #dde3d8;
  --forest: #1a392b;
  --deep: #10271e;
  --lime: #d9ef9c;
  --mint: #e7eee2;
  --danger: #9f362a;
  --display: "Instrument Serif", Georgia, serif;
  --sans: "DM Sans", system-ui, sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font: 1rem/1.5 var(--sans);
  color: var(--ink);
  background: var(--paper);
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.53;
}
a {
  color: inherit;
  text-decoration: none;
}
a,
button,
input,
select {
  outline-offset: 4px;
}
:focus-visible {
  outline: 2px solid #478461;
}
img,
canvas {
  display: block;
  max-width: 100%;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 0.99;
}
p {
  color: var(--muted);
}
[hidden] {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 9;
  clip-path: inset(50%);
  background: white;
  padding: 10px 16px;
  border-radius: 10px;
}
.skip-link:focus {
  clip-path: none;
}
.icon {
  width: 20px;
  height: 20px;
  flex: none;
  vertical-align: middle;
  color: inherit;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  width: max-content;
  font-size: 1.19rem;
  font-weight: 750;
  letter-spacing: -0.045em;
}
.brand img {
  width: 38px;
  height: 38px;
}
.brand span {
  display: block;
}
.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 9px;
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 0.94rem;
  text-align: center;
  white-space: normal;
}
.button.primary {
  background: var(--forest);
  color: #fff;
}
.button.primary:hover {
  background: #28523c;
}
.button.secondary {
  background: var(--surface);
  border-color: var(--line);
}
.button.secondary:hover,
.icon-button:hover {
  background: #edf1e8;
}
.button.light {
  color: var(--deep);
  background: var(--lime);
}
.button.light:hover {
  background: #e8f8ba;
}
.button.text {
  color: var(--forest);
  padding-inline: 7px;
  background: transparent;
}
.button.text:hover {
  text-decoration: underline;
}
.button.danger {
  color: var(--danger);
}
.icon-button {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}
.notice {
  padding: 13px 15px;
  background: #edf2e8;
  border-radius: 9px;
  color: var(--forest);
}
.notice.error {
  background: #fbece7;
  color: var(--danger);
}
.form {
  display: grid;
  gap: 18px;
}
.field {
  display: grid;
  gap: 7px;
}
.field label,
.field-label {
  font-size: 0.92rem;
  font-weight: 710;
}
.field input,
.field select,
.search input {
  width: 100%;
  min-height: 48px;
  padding: 10px 13px;
  border: 1px solid #d6ded2;
  border-radius: 9px;
  background: white;
  outline-offset: 2px;
}
.field input::placeholder,
.search input::placeholder {
  color: #627168;
}
.field small {
  font-size: 0.84rem;
  color: var(--muted);
}
.password {
  position: relative;
}
.password input {
  padding-right: 48px;
}
.password button {
  position: absolute;
  right: 4px;
  top: 2px;
  height: 44px;
  width: 44px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  border-radius: 8px;
  color: var(--muted);
}
.stack {
  display: grid;
  gap: 14px;
}
.loading {
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--muted);
}
.eyebrow {
  font-size: 0.85rem;
  font-weight: 750;
  letter-spacing: 0.105em;
  text-transform: uppercase;
  color: var(--forest);
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  max-width: 100%;
  padding: 5px 9px;
  border-radius: 99px;
  background: var(--mint);
  color: var(--forest);
  font-size: 0.82rem;
  line-height: 1.2;
  font-weight: 680;
}
.badge .icon {
  width: 15px;
  height: 15px;
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(390px, 1fr);
  min-height: 100svh;
  padding: 16px;
  gap: 16px;
}
.auth-art {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 650px;
  overflow: hidden;
  padding: 35px clamp(28px, 4.2vw, 68px);
  border-radius: 21px;
  color: #f5f7eb;
  background: #10251d url(/atlas.webp) 62% center/cover no-repeat;
}
.auth-art::before,
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.auth-art::before {
  background:
    linear-gradient(
      180deg,
      #0d2118a3 0%,
      transparent 35%,
      #10251db0 73%,
      #10251d 100%
    ),
    linear-gradient(90deg, #0d211838, transparent 75%);
}
.auth-art > * {
  position: relative;
}
.auth-art .brand {
  font-size: 1.37rem;
}
.auth-caption {
  display: grid;
  gap: 17px;
  margin-bottom: 19px;
  max-width: 550px;
}
.auth-caption .eyebrow {
  color: var(--lime);
}
.auth-caption h2 {
  font-size: clamp(3.7rem, 6vw, 6.45rem);
  letter-spacing: -0.035em;
}
.auth-caption em {
  font-weight: 400;
  color: var(--lime);
}
.auth-caption p {
  color: #e0eadc;
  max-width: 29rem;
}
.auth-main {
  display: grid;
  place-items: center;
  padding: 42px clamp(25px, 6vw, 88px);
}
.auth-card {
  width: min(100%, 400px);
  display: grid;
  gap: 26px;
}
.auth-heading {
  display: grid;
  gap: 11px;
}
.auth-heading h1 {
  font-size: clamp(3.15rem, 4.7vw, 4.35rem);
  letter-spacing: -0.035em;
}
.auth-switch {
  color: var(--muted);
  text-align: center;
  font-size: 0.96rem;
}
.auth-switch a {
  color: var(--forest);
  font-weight: 760;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.mobile-brand {
  display: none;
}
.pending-symbol {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background: var(--lime);
  color: var(--forest);
}
.pending-symbol .icon {
  width: 28px;
  height: 28px;
}

.shell {
  min-height: 100svh;
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
}
.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100svh;
  background: #fff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 27px 19px 19px;
  gap: 34px;
}
.sidebar .brand {
  margin-left: 7px;
}
.nav {
  display: grid;
  gap: 7px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  border-radius: 10px;
  padding: 10px 13px;
  color: var(--muted);
  font-weight: 680;
  font-size: 0.94rem;
}
.nav-link:hover {
  background: #f2f5ef;
  color: var(--forest);
}
.nav-link[aria-current="page"] {
  background: #e5eddf;
  color: var(--forest);
  font-weight: 780;
}
.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 13px;
}
.sidebar-progress {
  display: grid;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
}
.sidebar-progress span {
  font-size: 0.86rem;
  color: var(--muted);
}
.sidebar-progress strong {
  font-size: 0.9rem;
}
.progress-track {
  height: 6px;
  border-radius: 20px;
  overflow: hidden;
  background: #e7eee2;
}
.progress-track span {
  display: block;
  height: 100%;
  background: #759554;
  border-radius: 20px;
}
.user-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0 3px 5px;
  min-width: 0;
}
.avatar {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  flex: none;
  border-radius: 50%;
  background: #efefe2;
  color: #3f5334;
  font-size: 0.87rem;
  font-weight: 800;
}
.user-text {
  min-width: 0;
  flex: 1;
}
.user-text strong,
.user-text span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-text strong {
  font-size: 0.89rem;
}
.user-text span {
  font-size: 0.78rem;
  color: var(--muted);
}
.user-bar .icon-button {
  width: 38px;
  height: 38px;
  border-color: transparent;
}
.main-column {
  min-width: 0;
}
.topbar {
  min-height: 64px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px clamp(20px, 4vw, 54px);
  gap: 12px;
}
.topbar-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.91rem;
  font-weight: 650;
}
.topbar-label .icon {
  width: 18px;
  height: 18px;
}
.topbar .mobile-signout {
  display: none;
}
.screen {
  width: min(100%, 1450px);
  margin-inline: auto;
  padding: 28px clamp(20px, 4vw, 54px) 48px;
}
.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: 285px;
  overflow: hidden;
  border-radius: 19px;
  padding: 31px clamp(23px, 4.6vw, 62px);
  background: #12291f;
  color: #fff;
}
.hero::before {
  z-index: -1;
  background:
    linear-gradient(90deg, #12291f 6%, #12291f 28%, #12291f6b 64%, #12291f1c),
    url(/atlas.webp) right 47% / min(75%, 820px) auto no-repeat;
}
.hero-content {
  display: grid;
  justify-items: start;
  gap: 15px;
  max-width: 34rem;
}
.hero .eyebrow {
  color: var(--lime);
}
.hero h1 {
  font-size: clamp(3.4rem, 5.5vw, 5.6rem);
  letter-spacing: -0.035em;
}
.hero p {
  color: #e2ebe0;
  max-width: 29rem;
}
.hero .button {
  margin-top: 2px;
}
.section {
  display: grid;
  gap: 18px;
  margin-top: 34px;
}
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}
.section-heading h2 {
  font-size: clamp(2.45rem, 4.1vw, 3.4rem);
  letter-spacing: -0.025em;
}
.section-heading p,
.page-heading p {
  margin-top: 7px;
}
.search {
  position: relative;
  display: block;
  flex: 0 1 285px;
  width: 100%;
  max-width: 285px;
}
.search .icon {
  position: absolute;
  left: 13px;
  top: 14px;
  color: var(--muted);
  width: 18px;
  height: 18px;
  pointer-events: none;
}
.search input {
  padding-left: 40px;
}
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.filter {
  min-height: 40px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 7px 13px;
  border-radius: 99px;
  font-size: 0.88rem;
  font-weight: 680;
}
.filter:hover {
  background: #edf2e9;
}
.filter[aria-pressed="true"] {
  background: var(--forest);
  border-color: var(--forest);
  color: white;
}
.topic-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
}
.topic-card {
  position: relative;
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 184px;
  padding: 17px 17px 15px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: white;
  transition:
    border-color 0.18s,
    box-shadow 0.18s,
    transform 0.18s;
}
.topic-card:hover {
  border-color: #9aaf92;
  box-shadow: 0 8px 20px #1a392b0a;
  transform: translateY(-2px);
}
.topic-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
}
.topic-icon {
  display: grid;
  place-items: center;
  width: 41px;
  height: 41px;
  flex: none;
  border-radius: 11px;
  background: #e9f0df;
  color: #406044;
}
.topic-icon.tissue {
  background: #eee9f5;
  color: #67527e;
}
.topic-icon.systems {
  background: #f1eddf;
  color: #695b3b;
}
.topic-meta {
  font-size: 0.84rem;
  color: var(--muted);
  font-weight: 680;
}
.topic-card h3 {
  font-size: 1.08rem;
  line-height: 1.26;
  letter-spacing: -0.018em;
}
.topic-card p {
  font-size: 0.91rem;
  line-height: 1.42;
}
.topic-card .topic-bottom {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
}
.topic-bottom .icon {
  width: 15px;
  height: 15px;
}
.empty {
  padding: 24px;
  border: 1px dashed #c9d4c5;
  border-radius: 12px;
  text-align: center;
  color: var(--muted);
}

.page-heading {
  display: grid;
  gap: 10px;
  margin-bottom: 25px;
  max-width: 790px;
}
.page-heading h1 {
  font-size: clamp(3.2rem, 6vw, 5rem);
  letter-spacing: -0.035em;
}
.page-heading .eyebrow {
  font-size: 0.85rem;
}
.breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  max-width: 100%;
  margin-bottom: 17px;
  color: var(--forest);
  font-size: 0.92rem;
  font-weight: 720;
}
.breadcrumb:hover {
  text-decoration: underline;
}
.breadcrumb .icon {
  width: 17px;
  height: 17px;
}
.resource-list {
  display: grid;
  gap: 10px;
}
.resource {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.resource-copy {
  min-width: min(100%, 170px);
  flex: 1;
}
.resource-copy h3 {
  font-size: 1rem;
}
.resource-copy p {
  font-size: 0.88rem;
}
.resource-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}
.resource.selected {
  border-color: #839e7b;
}
.reader {
  scroll-margin-top: 68px;
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 13px;
  overflow: hidden;
  background: #fff;
}
.reader-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
}
.reader-heading h2 {
  font-size: clamp(1.7rem, 4vw, 2.35rem);
  line-height: 1.12;
}
.reader-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}
.reader-controls .icon-button {
  width: 40px;
  height: 40px;
}
.page-input {
  width: 58px;
  height: 40px;
  padding: 3px 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: center;
  background: #fff;
}
.reader-zoom {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: 8px;
}
.reader .canvas-wrap {
  min-height: 240px;
  max-height: min(74vh, 840px);
  max-height: min(74svh, 840px);
  padding: 14px;
  overflow: auto;
  background: #e5eae2;
}
.canvas-wrap canvas {
  max-width: none;
  margin: auto;
  box-shadow: 0 6px 20px #12291f1f;
  background: #fff;
}
.reader-message {
  padding: 36px 14px;
  text-align: center;
}
.reader-message.error {
  color: var(--danger);
}
.reader-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 15px;
}
.reader-footer p {
  font-size: 0.88rem;
}
.reader-footer .button {
  min-height: 40px;
}
.admin-list {
  display: grid;
  max-width: 820px;
  gap: 10px;
}
.admin-user {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.admin-copy {
  min-width: min(200px, 100%);
  flex: 1;
  overflow-wrap: anywhere;
}
.admin-copy p {
  font-size: 0.89rem;
}
.admin-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.badge.pending {
  background: #f4ebd1;
  color: #654e13;
}
.badge.rejected {
  background: #f6e9e5;
  color: #813f36;
}
.practice-panel {
  display: grid;
  gap: 24px;
  max-width: 660px;
  padding: clamp(17px, 4vw, 30px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.practice-panel fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}
.practice-panel legend {
  margin-bottom: 8px;
  font-weight: 720;
}
.difficulties {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.difficulty {
  position: relative;
}
.difficulty input {
  position: absolute;
  inset: auto;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.difficulty span {
  display: grid;
  justify-items: center;
  gap: 5px;
  text-align: center;
  padding: 12px 6px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 0.91rem;
  font-weight: 690;
  cursor: pointer;
}
.difficulty input:checked + span {
  background: var(--mint);
  border-color: #75936d;
  color: var(--forest);
}
.difficulty input:focus-visible + span {
  outline: 2px solid #478461;
  outline-offset: 3px;
}
.practice-panel select {
  appearance: none;
  padding-right: 38px;
}
.select-wrap {
  position: relative;
}
.select-wrap .icon {
  position: absolute;
  right: 12px;
  top: 14px;
  pointer-events: none;
}

@media (max-width: 1110px) {
  .shell {
    grid-template-columns: 195px minmax(0, 1fr);
  }
  .sidebar {
    padding-inline: 13px;
  }
  .topic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 800px) {
  .auth-layout {
    grid-template-columns: 1fr 1fr;
    padding: 9px;
    gap: 6px;
  }
  .auth-art {
    padding: 25px;
    min-height: 600px;
  }
  .auth-main {
    padding: 30px 26px;
  }
  .auth-caption h2 {
    font-size: 3.9rem;
  }
  .shell {
    display: block;
  }
  .sidebar {
    height: auto;
    position: sticky;
    top: 0;
    z-index: 4;
    flex-direction: row;
    align-items: center;
    gap: 11px;
    padding: 8px 13px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    justify-content: space-between;
  }
  .sidebar .brand {
    margin: 0;
  }
  .sidebar .brand img {
    width: 34px;
    height: 34px;
  }
  .sidebar .nav {
    display: flex;
    gap: 4px;
  }
  .nav-link {
    gap: 6px;
    min-height: 40px;
    padding: 7px 8px;
    font-size: 0.82rem;
  }
  .nav-link .icon {
    width: 16px;
    height: 16px;
  }
  .sidebar-footer {
    display: none;
  }
  .topbar {
    min-height: 50px;
    padding-block: 4px;
  }
  .topbar .mobile-signout {
    display: inline-grid;
    width: 38px;
    height: 38px;
  }
  .screen {
    padding-top: 20px;
  }
}
@media (max-width: 600px) {
  .auth-layout {
    display: block;
    padding: 0;
  }
  .auth-art {
    display: none;
  }
  .auth-main {
    place-items: start center;
    min-height: 100svh;
    padding: 27px 23px 44px;
  }
  .auth-card {
    gap: 23px;
  }
  .mobile-brand {
    display: inline-flex;
    margin-bottom: 16px;
  }
  .sidebar .brand span {
    display: none;
  }
  .nav-link {
    white-space: nowrap;
  }
  .topbar {
    padding-inline: 16px;
  }
  .screen {
    padding-inline: 14px;
    padding-bottom: 32px;
  }
  .hero {
    min-height: 246px;
    border-radius: 14px;
    padding: 22px 17px;
  }
  .hero::before {
    background:
      linear-gradient(90deg, #12291f 14%, #12291fdd 40%, #12291f3d 100%),
      url(/atlas.webp) 60% center/cover no-repeat;
  }
  .hero-content {
    gap: 12px;
  }
  .hero h1 {
    font-size: 3.7rem;
  }
  .hero p {
    max-width: 20rem;
  }
  .section {
    margin-top: 25px;
    gap: 13px;
  }
  .section-heading {
    display: grid;
    align-items: start;
    gap: 10px;
  }
  .search {
    max-width: none;
  }
  .filter-bar {
    gap: 5px;
  }
  .filter {
    padding-inline: 9px;
    font-size: 0.82rem;
  }
  .topic-grid {
    gap: 8px;
  }
  .topic-card {
    padding: 11px;
    gap: 8px;
    min-height: 178px;
  }
  .topic-card h3 {
    font-size: 1rem;
  }
  .topic-card p {
    font-size: 0.86rem;
  }
  .topic-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
  }
  .topic-icon .icon {
    width: 18px;
    height: 18px;
  }
  .topic-meta {
    font-size: 0.76rem;
  }
  .resource {
    gap: 9px;
    padding: 11px;
  }
  .resource-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .resource-actions .button {
    min-height: 40px;
  }
}
@media (max-width: 330px) {
  .nav-link {
    padding-inline: 5px;
  }
  .nav-link .icon {
    display: none;
  }
  .topic-grid {
    grid-template-columns: 1fr;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
