:root {
  color-scheme: light;
  --ink: #17283a;
  --slate: #4a5c6e;
  --accent: #096754;
  --accent-hover: #07513f;
  --soft: #e5f3ed;
  --line: #dce4eb;
  --control-line: #92a2b1;
  --canvas: #f3f6f9;
  --surface: #fff;
  --focus: #19755f;
  --radius: 14px;
  --nav-bg: #172b40;
  --nav-text: #d2dbe5;
  --header-height: 66px;
  font-family: "Inter", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  scroll-padding-top: var(--header-height);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  line-height: 1.65;
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

body > header {
  position: sticky;
  top: 0;
  z-index: 10;
  color: #fff;
  background: var(--nav-bg);
}

.shell {
  width: min(1280px, calc(100% - 56px));
  margin-inline: auto;
}

.top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 16px;
  min-height: 62px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 750;
}

.mark {
  display: grid;
  flex: none;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 9px;
  color: #fff;
  background: #137560;
}

.top nav {
  display: flex;
  gap: 4px;
}

.main-nav {
  justify-self: start;
  margin-inline-start: 8px;
}

.top .personal-nav {
  padding-inline-start: 12px;
  border-inline-start: 1px solid #40586d;
}

.subnav-band {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.product-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 48px;
  padding-block: 4px;
}

.nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--nav-text);
  font-size: .9375rem;
  font-weight: 600;
  white-space: nowrap;
}

.nav:hover,
.nav.active,
.nav[aria-current="page"] {
  color: #fff;
  background: #30495f;
}

.nav.active,
.nav[aria-current="page"] {
  box-shadow: inset 0 -2px #87dabc;
}

.product-nav .nav {
  min-height: 36px;
  color: var(--slate);
}

.product-nav .nav:hover,
.product-nav .nav.active {
  color: var(--accent);
  background: var(--soft);
}

.product-nav .nav.active {
  box-shadow: inset 0 -2px var(--accent);
}

small,
.meta {
  color: var(--slate);
  font-size: .875rem;
}

.account {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  text-align: end;
}

.account-identity {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
  min-width: 0;
  max-width: 12rem;
  padding: 5px 9px;
  border: 1px solid #40586d;
  border-radius: 8px;
  color: #fff;
  font-size: .875rem;
  line-height: 1.3;
}

.account-identity:hover,
.account-identity:focus-visible,
.account-identity[aria-current="page"] {
  background: #30495f;
}

.account-exam-line {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  font-size: .75rem;
  white-space: nowrap;
}

.account-role {
  color: var(--nav-text);
}

.account-exam-label {
  color: #b6efdc;
  font-weight: 600;
}

.account-name-line {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.account-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-points {
  padding: 2px 6px;
  border-radius: 6px;
  background: #30495f;
  color: #b6efdc;
  font-size: .75rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.account-actions {
  display: grid;
  justify-items: end;
}

.account-actions .nav {
  min-height: 28px;
  padding-block: 2px;
}

.role-switcher {
  position: relative;
}

.role-switcher summary {
  cursor: pointer;
}

.role-switcher summary::after {
  margin-inline-start: 5px;
  content: "▾";
}

.role-options {
  position: absolute;
  z-index: 1;
  inset-block-start: calc(100% + 5px);
  inset-inline-end: 0;
  display: grid;
  gap: 2px;
  min-width: 9rem;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 8px 25px #11233533;
}

.role-options button {
  min-height: 38px;
  justify-content: flex-start;
  border-color: transparent;
  background: transparent;
  color: var(--ink);
}

.role-options button:hover,
.role-options button:disabled {
  background: var(--soft);
  color: var(--accent);
}

.preview-notice {
  padding: 3px 12px;
  background: #f7e8c6;
  color: #503b10;
  text-align: center;
  font-size: .8125rem;
  font-weight: 650;
}

.layout {
  padding-block: 28px 64px;
}

.top :focus-visible {
  outline-color: #a5ebd1;
}

.top .add {
  border-color: #387e6e;
}

.layout.login {
  max-width: 42rem;
}

.login-screen {
  background: #f5f7f3;
  color: #23392b;
}

.login-card {
  display: flex;
  flex-direction: column;
  width: min(580px, calc(100% - 32px));
  min-height: 420px;
  margin: clamp(24px, 12vh, 124px) auto 24px;
  padding: 28px 36px;
  border: 1px solid #dce3d8;
  border-radius: 20px;
  background: #fff;
}

.login-wordmark {
  font-size: 27px;
  font-weight: 750;
  letter-spacing: -0.055em;
}

.login-wordmark span {
  color: #cc5734;
  font-weight: 500;
}

.login-content {
  width: min(100%, 368px);
  margin: auto;
  padding: 28px 0 48px;
  text-align: center;
}

.login-content h1 {
  margin: 0 0 8px;
  font-size: clamp(26px, 5vw, 34px);
}

.login-content p {
  margin: 0 0 22px;
  color: #536757;
  font-size: 15px;
}

.login-content .login-action {
  width: 100%;
  min-height: 46px;
  border-color: #e8754d;
  color: #30180e;
  background: #e8754d;
  box-shadow: 0 3px 5px #d4784830;
}

.login-content .login-action:hover {
  background: #ed8b68;
}

.login-content .login-action:focus-visible {
  outline-color: #315f3e;
}

@media (max-width: 600px) {
  .login-card {
    min-height: 380px;
    padding: 22px 20px;
  }
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0 0 18px;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  line-height: 1.3;
}

h2 {
  margin: 8px 0 5px;
  font-size: 1.125rem;
  line-height: 1.4;
}

p {
  margin: 0 0 10px;
}

button,
.button,
input,
textarea,
select {
  border-radius: 8px;
  font: inherit;
}

input,
textarea,
select {
  min-width: 0;
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--control-line);
  color: var(--ink);
  background: var(--surface);
}

input:not([type="checkbox"], [type="radio"], [type="hidden"]),
select {
  min-height: 42px;
}

input::placeholder,
textarea::placeholder {
  color: var(--slate);
  opacity: 1;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--accent);
  color: #fff;
  background: var(--accent);
  font-weight: 650;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
}

button:hover,
.button:hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}

button:disabled {
  opacity: .65;
  cursor: wait;
}

.secondary {
  border-color: var(--control-line);
  color: var(--accent);
  background: var(--surface);
}

.secondary:hover {
  border-color: var(--accent);
  background: var(--soft);
}

.danger {
  --accent: #a42524;
  --accent-hover: #8c1d1c;
  --soft: #fff2ef;
  --focus: #a42524;
}

.add {
  flex: none;
  margin: 0;
}

.heading,
.tabs,
.chips,
.meta,
.actions,
.exam-jump {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.heading {
  justify-content: space-between;
  margin-bottom: 14px;
}

.heading h1,
.heading h2 {
  margin: 0;
}

.heading h1 {
  min-width: 0;
}

.searchbox {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.search-status:not(:empty) {
  margin-top: 6px;
  color: var(--slate);
}

.filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 176px) auto;
  gap: 8px;
  margin-bottom: 14px;
}

.facet {
  display: grid;
  gap: 10px;
  margin: 14px 0 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.filterrow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.filterrow strong {
  min-width: 4.8em;
  color: var(--slate);
  font-size: .875rem;
}

.tag,
.chip,
.pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 6px;
  font-size: .875rem;
  font-weight: 650;
}

.tag,
.pill {
  padding: 2px 8px;
  vertical-align: middle;
}

.chip {
  padding: 4px 10px;
  min-height: 32px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.chip:hover {
  border-color: currentColor;
}

.chip.selected {
  border-color: currentColor;
  box-shadow: inset 0 -1px currentColor;
}

.chip.selected:not(.purple, .blue, .orange, .green, .unadjusted),
.pill {
  color: var(--accent);
  background: var(--soft);
}

.purple {
  color: #604080;
  background: #f1eafb;
}

.blue {
  color: #245782;
  background: #e6f0fb;
}

.orange {
  color: #854720;
  background: #fff0e3;
}

.green {
  color: #205f44;
  background: #e7f3ea;
}

.unadjusted {
  color: #745006;
  background: #fff1ce;
}

.tabs {
  gap: 20px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.tab {
  padding: 8px 2px;
}

.tab.chosen {
  border-bottom: 3px solid currentColor;
  color: var(--accent);
  font-weight: 700;
}

.chips,
.exam-jump {
  margin-block: 14px;
}

.exam-jump .chip {
  border-color: var(--line);
  color: var(--accent);
  background: var(--surface);
}

.exam-jump .chip:hover {
  border-color: var(--accent);
  background: var(--soft);
}

.cards {
  display: grid;
  gap: 9px;
}

.cards .facet {
  margin-block: 0 4px;
}

.qa-points {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--soft);
}

.qa-points h2 {
  margin: 0 0 4px;
  font-size: 1.0625rem;
}

.qa-points p {
  margin: 0;
  color: var(--slate);
  font-size: .875rem;
}

.qa-points-total {
  color: var(--accent);
  font-size: 1.875rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.qa-points-total small {
  color: inherit;
}

.panel,
.card {
  min-width: 0;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.card {
  padding-block: 14px;
}

.card:hover,
.card:focus-visible {
  border-color: var(--focus);
  background: #fbfefd;
}

.card h2 {
  font-weight: 720;
}

.card p {
  display: -webkit-box;
  margin-bottom: 5px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--slate);
}

.card .tag + .tag,
.card .tag + small {
  margin-inline-start: 4px;
}

.byline {
  display: block;
  margin-top: 8px;
}

.empty {
  color: var(--slate);
}

.article-panel,
.editor-panel,
.quiz-panel {
  max-width: 54rem;
  margin-inline: auto;
  padding: clamp(16px, 3vw, 32px);
}

.panel .meta {
  margin-bottom: 12px;
}

.summary,
.answercredit {
  color: var(--slate);
}

.answercredit {
  margin: 12px 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.detail {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.detail p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.article-body .prose {
  padding-top: clamp(16px, 3vw, 24px);
  border-top: 1px solid var(--line);
  overflow-wrap: anywhere;
  line-height: 1.85;
}

.article-body .prose:empty {
  display: none;
}

.prose :is(p, ol, ul) {
  max-width: 44rem;
  margin: 0 0 .9em;
  white-space: pre-line;
}

.prose :is(h2, h3) {
  margin: 1.55em 0 .35em;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.45;
}

.prose :is(h2, h3):first-child {
  margin-top: 0;
}

.prose :is(ol, ul) {
  padding-inline-start: 1.65em;
}

.prose li + li {
  margin-top: .35em;
}

.prose li::marker {
  color: var(--accent);
  font-weight: 650;
}

.prose > :last-child {
  margin-bottom: 0;
}

.prose .article-images {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(12px, 2.5vw, 20px);
  margin: 1.1em 0 1.4em;
}

.prose :is(.article-image, .article-video) {
  min-width: 0;
  margin: 0;
}

.prose .article-image:only-child {
  grid-column: 1 / -1;
  justify-self: center;
  max-width: 100%;
}

.prose .article-image > a {
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--canvas);
}

.prose .article-image > a:hover {
  border-color: var(--control-line);
}

.prose .article-image .media {
  margin: 0 auto;
  border-radius: 0;
}

.prose .article-image:not(:only-child) .media {
  width: 100%;
  max-height: none;
  aspect-ratio: 4 / 3;
}

.prose :is(.article-image, .article-video) > figcaption {
  margin-top: .45rem;
  color: var(--slate);
  font-size: .875rem;
  line-height: 1.5;
}

.prose .article-video {
  width: fit-content;
  max-width: 100%;
  margin: 1.1em auto 1.4em;
}

.prose .article-video .media {
  margin: 0 auto;
}

.media {
  display: block;
  max-width: 100%;
  max-height: 65vh;
  margin: 12px auto;
  border-radius: 8px;
  object-fit: contain;
}

video.media {
  background: #101c27;
}

.actions {
  margin-top: 16px;
}

.panel p > a:not(.button),
.panel > a:not(.button),
.actions > a:not(.button) {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

.quiz-editor {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
}

.quiz-editor summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--accent);
}

.quiz-editor-fields {
  display: grid;
  gap: 10px;
}

.editor label {
  display: grid;
  gap: 5px;
  font-weight: 600;
}

.editor .check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.check input {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.error {
  padding: 10px 12px;
  border-radius: 8px;
  color: #8b2f1e;
  background: #fff0eb;
}

.quiz-options {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 10px 0 0;
  border: 0;
}

.quiz-options legend {
  max-width: 100%;
  padding: 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.quiz-options .check {
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--control-line);
  border-radius: 8px;
  cursor: pointer;
  overflow-wrap: anywhere;
}

.quiz-options .check:hover,
.quiz-options .check:focus-within {
  border-color: var(--focus);
  background: var(--soft);
}

.quiz-clip {
  margin: 8px 0 12px;
}

.quiz-clip .media {
  min-width: min(100%, 280px);
  margin: 0 0 8px;
}

.quiz-clip figcaption {
  color: var(--slate);
  overflow-wrap: anywhere;
}

.quiz-images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 12px;
  margin: 4px 0 12px;
}

.quiz-images figure {
  min-width: 0;
  margin: 0;
}

.quiz-images a {
  display: block;
  width: fit-content;
  max-width: 100%;
}

.quiz-images .media {
  display: block;
  max-width: 100%;
  max-height: 460px;
  width: auto;
  height: auto;
  margin: 0;
}

.quiz-images figcaption {
  margin-top: 6px;
  color: var(--slate);
  font-size: .875rem;
}

progress {
  width: 100%;
  height: 10px;
  accent-color: var(--accent);
}

.completion {
  scroll-margin-top: 14px;
}

.completion.good {
  --tone: #1d6243;
  --tint: #e7f4eb;
  --bar: #24865c;
}

.completion.warn {
  --tone: #6d5003;
  --tint: #fff2cf;
  --bar: #a77910;
}

.completion.risk,
.completion.fail {
  --tone: #8c3832;
  --tint: #f9e9e6;
  --bar: #b75950;
}

.completion.empty {
  --tone: var(--slate);
  --tint: var(--canvas);
  --bar: var(--control-line);
}

.completion .heading strong {
  padding: 3px 9px;
  border-radius: 6px;
  color: var(--tone);
  background: var(--tint);
  font-size: .875rem;
}

.completion progress {
  accent-color: var(--bar);
}

.exam-list {
  display: grid;
  margin: 12px 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.exam-list li + li {
  border-top: 1px solid var(--line);
}

.exam-list a {
  display: block;
  padding: 9px 6px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.exam-list a:hover,
.exam-list a:focus-visible {
  color: var(--accent);
  background: var(--soft);
}

.catalog-head {
  display: grid;
  gap: 6px;
  padding: 12px 15px 15px;
  border-top: 1px solid var(--line);
}

.catalog-head h1 {
  margin: 0;
  font-size: 1rem;
}

.catalog-layout {
  display: grid;
  grid-template-columns: minmax(228px, 268px) minmax(0, 1fr);
  align-items: start;
  gap: 22px;
}

.catalog-sidebar {
  position: sticky;
  top: calc(var(--header-height) + 16px);
  max-height: calc(100dvh - var(--header-height) - 32px);
  overflow: auto;
}

.catalog-sidebar,
.catalog-records {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.catalog-filters {
  padding: 15px;
}

.catalog-filters summary,
.quiz-editor summary {
  cursor: pointer;
}

.catalog-filters summary {
  font-weight: 720;
}

.filter-count {
  display: inline-block;
  min-width: 1.5em;
  margin-inline-start: 7px;
  padding-inline: 4px;
  border-radius: 6px;
  color: var(--accent);
  background: var(--soft);
  font-size: .875rem;
  text-align: center;
}

.catalog-filter-groups {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.catalog-filters .filterrow {
  display: grid;
  align-items: start;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.catalog-filters .filterrow > div {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.catalog-filters .chip {
  padding-inline: 8px;
  font-size: .8125rem;
}

.catalog-filters .chip:not(.purple, .blue, .orange, .green, .unadjusted, .selected) {
  border-color: var(--line);
  background: var(--canvas);
}

.results-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-bottom: 10px;
  padding: 4px 0;
}

.results-heading h2 {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin: 0;
}

.results-counts {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  font-weight: 500;
}

.results-counts span {
  white-space: nowrap;
}

.results-learned {
  color: var(--accent);
}

.text-link,
.article-back a,
.editor-back a,
.quiz-navigation a {
  color: var(--accent);
  font-weight: 650;
  text-underline-offset: 3px;
}

.text-link:hover,
.article-back a:hover,
.editor-back a:hover,
.quiz-navigation a:hover {
  text-decoration: underline;
}

.catalog-records .card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 10px;
  padding: 15px 44px 15px 19px;
  border: 0;
  border-radius: 0;
}

.catalog-records .card:first-child {
  border-radius: var(--radius) var(--radius) 0 0;
}

.catalog-records .card:last-child {
  border-radius: 0 0 var(--radius) var(--radius);
}

.catalog-records .card:only-child {
  border-radius: var(--radius);
}

.catalog-records .card + .card {
  border-top: 1px solid var(--line);
}

.catalog-records .card::after {
  position: absolute;
  top: 50%;
  right: 20px;
  width: 7px;
  height: 7px;
  border: solid var(--slate);
  border-width: 1.5px 1.5px 0 0;
  content: "";
  transform: translateY(-50%) rotate(45deg);
}

.catalog-records .card:hover h2 {
  color: var(--accent);
}

.catalog-records .empty {
  border: 0;
}

.record-content {
  overflow-wrap: anywhere;
}

.record-learned {
  white-space: nowrap;
}

.record-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.record-meta small,
.catalog-records .byline {
  font-size: .8125rem;
}

.article-back,
.editor-back {
  max-width: 54rem;
  margin: 0 auto 10px;
  font-size: .9375rem;
}

.article-byline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-bottom: 12px;
  color: var(--slate);
  font-size: .875rem;
}

.article-actions {
  margin: 12px 0 18px;
}

.article-body {
  padding-top: 8px;
}

.editor-fields {
  display: grid;
  gap: 10px;
}

.entry-group {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.entry-group legend {
  margin-bottom: 5px;
  padding: 0;
  font-size: .875rem;
  font-weight: 600;
}

.entry-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.editor .entry-choice {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  font-size: .875rem;
  font-weight: 500;
}

.entry-choice input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--accent);
}

.entry-choice:has(:checked) {
  border-color: var(--accent);
  background: var(--soft);
  color: var(--accent);
}

.entry-group[hidden],
.editor .entry-choice[hidden] {
  display: none;
}

.editor-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
}

.article-editor textarea[name="solution"] {
  display: block;
  min-height: 9rem;
}

.editor-review {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--accent);
  font-size: .875rem;
  white-space: nowrap;
}

.editor-review:hover {
  text-decoration: underline;
}

.editor-upload {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.editor-upload button {
  min-height: 36px;
  padding: 4px 10px;
  font-size: .875rem;
}

.editor-upload small:empty {
  display: none;
}

.question-attachments {
  display: grid;
  gap: 6px;
  margin: 8px 0 4px;
  padding: 0;
  list-style: none;
}

.question-attachments:empty {
  display: none;
}

.question-attachments li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 8px 4px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.question-attachments a,
[data-upload-status] {
  overflow-wrap: anywhere;
}

.question-attachments button {
  flex: none;
  min-height: 36px;
  padding: 4px 10px;
  font-size: .875rem;
}

.entry-settings {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
}

.entry-settings summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
}

.entry-classification {
  margin-inline-start: 10px;
  overflow-wrap: anywhere;
  font-weight: 400;
}

.entry-settings[open] .entry-classification {
  display: none;
}

.entry-settings-fields {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.editor-actions {
  margin-top: 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.article-editor .quiz-editor {
  padding-block: 10px;
}

.exam-page {
  display: grid;
  gap: 16px;
}

.exam-page .exam-jump {
  margin-block: 0;
}

.exam-page .completion {
  padding: 0;
}

.exam-section-summary {
  padding: 14px 20px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: #f8fafc;
}

.exam-section-summary .heading {
  margin-bottom: 3px;
}

.exam-completed {
  margin-bottom: 0;
  color: var(--slate);
  font-size: .875rem;
}

.exam-page .exam-list {
  margin-top: 0;
}

.exam-page .exam-list a {
  display: flex;
  min-height: 45px;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding-inline: 20px;
}

.exam-state,
.record-learned {
  flex-shrink: 0;
  padding: 2px 7px;
  border-radius: 6px;
  color: var(--slate);
  background: var(--canvas);
  font-size: .8125rem;
  font-weight: 650;
}

.exam-state.is-passed,
.record-learned {
  color: var(--accent);
  background: var(--soft);
}

.quiz-navigation {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-bottom: 14px;
  font-size: .9375rem;
}

.quiz-heading {
  margin-bottom: 18px;
  padding: 12px 0 14px;
  border-block: 1px solid var(--line);
}

.quiz-heading h1 {
  margin-bottom: 4px;
}

.quiz-document {
  margin-bottom: 2px;
  font-weight: 650;
}

.quiz-context {
  margin-bottom: 0;
  color: var(--slate);
  font-size: .875rem;
}

.quiz-choice-list {
  display: grid;
  gap: 8px;
}

.quiz-options .check:has(input:checked) {
  border-color: var(--accent);
  background: var(--soft);
}

.quiz-result h2,
.quiz-answer {
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--accent);
  background: var(--soft);
}

.quiz-result h2 {
  margin-bottom: 10px;
}

.members-panel .heading {
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.members-panel .heading h1 {
  margin: 0 0 5px;
}

.members-panel .heading p {
  margin: 0;
}

.members-directory {
  border: 1px solid #dce3d8;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.members-filters {
  display: grid;
  grid-template-columns: minmax(0, 24rem) minmax(7rem, auto) minmax(7rem, auto) auto minmax(5rem, 1fr);
  align-items: end;
  gap: 10px;
  padding: 14px 16px;
}

.members-filters label {
  display: grid;
  gap: 4px;
  font-size: 0.86rem;
}

.member-count {
  margin: 0;
  align-self: center;
  justify-self: end;
  color: var(--slate);
  font-size: 0.85rem;
}

.members-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.members-table th,
.members-table td {
  padding: 10px 14px;
  border-top: 1px solid #e7ece4;
  text-align: start;
  overflow-wrap: anywhere;
}

.members-table thead {
  color: #465b4e;
  background: #f4f7f1;
}

.members-table tbody th {
  width: 26%;
  font-weight: 600;
}

.members-table tbody tr:hover {
  background: #fafbf9;
}

.member-detail {
  display: block;
  margin-top: 2px;
  color: #536757;
  font-size: 0.75rem;
  font-weight: 400;
}

.member-mobile {
  display: none;
}

.member-role-owner,
.member-role-admin,
.member-state-active {
  color: #24543b;
  font-weight: 650;
}

.member-state-disabled {
  color: #5d665e;
}

.member-recent {
  font-variant-numeric: tabular-nums;
}

.members-table .member-action {
  text-align: end;
}

.member-action .button {
  min-height: 36px;
  padding: 5px 10px;
}

.members-table .empty {
  padding: 24px 14px;
  text-align: center;
}

.member-feedback {
  padding: 8px 12px;
  border-radius: 8px;
  color: #24543b;
  background: #ebf3ea;
}

.member-editor {
  max-width: 40rem;
  margin-inline: auto;
}

.member-audit {
  margin-top: 16px;
  overflow-wrap: anywhere;
}

.member-dialog {
  width: min(36rem, calc(100% - 24px));
  max-height: calc(100% - 32px);
  padding: 0;
  border: 1px solid #dce3d8;
  border-radius: 14px;
  color: var(--ink);
  background: #fff;
}

.member-dialog::backdrop {
  background: rgb(21 32 25 / 53%);
}

.member-dialog .member-editor {
  padding: clamp(16px, 4vw, 26px);
  border: 0;
  box-shadow: none;
}

@media (max-width: 700px) {
  .members-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 12px 10px;
  }

  .members-filters label:first-child {
    grid-column: 1 / -1;
  }

  .members-table th,
  .members-table td {
    padding: 8px 6px;
  }

  .members-table .member-optional {
    display: none;
  }

  .members-table tbody th {
    width: 40%;
  }

  .member-mobile {
    display: block;
  }

  .member-action .button {
    min-height: 44px;
    padding: 6px 8px;
  }
}

@media (max-width: 720px) {
  .catalog-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .catalog-sidebar {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .catalog-filters {
    padding: 11px 13px;
  }

  .catalog-head {
    padding: 9px 13px 12px;
  }

  .catalog-filters .chip {
    min-height: 36px;
  }

  .catalog-records .card {
    padding: 12px 35px 12px 13px;
  }

  .catalog-records .card::after {
    right: 14px;
  }
}

@media (max-width: 1040px) {
  .top {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 3px 10px;
    padding-block: 7px 3px;
  }

  .top .brand {
    grid-column: 1;
  }

  .top .add {
    grid-column: 2;
  }

  .top .account {
    grid-column: 3;
  }

  .top .main-nav {
    grid-row: 2;
    grid-column: 1;
    margin-inline-start: 0;
  }

  .top .personal-nav {
    grid-row: 2;
    grid-column: 2 / -1;
    justify-self: end;
    padding-inline-start: 0;
    border-inline-start: 0;
  }
}

@media (max-width: 600px) {
  .prose .article-images {
    grid-template-columns: minmax(0, 1fr);
  }

  .prose .article-image:not(:only-child) .media {
    aspect-ratio: auto;
    max-height: 65vh;
  }

  .shell {
    width: calc(100% - 24px);
  }

  .top {
    column-gap: 6px;
  }

  .top .brand {
    grid-row: 1;
    grid-column: 1 / 3;
    gap: 5px;
    min-height: 38px;
    font-size: .9375rem;
  }

  .top .mark {
    width: 30px;
    height: 30px;
  }

  .top nav {
    gap: 3px;
  }

  .top .nav {
    min-height: 40px;
    padding-inline: 6px;
    font-size: .8125rem;
  }

  .product-nav {
    justify-content: space-between;
  }

  .product-nav .nav {
    flex: 1;
    min-height: 40px;
  }

  .top .add {
    grid-row: 2;
    grid-column: 1;
    justify-self: start;
    min-height: 36px;
    padding-inline: 8px;
    font-size: .8125rem;
  }

  .top .account {
    display: contents;
  }

  .top .account-identity {
    grid-row: 1;
    grid-column: 3;
    justify-self: end;
    max-width: min(42vw, 11rem);
    padding-inline: 5px;
    font-size: .75rem;
  }

  .top .account-actions {
    display: flex;
    grid-row: 2;
    grid-column: 2 / -1;
    justify-self: end;
    gap: 4px;
  }

  .top .account-actions .nav {
    min-height: 36px;
    padding: 2px 6px;
    border: 1px solid #40586d;
  }

  .top .main-nav,
  .top .personal-nav {
    grid-row: 3;
  }

  .layout {
    padding-block: 18px 36px;
  }

  .card,
  .panel,
  .facet {
    padding-inline: 13px;
  }

  .heading {
    gap: 8px;
  }

  .heading .button {
    padding-inline: 10px;
    font-size: .875rem;
  }

  .filterrow strong {
    flex-basis: 100%;
  }

  .chip {
    min-height: 36px;
  }

  .filters {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .filters input:not([type="hidden"]) {
    grid-column: 1 / -1;
  }

  .actions :is(.button, button),
  .exam-list a {
    min-height: 44px;
  }

  .editor .entry-choice {
    min-height: 44px;
  }

  .entry-classification {
    display: block;
    margin-inline-start: 18px;
  }

  .editor-upload button {
    min-height: 44px;
  }

  :root:has(.article-editor) {
    scroll-padding-bottom: calc(72px + env(safe-area-inset-bottom));
  }

  .article-editor .editor-actions {
    position: sticky;
    z-index: 1;
    bottom: 0;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    background: var(--surface);
  }

  .exam-section-summary,
  .exam-page .exam-list a {
    padding-inline: 13px;
  }

  .quiz-submit button {
    width: 100%;
    min-height: 44px;
  }
}
