:root {
  color-scheme: dark;
  --color-bg: #17191b;
  --color-surface: #222528;
  --color-text: #e3e4e2;
  --color-muted: #a5a8a8;
  --color-subtle: #797d7e;
  --color-border: #3a3e40;
  --color-primary: #f47b3b;
  --color-primary-hover: #ff6845;
  --color-green: #f28a4b;
  --color-ring-track: #383c3e;
  --color-shadow: 0 2px 8px rgb(0 0 0 / 20%), 0 12px 35px rgb(0 0 0 / 17%);
  --font-body: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Manrope", "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --radius-small: 12px;
  --radius-medium: 17px;
  --radius-card: 19px;
  --sidebar-width: 232px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 300px;
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-width: 300px;
  min-height: 100vh;
  margin: 0;
  color: var(--color-text);
  background: var(--color-bg);
  font-family: var(--font-body);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgb(119 125 96 / 45%);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.brand-logo {
  display: block;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
}

.auth-brand .brand-logo {
  width: 39px;
  height: 39px;
  flex-basis: 39px;
}

/* Authentication */
.auth-view {
  display: flex;
  min-height: 100svh;
  flex-direction: column;
  align-items: center;
  padding: 32px 21px 22px;
}

.auth-brand,
.sidebar-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -1.1px;
  text-decoration: none;
}

.auth-card {
  position: relative;
  width: min(100%, 418px);
  margin: auto;
  padding: 41px 38px 32px;
  border: 1px solid #eeeee9;
  border-radius: 21px;
  background: var(--color-surface);
  box-shadow: 0 5px 28px rgb(36 35 25 / 4%);
}

.auth-back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 31px;
  color: var(--color-muted);
  font-size: 12px;
  text-decoration: none;
}

.auth-back-link svg {
  width: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-heading {
  margin-bottom: 23px;
}

.auth-eyebrow,
.section-eyebrow {
  color: var(--color-green);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.4px;
}

.auth-heading h1 {
  margin: 13px 0 8px;
  font-family: var(--font-display);
  font-size: clamp(29px, 7vw, 36px);
  font-weight: 650;
  letter-spacing: -1.9px;
  line-height: 1.15;
}

.auth-heading>p {
  margin: 0;
  color: var(--color-muted);
  font-size: 13px;
  line-height: 1.7;
}

.auth-socials {
  display: grid;
  gap: 10px;
}

.social-button {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--color-border);
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: background 160ms, border-color 160ms;
}

.social-button:hover {
  border-color: #cecec5;
  background: #fafaf8;
}

.social-button svg {
  width: 18px;
  height: 18px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 19px 0;
  color: var(--color-subtle);
  font-size: 11px;
  white-space: nowrap;
}

.auth-divider::before,
.auth-divider::after {
  height: 1px;
  flex: 1;
  background: #eeeee9;
  content: "";
}

.auth-form {
  display: flex;
  flex-direction: column;
}

.field-label {
  margin-bottom: 7px;
  color: #474740;
  font-size: 11px;
  font-weight: 600;
}

.auth-form input {
  width: 100%;
  height: 43px;
  padding: 0 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #fff;
  color: var(--color-text);
  font-size: 12px;
  transition: border-color 160ms, box-shadow 160ms;
}

.auth-form input::placeholder {
  color: #b7b6ae;
}

.auth-form input:focus {
  border-color: #8c9177;
  outline: none;
  box-shadow: 0 0 0 3px rgb(119 125 96 / 11%);
}

.password-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
}

.text-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-primary);
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.text-link:hover {
  color: var(--color-primary-hover);
  text-decoration: underline;
}

.primary-button {
  display: flex;
  min-height: 45px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 9px;
  background: var(--color-primary);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 160ms, transform 160ms;
}

.primary-button:hover {
  transform: translateY(-1px);
  background: var(--color-primary-hover);
}

.auth-submit {
  margin-top: 19px;
}

.auth-submit span {
  font-size: 16px;
}

.auth-error {
  margin: 12px 0 0;
  color: #a63b36;
  font-size: 12px;
  line-height: 1.6;
}

.auth-switch {
  margin: 20px 0 0;
  color: var(--color-muted);
  font-size: 11px;
  text-align: center;
}

.switch-button {
  margin-left: 3px;
}

.auth-legal {
  margin: 22px 0 0;
  color: #a09f97;
  font-size: 10px;
  line-height: 1.7;
  text-align: center;
}

.auth-footer {
  margin: 15px 0 0;
  color: #a09f97;
  font-size: 11px;
}

/* Dashboard layout */
.dashboard-view {
  min-height: 100svh;
}

.sidebar {
  position: fixed;
  z-index: 4;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  padding: 29px 18px 17px;
  border-right: 1px solid var(--color-border);
  background: var(--color-surface);
}

.sidebar-brand {
  margin: 0 0 46px 5px;
}

.nav-caption {
  margin: 0 0 11px 10px;
  color: var(--color-subtle);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.2px;
}

.side-nav {
  display: grid;
  gap: 4px;
}

.side-link {
  display: flex;
  min-height: 39px;
  align-items: center;
  gap: 11px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #76766f;
  font-size: 12px;
  text-align: left;
  text-decoration: none;
  transition: background 140ms, color 140ms;
  cursor: pointer;
}

.side-link:hover {
  background: #f7f7f4;
  color: var(--color-text);
}

.side-link.active {
  background: #f3f3ee;
  color: #4c503c;
  font-weight: 600;
}

.side-link svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.sidebar-bottom {
  display: grid;
  gap: 17px;
  margin-top: auto;
}

.sidebar-tip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 11px;
  border: 1px solid #efefe9;
  border-radius: 11px;
  background: #fafaf8;
}

.tip-spark {
  color: #858969;
  font-size: 18px;
  line-height: 1;
}

.sidebar-tip p {
  margin: 0;
  color: var(--color-muted);
  font-size: 10px;
  line-height: 1.7;
}

.sidebar-tip strong {
  color: #494a41;
  font-size: 11px;
}

.admin-mode-toggle {
  position: relative;
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 10px;
  border: 1px solid var(--color-border);
  border-radius: 9px;
  background: var(--color-surface);
  cursor: pointer;
}

.admin-mode-copy {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #6f6f66;
  font-size: 11px;
  font-weight: 500;
}

.admin-mode-copy svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.admin-mode-input {
  position: absolute;
  z-index: 1;
  top: 0;
  right: 10px;
  width: 30px;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.admin-toggle-track {
  position: relative;
  width: 30px;
  height: 17px;
  flex: 0 0 30px;
  border-radius: 99px;
  background: #deded7;
  transition: background 150ms;
}

.admin-toggle-track::after {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgb(25 25 20 / 20%);
  content: "";
  transition: transform 150ms;
}

.admin-mode-input:checked+.admin-toggle-track {
  background: var(--color-primary);
}

.admin-mode-input:checked+.admin-toggle-track::after {
  transform: translateX(13px);
}

.admin-mode-input:focus-visible+.admin-toggle-track {
  outline: 3px solid rgb(119 125 96 / 45%);
  outline-offset: 3px;
}

.sign-out-button {
  width: 100%;
}

.sidebar-version {
  margin-left: 10px;
  color: var(--color-subtle);
  font-size: 8px;
  letter-spacing: 1px;
}

.dashboard-main {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.topbar {
  position: sticky;
  z-index: 3;
  top: 0;
  display: flex;
  height: 63px;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(23px, 5.1vw, 75px);
  border-bottom: 1px solid var(--color-border);
  background: rgb(248 248 246 / 94%);
  backdrop-filter: blur(14px);
}

.breadcrumb,
.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.breadcrumb {
  color: var(--color-muted);
  font-size: 11px;
}

.breadcrumb-slash {
  color: #cfcec5;
}

.breadcrumb strong {
  color: #474740;
  font-weight: 600;
}

.topbar-user {
  gap: 16px;
}

.streak-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--color-muted);
  font-size: 10px;
}

.streak-chip>span {
  color: #a18652;
  font-size: 13px;
}

.streak-chip strong {
  color: #44443d;
}

.topbar-avatar {
  width: 32px;
  height: 32px;
  padding: 0;
  overflow: hidden;
  border: 1px solid #e7e7de;
  border-radius: 50%;
  background: #eeede7;
  cursor: pointer;
}

.topbar-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dashboard-content {
  width: min(100%, 1110px);
  margin: 0 auto;
  padding: 42px clamp(23px, 5.1vw, 75px) 20px;
}

.welcome-section {
  display: flex;
  min-height: 136px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.welcome-copy {
  padding-top: 12px;
}

.welcome-copy .section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 9px;
  letter-spacing: 1.35px;
}

.eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #898d70;
}

.welcome-copy h1 {
  margin: 11px 0 6px;
  font-family: var(--font-display);
  font-size: clamp(25px, 3.4vw, 37px);
  font-weight: 600;
  letter-spacing: -1.8px;
  line-height: 1.2;
}

.heading-period {
  color: #939879;
}

.welcome-copy>p {
  margin: 0;
  color: var(--color-muted);
  font-size: 12px;
}

.profile-card {
  display: flex;
  width: 88px;
  flex: 0 0 88px;
  flex-direction: column;
  align-items: center;
  padding-top: 0;
}

.xp-ring {
  display: grid;
  width: 65px;
  height: 65px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--color-green) var(--progress), var(--color-ring-track) var(--progress));
}

.xp-ring img {
  width: 51px;
  height: 51px;
  border: 2px solid var(--color-surface);
  border-radius: 50%;
  background: #eeede7;
  object-fit: cover;
}

.profile-level {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-top: 7px;
  color: var(--color-muted);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: .9px;
}

.profile-level strong {
  color: #4b4d3d;
  font-size: 10px;
  letter-spacing: 0;
}

.profile-xp {
  margin-top: 3px;
  color: #55564c;
  font-size: 9px;
  font-weight: 600;
}

.profile-xp span {
  color: var(--color-subtle);
  font-weight: 400;
}

.search-section {
  margin-top: 19px;
}

.search-box {
  display: flex;
  height: 49px;
  align-items: center;
  gap: 12px;
  padding: 0 15px;
  border: 1px solid #e9e9e3;
  border-radius: 11px;
  background: var(--color-surface);
  box-shadow: 0 2px 9px rgb(42 42 30 / 3%);
  transition: border-color 150ms, box-shadow 150ms;
}

.search-box:focus-within {
  border-color: #b3b5a5;
  box-shadow: 0 0 0 3px rgb(119 125 96 / 9%);
}

.search-box>svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  fill: none;
  stroke: #96958c;
  stroke-linecap: round;
  stroke-width: 1.7;
}

.search-box input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--color-text);
  font-size: 11px;
}

.search-box input::placeholder {
  color: #a4a39b;
}

.search-box input:focus-visible {
  outline: none;
}

.search-shortcut {
  display: none;
  padding: 4px 6px;
  border: 1px solid #edede7;
  border-radius: 5px;
  color: #9b9a92;
  font-family: var(--font-body);
  font-size: 9px;
  white-space: nowrap;
}

.search-count {
  display: block;
  min-height: 18px;
  padding: 5px 2px 0;
  color: var(--color-muted);
  font-size: 10px;
}

.subjects-section {
  padding-top: 26px;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 17px;
}

.section-eyebrow-plain {
  font-size: 8px;
  letter-spacing: 1.25px;
}

.section-header h2 {
  margin: 5px 0 0;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -.75px;
}

.topics-note {
  color: var(--color-muted);
  font-size: 10px;
}

.admin-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-action-button {
  display: none;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  padding: 0 11px;
  border: 1px solid #dfe1d6;
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-primary);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: background 140ms, border-color 140ms;
}

.admin-action-button:hover {
  border-color: #aeb19d;
  background: #f7f8f3;
}

body.admin-mode-active .admin-action-button {
  display: inline-flex;
}

.subject-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.subject-card {
  position: relative;
  display: flex;
  min-height: 168px;
  flex-direction: column;
  overflow: hidden;
  padding: 16px 15px 14px;
  border: 1px solid rgb(55 55 40 / 5%);
  border-radius: var(--radius-medium);
  box-shadow: var(--color-shadow);
  transition: transform 160ms, box-shadow 160ms;
}

.subject-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgb(42 42 30 / 6%), 0 16px 38px rgb(42 42 30 / 4%);
}

.subject-card-button {
  width: 100%;
  color: var(--color-text);
  font-family: var(--font-body);
  text-align: left;
  cursor: pointer;
}

.subject-card-button:focus-visible,
.subtopic-card:focus-visible {
  outline-offset: 4px;
}

.subject-title {
  display: block;
  margin: 12px 0 3px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -.3px;
}

.subject-card-peach {
  background: #fbf4ee;
}

.subject-card-lavender {
  background: #f3f1f8;
}

.subject-card-sage {
  background: #f0f3ed;
}

.subject-card-blue {
  background: #eef3f5;
}

.card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.subject-icon {
  display: grid;
  width: 33px;
  height: 33px;
  place-items: center;
  border: 1px solid rgb(55 55 40 / 6%);
  border-radius: 10px;
}

.subject-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.45;
}

.icon-peach {
  background: #f4e9df;
  color: #ae795b;
}

.icon-lavender {
  background: #eae6f3;
  color: #8074a7;
}

.icon-sage {
  background: #e4ebdf;
  color: #71835f;
}

.icon-blue {
  background: #e0eaee;
  color: #65818c;
}

.subject-description {
  min-height: 15px;
  margin: 0;
  color: #85847c;
  font-size: 9px;
  line-height: 1.5;
}

.card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 12px;
  color: #89877e;
  font-size: 7px;
  font-weight: 600;
  letter-spacing: .8px;
}

.subject-arrow {
  font-size: 13px;
}

.topic-progress {
  position: absolute;
  right: 15px;
  bottom: 0;
  left: 15px;
  height: 2px;
  overflow: hidden;
  background: rgb(99 99 78 / 9%);
}

.topic-progress>span {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: #8a8c72;
}

.no-results {
  grid-column: 1 / -1;
  padding: 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-small);
  background: var(--color-surface);
  color: var(--color-muted);
  font-size: 12px;
  text-align: center;
}

.subject-card-button .card-bottom {
  width: 100%;
}

.subtopic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.subtopic-card {
  min-height: 169px;
  align-items: flex-start;
  width: 100%;
  color: var(--color-text);
  font-family: var(--font-body);
  text-align: left;
  cursor: pointer;
}

.subtopic-card .subject-description {
  max-width: 250px;
}

.subtopic-card .card-bottom {
  width: 100%;
}

.editor-placeholder {
  position: relative;
  min-height: 190px;
  margin-top: 17px;
  padding: 0;
  overflow: visible;
  border: 1px solid #efefe9;
  border-radius: 11px;
  background: #fff;
  color: #77786b;
}

.editor-toolbar {
  display: none;
  align-items: center;
  gap: 5px;
  padding: 8px 11px;
  border-bottom: 1px solid #efefe9;
  background: #fff;
}

body.admin-mode-active .editor-toolbar {
  display: flex;
}

.editor-toolbar {
  flex-wrap: wrap;
}

.editor-toolbar-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.editor-toolbar-end {
  margin-left: auto;
}

.editor-font-size-control,
.editor-table-size-control {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--color-muted);
  font-size: 10px;
  white-space: nowrap;
}

.editor-font-size-control input,
.editor-table-size-control input {
  width: 43px;
  height: 28px;
  padding: 0 5px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-surface);
  color: var(--color-text);
  text-align: center;
}

.editor-table-size-control input {
  width: 38px;
}

.editor-font-size-control input:disabled {
  opacity: .5;
}

.editor-tool {
  display: inline-grid;
  min-width: 30px;
  height: 29px;
  place-items: center;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #5e6053;
  font-size: 12px;
  cursor: pointer;
}

.editor-tool:hover,
.editor-tool[aria-pressed="true"] {
  border-color: #e9e9e2;
  background: #f5f5f1;
}

.editor-tool-wide {
  font-size: 10px;
  font-weight: 600;
}

.editor-tool-add {
  width: 29px;
  min-width: 29px;
  border-color: #e9e9e2;
  background: #f7f7f4;
  color: var(--color-primary);
  font-size: 19px;
}

.editor-tool-add:hover {
  border-color: #cfd1c3;
  background: #eff0e9;
}

.editor-toolbar-divider {
  width: 1px;
  height: 18px;
  margin: 0 3px;
  background: var(--color-border);
}

.code-language-control {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-right: auto;
  color: #73746b;
  font-size: 9px;
  font-weight: 600;
}

.code-language-control select {
  min-height: 29px;
  padding: 0 25px 0 9px;
  border: 1px solid #e8e8e2;
  border-radius: 7px;
  background: #fff;
  color: #44453e;
  font: inherit;
  font-size: 10px;
}

.code-language-control select:disabled {
  opacity: .55;
}

.code-language-control select:not(:disabled) {
  border-color: #cfd2c1;
  color: var(--color-primary);
}

.code-completion-hint {
  color: #999990;
  font-size: 8px;
  white-space: nowrap;
}

.editor-context-menu {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 5px;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 11px;
  background: #30312d;
  box-shadow: 0 7px 25px rgb(20 20 16 / 22%), 0 2px 5px rgb(20 20 16 / 13%);
  color: #fff;
}

.editor-context-menu .context-menu-button {
  display: inline-grid;
  min-width: 29px;
  height: 29px;
  place-items: center;
  padding: 0 7px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #f3f3ef;
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  transition: background 120ms, color 120ms;
}

.editor-context-menu .context-menu-button:hover,
.editor-context-menu .context-menu-button[aria-pressed="true"] {
  background: rgb(255 255 255 / 16%);
  color: #fff;
}

.editor-context-menu .context-menu-button:focus-visible {
  outline: 2px solid #c8d0a5;
  outline-offset: 1px;
}

.editor-context-menu .context-menu-button u {
  text-underline-offset: 2px;
}

.editor-context-menu .context-menu-divider {
  width: 1px;
  height: 19px;
  margin: 0 3px;
  background: rgb(255 255 255 / 22%);
}

.editor-table-menu {
  position: absolute;
  z-index: 22;
  top: 8px;
  right: 9px;
  left: 9px;
  flex-wrap: wrap;
  width: max-content;
  max-width: calc(100% - 18px);
}

.editor-table-menu[hidden] {
  display: none;
}

.table-menu-label {
  padding: 0 5px;
  color: #c1c4c2;
  font-size: 10px;
  font-weight: 650;
}

.editor-table-menu .context-menu-button {
  min-width: 32px;
  font-size: 10px;
}

.editor-link-dialog {
  width: min(460px, calc(100vw - 32px));
  max-height: min(85svh, 640px);
  padding: 0;
  overflow: auto;
  border: 1px solid #484d4e;
  border-radius: 14px;
  background: #24282a;
  color: #e3e4e2;
  box-shadow: 0 18px 60px rgb(0 0 0 / 48%);
}

.editor-link-dialog::backdrop {
  background: rgb(8 10 11 / 65%);
  backdrop-filter: blur(3px);
}

.editor-link-dialog form {
  display: grid;
  gap: 15px;
  padding: 20px;
}

.editor-link-dialog[open] {
  display: block;
}

.editor-link-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.editor-link-dialog-header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 650;
}

.editor-link-close {
  width: 31px;
  height: 31px;
  border: 1px solid #484d4e;
  border-radius: 8px;
  background: #2d3234;
  color: #e3e4e2;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
}

.editor-link-field {
  display: grid;
  gap: 7px;
  color: #c4c7c5;
  font-size: 11px;
  font-weight: 600;
}

.editor-link-field input,
.editor-link-field select {
  width: 100%;
  min-height: 40px;
  padding: 0 11px;
  border: 1px solid #44494a;
  border-radius: 8px;
  background: #1b1e20;
  color: #e3e4e2;
  font: inherit;
  font-size: 12px;
}

.editor-link-help {
  margin: -4px 0 0;
  color: #a5a8a8;
  font-size: 10px;
  line-height: 1.6;
}

.editor-link-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.editor-link-actions button {
  min-height: 36px;
  padding: 0 12px;
  font-size: 10px;
}

.copy-internal-link {
  min-height: 33px;
  padding: 0 11px;
  font-size: 10px;
  white-space: nowrap;
}

.wiki-detail-heading .wiki-internal-link-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 13px;
}

.wiki-link-help {
  color: var(--color-subtle);
  font-size: 10px;
}

.editor-drag-handle {
  position: fixed;
  z-index: 24;
  display: grid;
  width: 27px;
  height: 29px;
  place-items: center;
  border: 1px solid #e9e9e2;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 2px 8px rgb(30 30 24 / 8%);
  color: #85867b;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -2px;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.editor-drag-handle:hover {
  border-color: #d9dacd;
  background: #f5f6f1;
  color: #555849;
}

.editor-drag-handle:focus-visible {
  outline: 2px solid #aeb39a;
  outline-offset: 2px;
}

.editor-drag-handle.is-grabbing {
  cursor: grabbing;
}

.editor-drag-handle[hidden] {
  display: none;
}

.editor-drop-indicator {
  position: fixed;
  z-index: 23;
  height: 2px;
  border-radius: 2px;
  background: #8b9292;
  box-shadow: 0 0 0 1px rgb(160 168 168 / 8%);
  pointer-events: none;
}

.editor-drop-indicator::before {
  position: absolute;
  top: 50%;
  left: -3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8b9292;
  content: "";
  transform: translateY(-50%);
}

.editor-drop-indicator[hidden] {
  display: none;
}

[data-tippy-root] {
  z-index: 20 !important;
}

.slash-command-menu {
  position: fixed;
  z-index: 30;
  display: grid;
  width: min(300px, calc(100vw - 24px));
  max-height: min(360px, calc(100vh - 24px));
  gap: 3px;
  padding: 6px;
  overflow-y: auto;
  border: 1px solid #e8e8e2;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 35px rgb(30 30 24 / 13%), 0 2px 7px rgb(30 30 24 / 6%);
  color: var(--color-text);
}

.slash-command-menu[hidden] {
  display: none;
}

.slash-command-option {
  display: flex;
  min-width: 0;
  min-height: 48px;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.slash-command-option:hover,
.slash-command-option.is-selected,
.slash-command-option[aria-selected="true"] {
  background: #f0f0ec;
}

.slash-command-option:focus-visible {
  outline: 2px solid #aeb39a;
  outline-offset: -2px;
}

.slash-command-icon {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border: 1px solid #edede7;
  border-radius: 7px;
  background: #fff;
  color: #626355;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
}

.slash-command-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.slash-command-copy strong {
  overflow: hidden;
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slash-command-copy>span {
  overflow: hidden;
  color: var(--color-muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slash-command-empty {
  margin: 0;
  padding: 12px 10px;
  color: var(--color-muted);
  font-size: 10px;
}

.code-completion-menu {
  position: fixed;
  z-index: 31;
  display: grid;
  width: min(280px, calc(100vw - 24px));
  max-height: min(280px, calc(100vh - 24px));
  gap: 2px;
  padding: 5px;
  overflow: auto;
  border: 1px solid #e8e8e2;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 9px 28px rgb(30 30 24 / 14%), 0 2px 7px rgb(30 30 24 / 6%);
  color: var(--color-text);
}

.code-completion-menu[hidden] {
  display: none;
}

.code-completion-option {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.code-completion-option:hover,
.code-completion-option.is-selected,
.code-completion-option[aria-selected="true"] {
  background: #f0f0ec;
}

.code-completion-option code {
  color: #3e513a;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  font-weight: 600;
}

.code-completion-option span {
  color: var(--color-muted);
  font-size: 9px;
}

.code-completion-empty {
  margin: 0;
  padding: 9px;
  color: var(--color-muted);
  font-size: 9px;
}

.editor-prose blockquote {
  margin: 15px 0;
  padding: 3px 0 3px 16px;
  border-left: 3px solid #a8ad91;
  color: #6e7065;
  font-style: italic;
}

.editor-prose blockquote p:last-child {
  margin-bottom: 0;
}

.editor-prose .editor-callout,
.wiki-detail-prose .editor-callout {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin: 14px 0;
  padding: 13px 15px;
  border: 1px solid #eee6c9;
  border-radius: 11px;
  background: #fbf7e9;
  color: #535347;
}

.editor-prose .editor-callout-icon,
.wiki-detail-prose .editor-callout-icon {
  flex: 0 0 auto;
  padding-top: 1px;
  font-size: 16px;
  line-height: 1.5;
}

.editor-prose .editor-callout-content,
.wiki-detail-prose .editor-callout-content {
  min-width: 0;
  flex: 1;
}

.editor-prose .editor-callout-content> :first-child,
.wiki-detail-prose .editor-callout-content> :first-child {
  margin-top: 0;
}

.editor-prose .editor-callout-content> :last-child,
.wiki-detail-prose .editor-callout-content> :last-child {
  margin-bottom: 0;
}

.editor-prose hr {
  height: 1px;
  margin: 23px 0;
  border: 0;
  background: #e5e6df;
}

.editor-prose pre {
  margin: 14px 0;
  padding: 14px 16px;
  overflow-x: auto;
  border: 1px solid #e8e8e2;
  border-radius: 11px;
  background: #f7f8f5;
  color: #35362f;
}

.editor-prose pre code {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: .9em;
  line-height: 1.7;
  white-space: pre;
}

.editor-prose .hljs-comment,
.editor-prose .hljs-quote {
  color: #858b78;
  font-style: italic;
}

.editor-prose .hljs-keyword,
.editor-prose .hljs-selector-tag,
.editor-prose .hljs-literal,
.editor-prose .hljs-type,
.editor-prose .hljs-built_in {
  color: #7957a8;
}

.editor-prose .hljs-string,
.editor-prose .hljs-doctag,
.editor-prose .hljs-template-tag,
.editor-prose .hljs-template-variable {
  color: #3f8055;
}

.editor-prose .hljs-number,
.editor-prose .hljs-symbol,
.editor-prose .hljs-bullet {
  color: #b16a35;
}

.editor-prose .hljs-title,
.editor-prose .hljs-title.function_,
.editor-prose .hljs-function,
.editor-prose .hljs-section {
  color: #326e9a;
}

.editor-prose .hljs-attr,
.editor-prose .hljs-attribute,
.editor-prose .hljs-property,
.editor-prose .hljs-variable {
  color: #9a5d43;
}

.editor-prose .hljs-tag,
.editor-prose .hljs-name,
.editor-prose .hljs-selector-class,
.editor-prose .hljs-selector-id {
  color: #a34d57;
}

.editor-prose .hljs-meta,
.editor-prose .hljs-meta .hljs-keyword {
  color: #8b6a35;
}

.editor-prose .hljs-operator,
.editor-prose .hljs-punctuation {
  color: #686960;
}

.editor-prose .hljs-addition {
  color: #26734d;
  background: #e7f4e9;
}

.editor-prose .hljs-deletion {
  color: #a64242;
  background: #f9e8e8;
}

.editor-prose a {
  color: #80bfff;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.editor-prose a:hover {
  color: #b5d8ff;
}

.editor-prose :not(pre) > code {
  padding: 2px 5px;
  border: 1px solid var(--color-border);
  border-radius: 5px;
  background: var(--color-surface);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: .9em;
}

.editor-content {
  min-height: 153px;
  padding: 16px 44px 16px 19px;
  background: #fff;
  color: var(--color-text);
  text-align: left;
}

.editor-content,
.editor-prose {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.editor-prose {
  min-height: 120px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  outline: none;
  color: var(--color-text);
  font-size: 13px;
  line-height: 1.75;
}

.editor-prose p {
  margin: 0 0 9px;
}

.editor-prose p:has(> .editor-image-wrap[data-wrap="left"]),
.editor-prose p:has(> .editor-image-wrap[data-wrap="right"]) {
  display: flow-root;
}

.editor-prose h2,
.editor-prose h3 {
  margin: 13px 0 8px;
  font-family: var(--font-display);
  font-weight: 650;
}

.editor-prose h2 {
  font-size: 20px;
}

.editor-prose h3 {
  font-size: 16px;
}

.editor-prose ul,
.editor-prose ol {
  padding-left: 22px;
}

.editor-prose p.is-editor-empty:first-child::before {
  float: left;
  height: 0;
  color: #a6a69d;
  content: attr(data-placeholder);
  pointer-events: none;
}

.editor-prose[data-editor-fallback="true"]:empty::before {
  color: #a6a69d;
  content: attr(data-placeholder);
  pointer-events: none;
}

.editor-prose img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 12px 0;
  border-radius: 10px;
}

.editor-prose ul[data-type="taskList"] {
  padding: 0;
  list-style: none;
}

.editor-prose ul[data-type="taskList"] li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 6px 0;
  list-style: none;
}

.editor-prose ul[data-type="taskList"] li>label {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  margin-top: 4px;
}

.editor-prose ul[data-type="taskList"] li>label input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.editor-prose ul[data-type="taskList"] li>div {
  min-width: 0;
  flex: 1;
}

.editor-prose ul[data-type="taskList"] li>div>p {
  margin: 0;
}

.editor-prose [style*="text-align"] {
  max-width: 100%;
}

.editor-prose .tableWrapper {
  max-width: 100%;
  margin: 16px 0;
  overflow-x: auto;
}

.editor-prose table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.editor-prose th,
.editor-prose td {
  position: relative;
  min-width: 90px;
  padding: 9px 11px;
  border: 1px solid var(--color-border);
  vertical-align: top;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.editor-prose th {
  background: var(--color-bg);
  color: var(--color-text);
  font-weight: 650;
  text-align: left;
}

.editor-prose .selectedCell::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  background: rgb(244 123 59 / 10%);
  content: "";
  pointer-events: none;
}

.editor-prose .column-resize-handle {
  position: absolute;
  top: 0;
  right: -2px;
  bottom: -2px;
  width: 4px;
  background: rgb(244 123 59 / 58%);
  pointer-events: none;
}

.editor-prose.resize-cursor {
  cursor: col-resize;
}

.editor-status {
  margin: 0;
  padding: 0 19px 12px;
  color: var(--color-subtle);
  font-size: 9px;
  text-align: left;
}

.editor-status.is-error {
  color: #a63b36;
}

.editor-status:empty {
  display: none;
}

.workspace-view {
  width: min(100%, 1110px);
  min-height: calc(100svh - 63px);
  margin: 0 auto;
  padding: 35px clamp(23px, 5.1vw, 75px) 36px;
}

.workspace-view>.back-button {
  margin-bottom: 25px;
}

.workspace-view h1 {
  margin: 7px 0 5px;
  font-family: var(--font-display);
  font-size: clamp(25px, 3vw, 34px);
  font-weight: 650;
  letter-spacing: -1.35px;
}

.workspace-intro,
.workspace-heading-row p {
  margin: 0;
  color: var(--color-muted);
  font-size: 11px;
  line-height: 1.7;
}

.workspace-heading-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 10px 0 25px;
}

.workspace-heading-row h1 {
  margin-top: 5px;
}

.subtopic-workspace {
  width: min(100%, 1390px);
  padding-right: clamp(23px, 4.2vw, 60px);
  padding-left: clamp(23px, 4.2vw, 60px);
}

.subtopic-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  align-items: start;
  gap: 28px;
}

.subtopic-main-content {
  min-width: 0;
}

.subtopic-learning-toggle {
  display: none;
}

.subtopic-workspace>.section-eyebrow {
  display: block;
}

.subtopic-workspace .admin-action-button {
  display: none;
}

body.admin-mode-active .subtopic-workspace .admin-action-button {
  display: inline-flex;
}

.create-workspace>h1 {
  margin-top: 7px;
}

.create-form-row {
  display: grid;
  grid-template-columns: minmax(170px, .36fr) minmax(0, 1fr);
  gap: 13px;
  margin: 23px 0 14px;
}

.create-field {
  display: grid;
  gap: 7px;
  color: #595a50;
  font-size: 10px;
  font-weight: 600;
}

.create-field select,
.create-field input {
  width: 100%;
  min-height: 39px;
  padding: 0 11px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 11px;
}

.create-field textarea {
  width: 100%;
  min-height: 72px;
  resize: vertical;
  padding: 10px 11px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  font-size: 11px;
  line-height: 1.6;
}

.create-field textarea:focus {
  border-color: #b3b5a5;
  outline: none;
  box-shadow: 0 0 0 3px rgb(119 125 96 / 9%);
}

.create-field select:focus,
.create-field input:focus {
  border-color: #b3b5a5;
  outline: none;
  box-shadow: 0 0 0 3px rgb(119 125 96 / 9%);
}

.wiki-metadata {
  display: grid;
  gap: 13px;
  margin-bottom: 15px;
}

.wiki-metadata[hidden] {
  display: none;
}

.field-hint {
  color: var(--color-subtle);
  font-size: 9px;
  font-weight: 400;
}

.cover-upload {
  display: flex;
  min-height: 75px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px dashed #d6d7cb;
  border-radius: 10px;
  background: #fafaf8;
  cursor: pointer;
}

.cover-upload input {
  width: min(100%, 250px);
  min-height: 34px;
  padding: 6px;
  border: 0;
  background: transparent;
  font-size: 10px;
}

.cover-upload input:focus {
  outline: none;
}

.cover-upload-copy {
  display: grid;
  flex: 1;
  gap: 4px;
  color: var(--color-muted);
  font-size: 9px;
}

.cover-upload-copy strong {
  color: var(--color-primary);
  font-size: 10px;
}

.cover-preview {
  width: 86px;
  height: 58px;
  flex: 0 0 86px;
  border-radius: 7px;
  object-fit: cover;
}

.cover-preview[hidden] {
  display: none;
}

.create-workspace .editor-placeholder {
  margin-top: 0;
}

.create-workspace .editor-content {
  min-height: 220px;
}

.create-workspace .editor-prose {
  min-height: 185px;
}

.create-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 13px;
}

.create-actions .primary-button,
.secondary-button {
  min-height: 38px;
  padding: 0 14px;
  font-size: 10px;
}

.secondary-button {
  border: 1px solid var(--color-border);
  border-radius: 9px;
  background: var(--color-surface);
  color: var(--color-primary);
  font-weight: 600;
  cursor: pointer;
}

.secondary-button:hover {
  background: #f7f7f4;
}

.saved-drafts-section {
  margin-top: 29px;
}

.saved-drafts-section h2,
.wiki-picker h2 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -.35px;
}

.draft-count {
  display: inline-grid;
  min-width: 21px;
  height: 21px;
  place-items: center;
  margin-left: 4px;
  border-radius: 50%;
  background: #eeefe8;
  color: var(--color-primary);
  font-family: var(--font-body);
  font-size: 9px;
  vertical-align: 1px;
}

.saved-drafts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 9px;
}

.saved-draft {
  display: flex;
  min-height: 57px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface);
  text-align: left;
  cursor: pointer;
}

.saved-draft:hover,
.saved-draft.is-selected {
  border-color: #b7baa9;
  background: #f7f8f3;
}

.saved-draft strong {
  max-width: 100%;
  overflow: hidden;
  color: var(--color-text);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.saved-draft>span {
  color: var(--color-muted);
  font-size: 9px;
}

.create-overview-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 12px 0 30px;
}

.create-overview-heading h1 {
  margin: 6px 0 5px;
}

.create-new-button {
  display: inline-flex;
  min-height: 42px;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  padding: 0 15px;
  font-size: 11px;
}

.create-new-button>span {
  font-size: 17px;
  line-height: 1;
}

.create-workspace>[hidden],
.create-workspace #create-overview[hidden],
.create-workspace #create-editor-panel[hidden] {
  display: none !important;
}

.create-editor-panel>.back-button {
  margin: 0 0 23px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.create-classification-row {
  margin-top: 0;
}

.document-titlebar {
  display: grid;
  grid-template-columns: minmax(145px, 205px) minmax(180px, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin: 16px 0 15px;
  padding-bottom: 13px;
  border-bottom: 1px solid #ededE7;
}

.document-type-field {
  min-width: 0;
}

.document-type-field select {
  width: 100%;
  min-height: 37px;
  padding: 0 30px 0 11px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: #f5f6f2;
  color: #55584a;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
}

.document-type-field select:hover,
.document-type-field select:focus {
  border-color: #dfe0d6;
  outline: none;
  background: #fff;
}

.document-name-field {
  min-width: 0;
}

.document-name-field input {
  width: 100%;
  min-height: 38px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -.3px;
}

.document-name-field input::placeholder {
  color: #a0a196;
}

.document-name-field input:hover,
.document-name-field input:focus {
  border-color: #e6e7df;
  outline: none;
  background: #fff;
}

.autosave-status {
  justify-self: end;
  color: #8b8c82;
  font-size: 9px;
  white-space: nowrap;
}

.autosave-status[data-state="saving"] {
  color: #8a7a4b;
}

.autosave-status[data-state="saved"] {
  color: #6d8060;
}

.autosave-status[data-state="error"] {
  color: #a63b36;
}

.saved-drafts-section {
  margin-top: 0;
}

.saved-drafts-section h2 {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 16px;
  font-size: 14px;
}

.saved-drafts {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 205px), 222px));
  gap: 17px;
  align-items: stretch;
}

.saved-draft {
  min-width: 0;
  min-height: 0;
  height: 355px;
  padding: 0;
  overflow: hidden;
  border: 1px solid #e9e9e2;
  border-radius: 14px;
  background: var(--color-surface);
  box-shadow: 0 3px 12px rgb(42 42 30 / 4%);
  text-align: left;
  transition: transform 160ms, box-shadow 160ms, border-color 160ms;
}

.saved-draft:hover,
.saved-draft.is-selected {
  transform: translateY(-3px);
  border-color: #d5d6cb;
  background: var(--color-surface);
  box-shadow: 0 9px 23px rgb(42 42 30 / 9%);
}

.saved-draft:focus-visible {
  outline: 3px solid rgb(119 125 96 / 40%);
  outline-offset: 3px;
}

.saved-draft-preview {
  position: relative;
  display: block;
  width: 100%;
  height: 50%;
  flex: 0 0 50%;
  overflow: hidden;
  background: #f0f1ec;
}

.saved-draft-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.saved-draft-preview .saved-draft-excerpt {
  display: -webkit-box;
  height: 100%;
  overflow: hidden;
  padding: 19px 17px;
  color: #72756b;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.8;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  line-clamp: 6;
  -webkit-line-clamp: 6;
}

.saved-draft-details {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 13px 14px 12px;
}

.saved-draft-kind {
  color: #8b8c80;
  font-size: 8px;
  font-weight: 650;
  letter-spacing: .7px;
  line-height: 1.3;
  text-transform: uppercase;
}

.saved-draft .saved-draft-title {
  display: -webkit-box;
  max-width: 100%;
  overflow: hidden;
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: normal;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  -webkit-line-clamp: 2;
}

.saved-draft-summary {
  display: -webkit-box;
  width: 100%;
  overflow: hidden;
  color: #898a81;
  font-size: 9px;
  font-weight: 400;
  line-height: 1.5;
  text-align: left;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  -webkit-line-clamp: 2;
}

.saved-draft-tags {
  display: flex;
  width: 100%;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: auto;
  padding-top: 7px;
}

.saved-draft-tag {
  display: inline-block;
  max-width: 100%;
  padding: 5px 7px;
  overflow: hidden;
  border: 1px solid #e9eae3;
  border-radius: 6px;
  background: #f7f8f4;
  color: #6d705e;
  font-size: 7px;
  font-weight: 550;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drafts-empty-state {
  display: flex;
  min-height: 230px;
  grid-column: 1 / -1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 28px;
  border: 1px dashed #dfe0d7;
  border-radius: 14px;
  background: rgb(255 255 255 / 48%);
  color: var(--color-muted);
  text-align: center;
}

.drafts-empty-state>span:first-child {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 11px;
  background: #eef0e9;
  color: #7b8064;
  font-size: 17px;
}

.drafts-empty-state strong {
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 650;
}

.drafts-empty-state>span:last-child {
  font-size: 10px;
  line-height: 1.6;
}

.create-editor-panel .editor-placeholder {
  margin-top: 0;
}

.create-editor-panel .editor-content {
  min-height: 220px;
}

.create-editor-panel .editor-prose {
  min-height: 185px;
}

.workspace-empty {
  margin: 0;
  color: var(--color-muted);
  font-size: 10px;
  line-height: 1.6;
}

.wiki-picker {
  margin: 19px 0;
  padding: 17px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
}

.wiki-picker>p {
  margin: 0 0 13px;
  color: var(--color-muted);
  font-size: 10px;
  line-height: 1.6;
}

.wiki-page-options {
  display: grid;
  gap: 7px;
}

.wiki-page-option {
  display: flex;
  min-height: 36px;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border: 1px solid #efefe9;
  border-radius: 8px;
  color: var(--color-text);
  font-size: 10px;
  cursor: pointer;
}

.wiki-page-option input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--color-primary);
}

.picker-submit {
  min-height: 36px;
  margin-top: 12px;
  padding: 0 12px;
  font-size: 10px;
}

.linked-wiki-pages {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 17px;
  margin-top: 20px;
}

.linked-wiki-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 105px;
  align-items: stretch;
  gap: 15px;
  padding: 10px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 17px;
  background: var(--color-surface);
  box-shadow: var(--color-shadow);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 160ms, box-shadow 160ms, border-color 160ms;
}

.linked-wiki-card:hover {
  transform: translateY(-2px);
  border-color: #d5d6cb;
  box-shadow: 0 6px 18px rgb(42 42 30 / 7%);
}

.linked-wiki-card:focus-visible {
  outline: 3px solid rgb(119 125 96 / 45%);
  outline-offset: 3px;
}

.linked-wiki-cover {
  display: grid;
  width: 112px;
  min-height: 83px;
  flex: 0 0 112px;
  place-items: center;
  overflow: hidden;
  border-radius: 11px;
  background: #eef0e9;
}

.linked-wiki-cover img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 83px;
  object-fit: cover;
}

.linked-wiki-cover-empty {
  color: #898d70;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: -.3px;
}

.linked-wiki-details {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  padding: 5px 13px 5px 0;
}

.linked-wiki-title {
  overflow: hidden;
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -.35px;
  text-overflow: ellipsis;
}

.linked-wiki-summary {
  display: -webkit-box;
  overflow: hidden;
  color: var(--color-muted);
  font-size: 10px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  -webkit-line-clamp: 2;
}

.linked-wiki-arrow {
  position: absolute;
  top: 12px;
  right: 13px;
  color: #858969;
  font-size: 13px;
}

.wiki-page-view {
  max-width: 1180px;
}

.wiki-page-view>.back-button {
  margin-bottom: 30px;
}

.wiki-detail-cover {
  width: 100%;
  max-height: 350px;
  margin-bottom: 31px;
  overflow: hidden;
  border-radius: 18px;
  background: #eeefe9;
}

.wiki-detail-cover img {
  display: block;
  width: 100%;
  max-height: 350px;
  object-fit: cover;
}

.wiki-detail-heading {
  max-width: 900px;
  margin: 0 auto;
}

.wiki-detail-heading h1 {
  margin: 13px 0 9px;
  font-size: clamp(32px, 5vw, 48px);
  letter-spacing: -2px;
  line-height: 1.13;
}

.wiki-detail-heading p {
  max-width: 640px;
  margin: 0;
  color: var(--color-muted);
  font-size: 14px;
  line-height: 1.75;
}

.wiki-detail-divider {
  max-width: 900px;
  height: 1px;
  margin: 27px auto;
  background: var(--color-border);
}

.wiki-detail-content {
  max-width: 900px;
  min-width: 0;
  margin: 0 auto;
}

.wiki-detail-prose {
  min-height: 0;
  font-size: 15px;
  line-height: 1.9;
}

.wiki-detail-prose h2 {
  margin-top: 1.6em;
  font-size: 25px;
}

.wiki-detail-prose h3 {
  margin-top: 1.4em;
  font-size: 19px;
}

.wiki-detail-prose p {
  margin-bottom: 1.1em;
}

.wiki-detail-prose img {
  max-height: 600px;
  object-fit: contain;
  object-position: left center;
}

.system-placeholder {
  display: flex;
  min-height: 110px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-top: 17px;
  padding: 16px;
  border: 1px dashed #dcdcd3;
  border-radius: 11px;
  background: #fafaf8;
  color: #77786b;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}

.placeholder-caption {
  color: var(--color-subtle);
  font-size: 9px;
  font-weight: 400;
}

.topic-view {
  min-height: calc(100svh - 63px);
}

.topic-layout {
  display: grid;
  width: min(100%, 1390px);
  min-height: calc(100svh - 63px);
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 28px;
  margin: 0 auto;
  padding: 35px clamp(23px, 4.2vw, 60px) 28px;
}

.topic-main-content {
  min-width: 0;
}

.topic-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.topic-header-copy {
  min-width: 0;
}

.topic-header .copy-internal-link {
  align-self: flex-end;
  margin: 0 0 1px auto;
}

.back-button {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 25px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-muted);
  font-size: 11px;
  cursor: pointer;
}

.back-button:hover {
  color: var(--color-primary);
}

.back-button svg {
  width: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.topic-header h1 {
  margin: 7px 0 5px;
  font-family: var(--font-display);
  font-size: clamp(25px, 3vw, 34px);
  font-weight: 650;
  letter-spacing: -1.35px;
}

.topic-header-copy>p {
  margin: 0;
  color: var(--color-muted);
  font-size: 11px;
  line-height: 1.6;
}

.learning-sidebar-toggle {
  display: none;
}

.subtopics-section {
  padding-top: 29px;
}

.subtopic-grid .subject-card {
  min-height: 179px;
}

.learning-sidebar {
  position: relative;
  min-width: 0;
  align-self: start;
  padding: 18px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-medium);
  background: var(--color-surface);
  box-shadow: var(--color-shadow);
}

.learning-sidebar-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 1px 14px;
}

.learning-sidebar-heading h2 {
  margin: 5px 0 0;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -.55px;
}

.learning-sidebar-heading .section-eyebrow {
  font-size: 8px;
}

.close-sidebar-button {
  display: none;
}

.learning-tabs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 9px;
  background: #f6f6f2;
}

.learning-tab {
  min-height: 35px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--color-muted);
  font-size: 10px;
  text-align: left;
  cursor: pointer;
  transition: background 140ms, color 140ms, box-shadow 140ms;
}

.learning-tab:hover {
  color: var(--color-text);
}

.learning-tab.is-active {
  border-color: #ecece6;
  background: var(--color-surface);
  box-shadow: 0 1px 3px rgb(42 42 30 / 4%);
  color: #4c503c;
  font-weight: 600;
}

.learning-panel {
  padding-top: 15px;
}

.exercise-card {
  padding: 16px 14px;
  border: 1px solid #efefe9;
  border-radius: 12px;
  background: #fafaf8;
}

.exercise-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--color-green);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 1px;
}

.exercise-label .eyebrow-dot {
  width: 5px;
  height: 5px;
}

.exercise-card h3 {
  margin: 11px 0 6px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -.35px;
}

.exercise-card>p {
  margin: 0;
  color: var(--color-muted);
  font-size: 10px;
  line-height: 1.65;
}

.exercise-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 13px;
  margin-top: 16px;
  color: #66665c;
  font-size: 9px;
}

.exercise-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.exercise-meta svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: #898d70;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.exercise-meta span:first-child svg {
  fill: #e8e4d7;
}

.exercise-button {
  width: 100%;
  min-height: 38px;
  justify-content: space-between;
  margin-top: 17px;
  padding: 0 11px;
  font-size: 10px;
}

.exercise-button span {
  font-size: 15px;
}

.learning-empty-card {
  background: var(--color-surface);
}

.learning-empty-card .system-placeholder {
  min-height: 55px;
  margin-top: 14px;
  font-size: 9px;
}

.system-placeholder>span {
  color: #898d70;
  font-size: 15px;
}

.learning-sidebar-backdrop {
  display: none;
}

.dashboard-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 29px;
  padding: 13px 0 7px;
  border-top: 1px solid var(--color-border);
  color: #a09f97;
  font-size: 9px;
}

.toast {
  position: fixed;
  z-index: 6;
  right: 22px;
  bottom: 22px;
  left: 22px;
  width: max-content;
  max-width: calc(100% - 44px);
  margin: 0 auto;
  padding: 12px 17px;
  border: 1px solid #e8e8df;
  border-radius: 10px;
  background: var(--color-surface);
  box-shadow: var(--color-shadow);
  color: #474740;
  font-size: 12px;
  animation: toast-in 180ms ease-out;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(7px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 560px) {
  .auth-view {
    padding-top: 41px;
  }

  .auth-back-link {
    margin-bottom: 39px;
  }

  .search-shortcut {
    display: inline-block;
  }

  .subject-grid {
    gap: 15px;
  }

  .subject-card {
    min-height: 178px;
    padding: 18px 17px 15px;
  }
}

@media (min-width: 760px) {
  .subject-grid {
    grid-template-columns: minmax(245px, 0.4fr);
    gap: 15px;
  }

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

  .welcome-section {
    min-height: 146px;
  }

  .subjects-section {
    padding-top: 27px;
  }
}

@media (max-width: 680px) {
  :root {
    --sidebar-width: 0px;
  }

  .sidebar {
    position: sticky;
    z-index: 5;
    top: 0;
    bottom: auto;
    width: 100%;
    height: 55px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0 19px;
    border-right: 0;
    border-bottom: 1px solid var(--color-border);
  }

  .sidebar-brand {
    margin: 0;
    font-size: 17px;
  }

  .sidebar-brand .brand-logo {
    width: 31px;
    height: 31px;
    flex-basis: 31px;
  }

  .nav-caption {
    display: none;
  }

  .sidebar-bottom {
    display: contents;
  }

  .sidebar-tip,
  .sidebar-bottom>.sign-out-button,
  .sidebar-version {
    display: none;
  }

  .admin-mode-toggle {
    position: absolute;
    top: 9px;
    right: 16px;
    min-height: 36px;
    padding: 0 8px;
  }

  .admin-mode-copy {
    gap: 5px;
    font-size: 9px;
  }

  .admin-mode-copy svg {
    width: 14px;
    height: 14px;
  }

  .admin-toggle-track {
    width: 27px;
    height: 16px;
    flex-basis: 27px;
  }

  .admin-toggle-track::after {
    width: 12px;
    height: 12px;
  }

  .admin-mode-input {
    right: 8px;
    width: 27px;
  }

  .admin-mode-input:checked+.admin-toggle-track::after {
    transform: translateX(11px);
  }

  .side-nav {
    position: fixed;
    z-index: 6;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    padding: 6px 9px max(6px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--color-border);
    background: var(--color-surface);
  }

  body.admin-mode-active .side-nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .side-link {
    min-height: 49px;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    padding: 4px 1px;
    font-size: 9px;
  }

  .side-link svg {
    width: 16px;
    height: 16px;
    flex-basis: 16px;
  }

  .dashboard-main {
    min-height: calc(100svh - 55px);
    margin-left: 0;
  }

  .topbar {
    position: relative;
    height: 49px;
    padding: 0 19px;
  }

  .dashboard-content {
    padding: 27px 19px 78px;
  }

  .topic-view {
    min-height: calc(100svh - 104px);
  }

  .topic-layout {
    display: block;
    min-height: calc(100svh - 104px);
    padding: 25px 19px 83px;
  }

  .workspace-view {
    min-height: calc(100svh - 104px);
    padding: 25px 19px 83px;
  }

  .subtopic-workspace {
    width: 100%;
  }

  .subtopic-layout {
    display: block;
  }

  .create-overview-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 24px;
  }

  .create-new-button {
    min-height: 39px;
  }

  .saved-drafts {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 165px), 1fr));
    gap: 12px;
  }

  .saved-draft {
    height: 330px;
  }

  .saved-draft-details {
    padding: 11px 11px 10px;
  }

  .saved-draft-tag {
    padding: 4px 5px;
    font-size: 6.5px;
  }

  .create-editor-panel>.back-button {
    margin-bottom: 18px;
  }

  .document-titlebar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 10px;
  }

  .document-type-field {
    grid-column: 1;
    grid-row: 1;
  }

  .document-name-field {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .autosave-status {
    grid-column: 2;
    grid-row: 1;
    max-width: 145px;
    overflow: hidden;
    font-size: 8px;
    text-overflow: ellipsis;
  }

  .workspace-heading-row {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 20px;
  }

  .workspace-heading-row .admin-action-button {
    align-self: flex-start;
  }

  .create-form-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    margin-top: 19px;
  }

  .create-workspace .editor-content {
    min-height: 190px;
    padding: 13px;
  }

  .create-workspace .editor-prose {
    min-height: 160px;
  }

  .code-completion-hint {
    display: none;
  }

  .linked-wiki-card {
    padding: 15px;
  }

  .topic-header h1 {
    font-size: clamp(24px, 6vw, 31px);
  }

  .topic-header-copy>p {
    max-width: 310px;
  }

  .topic-header {
    flex-wrap: wrap;
  }

  .topic-header .copy-internal-link {
    align-self: flex-start;
    margin-top: 42px;
  }

  .learning-sidebar-toggle {
    display: inline-flex;
    min-height: 35px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 45px;
    padding: 0 10px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
    color: #e3e4e2;
    font-size: 10px;
    cursor: pointer;
  }

  .subtopic-learning-toggle {
    align-self: flex-start;
    margin-top: 0;
  }

  .learning-sidebar-toggle svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.5;
  }

  .learning-sidebar {
    position: fixed;
    z-index: 9;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(340px, calc(100vw - 42px));
    overflow-y: auto;
    padding: max(20px, env(safe-area-inset-top)) 18px max(22px, env(safe-area-inset-bottom));
    border: 0;
    border-left: 1px solid var(--color-border);
    border-radius: 18px 0 0 18px;
    box-shadow: -12px 0 35px rgb(42 42 30 / 10%);
    transform: translateX(105%);
    transition: transform 200ms ease;
  }

  .learning-sidebar.is-open {
    transform: translateX(0);
  }

  .learning-sidebar-heading {
    padding-bottom: 17px;
  }

  .learning-sidebar-heading h2 {
    font-size: 19px;
  }

  .close-sidebar-button {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid var(--color-border);
    border-radius: 9px;
    background: var(--color-surface);
    color: var(--color-muted);
    font-size: 21px;
    line-height: 1;
    cursor: pointer;
  }

  .learning-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .learning-tab {
    padding: 5px;
    font-size: 9px;
    text-align: center;
  }

  .learning-sidebar-backdrop:not([hidden]) {
    position: fixed;
    z-index: 8;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgb(26 27 22 / 32%);
  }

  .topic-main-content {
    min-width: 0;
  }

  .subtopics-section {
    padding-top: 25px;
  }

  .subtopic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .subtopic-grid .subject-card {
    min-height: 165px;
  }

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

  .welcome-section {
    min-height: 121px;
  }

  .welcome-copy h1 {
    max-width: 330px;
    font-size: clamp(22px, 5.7vw, 31px);
  }

  .search-section {
    margin-top: 11px;
  }

  .subjects-section {
    padding-top: 19px;
  }

  .subject-card {
    min-height: 163px;
  }

  .admin-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
  }

  .admin-action-button {
    min-height: 30px;
    padding: 0 8px;
    font-size: 9px;
  }

  .section-header {
    align-items: flex-end;
  }
}

/* Profile settings pop-out */
.profile-modal-backdrop {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgb(5 7 8 / 72%);
  backdrop-filter: blur(5px);
}

.profile-modal-backdrop[hidden] {
  display: none;
}

.toast {
  z-index: 90;
}

.profile-modal {
  display: flex;
  width: min(100%, 760px);
  max-height: min(760px, calc(100svh - 44px));
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #414647;
  border-radius: 18px;
  background: #222528;
  color: #e3e4e2;
  box-shadow: 0 24px 80px rgb(0 0 0 / 54%);
}

.profile-modal-header {
  display: flex;
  min-height: 65px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 0 22px;
  border-bottom: 1px solid #3b4041;
}

.profile-modal-header h2 {
  margin: 0;
  color: #e3e4e2;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -.3px;
}

.profile-modal-close {
  display: grid;
  width: 35px;
  height: 35px;
  flex: 0 0 35px;
  place-items: center;
  border: 1px solid #454a4b;
  border-radius: 9px;
  background: #292d2f;
  color: #d5d7d5;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.profile-modal-close:hover {
  border-color: #f28a4b;
  color: #ffad78;
}

.profile-modal-body {
  display: grid;
  min-height: 0;
  grid-template-columns: 176px minmax(0, 1fr);
  overflow: hidden;
}

.profile-settings-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 12px;
  border-right: 1px solid #3b4041;
  background: #1e2123;
}

.profile-settings-tab {
  min-height: 37px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #a5a8a8;
  font-size: 11px;
  text-align: left;
  cursor: pointer;
}

.profile-settings-tab:hover {
  background: #292d2f;
  color: #e3e4e2;
}

.profile-settings-tab.is-active {
  border-color: #4a403a;
  background: #342d29;
  color: #ffad78;
  font-weight: 650;
}

.profile-settings-content {
  min-width: 0;
  padding: 22px;
  overflow: auto;
}

.profile-settings-panel {
  max-width: 560px;
  margin: 0 auto;
}

.profile-settings-panel>h3 {
  margin: 7px 0 18px;
  color: #e3e4e2;
  font-family: var(--font-display);
  font-size: 19px;
  letter-spacing: -.5px;
}

.profile-section-eyebrow {
  color: #ff9a5f;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.2px;
}

.profile-preview-card {
  position: relative;
}

.profile-preview-banner {
  margin: 0 0 15px;
  padding: 8px 10px;
  border: 1px solid #5a4131;
  border-radius: 7px;
  background: #342820;
  color: #ffbd91;
  font-size: 10px;
}

.profile-avatar-picker {
  position: relative;
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  margin-bottom: 12px;
  overflow: hidden;
  border: 1px solid #4b5051;
  border-radius: 50%;
  background: #303436;
  cursor: pointer;
}

.profile-avatar-picker img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-avatar-picker span {
  position: absolute;
  inset: auto 0 0;
  padding: 5px 2px;
  background: rgb(15 17 18 / 82%);
  color: #fff;
  font-size: 7px;
  text-align: center;
  opacity: 0;
  transition: opacity 140ms;
}

.profile-avatar-picker:hover span,
.profile-avatar-picker:focus-within span {
  opacity: 1;
}

.profile-preview-card>h3 {
  margin: 0 0 4px;
  color: #e3e4e2;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -.5px;
}

.profile-email-preview {
  margin: 0;
  color: #a5a8a8;
  font-size: 10px;
}

.profile-description-preview {
  min-height: 38px;
  margin: 13px 0 18px;
  color: #b8babb;
  font-size: 11px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.profile-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 17px 0;
  padding: 13px 0;
  border-top: 1px solid #3b4041;
  border-bottom: 1px solid #3b4041;
}

.profile-stat-grid>div {
  display: grid;
  gap: 4px;
  padding: 0 9px;
  border-right: 1px solid #3b4041;
  text-align: center;
}

.profile-stat-grid>div:first-child {
  padding-left: 0;
}

.profile-stat-grid>div:last-child {
  padding-right: 0;
  border-right: 0;
}

.profile-stat-grid strong {
  color: #ffad78;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
}

.profile-stat-grid span {
  color: #a5a8a8;
  font-size: 9px;
}

.profile-primary-actions,
.profile-edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.profile-primary-actions>button,
.profile-edit-actions>button {
  min-height: 37px;
  flex: 1 1 130px;
  justify-content: center;
  padding: 0 12px;
  font-size: 10px;
}

.profile-edit-form {
  display: grid;
  gap: 14px;
}

.profile-edit-form[hidden] {
  display: none;
}

.profile-field {
  display: grid;
  gap: 7px;
  color: #c5c7c5;
  font-size: 10px;
  font-weight: 600;
}

.profile-field input,
.profile-field textarea {
  width: 100%;
  min-height: 39px;
  padding: 9px 11px;
  border: 1px solid #414647;
  border-radius: 8px;
  background: #1b1e20;
  color: #e3e4e2;
  font: inherit;
  font-size: 11px;
}

.profile-field textarea {
  min-height: 95px;
  resize: vertical;
  line-height: 1.6;
}

.profile-field input:focus,
.profile-field textarea:focus {
  border-color: #f28a4b;
  outline: none;
  box-shadow: 0 0 0 3px rgb(244 123 59 / 14%);
}

.profile-field input[readonly] {
  color: #c1c4c2;
}

.profile-sync-note,
.profile-panel-description {
  margin: 3px 0 0;
  color: #929798;
  font-size: 9px;
  line-height: 1.6;
}

.profile-edit-actions {
  margin-top: 2px;
}

.profile-edit-actions .primary-button {
  color: #17191b;
}

.password-display-row {
  display: flex;
  gap: 8px;
}

.password-display-row input {
  min-width: 0;
  flex: 1;
}

.password-eye-button {
  min-width: 42px;
  min-height: 39px;
  justify-content: center;
  padding: 0 10px;
}

.account-action-button {
  min-height: 36px;
  margin-top: 12px;
  padding: 0 12px;
  font-size: 10px;
}

.profile-setting-row {
  display: flex;
  min-height: 59px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid #3b4041;
  cursor: pointer;
}

.profile-setting-row>span {
  display: grid;
  gap: 4px;
}

.profile-setting-row strong {
  color: #dfe1df;
  font-size: 10px;
  font-weight: 600;
}

.profile-setting-row small {
  color: #969b9c;
  font-size: 9px;
  line-height: 1.45;
}

.profile-setting-row input[type="checkbox"] {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  accent-color: #f47b3b;
}

.profile-setting-row select {
  min-height: 34px;
  padding: 0 27px 0 9px;
  border: 1px solid #414647;
  border-radius: 7px;
  background: #1b1e20;
  color: #e3e4e2;
  font-size: 10px;
}

.profile-panel-description {
  margin: -8px 0 16px;
}

.admin-whitelist-form {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  margin: 16px 0 12px;
}

.admin-whitelist-form .profile-field {
  flex: 1;
}

.admin-whitelist-form>button {
  min-height: 39px;
  flex: 0 0 auto;
  padding: 0 11px;
  font-size: 9px;
}

.admin-whitelist {
  display: grid;
  gap: 6px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.admin-whitelist-empty {
  padding: 10px;
  border: 1px dashed #414647;
  border-radius: 8px;
  color: #969b9c;
  font-size: 9px;
}

.admin-whitelist-item {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid #414647;
  border-radius: 8px;
  background: #1d2022;
  color: #dfe1df;
  font-size: 10px;
}

.admin-whitelist-item>span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-whitelist-remove {
  flex: 0 0 auto;
  padding: 5px 7px;
  border: 1px solid #54423b;
  border-radius: 6px;
  background: #302720;
  color: #ffad78;
  font-size: 8px;
  cursor: pointer;
}

.admin-whitelist-remove:hover {
  border-color: #f28a4b;
}

body[data-theme="light"] {
  color-scheme: light;
  --color-bg: #f4f5f3;
  --color-surface: #fff;
  --color-text: #282c2d;
  --color-muted: #656b6c;
  --color-subtle: #858b8c;
  --color-border: #d9dddc;
  --color-shadow: 0 2px 8px rgb(21 30 31 / 7%), 0 12px 35px rgb(21 30 31 / 7%);
}

body[data-theme="light"],
body[data-theme="light"] .auth-view,
body[data-theme="light"] .dashboard-view,
body[data-theme="light"] .dashboard-main,
body[data-theme="light"] .workspace-view,
body[data-theme="light"] .topic-layout {
  background: var(--color-bg);
  color: var(--color-text);
}

body[data-theme="light"] .auth-card,
body[data-theme="light"] .sidebar,
body[data-theme="light"] .topbar,
body[data-theme="light"] .search-box,
body[data-theme="light"] .editor-placeholder,
body[data-theme="light"] .editor-content,
body[data-theme="light"] .wiki-picker,
body[data-theme="light"] .wiki-detail-content,
body[data-theme="light"] .saved-draft,
body[data-theme="light"] .subject-card,
body[data-theme="light"] .subtopic-card,
body[data-theme="light"] .exercise-card,
body[data-theme="light"] .linked-wiki-card {
  border-color: var(--color-border);
  background-color: var(--color-surface);
  color: var(--color-text);
}

body[data-theme="light"] .auth-heading h1,
body[data-theme="light"] .welcome-copy h1,
body[data-theme="light"] .section-header h2,
body[data-theme="light"] .workspace-view h1,
body[data-theme="light"] .wiki-detail-heading h1,
body[data-theme="light"] .topbar .breadcrumb strong,
body[data-theme="light"] .exercise-card h3 {
  color: var(--color-text);
}

body[data-theme="light"] .auth-form input,
body[data-theme="light"] .create-field input,
body[data-theme="light"] .create-field select,
body[data-theme="light"] .create-field textarea,
body[data-theme="light"] .document-name-field input,
body[data-theme="light"] .code-language-control select,
body[data-theme="light"] .document-type-field select {
  border-color: var(--color-border);
  background: #fff;
  color: #282c2d;
}

body[data-theme="light"] .side-nav {
  border-color: var(--color-border);
  background: #fff;
}

body[data-theme="light"] .side-link {
  color: #656b6c;
}

body[data-theme="light"] .side-link:hover,
body[data-theme="light"] .side-link.active {
  background: #f1eee9;
  color: #cf5c2e;
}

body[data-theme="light"] .sidebar-tip {
  border-color: #e1e4e3;
  background: #f7f8f6;
}

body[data-theme="light"] .sidebar-tip p {
  color: #656b6c;
}

body[data-theme="light"] .sidebar-tip strong {
  color: #333839;
}

body[data-theme="light"] .admin-mode-toggle {
  border-color: #d9dddc;
  background: #fff;
}

body[data-theme="light"] .admin-mode-copy {
  color: #4e5556;
}

body[data-theme="light"] .admin-toggle-track {
  background: #d6dad9;
}

body[data-theme="light"] .learning-sidebar {
  border-color: var(--color-border);
  background: #fff;
}

body[data-theme="light"] .learning-tabs {
  border-color: #e1e4e3;
  background: #f1f3f2;
}

body[data-theme="light"] .learning-tab {
  color: #626869;
}

body[data-theme="light"] .learning-tab:hover {
  background: #e9eceb;
  color: #282c2d;
}

body[data-theme="light"] .learning-tab.is-active {
  border-color: #e2e4e2;
  background: #fff;
  color: #bd552e;
}

body[data-theme="light"] .exercise-card,
body[data-theme="light"] .exercise-card.learning-empty-card {
  border-color: #e1e4e3;
  background: #fff;
  color: #282c2d;
}

body[data-theme="light"] .exercise-card h3 {
  color: #282c2d;
}

body[data-theme="light"] .exercise-card>p,
body[data-theme="light"] .learning-tab {
  color: #656b6c;
}

body[data-theme="light"] .system-placeholder {
  border-color: #d9dddc;
  background: #f5f6f5;
  color: #626869;
}

body[data-theme="light"] .profile-modal {
  border-color: #e0e3e2;
  background: #fff;
  color: #282c2d;
}

body[data-theme="light"] .profile-modal-header {
  border-color: #e4e7e6;
}

body[data-theme="light"] .profile-modal-header h2,
body[data-theme="light"] .profile-settings-panel>h3,
body[data-theme="light"] .profile-preview-card>h3 {
  color: #282c2d;
}

body[data-theme="light"] .profile-settings-nav {
  border-color: #e4e7e6;
  background: #f7f8f7;
}

body[data-theme="light"] .profile-settings-tab {
  color: #656b6c;
}

body[data-theme="light"] .profile-settings-tab:hover {
  background: #ebeeed;
  color: #282c2d;
}

body[data-theme="light"] .profile-settings-tab.is-active {
  border-color: #f1d6c7;
  background: #fff3ec;
  color: #bd552e;
}

body[data-theme="light"] .profile-avatar-picker {
  border-color: #d9dddc;
  background: #f1f3f2;
}

body[data-theme="light"] .profile-email-preview,
body[data-theme="light"] .profile-description-preview,
body[data-theme="light"] .profile-stat-grid span,
body[data-theme="light"] .profile-field,
body[data-theme="light"] .profile-setting-row strong {
  color: #555c5d;
}

body[data-theme="light"] .profile-stat-grid,
body[data-theme="light"] .profile-stat-grid>div,
body[data-theme="light"] .profile-setting-row {
  border-color: #e4e7e6;
}

body[data-theme="light"] .profile-field input,
body[data-theme="light"] .profile-field textarea,
body[data-theme="light"] .profile-setting-row select,
body[data-theme="light"] .admin-whitelist-item {
  border-color: #d9dddc;
  background: #fff;
  color: #282c2d;
}

body[data-theme="light"] .profile-setting-row small,
body[data-theme="light"] .profile-sync-note,
body[data-theme="light"] .profile-panel-description {
  color: #737a7b;
}

body[data-theme="light"] .profile-modal-close,
body[data-theme="light"] .secondary-button,
body[data-theme="light"] .admin-action-button {
  border-color: #d9dddc;
  background: #f4f5f4;
  color: #333839;
}

body[data-theme="light"] .saved-draft-preview {
  background: #f1f3f2;
}

body[data-theme="light"] .saved-draft-preview .saved-draft-excerpt,
body[data-theme="light"] .saved-draft-summary {
  color: #656b6c;
}

body[data-theme="light"] .editor-table-menu {
  border-color: #d9dddc;
  background: #fff;
  color: #282c2d;
  box-shadow: 0 8px 24px rgb(21 30 31 / 14%);
}

body[data-theme="light"] .editor-table-menu .context-menu-button {
  color: #333839;
}

body[data-theme="light"] .editor-table-menu .context-menu-button:hover {
  background: #f0f2f1;
  color: #bd552e;
}

body[data-theme="light"] .table-menu-label,
body[data-theme="light"] .wiki-link-help {
  color: #656b6c;
}

body[data-theme="light"] .editor-prose .editor-image-wrap>img {
  border-color: #d9dddc;
}

body[data-theme="light"] .editor-link-dialog {
  border-color: #d9dddc;
  background: #fff;
  color: #282c2d;
}

body[data-theme="light"] .editor-link-close {
  border-color: #d9dddc;
  background: #f4f5f4;
  color: #333839;
}

body[data-theme="light"] .editor-link-field {
  color: #4e5556;
}

body[data-theme="light"] .editor-link-field input,
body[data-theme="light"] .editor-link-field select {
  border-color: #d9dddc;
  background: #fff;
  color: #282c2d;
}

body[data-theme="light"] .editor-link-help {
  color: #656b6c;
}

@media (max-width: 620px) {
  .profile-modal-backdrop {
    align-items: end;
    padding: 0;
  }

  .profile-modal {
    width: 100%;
    max-height: min(92svh, 820px);
    border-radius: 18px 18px 0 0;
  }

  .profile-modal-header {
    min-height: 57px;
    padding: 0 16px;
  }

  .profile-modal-body {
    grid-template-columns: 112px minmax(0, 1fr);
  }

  .profile-settings-nav {
    padding: 13px 7px;
  }

  .profile-settings-tab {
    padding: 7px;
    font-size: 9px;
  }

  .profile-settings-content {
    padding: 16px 13px;
  }

  .profile-primary-actions {
    flex-direction: column;
  }

  .profile-primary-actions>button {
    flex-basis: 36px;
  }

  .admin-whitelist-form {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-whitelist-form>button {
    align-self: flex-start;
  }
}

@media (max-width: 410px) {
  .auth-card {
    padding: 31px 23px 25px;
  }

  .streak-chip {
    gap: 4px;
    font-size: 9px;
  }

  .topbar-user {
    gap: 9px;
  }

  .subject-grid {
    gap: 9px;
  }

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

  .subtopic-grid .subject-card {
    min-height: 150px;
  }

  .learning-sidebar-toggle {
    gap: 4px;
    padding: 0 7px;
    font-size: 9px;
  }

  .admin-actions {
    max-width: 60%;
  }

  .admin-action-button {
    max-width: 100%;
    min-height: 28px;
    font-size: 8px;
  }

  .subject-card {
    min-height: 158px;
    padding: 13px 12px 12px;
  }

  .subject-description {
    font-size: 8px;
  }

  .card-bottom {
    font-size: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* EISlearn cool dark palette with warm orange accents */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline-color: rgb(255 132 66 / 65%);
}

.auth-view,
.dashboard-view,
.dashboard-main,
.workspace-view,
.topic-layout {
  background: var(--color-bg);
}

.auth-brand,
.sidebar-brand,
.welcome-copy h1,
.section-header h2,
.workspace-view h1,
.topbar .breadcrumb strong,
.profile-level strong,
.profile-xp,
.sidebar-tip strong,
.auth-heading h1,
.wiki-detail-heading h1 {
  color: var(--color-text);
}

.auth-card,
.sidebar,
.topbar,
.search-box,
.editor-placeholder,
.editor-content,
.wiki-picker,
.wiki-detail-content,
.saved-draft,
.subject-card,
.subtopic-card,
.exercise-preview-card,
.quiz-preview-card,
.flashcard-preview-card {
  border-color: var(--color-border);
  background-color: var(--color-surface);
  color: var(--color-text);
}

.auth-card {
  box-shadow: var(--color-shadow);
}

.sidebar {
  border-right-color: var(--color-border);
}

.topbar {
  background: rgb(23 25 27 / 93%);
}

.breadcrumb-slash,
.breadcrumb,
.section-eyebrow,
.auth-eyebrow {
  color: #a5a8a8;
}

.side-link {
  color: #b1b3b2;
}

.side-link:hover,
.side-link.active {
  background: #303336;
  color: #ff9a5f;
}

.nav-caption,
.sidebar-version,
.auth-legal,
.auth-footer {
  color: #818586;
}

.sidebar-tip {
  border-color: var(--color-border);
  background: #292c2e;
}

.admin-mode-copy,
.field-label,
.create-field {
  color: #c5c7c5;
}

.admin-toggle-track {
  background: #4b4f50;
}

.admin-mode-input:checked+.admin-toggle-track {
  background: var(--color-primary);
}

.search-box {
  box-shadow: 0 2px 12px rgb(0 0 0 / 16%);
}

.search-box:focus-within,
.auth-form input:focus,
.create-field input:focus,
.create-field select:focus,
.create-field textarea:focus {
  border-color: #f28a4b;
  box-shadow: 0 0 0 3px rgb(244 123 59 / 16%);
}

.search-box input::placeholder,
.auth-form input::placeholder,
.create-field input::placeholder,
.create-field textarea::placeholder {
  color: #85898a;
}

.search-shortcut {
  border-color: var(--color-border);
  color: #a5a8a8;
}

.primary-button {
  background: #f47b3b;
  color: #17191b;
}

.primary-button:hover {
  background: #ff6845;
}

.secondary-button,
.admin-action-button,
.back-button,
.social-button {
  border-color: var(--color-border);
  background: #292c2e;
  color: #e3e4e2;
}

.secondary-button:hover,
.admin-action-button:hover,
.back-button:hover,
.social-button:hover {
  border-color: #66615d;
  background: #323537;
}

.text-link,
.auth-form .text-link {
  color: #ff9a5f;
}

.auth-form input,
.create-field select,
.create-field input,
.create-field textarea {
  border-color: var(--color-border);
  background: #1b1e20;
  color: var(--color-text);
}

.auth-form input:focus,
.create-field input:focus,
.create-field select:focus,
.create-field textarea:focus {
  background: #202325;
}

.auth-divider::before,
.auth-divider::after,
.wiki-detail-divider {
  background: var(--color-border);
}

.auth-divider {
  color: #95999a;
}

.subject-card-peach,
.subject-card-lavender,
.subject-card-sage,
.subject-card-blue {
  background: #25292b;
}

.subject-card:hover,
.linked-wiki-card:hover,
.saved-draft:hover {
  border-color: #66615d;
  box-shadow: 0 9px 24px rgb(0 0 0 / 25%);
}

.learning-sidebar {
  border-color: var(--color-border);
  background: var(--color-surface);
}

.learning-tabs {
  border: 1px solid #3a3e40;
  background: #1b1e20;
}

.learning-tab {
  color: #a5a8a8;
}

.learning-tab:hover {
  background: #292d2f;
  color: #e3e4e2;
}

.learning-tab.is-active {
  border-color: #4a4f50;
  background: #303436;
  box-shadow: 0 1px 4px rgb(0 0 0 / 28%);
  color: #ffad78;
}

.exercise-card,
.exercise-card.learning-empty-card {
  border-color: #414647;
  background: #25292b;
  color: var(--color-text);
}

.exercise-card h3 {
  color: #e3e4e2;
}

.exercise-card>p {
  color: #a5a8a8;
}

.exercise-meta {
  color: #c0c3c1;
}

.exercise-meta svg {
  stroke: #ff9a5f;
}

.exercise-meta span:first-child svg {
  fill: #4b382b;
}

.system-placeholder {
  border-color: #4a4e4f;
  background: #1b1e20;
  color: #c1c4c2;
}

.system-placeholder>span {
  color: #ff9a5f;
}

.learning-content-card+.learning-content-card {
  margin-top: 9px;
}

.learning-content-card h3 {
  overflow-wrap: anywhere;
}

.learning-empty-card h3 {
  margin-bottom: 7px;
}

.subject-icon,
.icon-peach,
.icon-lavender,
.icon-sage,
.icon-blue {
  border-color: #3e4243;
  background: #303436;
  color: #ff9a5f;
}

.subject-description,
.card-bottom,
.topics-note,
.workspace-intro,
.workspace-heading-row p,
.profile-level,
.profile-xp span {
  color: #a1a5a5;
}

.topic-progress {
  background: #3c4041;
}

.topic-progress>span,
.xp-ring {
  background-color: #383c3e;
}

.xp-ring {
  background: conic-gradient(#ff8547 var(--progress), #383c3e var(--progress));
}

.xp-ring img,
.topbar-avatar {
  border-color: #444849;
  background: #303436;
}

.profile-level strong {
  color: #ff9a5f;
}

.auth-back-link,
.auth-switch {
  color: #a5a8a8;
}

.auth-socials .social-button {
  background: #292c2e;
  color: #e3e4e2;
}

.editor-placeholder {
  background: #1d2022;
}

.editor-toolbar {
  border-bottom-color: var(--color-border);
  background: #222528;
}

.editor-tool {
  color: #d0d2d0;
}

.editor-tool:hover,
.editor-tool[aria-pressed="true"] {
  border-color: #4b4f50;
  background: #343839;
}

.code-language-control select,
.document-type-field select {
  border-color: #45494a;
  background: #292d2f;
  color: #e3e4e2;
}

.code-language-control select:not(:disabled) {
  border-color: #f28a4b;
  color: #ff9a5f;
}

.editor-context-menu {
  border-color: #4a4e4f;
  background: #303436;
}

.editor-context-menu .context-menu-button {
  color: #e3e4e2;
}

.editor-context-menu .context-menu-button:hover,
.editor-context-menu .context-menu-button[aria-pressed="true"] {
  background: rgb(255 132 66 / 18%);
  color: #ffad78;
}

.editor-prose {
  color: #e0e2e0;
}

.editor-prose p.is-editor-empty:first-child::before {
  color: #74797a;
}

.editor-prose blockquote {
  border-left-color: #f28a4b;
  color: #b8babb;
}

.editor-prose hr {
  background: #45494a;
}

.editor-prose pre {
  border-color: #3d4243;
  background: #171a1c;
  color: #e0e2e0;
}

.editor-prose .editor-callout,
.wiki-detail-prose .editor-callout {
  border-color: #67503b;
  background: #302820;
  color: #e2d6c9;
}

.editor-status {
  color: #8a8f90;
}

.editor-status.is-error,
.auth-error {
  color: #ff8574;
}

.create-overview-heading,
.saved-drafts-section h2 {
  color: var(--color-text);
}

.draft-count {
  background: #38332f;
  color: #ff9a5f;
}

.saved-draft {
  border-color: #3c4142;
  background: #222528;
}

.saved-draft:hover,
.saved-draft.is-selected {
  border-color: #f28a4b;
  background: #25292b;
}

.saved-draft-preview {
  border-bottom: 1px solid #3b4041;
  background: #292d2f;
}

.saved-draft-preview .saved-draft-excerpt {
  color: #b8babb;
}

.saved-draft-kind {
  color: #ff9a5f;
}

.saved-draft-summary,
.saved-draft-tag {
  color: #a8acab;
}

.saved-draft-tag {
  border-color: #44494a;
  background: #2b2f31;
}

.drafts-empty-state {
  border-color: #44494a;
  background: #202325;
  color: #a5a8a8;
}

.drafts-empty-state>span:first-child {
  background: #3a2d25;
  color: #ff9a5f;
}

.drafts-empty-state strong {
  color: var(--color-text);
}

.file-menu {
  position: relative;
  justify-self: start;
}

.file-menu-trigger {
  display: inline-flex;
  min-width: 94px;
  min-height: 39px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 12px;
  border: 1px solid #44494a;
  border-radius: 8px;
  background: #292d2f;
  color: #e3e4e2;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.file-menu-trigger>span {
  color: #ff9a5f;
  font-size: 14px;
}

.file-menu-trigger:hover,
.file-menu-trigger[aria-expanded="true"] {
  border-color: #f28a4b;
  background: #303436;
}

.file-menu-dropdown {
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  left: 0;
  display: grid;
  width: 210px;
  gap: 2px;
  padding: 5px;
  border: 1px solid #454a4b;
  border-radius: 9px;
  background: #25292b;
  box-shadow: 0 14px 35px rgb(0 0 0 / 40%);
}

.file-menu-dropdown[hidden] {
  display: none;
}

.file-menu-entry {
  position: relative;
}

.file-menu-item {
  display: flex;
  width: 100%;
  min-height: 36px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #d9dbd9;
  font-size: 11px;
  text-align: left;
  cursor: pointer;
}

.file-menu-item:hover,
.file-menu-item:focus-visible,
.file-menu-entry.is-open>.file-menu-item {
  outline: none;
  background: #383c3e;
  color: #ff9a5f;
}

.file-menu-chevron {
  color: #ff9a5f;
  font-size: 18px;
  line-height: 1;
}

.file-submenu {
  position: absolute;
  top: -5px;
  left: calc(100% - 3px);
  display: none;
  width: 218px;
  padding: 11px;
  border: 1px solid #454a4b;
  border-radius: 9px;
  background: #25292b;
  box-shadow: 0 14px 35px rgb(0 0 0 / 40%);
}

.file-menu-entry:hover>.file-submenu,
.file-menu-entry:focus-within>.file-submenu,
.file-menu-entry.is-open>.file-submenu {
  display: block;
}

.file-submenu .create-field {
  gap: 7px;
  font-size: 9px;
}

.file-submenu .create-field select {
  min-height: 36px;
  font-size: 10px;
}

.document-titlebar {
  grid-template-columns: 112px minmax(180px, 1fr) auto;
  border-bottom-color: #3c4142;
}

.file-submenu {
  width: 218px;
  padding: 6px;
}

.file-option-list {
  display: grid;
  gap: 2px;
}

.file-option {
  display: flex;
  width: 100%;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #d9dbd9;
  font-size: 10px;
  text-align: left;
  cursor: pointer;
}

.file-option:hover,
.file-option:focus-visible {
  outline: none;
  background: #383c3e;
  color: #ff9a5f;
}

.file-option[aria-checked="true"] {
  color: #ff9a5f;
}

.file-option-check {
  color: #ff9a5f;
  opacity: 0;
}

.file-option[aria-checked="true"] .file-option-check {
  opacity: 1;
}

.document-name-field input {
  color: #e3e4e2;
}

.document-name-field input::placeholder {
  color: #85898a;
}

.document-name-field input:hover,
.document-name-field input:focus {
  border-color: #484d4e;
  background: #202426;
}

.autosave-status {
  color: #a5a8a8;
}

.autosave-status[data-state="saving"] {
  color: #ffbd78;
}

.autosave-status[data-state="saved"] {
  color: #b0c0a1;
}

.autosave-status[data-state="error"] {
  color: #ff8574;
}

.create-field textarea:focus,
.create-field select:focus,
.create-field input:focus {
  border-color: #f28a4b;
}

.cover-upload {
  border-color: #4a4e4f;
  background: #25292b;
}

.cover-upload-copy strong,
.field-hint {
  color: #ff9a5f;
}

.cover-upload {
  flex-wrap: wrap;
}

.cover-upload input {
  flex: 0 1 255px;
  color: #d8dad8;
}

.cover-preview {
  width: 100px;
  height: 68px;
  flex-basis: 100px;
  border: 1px solid #44494a;
}

.cover-remove-button {
  min-height: 31px;
  padding: 0 9px;
  border: 1px solid #54423b;
  border-radius: 7px;
  background: #302720;
  color: #ff9a5f;
  font-size: 9px;
  cursor: pointer;
}

.cover-remove-button:hover {
  border-color: #f28a4b;
  background: #3b2c25;
}

.wiki-page-option {
  border-color: #414647;
  color: #d5d7d5;
}

.linked-wiki-card,
.wiki-detail-cover {
  border-color: #3c4142;
  background: #222528;
}

.linked-wiki-title {
  color: #e3e4e2;
}

.linked-wiki-summary {
  color: #a5a8a8;
}

.linked-wiki-cover {
  background: #303436;
}

.editor-drag-handle {
  border-color: #4b5051;
  background: #292d2f;
  color: #d6d8d6;
}

.editor-drag-handle:hover {
  border-color: #f28a4b;
  background: #38302b;
  color: #ffad78;
}

.editor-drop-indicator {
  background: #8d9697;
  box-shadow: 0 0 0 1px rgb(181 190 190 / 8%);
}

.editor-drop-indicator::before {
  background: #8d9697;
}

.editor-tool:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.toast {
  border: 1px solid #474c4d;
  background: #292d2f;
  color: #e3e4e2;
  box-shadow: 0 12px 32px rgb(0 0 0 / 30%);
}

.editor-prose .editor-image-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
  margin: 10px 0;
  vertical-align: middle;
  line-height: normal;
}

.editor-prose .editor-image-wrap[data-wrap="left"] {
  float: left;
  margin: 5px 18px 12px 0;
}

.editor-prose .editor-image-wrap[data-wrap="right"] {
  float: right;
  margin: 5px 0 12px 18px;
}

.editor-prose .editor-image-wrap[data-wrap="none"] {
  float: none;
}

.editor-prose .editor-image-wrap>img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 0;
  border: 1px solid #3e4344;
  border-radius: 7px;
  object-fit: contain;
}

.editor-prose .editor-image-wrap.is-cropped>img {
  height: 100%;
  object-fit: cover;
}

.editor-prose .editor-image-wrap.is-crop-mode>img {
  cursor: move;
}

.editor-prose .editor-image-wrap.ProseMirror-selectednode>img {
  outline: 2px solid #f28a4b;
  outline-offset: 2px;
}

.editor-image-controls {
  position: absolute;
  z-index: 7;
  top: 7px;
  left: 50%;
  display: none;
  align-items: center;
  gap: 3px;
  padding: 4px;
  border: 1px solid #4b5051;
  border-radius: 8px;
  background: #222628;
  box-shadow: 0 5px 18px rgb(0 0 0 / 38%);
  line-height: 1;
  transform: translateX(-50%);
}

.editor-image-wrap:hover .editor-image-controls,
.editor-image-wrap:focus-within .editor-image-controls,
.editor-image-wrap.ProseMirror-selectednode .editor-image-controls {
  display: flex;
}

.editor-prose[contenteditable="false"] .editor-image-controls,
.editor-prose[contenteditable="false"] .editor-image-resize-handle {
  display: none !important;
}

.editor-image-control {
  display: grid;
  min-width: 26px;
  height: 25px;
  place-items: center;
  padding: 0 6px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #e1e3e1;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

.editor-image-control:hover,
.editor-image-control:focus-visible {
  outline: none;
  background: #3a3e40;
  color: #ff9a5f;
}

.editor-image-resize-handle {
  position: absolute;
  right: -5px;
  bottom: -5px;
  display: none;
  width: 14px;
  height: 14px;
  padding: 0;
  border: 2px solid #222628;
  border-radius: 4px;
  background: #ff8547;
  cursor: nwse-resize;
  touch-action: none;
}

.editor-image-wrap:hover .editor-image-resize-handle,
.editor-image-wrap:focus-within .editor-image-resize-handle,
.editor-image-wrap.ProseMirror-selectednode .editor-image-resize-handle {
  display: block;
}

.editor-image-wrap.is-resizing,
.editor-image-wrap.is-crop-mode {
  user-select: none;
}

.wiki-detail-prose .editor-image-wrap {
  max-width: 100%;
}

@media (max-width: 680px) {
  .document-titlebar {
    grid-template-columns: 112px minmax(0, 1fr);
  }

  .file-menu-dropdown {
    width: min(172px, calc(100vw - 42px));
  }

  .file-submenu {
    left: calc(100% - 3px);
    width: min(190px, calc(100vw - 42px));
  }
}

body[data-theme="light"] .field-label,
body[data-theme="light"] .auth-form .field-label,
body[data-theme="light"] .create-field {
  color: #4e5556;
}

body[data-theme="light"] .auth-divider {
  color: #737a7b;
}

body[data-theme="light"] .auth-socials .social-button {
  border-color: #d9dddc;
  background: #fff;
  color: #282c2d;
}

body[data-theme="light"] .auth-socials .social-button:hover {
  border-color: #c5cbca;
  background: #f7f8f7;
}

body[data-theme="light"] .editor-toolbar {
  border-bottom-color: #d9dddc;
  background: #fff;
}

body[data-theme="light"] .editor-tool {
  color: #4e5556;
}

body[data-theme="light"] .editor-tool:hover,
body[data-theme="light"] .editor-tool[aria-pressed="true"] {
  border-color: #d9dddc;
  background: #f1f3f2;
  color: #bd552e;
}

body[data-theme="light"] .editor-tool-add {
  border-color: #d9dddc;
  background: #f4f5f4;
  color: #bd552e;
}

body[data-theme="light"] .editor-tool-add:hover {
  border-color: #c5cbca;
  background: #ebeeed;
}

body[data-theme="light"] .code-language-control {
  color: #656b6c;
}

body[data-theme="light"] .editor-prose {
  color: #282c2d;
}

body[data-theme="light"] .editor-prose a,
body[data-theme="light"] .editor-prose a:hover {
  color: #1263b3;
}

body[data-theme="light"] .editor-prose p.is-editor-empty:first-child::before {
  color: #858b8c;
}

body[data-theme="light"] .editor-prose blockquote {
  border-left-color: #cf5c2e;
  color: #555c5d;
}

body[data-theme="light"] .editor-prose hr {
  background: #d9dddc;
}

body[data-theme="light"] .editor-prose pre {
  border-color: #d9dddc;
  background: #f4f5f4;
  color: #282c2d;
}

body[data-theme="light"] .editor-prose .editor-callout,
body[data-theme="light"] .wiki-detail-prose .editor-callout {
  border-color: #ead9bd;
  background: #fff8e9;
  color: #514838;
}

body[data-theme="light"] .editor-prose .hljs-comment,
body[data-theme="light"] .editor-prose .hljs-quote {
  color: #68705c;
}

body[data-theme="light"] .editor-prose .hljs-keyword,
body[data-theme="light"] .editor-prose .hljs-selector-tag,
body[data-theme="light"] .editor-prose .hljs-literal,
body[data-theme="light"] .editor-prose .hljs-type,
body[data-theme="light"] .editor-prose .hljs-built_in {
  color: #68418f;
}

body[data-theme="light"] .editor-prose .hljs-string,
body[data-theme="light"] .editor-prose .hljs-doctag,
body[data-theme="light"] .editor-prose .hljs-template-tag,
body[data-theme="light"] .editor-prose .hljs-template-variable {
  color: #2f6842;
}

body[data-theme="light"] .editor-prose .hljs-number,
body[data-theme="light"] .editor-prose .hljs-symbol,
body[data-theme="light"] .editor-prose .hljs-bullet {
  color: #8d4e1e;
}

body[data-theme="light"] .editor-prose .hljs-title,
body[data-theme="light"] .editor-prose .hljs-title.function_,
body[data-theme="light"] .editor-prose .hljs-function,
body[data-theme="light"] .editor-prose .hljs-section {
  color: #245779;
}

body[data-theme="light"] .editor-prose .hljs-attr,
body[data-theme="light"] .editor-prose .hljs-attribute,
body[data-theme="light"] .editor-prose .hljs-property,
body[data-theme="light"] .editor-prose .hljs-variable {
  color: #81442e;
}

body[data-theme="light"] .editor-prose .hljs-tag,
body[data-theme="light"] .editor-prose .hljs-name,
body[data-theme="light"] .editor-prose .hljs-selector-class,
body[data-theme="light"] .editor-prose .hljs-selector-id {
  color: #8c3441;
}

body[data-theme="light"] .editor-prose .hljs-meta,
body[data-theme="light"] .editor-prose .hljs-meta .hljs-keyword {
  color: #72551e;
}

body[data-theme="light"] .editor-prose .hljs-operator,
body[data-theme="light"] .editor-prose .hljs-punctuation {
  color: #4f5147;
}

body[data-theme="light"] .editor-prose table th,
body[data-theme="light"] .editor-prose table td {
  border-color: #d9dddc;
}

body[data-theme="light"] .editor-prose table th {
  background: #f1f3f2;
}

body[data-theme="light"] .editor-context-menu {
  border-color: #d9dddc;
  background: #fff;
  color: #282c2d;
  box-shadow: 0 7px 25px rgb(21 30 31 / 14%);
}

body[data-theme="light"] .editor-context-menu .context-menu-button {
  color: #333839;
}

body[data-theme="light"] .editor-context-menu .context-menu-button:hover,
body[data-theme="light"] .editor-context-menu .context-menu-button[aria-pressed="true"] {
  background: #f0f2f1;
  color: #bd552e;
}

body[data-theme="light"] .editor-context-menu .context-menu-divider {
  background: #d9dddc;
}

body[data-theme="light"] .file-menu-trigger,
body[data-theme="light"] .file-menu-dropdown,
body[data-theme="light"] .file-submenu {
  border-color: #d9dddc;
  background: #fff;
  color: #282c2d;
  box-shadow: 0 10px 28px rgb(21 30 31 / 14%);
}

body[data-theme="light"] .file-menu-trigger {
  background: #f4f5f4;
}

body[data-theme="light"] .file-menu-trigger:hover,
body[data-theme="light"] .file-menu-trigger[aria-expanded="true"] {
  border-color: #d9875e;
  background: #fff3ec;
}

body[data-theme="light"] .file-menu-item,
body[data-theme="light"] .file-option {
  color: #333839;
}

body[data-theme="light"] .file-menu-item:hover,
body[data-theme="light"] .file-menu-item:focus-visible,
body[data-theme="light"] .file-menu-entry.is-open>.file-menu-item,
body[data-theme="light"] .file-option:hover,
body[data-theme="light"] .file-option:focus-visible {
  background: #f0f2f1;
  color: #bd552e;
}

body[data-theme="light"] .file-option[aria-checked="true"],
body[data-theme="light"] .file-menu-chevron {
  color: #bd552e;
}

body[data-theme="light"] .editor-drag-handle {
  border-color: #d9dddc;
  background: #fff;
  color: #555c5d;
}

body[data-theme="light"] .editor-drag-handle:hover {
  border-color: #d9875e;
  background: #fff3ec;
  color: #bd552e;
}

body[data-theme="light"] .editor-image-controls {
  border-color: #d9dddc;
  background: #fff;
  box-shadow: 0 5px 18px rgb(21 30 31 / 14%);
}

body[data-theme="light"] .editor-image-control {
  color: #333839;
}

body[data-theme="light"] .editor-image-control:hover,
body[data-theme="light"] .editor-image-control:focus-visible {
  background: #f0f2f1;
  color: #bd552e;
}

body[data-theme="light"] .editor-image-resize-handle {
  border-color: #fff;
}

body[data-theme="light"] .learning-sidebar-toggle {
  color: #333839;
}

.search-content-results {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.search-content-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 10px;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 9px;
  background: var(--color-surface);
  color: var(--color-text);
  text-align: left;
  cursor: pointer;
}

.search-content-result:hover,
.search-content-result:focus-visible {
  border-color: var(--color-primary);
  filter: brightness(1.08);
}

.search-content-result strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-content-result-kind {
  color: var(--color-primary);
  font-size: 9px;
}

.search-content-result-description {
  grid-column: 1 / -1;
  overflow: hidden;
  color: var(--color-muted);
  font-size: 9px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-content-results[hidden] {
  display: none;
}

/* ==========================================================================
   QUIZ MODULE STYLES (Quiz-Editor, Quiz-Player & Quiz-Auswertung)
   ========================================================================== */

/* Quiz Editor in Admin-Workspace */
.quiz-editor-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 8px;
}

.quiz-editor-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-small);
}

.quiz-editor-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgb(244 123 59 / 14%);
  color: var(--color-primary);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.quiz-editor-intro {
  margin: 0;
  color: var(--color-muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.quiz-meta-grid {
  display: grid;
  gap: 14px;
}

.quiz-questions-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.quiz-questions-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.quiz-questions-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.quiz-questions-title-row h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
}

.quiz-count-badge {
  padding: 3px 9px;
  background: #2a2e30;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-muted);
}

.quiz-questions-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.quiz-question-editor-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 22px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-small);
  box-shadow: 0 2px 10px rgb(0 0 0 / 12%);
  transition: border-color 160ms, box-shadow 160ms;
}

.quiz-question-editor-card:hover {
  border-color: #52575a;
}

.quiz-q-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.quiz-q-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quiz-q-index-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  padding: 4px 10px;
  background: #292d30;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--color-text);
}

.quiz-q-type-select {
  height: 34px;
  padding: 0 10px;
  background: #1b1d1f;
  border: 1px solid var(--color-border);
  border-radius: 7px;
  color: var(--color-text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.quiz-q-type-select:focus {
  border-color: var(--color-primary);
  outline: none;
}

.quiz-q-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.quiz-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: #272a2c;
  border: 1px solid var(--color-border);
  border-radius: 7px;
  color: var(--color-muted);
  cursor: pointer;
  font-size: 13px;
  transition: background 140ms, color 140ms, border-color 140ms;
}

.quiz-icon-btn:hover {
  background: #34383b;
  color: var(--color-text);
  border-color: #55595c;
}

.quiz-icon-btn-delete:hover {
  background: rgb(255 77 79 / 18%);
  color: #ff4d4f;
  border-color: rgb(255 77 79 / 40%);
}

.quiz-options-wrapper {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quiz-options-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quiz-option-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quiz-opt-radio,
.quiz-opt-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--color-primary);
  flex-shrink: 0;
}

.quiz-opt-input {
  flex: 1;
  height: 38px;
  padding: 0 12px;
  background: #1b1d1f;
  border: 1px solid var(--color-border);
  border-radius: 7px;
  color: var(--color-text);
  font-size: 12.5px;
  transition: border-color 140ms;
}

.quiz-opt-input:focus {
  border-color: var(--color-primary);
  outline: none;
}

.quiz-opt-del {
  width: 30px;
  height: 30px;
  padding: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--color-subtle);
  cursor: pointer;
  font-size: 13px;
  transition: color 140ms, background 140ms;
}

.quiz-opt-del:hover {
  background: #2d3133;
  color: #ff7875;
}

.quiz-add-btn {
  align-self: flex-start;
  padding: 6px 14px;
  background: #222528;
  border: 1px dashed #484d50;
  border-radius: 7px;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 140ms;
}

.quiz-add-btn:hover {
  background: #2a2e31;
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.quiz-editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--color-border);
  flex-wrap: wrap;
}

.test-quiz-button {
  background: linear-gradient(135deg, #f47b3b, #ff5722);
  color: #17191b;
  font-weight: 700;
}

/* ==========================================================================
   QUIZ PLAYER & AUSWERTUNG (Frontend Workspace)
   ========================================================================== */
.quiz-workspace {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 860px;
  margin: 0 auto;
  padding: 24px 20px 48px;
  animation: fadeIn 220ms ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.quiz-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.quiz-header-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quiz-tag {
  padding: 4px 10px;
  background: rgb(244 123 59 / 14%);
  color: var(--color-primary);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.quiz-badge-type {
  padding: 4px 10px;
  background: #272a2c;
  color: var(--color-muted);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

.quiz-player-header {
  margin-bottom: 20px;
}

.quiz-title {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: clamp(22px, 4vw, 28px);
  font-weight: 750;
  letter-spacing: -0.6px;
  line-height: 1.25;
}

.quiz-desc {
  margin: 0;
  color: var(--color-muted);
  font-size: 13.5px;
  line-height: 1.6;
}

/* Progress bar & navigation dots */
.quiz-progress-container {
  padding: 16px 20px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-small);
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 2px 10px rgb(0 0 0 / 10%);
}

.quiz-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.quiz-progress-text {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text);
}

.quiz-type-badge {
  padding: 3px 9px;
  background: rgb(244 123 59 / 12%);
  color: var(--color-primary);
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
}

.quiz-progress-bar-track {
  width: 100%;
  height: 8px;
  background: #2c3033;
  border-radius: 5px;
  overflow: hidden;
}

.quiz-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #f47b3b, #ff9a5f);
  border-radius: 5px;
  transition: width 240ms ease-out;
}

.quiz-step-dots {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.quiz-step-pill {
  padding: 4px 10px;
  background: #25282b;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-muted);
  cursor: pointer;
  transition: all 140ms ease;
}

.quiz-step-pill:hover {
  background: #303437;
  color: var(--color-text);
  border-color: #55595d;
}

.quiz-step-pill.is-active {
  background: rgb(244 123 59 / 16%);
  border-color: var(--color-primary);
  color: var(--color-primary);
  font-weight: 700;
}

.quiz-step-pill.is-answered {
  border-color: #4f5558;
  color: var(--color-text);
  background: #2c3033;
}

/* Question card */
.quiz-question-card {
  padding: 30px 32px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: 0 4px 24px rgb(0 0 0 / 16%);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.quiz-question-number-badge span {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--color-primary);
}

.quiz-question-heading {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(18px, 3.2vw, 22px);
  font-weight: 650;
  line-height: 1.45;
  color: var(--color-text);
}

.quiz-answers-container {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

/* Choice card */
.quiz-choice-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: #1c1f21;
  border: 1.5px solid var(--color-border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 160ms ease;
  user-select: none;
}

.quiz-choice-option:hover {
  border-color: #616669;
  background: #232729;
}

.quiz-choice-option.is-selected {
  border-color: var(--color-primary);
  background: rgb(244 123 59 / 12%);
  box-shadow: 0 0 0 1px var(--color-primary);
}

.quiz-choice-option input[type="radio"],
.quiz-choice-option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--color-primary);
  flex-shrink: 0;
}

.choice-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #292d30;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  transition: all 160ms ease;
}

.quiz-choice-option.is-selected .choice-letter {
  background: var(--color-primary);
  color: #17191b;
}

.choice-text {
  flex: 1;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--color-text);
}

/* Freitext Input */
.quiz-text-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quiz-text-input {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  background: #1c1f21;
  border: 1.5px solid var(--color-border);
  border-radius: 10px;
  color: var(--color-text);
  font-size: 14px;
  font-weight: 500;
  transition: border-color 160ms, box-shadow 160ms;
}

.quiz-text-input:focus {
  border-color: var(--color-primary);
  outline: none;
  box-shadow: 0 0 0 3px rgb(244 123 59 / 18%);
}

.quiz-field-hint {
  font-size: 11.5px;
  color: var(--color-subtle);
  margin: 0;
}

/* Player Action Bar */
.quiz-player-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.quiz-player-actions-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quiz-submit-action {
  background: linear-gradient(135deg, #f47b3b, #ff5722);
  color: #17191b;
  font-weight: 750;
  padding: 0 20px;
}

/* Auswertungsansicht (Results) */
.quiz-result-hero {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 34px 34px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: 0 6px 30px rgb(0 0 0 / 20%);
}

.quiz-result-score-circle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 128px;
  height: 128px;
  border-radius: 50%;
  border: 4px solid var(--color-primary);
  background: radial-gradient(circle, rgb(244 123 59 / 18%) 0%, transparent 75%);
  box-shadow: 0 0 24px rgb(244 123 59 / 22%);
  flex-shrink: 0;
}

.score-percent {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 850;
  color: var(--color-primary);
  letter-spacing: -1.2px;
  line-height: 1;
}

.score-fraction {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-muted);
}

.quiz-result-summary {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.quiz-result-eyebrow {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.4px;
  color: var(--color-primary);
}

.quiz-grade-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 6px 0 10px;
  flex-wrap: wrap;
}

.quiz-grade-display {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(22px, 3.5vw, 26px);
  font-weight: 750;
  letter-spacing: -0.5px;
  color: var(--color-text);
}

.quiz-grade-display.grade-1 {
  color: #34c759;
}

.quiz-grade-display.grade-2 {
  color: #5be27c;
}

.quiz-grade-display.grade-3 {
  color: #38bdf8;
}

.quiz-grade-display.grade-4 {
  color: #fbbf24;
}

.quiz-grade-display.grade-5 {
  color: #fb923c;
}

.quiz-grade-display.grade-6 {
  color: #ff4d4f;
}

.quiz-xp-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: rgb(244 123 59 / 18%);
  border: 1px solid rgb(244 123 59 / 35%);
  border-radius: 16px;
  color: #ff9a5f;
  font-size: 12.5px;
  font-weight: 750;
}

.quiz-result-feedback {
  margin: 0 0 20px;
  color: var(--color-muted);
  font-size: 13.5px;
  line-height: 1.6;
}

.quiz-result-buttons {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Detaillierte Fehleranalyse */
.quiz-analysis-section {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 14px;
}

.quiz-analysis-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.quiz-analysis-heading {
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 750;
}

.quiz-analysis-desc {
  margin: 0;
  color: var(--color-muted);
  font-size: 12.5px;
}

.quiz-analysis-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.quiz-review-card {
  padding: 22px 24px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-small);
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 2px 12px rgb(0 0 0 / 10%);
}

.quiz-review-card.is-correct-card {
  border-left: 4.5px solid #34c759;
}

.quiz-review-card.is-incorrect-card {
  border-left: 4.5px solid #ff4d4f;
}

.quiz-review-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.quiz-review-number {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-muted);
}

.review-status-badge {
  padding: 3px 9px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 750;
}

.review-status-badge.is-correct {
  background: rgb(52 199 89 / 16%);
  color: #34c759;
}

.review-status-badge.is-incorrect {
  background: rgb(255 77 79 / 16%);
  color: #ff4d4f;
}

.review-status-badge.is-partial {
  background: rgb(251 191 36 / 18%);
  color: #f59e0b;
}

.quiz-review-card.is-partial-card {
  border-left: 4.5px solid #f59e0b;
}

.answer-box.user-answer.is-partial {
  background: rgb(251 191 36 / 9%);
  border-color: rgb(251 191 36 / 40%);
  color: #d97706;
}

.quiz-review-question {
  margin: 0;
  font-family: var(--font-display);
  font-size: 15.5px;
  font-weight: 650;
  line-height: 1.45;
  color: var(--color-text);
}

.quiz-review-comparison {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.answer-box {
  padding: 12px 14px;
  border-radius: 8px;
  background: #1a1c1e;
  border: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.answer-box-label {
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--color-muted);
}

.answer-box-content {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
}

.answer-box.user-answer.is-correct {
  background: rgb(52 199 89 / 9%);
  border-color: rgb(52 199 89 / 40%);
  color: #5be27c;
}

.answer-box.user-answer.is-incorrect {
  background: rgb(255 77 79 / 9%);
  border-color: rgb(255 77 79 / 40%);
  color: #ff7875;
}

.answer-box.correct-answer {
  background: rgb(52 199 89 / 6%);
  border-color: rgb(52 199 89 / 30%);
  color: #5be27c;
}

.quiz-explanation-box {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: rgb(244 123 59 / 8%);
  border: 1px solid rgb(244 123 59 / 24%);
  border-radius: 9px;
}

.explanation-icon {
  font-size: 18px;
  line-height: 1.2;
  flex-shrink: 0;
}

.quiz-explanation-box strong {
  display: block;
  font-size: 11px;
  font-weight: 750;
  color: #ff9a5f;
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.quiz-explanation-box p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--color-text);
}

/* Light mode overrides */
body[data-theme="light"] .quiz-editor-header,
body[data-theme="light"] .quiz-question-editor-card,
body[data-theme="light"] .quiz-progress-container,
body[data-theme="light"] .quiz-question-card,
body[data-theme="light"] .quiz-result-hero,
body[data-theme="light"] .quiz-review-card {
  background: #ffffff;
  border-color: #d9dddc;
  box-shadow: 0 2px 14px rgb(21 30 31 / 6%);
}

body[data-theme="light"] .quiz-q-index-pill,
body[data-theme="light"] .quiz-q-type-select,
body[data-theme="light"] .quiz-opt-input,
body[data-theme="light"] .quiz-text-input,
body[data-theme="light"] .quiz-step-pill,
body[data-theme="light"] .quiz-choice-option,
body[data-theme="light"] .answer-box {
  background: #f8f9f8;
  border-color: #d9dddc;
  color: #282c2d;
}

body[data-theme="light"] .quiz-choice-option:hover {
  background: #f1f3f2;
}

body[data-theme="light"] .quiz-choice-option.is-selected {
  background: #fff3ec;
  border-color: #f47b3b;
}

body[data-theme="light"] .quiz-progress-bar-track {
  background: #e6eae9;
}

body[data-theme="light"] .choice-letter {
  background: #e9eceb;
  color: #555c5d;
}

body[data-theme="light"] .quiz-explanation-box {
  background: #fff5ee;
  border-color: #ffd8c2;
}

/* Responsive adjustments */
@media (max-width: 680px) {
  .quiz-workspace {
    padding: 16px 12px 36px;
  }

  .quiz-result-hero {
    flex-direction: column;
    text-align: center;
    padding: 24px 18px;
    gap: 20px;
  }

  .quiz-grade-row {
    justify-content: center;
  }

  .quiz-result-buttons {
    justify-content: center;
  }

  .quiz-question-card {
    padding: 20px 16px;
  }

  .quiz-player-actions {
    flex-direction: column-reverse;
    width: 100%;
  }

  .quiz-player-actions>button,
  .quiz-player-actions-right {
    width: 100%;
  }

  .quiz-player-actions-right>button {
    flex: 1;
  }
}

/* ==========================================================================
   Craft.do Editor Enhancements & Aesthetics
   ========================================================================== */

/* Toolbar Groups & Stats Pill */
.editor-toolbar-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.editor-toolbar-end {
  margin-left: auto;
}

.editor-stats-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border: 1px solid var(--color-border);
  border-radius: 20px;
  background: var(--color-surface);
  color: var(--color-subtle);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.01em;
  user-select: none;
}

.craft-block-selector-label {
  display: inline-flex;
  align-items: center;
}

.craft-block-format-select {
  min-height: 29px;
  padding: 0 24px 0 10px;
  border: 1px solid var(--color-border);
  border-radius: 7px;
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}

.craft-block-format-select:hover {
  border-color: var(--color-primary);
}

.craft-block-format-select:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
}

/* Craft.do Left-Positioned Block Handle */
.editor-drag-handle {
  position: fixed;
  z-index: 28;
  display: flex;
  width: 24px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-surface);
  box-shadow: 0 2px 10px rgb(0 0 0 / 22%), 0 1px 3px rgb(0 0 0 / 12%);
  color: var(--color-subtle);
  cursor: grab;
  user-select: none;
  touch-action: none;
  transition: transform 0.12s ease, color 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.editor-drag-handle:hover {
  transform: scale(1.1);
  border-color: var(--color-primary);
  background: var(--color-bg);
  color: var(--color-primary);
}

.editor-drag-handle.is-grabbing {
  cursor: grabbing;
  transform: scale(0.95);
  box-shadow: 0 4px 16px rgb(0 0 0 / 35%);
}

.editor-drop-indicator {
  position: fixed;
  z-index: 29;
  height: 3px;
  border-radius: 3px;
  background: var(--color-primary);
  box-shadow: 0 0 8px rgb(244 123 59 / 65%);
  pointer-events: none;
  transition: top 0.08s ease;
}

.editor-drop-indicator::before {
  position: absolute;
  top: 50%;
  left: -4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-primary);
  content: "";
  transform: translateY(-50%);
  box-shadow: 0 0 6px rgb(244 123 59 / 75%);
}

/* Craft.do Block Action Menu */
.craft-block-menu {
  position: fixed;
  z-index: 35;
  width: min(320px, calc(100vw - 24px));
  max-height: min(460px, calc(100vh - 32px));
  padding: 12px;
  overflow-y: auto;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background: rgba(30, 33, 36, 0.96);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 16px 40px rgb(0 0 0 / 45%), 0 2px 10px rgb(0 0 0 / 25%);
  color: var(--color-text);
  animation: craftMenuFadeIn 0.15s ease-out;
}

@keyframes craftMenuFadeIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.craft-menu-section-header {
  padding: 4px 6px 6px;
  color: var(--color-subtle);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.craft-menu-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  margin-bottom: 4px;
}

.craft-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--color-text);
  font-size: 12px;
  font-weight: 550;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s, transform 0.1s;
}

.craft-menu-item:hover {
  background: rgb(255 255 255 / 10%);
  transform: translateX(2px);
}

.craft-menu-item-icon {
  display: inline-grid;
  width: 20px;
  height: 20px;
  place-items: center;
  color: var(--color-primary);
  font-size: 13px;
  font-weight: 700;
}

.craft-menu-divider {
  height: 1px;
  margin: 8px 0;
  background: var(--color-border);
}

.craft-color-picker-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 4px 2px;
}

.craft-color-pill {
  padding: 4px 9px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s, border-color 0.1s, background 0.1s;
}

.craft-color-pill:hover {
  transform: translateY(-1px);
  border-color: var(--color-primary);
}

.craft-color-pill.style-blue { background: rgb(59 130 246 / 18%); color: #60a5fa; border-color: rgb(59 130 246 / 35%); }
.craft-color-pill.style-green { background: rgb(16 185 129 / 18%); color: #34d399; border-color: rgb(16 185 129 / 35%); }
.craft-color-pill.style-amber { background: rgb(245 158 11 / 18%); color: #fbbf24; border-color: rgb(245 158 11 / 35%); }
.craft-color-pill.style-purple { background: rgb(139 92 246 / 18%); color: #a78bfa; border-color: rgb(139 92 246 / 35%); }
.craft-color-pill.style-coral { background: rgb(244 63 94 / 18%); color: #fb7185; border-color: rgb(244 63 94 / 35%); }

.craft-menu-actions {
  display: grid;
  gap: 3px;
}

.craft-menu-action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--color-text);
  font-size: 11.5px;
  font-weight: 550;
  cursor: pointer;
  transition: background 0.12s;
}

.craft-menu-action-btn:hover {
  background: rgb(255 255 255 / 8%);
}

.craft-menu-action-btn.danger {
  color: #f87171;
}

.craft-menu-action-btn.danger:hover {
  background: rgb(239 68 68 / 16%);
}

/* Craft Highlight Markers */
.craft-highlight-picker-container {
  position: relative;
  display: inline-flex;
}

.craft-highlight-palette {
  position: absolute;
  top: 100%;
  left: 50%;
  z-index: 32;
  display: flex;
  gap: 5px;
  padding: 6px;
  margin-top: 5px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface);
  box-shadow: 0 8px 24px rgb(0 0 0 / 30%);
  transform: translateX(-50%);
}

.highlight-swatch {
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid rgb(255 255 255 / 20%);
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.12s;
}

.highlight-swatch:hover {
  transform: scale(1.2);
}

.highlight-swatch.yellow { background: #fde047; }
.highlight-swatch.green  { background: #86efac; }
.highlight-swatch.blue   { background: #93c5fd; }
.highlight-swatch.pink   { background: #f472b6; }
.highlight-swatch.orange { background: #fb923c; }
.highlight-swatch.clear  {
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--color-subtle);
  font-size: 10px;
  font-weight: 700;
}

mark.craft-highlight {
  padding: 2px 5px;
  border-radius: 4px;
  color: inherit;
}

mark.craft-highlight-yellow { background: rgb(253 224 71 / 38%); }
mark.craft-highlight-green  { background: rgb(134 239 172 / 38%); }
mark.craft-highlight-blue   { background: rgb(147 197 253 / 38%); }
mark.craft-highlight-pink   { background: rgb(244 114 182 / 38%); }
mark.craft-highlight-orange { background: rgb(251 146 60 / 38%); }

/* Craft.do Callouts with Multi-block Support & Interactive Icon */
.editor-prose .editor-callout {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  margin: 1.4em 0;
  border: 1px solid var(--color-border);
  border-left: 4.5px solid var(--color-primary);
  border-radius: 14px;
  background: rgb(244 123 59 / 7%);
  transition: border-color 0.15s, background-color 0.15s;
}

.editor-prose .editor-callout.callout-info {
  border-left-color: #3b82f6;
  background: rgb(59 130 246 / 8%);
}

.editor-prose .editor-callout.callout-warning {
  border-left-color: #f59e0b;
  background: rgb(245 158 11 / 8%);
}

.editor-prose .editor-callout.callout-success {
  border-left-color: #10b981;
  background: rgb(16 185 129 / 8%);
}

.editor-prose .editor-callout.callout-note {
  border-left-color: #8b5cf6;
  background: rgb(139 92 246 / 8%);
}

.editor-prose .editor-callout.callout-idea {
  border-left-color: #f43f5e;
  background: rgb(244 63 94 / 8%);
}

.editor-prose .editor-callout-icon {
  display: inline-grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border-radius: 8px;
  background: rgb(255 255 255 / 10%);
  font-size: 16px;
  cursor: pointer;
  user-select: none;
  transition: transform 0.12s, background 0.12s;
}

.editor-prose .editor-callout-icon:hover {
  transform: scale(1.15);
  background: rgb(255 255 255 / 20%);
}

.editor-prose .editor-callout-content {
  flex: 1;
  min-width: 0;
}

.editor-prose .editor-callout-content > :first-child {
  margin-top: 0;
}

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

/* Callout Icon Picker Popup */
.craft-callout-picker {
  position: fixed;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
  padding: 8px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
  box-shadow: 0 10px 30px rgb(0 0 0 / 35%);
}

.callout-picker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--color-text);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.1s;
}

.callout-picker-item:hover {
  background: rgb(255 255 255 / 12%);
}

/* Craft.do Toggle Block (Collapsible) */
.editor-prose details.craft-toggle,
.wiki-detail-prose details.craft-toggle {
  margin: 1em 0;
  padding: 4px 0 4px 8px;
  border-left: 2px solid var(--color-border);
  border-radius: 4px;
  transition: border-color 0.15s;
}

.editor-prose details.craft-toggle[open],
.wiki-detail-prose details.craft-toggle[open] {
  border-left-color: var(--color-primary);
}

.editor-prose details.craft-toggle summary,
.wiki-detail-prose details.craft-toggle summary {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 650;
  color: var(--color-text);
  cursor: pointer;
  list-style: none;
  user-select: none;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background 0.12s;
}

.editor-prose details.craft-toggle summary::-webkit-details-marker,
.wiki-detail-prose details.craft-toggle summary::-webkit-details-marker {
  display: none;
}

.editor-prose details.craft-toggle summary::before,
.wiki-detail-prose details.craft-toggle summary::before {
  content: "▶";
  font-size: 10px;
  color: var(--color-primary);
  transition: transform 0.2s ease;
  display: inline-block;
}

.editor-prose details.craft-toggle[open] > summary::before,
.wiki-detail-prose details.craft-toggle[open] > summary::before {
  transform: rotate(90deg);
}

.editor-prose details.craft-toggle summary:hover,
.wiki-detail-prose details.craft-toggle summary:hover {
  background: rgb(255 255 255 / 6%);
}

.editor-prose .craft-toggle-content,
.wiki-detail-prose .craft-toggle-content {
  padding-left: 22px;
  margin-top: 6px;
}

/* Craft.do Card Container Block */
.editor-prose .craft-card-block,
.wiki-detail-prose .craft-card-block {
  padding: 18px 22px;
  margin: 1.4em 0;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background: var(--color-surface);
  box-shadow: 0 4px 18px rgb(0 0 0 / 12%);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.editor-prose .craft-card-block:hover,
.wiki-detail-prose .craft-card-block:hover {
  border-color: var(--color-primary);
  box-shadow: 0 8px 24px rgb(0 0 0 / 18%);
}

.editor-prose .craft-card-block.style-blue { background: rgb(59 130 246 / 7%); border-color: rgb(59 130 246 / 25%); }
.editor-prose .craft-card-block.style-green { background: rgb(16 185 129 / 7%); border-color: rgb(16 185 129 / 25%); }
.editor-prose .craft-card-block.style-amber { background: rgb(245 158 11 / 7%); border-color: rgb(245 158 11 / 25%); }
.editor-prose .craft-card-block.style-purple { background: rgb(139 92 246 / 7%); border-color: rgb(139 92 246 / 25%); }
.editor-prose .craft-card-block.style-coral { background: rgb(244 63 94 / 7%); border-color: rgb(244 63 94 / 25%); }

/* Code Block Copy Button & Header */
.editor-prose .code-block-wrapper,
.wiki-detail-prose .code-block-wrapper {
  position: relative;
  margin: 1.4em 0;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  overflow: hidden;
  background: #111315;
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  border-bottom: 1px solid rgb(255 255 255 / 8%);
  background: #181b1d;
  font-size: 11px;
  font-family: var(--font-body);
  color: var(--color-muted);
}

.code-block-lang {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-primary);
}

.code-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 6px;
  background: rgb(255 255 255 / 6%);
  color: var(--color-muted);
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
}

.code-copy-btn:hover {
  background: rgb(255 255 255 / 14%);
  color: #fff;
  border-color: rgb(255 255 255 / 25%);
}

.code-copy-btn.copied {
  background: rgb(16 185 129 / 20%);
  color: #34d399;
  border-color: rgb(16 185 129 / 40%);
}

/* Enhanced Slash Command Menu with Categorized Sections */
.slash-category-header {
  padding: 8px 10px 4px;
  color: var(--color-subtle);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  border-top: 1px solid var(--color-border);
  margin-top: 4px;
}

.slash-category-header:first-child {
  border-top: 0;
  margin-top: 0;
}

/* Light Theme Overrides */
body[data-theme="light"] .craft-block-menu {
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 16px 40px rgb(0 0 0 / 12%), 0 2px 8px rgb(0 0 0 / 6%);
  color: #22231f;
}

body[data-theme="light"] .craft-menu-item:hover {
  background: rgb(0 0 0 / 5%);
}

body[data-theme="light"] .craft-menu-action-btn:hover {
  background: rgb(0 0 0 / 5%);
}

body[data-theme="light"] .craft-callout-picker {
  background: #fff;
  box-shadow: 0 10px 30px rgb(0 0 0 / 10%);
}

body[data-theme="light"] .callout-picker-item:hover {
  background: rgb(0 0 0 / 5%);
}

body[data-theme="light"] .code-block-header {
  background: #f4f4f0;
  border-bottom-color: #e5e5de;
}

/* Craft.do Toggle Edit Button */
.craft-toggle-edit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 11px;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--color-muted);
}

.editor-prose details.craft-toggle summary:hover .craft-toggle-edit-btn {
  opacity: 0.7;
}

.craft-toggle-edit-btn:hover {
  opacity: 1 !important;
  background: rgb(255 255 255 / 12%);
  color: #fff;
}

body[data-theme="light"] .craft-toggle-edit-btn:hover {
  background: rgb(0 0 0 / 8%);
  color: #000;
}

.wiki-detail-prose .craft-toggle-edit-btn {
  display: none !important;
}

/* Dark Mode Slash Command Menu Polish */
body:not([data-theme="light"]) .slash-command-menu {
  background: #181a1b;
  border-color: rgb(255 255 255 / 10%);
  box-shadow: 0 16px 45px rgb(0 0 0 / 60%), 0 2px 8px rgb(0 0 0 / 40%);
}

body:not([data-theme="light"]) .slash-command-option:hover,
body:not([data-theme="light"]) .slash-command-option.is-selected,
body:not([data-theme="light"]) .slash-command-option[aria-selected="true"] {
  background: rgb(255 255 255 / 8%);
}

body:not([data-theme="light"]) .slash-command-icon {
  background: #222527;
  border-color: rgb(255 255 255 / 8%);
  color: var(--color-primary);
}
/* Tabellen-Menü: Plus/Minus */
.table-menu-stepper {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 6px;
  color: #c1c4c2;
  font-size: 10px;
  font-weight: 650;
}

.editor-table-menu .table-menu-stepper .context-menu-button {
  min-width: 26px;
  font-size: 14px;
  line-height: 1;
}

/* Code-Sprache nur im Codeblock */
.code-language-control[hidden] {
  display: none;
}

/* Einheitliche Dropdowns statt nativer Selects */
.ui-dropdown {
  position: relative;
  display: inline-flex;
}

.ui-dropdown-toggle {
  display: inline-flex;
  min-height: 29px;
  align-items: center;
  gap: 8px;
  padding: 0 9px;
  border: 1px solid var(--color-border);
  border-radius: 7px;
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.ui-dropdown-toggle:hover:not(:disabled) {
  border-color: var(--color-primary);
}

.ui-dropdown-toggle:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.ui-dropdown-toggle::after {
  content: "⌄";
  font-size: 12px;
  line-height: 1;
}

.ui-dropdown-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 4px);
  left: 0;
  min-width: 100%;
  max-height: 280px;
  padding: 4px;
  overflow: auto;
  border: 1px solid var(--color-border);
  border-radius: 9px;
  background: var(--color-surface);
  box-shadow: 0 10px 30px rgb(0 0 0 / 35%);
}

.ui-dropdown-menu[hidden] {
  display: none;
}

.ui-dropdown-option {
  display: block;
  width: 100%;
  padding: 6px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--color-text);
  font: inherit;
  font-size: 11px;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.ui-dropdown-option:hover:not(:disabled),
.ui-dropdown-option.is-selected {
  background: rgb(255 255 255 / 9%);
}

.ui-dropdown-option:disabled {
  opacity: .4;
  cursor: not-allowed;
}

/* Reader: Innenabstand und Lesezeit */
.wiki-detail-content {
  padding: 36px clamp(20px, 4.5vw, 52px);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  box-sizing: border-box;
}

.wiki-read-time,
.linked-wiki-read-time {
  display: inline-block;
  margin-top: 8px;
  color: var(--color-subtle);
  font-size: 12px;
  font-weight: 600;
}

.wiki-read-time {
  display: block;
  width: fit-content;
  margin-top: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--color-bg);
}

/* ==========================================================================
   KARTEIKARTEN & ÜBUNGSAUFGABEN
   ========================================================================== */

.exercise-meta-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 14px;
}

.exercise-field-input,
.exercise-code-textarea,
.exercise-hint-input {
  width: 100%;
  padding: 10px 12px;
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-small);
  font: inherit;
}

.exercise-code-textarea {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13.5px;
  line-height: 1.55;
  resize: vertical;
}

.exercise-field-input:focus,
.exercise-code-textarea:focus,
.exercise-hint-input:focus {
  outline: none;
  border-color: var(--color-primary);
}

@media (max-width: 720px) {
  .exercise-meta-grid {
    grid-template-columns: 1fr;
  }
}

/* Karteikarten-Player */
.flashcard-scene {
  perspective: 1400px;
  margin: 8px 0 18px;
}

.flashcard-card {
  position: relative;
  min-height: 280px;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 560ms cubic-bezier(0.4, 0.2, 0.2, 1);
}

.flashcard-card.no-transition {
  transition: none;
}

.flashcard-card.is-flipped {
  transform: rotateY(180deg);
}

.flashcard-card:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 4px;
  border-radius: var(--radius-card);
}

.flashcard-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 28px;
  text-align: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--color-shadow);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: auto;
}

.flashcard-face p {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(18px, 3vw, 24px);
  font-weight: 650;
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.flashcard-back {
  transform: rotateY(180deg);
  border-color: rgb(244 123 59 / 45%);
}

.flashcard-side-label {
  color: var(--color-primary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.flashcard-hint-box {
  margin: 0 0 14px;
  padding: 12px 16px;
  color: #ffb98f;
  background: rgb(244 123 59 / 12%);
  border: 1px solid rgb(244 123 59 / 30%);
  border-radius: var(--radius-small);
}

.flashcard-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
}

.flashcard-unknown:hover {
  border-color: #e5655f;
  color: #ff8a84;
}

@media (prefers-reduced-motion: reduce) {
  .flashcard-card {
    transition: none;
  }
}

/* Übungsaufgaben-Viewer */
.exercise-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.exercise-difficulty-badge,
.exercise-done-badge {
  padding: 5px 12px;
  border-radius: 16px;
  border: 1px solid var(--color-border);
  background: #272a2c;
  color: var(--color-muted);
  font-size: 12.5px;
  font-weight: 750;
}

.exercise-difficulty-badge[data-difficulty="leicht"] {
  color: #7bd88f;
  border-color: rgb(123 216 143 / 40%);
}

.exercise-difficulty-badge[data-difficulty="mittel"] {
  color: #ffc861;
  border-color: rgb(255 200 97 / 40%);
}

.exercise-difficulty-badge[data-difficulty="schwer"] {
  color: #ff8a84;
  border-color: rgb(255 138 132 / 40%);
}

.exercise-done-badge {
  color: #7bd88f;
  border-color: rgb(123 216 143 / 40%);
}

.exercise-panel {
  padding: 20px 22px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-small);
}

.exercise-panel h2 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 17px;
}

.exercise-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.exercise-panel-head h2 {
  margin: 0;
}

.exercise-rich {
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.exercise-panel-head + .exercise-rich,
.exercise-panel-head + .exercise-hints {
  margin-top: 14px;
}

.exercise-rich p {
  margin: 0 0 10px;
}

.exercise-rich code {
  padding: 1px 6px;
  background: var(--color-bg);
  border-radius: 5px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.92em;
}

.exercise-code {
  margin: 0 0 12px;
  padding: 14px 16px;
  overflow-x: auto;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-small);
}

.exercise-code code {
  padding: 0;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre;
}

.exercise-hints {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.exercise-hint-item {
  padding: 10px 14px;
  background: rgb(244 123 59 / 8%);
  border: 1px solid rgb(244 123 59 / 28%);
  border-radius: var(--radius-small);
}

.exercise-hint-item summary {
  cursor: pointer;
  color: var(--color-primary);
  font-weight: 700;
}

.exercise-hint-item .exercise-rich {
  margin-top: 8px;
}

.exercise-empty-note {
  margin: 0;
  color: var(--color-muted);
}

/* Teilaufgaben */
.exercise-subtasks {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
}

.exercise-subtask {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-small);
  transition: border-color 160ms;
}

.exercise-subtask-label {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.exercise-subtask-prompt {
  font-weight: 650;
}

.exercise-subtask-status {
  min-height: 1.2em;
  color: var(--color-muted);
  font-size: 12.5px;
  font-weight: 700;
}

.exercise-subtask.is-correct {
  border-color: rgb(123 216 143 / 55%);
}

.exercise-subtask.is-correct .exercise-subtask-status {
  color: #7bd88f;
}

.exercise-subtask.is-wrong {
  border-color: rgb(255 138 132 / 40%);
}

.exercise-subtask.is-wrong .exercise-subtask-status {
  color: #ff8a84;
}

.primary-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.exercise-subtask-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.exercise-subtask-row .exercise-subtask-input {
  flex: 1;
  min-width: 0;
}

.exercise-check-box {
  appearance: none;
  -webkit-appearance: none;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  margin: 0;
  display: grid;
  place-content: center;
  background: var(--color-bg);
  border: 1.5px solid var(--color-border);
  border-radius: 8px;
  cursor: pointer;
  transition: background 140ms, border-color 140ms;
}

.exercise-check-box:hover {
  border-color: var(--color-primary);
}

.exercise-check-box::after {
  content: "";
  width: 6px;
  height: 12px;
  margin-top: -2px;
  border: solid #000;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 120ms;
}

.exercise-check-box:checked {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.exercise-check-box:checked::after {
  transform: rotate(45deg) scale(1);
}

.exercise-check-box:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.quiz-result-buttons #flashcards-finish-btn {
  min-height: 38px;
  padding-block: 0;
}

/* CMS: Themenverwaltung */
.sidebar-topics {
  display: grid;
  gap: 2px;
  margin: -2px 0 2px 14px;
  padding-left: 8px;
  border-left: 1px solid var(--color-border);
}

.sidebar-topics:empty {
  display: none;
}

.sidebar-topics .side-link {
  min-height: 32px;
  font-size: 11px;
}

.sidebar-topics .side-link svg {
  width: 14px;
  height: 14px;
  flex-basis: 14px;
}

.sidebar-topics .side-link span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-topics .side-link[aria-current] {
  background: #f3f3ee;
  color: #4c503c;
  font-weight: 600;
}

.topics-cms-lead {
  max-width: 62ch;
  margin: 0 0 24px;
  color: var(--color-muted);
  font-size: 12px;
  line-height: 1.6;
}

.topics-cms-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

.topics-cms-panel {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: var(--color-surface);
}

.topics-cms-panel h2,
.topics-cms-group h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 650;
}

.topics-cms-group h3 {
  margin-bottom: 8px;
  color: var(--color-muted);
  font-size: 11px;
}

.topics-cms-form,
.topics-cms-groups {
  display: grid;
  gap: 12px;
}

.topics-cms-actions,
.topics-cms-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.topic-icon-picker {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  color: #595a50;
  font-size: 10px;
  font-weight: 600;
}

.topic-icon-picker legend {
  margin-bottom: 7px;
  padding: 0;
}

.topic-icon-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.topic-icon-option {
  position: relative;
  cursor: pointer;
}

.topic-icon-option input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.topic-icon-face {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--color-border);
  border-radius: 9px;
  color: var(--color-muted);
  transition: border-color 140ms, color 140ms, background 140ms;
}

.topic-icon-face svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.topic-icon-option input:checked + .topic-icon-face {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: rgb(244 123 59 / 10%);
}

.topic-icon-option input:focus-visible + .topic-icon-face {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.topics-cms-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.topics-cms-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.topics-cms-row-copy {
  display: grid;
  flex: 1 1 160px;
  min-width: 0;
  gap: 2px;
  font-size: 11px;
}

.topics-cms-row-copy span,
.topics-cms-row-copy small,
.topics-cms-empty {
  color: var(--color-muted);
  font-size: 10px;
}

.topics-cms-row-actions .secondary-button {
  min-height: 30px;
  padding: 0 10px;
}

.topics-danger-link {
  color: #e0705c;
}

.topics-delete-dialog {
  width: min(92vw, 440px);
  padding: 22px;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: 0 24px 80px rgb(0 0 0 / 45%);
}

.topics-delete-dialog::backdrop {
  background: rgb(0 0 0 / 55%);
}

.topics-delete-dialog h2 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 16px;
}

.topics-delete-dialog p {
  margin: 0 0 10px;
  color: var(--color-muted);
  font-size: 12px;
  line-height: 1.6;
}

.topics-delete-details {
  margin: 0 0 14px;
  padding-left: 18px;
  font-size: 12px;
  line-height: 1.7;
}

.topics-danger-button {
  background: #c9533d;
}

.topics-danger-button:hover {
  background: #b3432f;
}

@media (max-width: 860px) {
  .topics-cms-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

#avatar-upload-button {
  margin: -2px 0 12px;
  padding: 6px 12px;
  font-size: 12px;
}
