/* Dendrita platform view — production translation of the approved Home prototype. */

@font-face {
  font-family: "Dendrita Inter";
  src: url("/assets/inter-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: "Dendrita Playfair";
  src: url("/assets/playfair-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: "Dendrita Playfair";
  src: url("/assets/playfair-italic-latin.woff2") format("woff2");
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --d-green-900: #374529;
  --d-green-800: #465834;
  --d-green-700: #556b3f;
  --d-green-500: #7e9465;
  --d-green-300: #abbc94;
  --d-green-100: #e5ebd9;
  --d-green-50: #f1f4e9;
  /* Supporting slate blue — the owner's study-plan artifact, oklch(48% .07 230) / oklch(42% .07 230)
     resolved to sRGB. Green stays dominant; blue marks the study-material action and the answer a
     revealed flashcard is testing — the two places that must not read as more of the green field. */
  --d-blue-700: #2e657e;
  --d-blue-800: #1b546c;
  --d-ground: #f2efe6;
  --d-cream: #f2efe6;
  --d-paper: #fbfaf5;
  --d-white: #fff;
  --d-fixed-light: #f2efe6;
  --d-on-primary: #f2efe6;
  --d-ink: #1a1d1a;
  --d-text: #3a3e38;
  --d-muted: #7c806f;
  --d-border: #e2ddcf;
  --d-green-border: #d5dec2;
  --d-cream-glass: rgb(242 239 230 / 96%);
  --d-white-glass: rgb(255 255 255 / 97%);
  --d-paper-glass: rgb(251 250 245 / 97%);
  --d-accent-rust: #b85c38;
  --d-success-bg: #edf2e4;
  --d-error: var(--d-accent-rust);
  --d-error-border: #c9805e;
  --d-error-bg: #f5e9e2;
  --d-warning: #8a6407;
  --d-warning-border: #d8c48a;
  --d-warning-bg: #f3ecd8;
  --d-on-dark: #f2efe6;
  --d-on-dark-muted: #c9cfbe;
  --d-sidebar-width: 220px;
  --d-font-body: "Dendrita Inter", Inter, system-ui, sans-serif;
  --d-font-display: "Dendrita Playfair", Georgia, serif;
  --d-shadow-card: 0 1px 2px rgb(26 29 26 / 5%);
  --d-mobile-nav-height: calc(64px + env(safe-area-inset-bottom));
}

/* The owner-approved dark extension keeps Dendrita warm and botanical: moss-black ground,
   charcoal paper, sage controls, and ivory ink. All work surfaces inherit through these tokens. */
:root[data-theme="dark"] {
  --d-green-900: #283323;
  --d-green-800: #78945e;
  --d-green-700: #93ab78;
  --d-green-500: #829b6b;
  --d-green-300: #657957;
  --d-green-100: #303a2c;
  --d-green-50: #252d23;
  --d-blue-700: #70a6be;
  --d-blue-800: #5c91a9;
  --d-ground: #141914;
  --d-paper: #1b211a;
  --d-white: #22291f;
  --d-on-primary: #141914;
  --d-ink: #f4f1e8;
  --d-text: #d8ddcf;
  --d-muted: #aeb6a4;
  --d-border: #3b4537;
  --d-green-border: #526348;
  --d-cream-glass: rgb(20 25 20 / 96%);
  --d-white-glass: rgb(34 41 31 / 97%);
  --d-paper-glass: rgb(27 33 26 / 97%);
  --d-accent-rust: #df8964;
  --d-success-bg: #273424;
  --d-error: #ed9d79;
  --d-error-border: #92563e;
  --d-error-bg: #36241f;
  --d-warning: #e0b85f;
  --d-warning-border: #7d6732;
  --d-warning-bg: #332c1e;
  --d-on-dark: #f4f1e8;
  --d-on-dark-muted: #cad2c0;
  --d-shadow-card: 0 1px 2px rgb(0 0 0 / 24%);
}

html:has(body[data-platform-view="dendrita"]),
body[data-platform-view="dendrita"] {
  height: 100%;
  margin: 0;
  overflow: hidden;
  color-scheme: light;
  background: var(--d-ground);
}

:root[data-theme="dark"]:has(body[data-platform-view="dendrita"]),
:root[data-theme="dark"] body[data-platform-view="dendrita"] {
  color-scheme: dark;
}

/* Solid sage, rust, and blue controls become lighter in the dark palette; their ink follows. */
:root[data-theme="dark"] .card.auth .btn.block,
:root[data-theme="dark"] .dendrita-week-day.is-today .dendrita-week-dot,
:root[data-theme="dark"] .dendrita-block-form .dendrita-primary-button,
:root[data-theme="dark"] .dendrita-question-map-cell.is-correct,
:root[data-theme="dark"] .dendrita-question-map-cell.is-incorrect,
:root[data-theme="dark"] body.dendrita-question-active .opt.correct .key,
:root[data-theme="dark"] body.dendrita-question-active .opt.incorrect .key,
:root[data-theme="dark"] body.dendrita-question-active .qtag.topic:hover,
:root[data-theme="dark"] body.dendrita-question-active .dendrita-question-primary,
:root[data-theme="dark"] body.dendrita-question-summary-active .gi.correct,
:root[data-theme="dark"] body.dendrita-question-summary-active .gi.incorrect,
:root[data-theme="dark"] body.dendrita-question-summary-active .qcard .btn,
:root[data-theme="dark"] body.dendrita-flashcard-active .dendrita-flashcard-reveal,
:root[data-theme="dark"] .dendrita-flashcard-summary-actions button:first-child,
:root[data-theme="dark"] .dendrita-explore-node-ring,
:root[data-theme="dark"] .dendrita-explore-empty button,
:root[data-theme="dark"] .dendrita-content .dendrita-primary-button,
:root[data-theme="dark"] .dendrita-content-chips button.is-active,
:root[data-theme="dark"] .dendrita-content-failure button,
:root[data-theme="dark"] .dendrita-reviews-seg button.is-active,
:root[data-theme="dark"] .dendrita-decks-review-all,
:root[data-theme="dark"] .dendrita-account-danger.is-solid,
:root[data-theme="dark"] .dendrita-account-retry,
:root[data-theme="dark"] body[data-platform-view="dendrita"] .dendrita-plan-modes button.is-active,
:root[data-theme="dark"] body[data-platform-view="dendrita"] .dendrita-plan-seg button.is-active,
:root[data-theme="dark"] body[data-platform-view="dendrita"] .dendrita-plan-secondary,
:root[data-theme="dark"] body[data-platform-view="dendrita"] .dendrita-plan-start,
:root[data-theme="dark"] body.dendrita-question-active .reportpanel #reportSend,
:root[data-theme="dark"] body.dendrita-flashcard-active .reportpanel #reportSend,
:root[data-theme="dark"] .dendrita-account-report-send {
  color: var(--d-on-primary);
}

/* The shared reference client also has a blue-black dark palette. Dendrita owns these controls
   when its view is active, so the platform tokens must win the cascade. */
:root[data-theme="dark"] body[data-platform-view="dendrita"] select,
:root[data-theme="dark"] body[data-platform-view="dendrita"] input[type="number"],
:root[data-theme="dark"] body[data-platform-view="dendrita"] .seg button,
:root[data-theme="dark"] body[data-platform-view="dendrita"] .langbtn,
:root[data-theme="dark"] body[data-platform-view="dendrita"] .flagbtn,
:root[data-theme="dark"] body[data-platform-view="dendrita"] .chip,
:root[data-theme="dark"] body[data-platform-view="dendrita"] .adminInput,
:root[data-theme="dark"] body[data-platform-view="dendrita"] .invitelink input,
:root[data-theme="dark"] body[data-platform-view="dendrita"] .authform input {
  color: var(--d-text);
  background: var(--d-white);
  border-color: var(--d-border);
}

:root[data-theme="dark"] body.dendrita-question-active .opt {
  background: var(--d-paper); color: var(--d-text); border-color: var(--d-border);
}
:root[data-theme="dark"] body.dendrita-question-active .opt:hover:not(.disabled) { background: var(--d-green-50); border-color: var(--d-green-300); }
:root[data-theme="dark"] body.dendrita-question-active .opt.selected { background: var(--d-green-100); border-color: var(--d-green-500); }
:root[data-theme="dark"] body.dendrita-question-active .opt.correct { background: var(--d-success-bg); border-color: var(--d-green-500); }
:root[data-theme="dark"] body.dendrita-question-active .opt.incorrect { background: var(--d-error-bg); border-color: var(--d-error-border); }

body[data-platform-view="dendrita"] {
  font-family: var(--d-font-body);
  color: var(--d-text);
  -webkit-font-smoothing: antialiased;
}

body[data-platform-view="dendrita"] button,
body[data-platform-view="dendrita"] input,
body[data-platform-view="dendrita"] select {
  font: inherit;
}

.dendrita-compat {
  display: none !important;
}

.dendrita-shell {
  position: relative;
  display: flex;
  width: 100%;
  height: 100vh;
  min-height: 0;
  background: var(--d-ground);
}

.dendrita-sidebar {
  position: relative;
  z-index: 4;
  display: flex;
  flex: 0 0 var(--d-sidebar-width);
  flex-direction: column;
  width: var(--d-sidebar-width);
  height: 100%;
  padding: 22px 12px;
  overflow: hidden auto;
  box-sizing: border-box;
  color: var(--d-on-dark);
  background: var(--d-green-900) url("/assets/sidebar-texture.jpg") center / cover no-repeat;
  transition: width 180ms ease-out, flex-basis 180ms ease-out;
}

.dendrita-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 0 6px 20px;
}

.dendrita-brand img {
  display: block;
  flex: 0 0 auto;
  width: 28px;
  height: 32px;
  border-radius: 6px;
}

.dendrita-brand-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
  white-space: nowrap;
}

.dendrita-brand-copy > span {
  font: 400 22px/1 var(--d-font-display);
  color: var(--d-cream);
}

.dendrita-brand-copy small {
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--d-on-dark-muted);
}

.dendrita-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dendrita-nav .dendrita-nav-more,
.dendrita-mobile-menu { display: none; }

.dendrita-nav button {
  display: flex;
  align-items: center;
  width: 100%;
  height: 38px;
  gap: 11px;
  padding: 0 10px;
  color: var(--d-on-dark-muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 400;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  transition: background 150ms ease-out, color 150ms ease-out;
}

.dendrita-nav button:hover {
  color: var(--d-cream);
  background: rgb(242 239 230 / 10%);
}

.dendrita-nav button.is-active {
  color: var(--d-cream);
  background: rgb(242 239 230 / 13%);
  font-weight: 600;
}

/* The block builder is printed inside Home but ALSO as a sibling of Explore's and the content
   panel's <main>, so it cannot inherit its icon strokes from `.dendrita-home` — without its own
   entry here every icon in it fell back to a solid black fill (the magnifier became a dot). */
.dendrita-nav svg,
.dendrita-constancy svg,
.dendrita-sidebar-toggle svg,
.dendrita-auth-reveal svg,
.dendrita-block-builder svg,
.dendrita-home svg {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dendrita-nav svg {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
}

.dendrita-constancy {
  margin-top: auto;
  padding: 10px 12px;
  overflow: hidden;
  background: rgb(242 239 230 / 7%);
  border: 1px solid rgb(242 239 230 / 15%);
  border-radius: 10px;
}

.dendrita-constancy-head {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 10px;
  white-space: nowrap;
}

.dendrita-constancy-head > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--d-on-dark-muted);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.dendrita-preview-label { display: inline-flex; align-items: center; padding: 2px 5px; color: var(--d-green-900); background: var(--d-green-100); border-radius: 999px; font: 600 8px/1 var(--d-font-sans); letter-spacing: .06em; text-transform: uppercase; vertical-align: middle; }

.dendrita-constancy-streak {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  background: rgb(242 239 230 / 8%);
  border: 1px solid rgb(242 239 230 / 10%);
  border-radius: 9px;
}

.dendrita-constancy-flame {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: var(--d-accent-rust);
  background: rgb(184 92 56 / 16%);
  border-radius: 50%;
}

.dendrita-constancy-flame svg { width: 16px; height: 16px; }
.dendrita-constancy-copy { display: flex; min-width: 0; flex-direction: column; gap: 1px; }
.dendrita-constancy-copy b { color: var(--d-cream); font-size: 14px; line-height: 1.15; }
.dendrita-constancy-copy small { color: var(--d-on-dark-muted); font-size: 9.5px; line-height: 1.2; }

.dendrita-sidebar-tools { padding-top: 8px; }
.dendrita-theme-toggle {
  display: flex;
  width: 100%;
  min-height: 38px;
  align-items: center;
  gap: 11px;
  padding: 0 10px;
  color: var(--d-on-dark-muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}
.dendrita-theme-toggle:hover,
.dendrita-theme-toggle:focus-visible { color: var(--d-fixed-light); background: rgb(242 239 230 / 10%); outline: none; }
.dendrita-theme-icon { width: 17px; height: 17px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.dendrita-theme-icon-dark { display: none; }
:root[data-theme="dark"] .dendrita-theme-icon-light { display: none; }
:root[data-theme="dark"] .dendrita-theme-icon-dark { display: block; }

.dendrita-sidebar-toggle {
  position: absolute;
  z-index: 5;
  top: 25px;
  left: calc(var(--d-sidebar-width) - 13px);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  color: var(--d-green-700);
  background: var(--d-white);
  border: 1px solid var(--d-border);
  border-radius: 50%;
  box-shadow: 0 1px 2px rgb(26 29 26 / 8%);
  cursor: pointer;
  transition: left 180ms ease-out, background 150ms ease-out;
}

.dendrita-sidebar-toggle:hover { background: var(--d-green-100); }
.dendrita-sidebar-toggle svg { width: 14px; height: 14px; }

.dendrita-shell.is-collapsed .dendrita-sidebar {
  flex-basis: 64px;
  width: 64px;
}

.dendrita-shell.is-collapsed .dendrita-sidebar-toggle { left: 51px; }
.dendrita-shell.is-collapsed .dendrita-brand { justify-content: center; padding-inline: 0; }
.dendrita-shell.is-collapsed .dendrita-brand-copy,
.dendrita-shell.is-collapsed .dendrita-nav button span,
.dendrita-shell.is-collapsed .dendrita-constancy { display: none; }
.dendrita-shell.is-collapsed .dendrita-nav button { justify-content: center; width: 40px; padding: 0; margin-inline: auto; }
.dendrita-shell.is-collapsed .dendrita-theme-toggle { justify-content: center; width: 40px; padding: 0; margin-inline: auto; }
.dendrita-shell.is-collapsed .dendrita-theme-toggle span { display: none; }

.dendrita-workspace {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
}

body[data-platform-view="dendrita"] .dendrita-app {
  width: 100%;
  max-width: none;
  min-height: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body:not(.dendrita-authenticated) .dendrita-sidebar,
body:not(.dendrita-authenticated) .dendrita-sidebar-toggle { display: none; }

body:not(.dendrita-authenticated) .dendrita-workspace {
  display: grid;
  place-items: center;
  min-height: 100vh;
  background: var(--d-green-900) url("/assets/sidebar-texture.jpg") center / cover;
}

body:not(.dendrita-authenticated) .dendrita-app {
  width: min(440px, calc(100% - 32px));
  min-height: 0;
}

body:not(.dendrita-authenticated) .dendrita-app .card.auth {
  background: var(--d-paper);
  border: 1px solid var(--d-border);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgb(26 29 26 / 18%);
}

/* Auth card identity. The shared shell styles this card with the subject-neutral blue brand;
   Dendrita is the first thing a student sees, so the mark, wordmark, and primary action all
   speak the platform's own green. Blue stays reserved for the study-material action. */
.card.auth .authlogo {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  /* logo.png ships its own opaque green field; matching it exactly keeps the tile seamless. */
  background: rgb(86 109 65);
  box-shadow: none;
}
.card.auth .authlogo img { display: block; width: 44px; height: 50px; }

.card.auth h1 {
  color: var(--d-ink);
  font-family: var(--d-font-display);
  font-weight: 500;
  letter-spacing: 0;
}
.card.auth .authsub { color: var(--d-muted); }

.card.auth .authform label { color: var(--d-muted); }
.card.auth .authform input { border: 1px solid var(--d-border); border-radius: 9px; }
.card.auth .authform input:focus {
  border-color: var(--d-green-500);
  box-shadow: 0 0 0 3px rgb(126 148 101 / 22%);
}

.card.auth .btn.block { color: var(--d-cream); background: var(--d-green-800); }
.card.auth .btn.block:hover { background: var(--d-green-700); }

/* An empty error reserved a fixed strip that pushed the action away from the fields. */
.card.auth .autherr { color: var(--d-error); }
.card.auth .autherr:empty { display: none; }

.card.auth .dendrita-auth-field { position: relative; }
.card.auth .dendrita-auth-field input { padding-right: 44px; }
.card.auth .dendrita-auth-reveal {
  position: absolute;
  right: 9px;
  bottom: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  color: var(--d-muted);
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
}
.card.auth .dendrita-auth-reveal svg { width: 18px; height: 18px; }
.card.auth .dendrita-auth-reveal:hover { color: var(--d-text); background: var(--d-green-50); }

.card.auth .dendrita-auth-note {
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--d-border);
  color: var(--d-muted);
  font-size: 12.5px;
  line-height: 1.5;
  text-align: center;
}

body.dendrita-authenticated:not(.dendrita-home-active) .dendrita-app {
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 36px 48px;
}

body.dendrita-authenticated.dendrita-explore-active .dendrita-app {
  max-width: none;
  margin: 0;
  padding: 0;
}
body.dendrita-explore-active .dendrita-workspace { background: var(--d-ground); }

.dendrita-home {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 36px 36px;
  box-sizing: border-box;
}

.dendrita-home-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 2px 2px 0;
  margin-bottom: 12px;
}

.dendrita-home-header h1 {
  margin: 0;
  color: var(--d-ink);
  font: 500 30px/1.1 var(--d-font-display);
  letter-spacing: -.01em;
}

.dendrita-home-header p {
  margin: 5px 0 0;
  color: var(--d-muted);
  font-size: 14px;
}

.dendrita-user-tools {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 4px;
}

.dendrita-icon-button,
.dendrita-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  cursor: pointer;
}

.dendrita-icon-button {
  width: 38px;
  height: 38px;
  color: var(--d-ink);
  background: transparent;
  border-radius: 50%;
}

.dendrita-icon-button:hover { background: var(--d-green-100); }
.dendrita-icon-button svg { width: 20px; height: 20px; }

.dendrita-avatar {
  width: 42px;
  height: 42px;
  color: var(--d-cream);
  background: var(--d-green-800);
  border-radius: 50%;
  font-size: 15px;
  font-weight: 600;
}

.dendrita-profile-menu {
  position: absolute;
  z-index: 20;
  top: 52px;
  right: 0;
  display: grid;
  width: 156px;
  padding: 6px;
  background: var(--d-white);
  border: 1px solid var(--d-border);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgb(26 29 26 / 14%);
}

.dendrita-profile-menu[hidden] { display: none; }
.dendrita-profile-menu button { display: flex; align-items: center; gap: 8px; padding: 8px 9px; color: var(--d-text); background: transparent; border: 0; border-radius: 7px; text-align: left; cursor: pointer; }
.dendrita-profile-menu button:hover { background: var(--d-green-50); }
.dendrita-profile-menu svg { width: 15px; height: 15px; }

.dendrita-home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.42fr) minmax(300px, 1fr);
  gap: 14px;
  align-items: stretch;
}

.dendrita-care {
  position: relative;
  display: flex;
  min-height: 348px;
  padding: 20px 28px 14px;
  overflow: hidden;
  box-sizing: border-box;
  color: var(--d-on-dark);
  background: var(--d-green-800) url("/assets/hero-texture.jpg") center / cover;
  border-radius: 14px;
}

.dendrita-care-decoration {
  position: absolute;
  top: -12px;
  right: -130px;
  width: 623px;
  height: auto;
  max-width: none;
  opacity: .35;
  pointer-events: none;
}

.dendrita-care-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
}

.dendrita-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  color: var(--d-on-dark);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.dendrita-eyebrow svg { width: 18px; height: 18px; }
.dendrita-care h2 { max-width: 470px; margin: 0; color: var(--d-cream); font: 500 33px/1.12 var(--d-font-display); letter-spacing: -.015em; text-wrap: pretty; }
.dendrita-care.is-caught-up h2 { font-size: 46px; }
.dendrita-care.is-failure h2 { max-width: 440px; font-size: 36px; }
.dendrita-care-lead { max-width: 370px; margin: 10px 0 0; color: var(--d-on-dark-muted); font-size: 14px; line-height: 1.55; }

.dendrita-care-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px 22px;
  margin-top: 14px;
}

.dendrita-primary-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 10px 18px;
  color: var(--d-green-900);
  background: var(--d-cream);
  border: 0;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.dendrita-primary-button:hover { background: var(--d-border); }
.dendrita-primary-button svg { width: 17px; height: 17px; }
.dendrita-text-action { padding: 0; color: var(--d-cream); background: transparent; border: 0; font-size: 14px; font-weight: 500; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; cursor: pointer; }
.dendrita-text-action:hover { opacity: .8; }
.dendrita-time-preview { display: inline-flex; align-items: center; gap: 8px; color: var(--d-on-dark-muted); font-size: 13px; cursor: help; }
.dendrita-time-preview .dendrita-preview-label { color: var(--d-cream); background: rgb(242 239 230 / 14%); }
.dendrita-time-preview svg { width: 14px; height: 14px; color: var(--d-cream); }

.dendrita-offer {
  display: flex;
  max-width: 460px;
  flex-direction: column;
  gap: 4px;
  margin-top: 12px;
  padding: 9px 14px;
  box-sizing: border-box;
  border: 1px solid rgb(242 239 230 / 30%);
  border-radius: 10px;
}

.dendrita-offer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dendrita-offer-label { color: var(--d-on-dark-muted); font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.dendrita-offer-duration { padding: 2px 7px; color: var(--d-on-dark-muted); border: 1px solid rgb(242 239 230 / 30%); border-radius: 6px; font-size: 11px; }
.dendrita-offer-title { color: var(--d-cream); font: 500 16px/1.25 var(--d-font-display); }
.dendrita-offer-sequence { color: var(--d-on-dark-muted); font-size: 11.5px; }
.dendrita-offer-actions { display: flex; align-items: center; gap: 16px; padding-top: 2px; }
.dendrita-offer-actions button { padding: 0; color: var(--d-on-dark-muted); background: transparent; border: 0; font-size: 13px; cursor: pointer; }
.dendrita-offer-actions button:first-child { color: var(--d-cream); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }

.dendrita-due-split {
  display: flex;
  gap: 12px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid rgb(242 239 230 / 20%);
}

.dendrita-due-kind {
  display: flex;
  flex: 1;
  min-width: 0;
  align-items: center;
  gap: 11px;
  padding: 6px 14px;
  color: inherit;
  background: transparent;
  border: 1px solid rgb(242 239 230 / 30%);
  border-radius: 10px;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.dendrita-due-kind:hover:not(:disabled) { background: rgb(242 239 230 / 8%); }
.dendrita-due-kind:focus-visible { outline: 2px solid var(--d-cream); outline-offset: 2px; }
.dendrita-due-kind:disabled { opacity: .5; cursor: default; }
.dendrita-due-kind > i { display: flex; flex: 0 0 auto; align-items: center; justify-content: center; width: 30px; height: 30px; border: 1px solid rgb(242 239 230 / 45%); border-radius: 50%; }
.dendrita-due-kind svg { width: 15px; height: 15px; }
.dendrita-due-kind span { color: var(--d-on-dark); font-size: 13px; }
.dendrita-due-kind b { margin-left: auto; color: var(--d-cream); font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; }

.dendrita-loading-stack { display: grid; gap: 14px; }
.dendrita-skeleton { overflow: hidden; border-radius: 8px; background: rgb(242 239 230 / 12%); }
.dendrita-skeleton::after { display: block; width: 45%; height: 100%; content: ""; background: linear-gradient(90deg, transparent, rgb(255 255 255 / 12%), transparent); animation: dendrita-shimmer 1.3s linear infinite; }
.dendrita-skeleton.is-title { width: min(320px, 100%); height: 46px; }
.dendrita-skeleton.is-line { width: min(420px, 100%); height: 14px; }
.dendrita-skeleton.is-action { width: 160px; height: 44px; margin-top: 10px; }
@keyframes dendrita-shimmer { from { transform: translateX(-120%); } to { transform: translateX(250%); } }
/* dendrita-shimmer slides a narrow highlight strip inside an overflow-hidden parent — correct for
   ::after sweeps, wrong for the loading placeholders, which carry the gradient on themselves: there
   the translate moved the whole bar sideways across the card instead of sweeping light over it.
   Those animate their own background position. */
@keyframes dendrita-sheen { from { background-position: -140% 0; } to { background-position: 140% 0; } }

.dendrita-home-side { display: flex; min-width: 0; flex-direction: column; gap: 14px; }
.dendrita-paper-card { background: var(--d-paper); border: 1px solid var(--d-border); border-radius: 14px; box-shadow: var(--d-shadow-card); }

.dendrita-topic-card { position: relative; padding: 16px 18px; }
.dendrita-card-title { display: flex; align-items: center; gap: 11px; color: var(--d-ink); font: 500 21px/1.2 var(--d-font-display); }
.dendrita-card-title svg { width: 22px; height: 22px; color: var(--d-green-700); }
.dendrita-help-toggle { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0; color: var(--d-muted); background: transparent; border: 0; border-radius: 999px; cursor: pointer; }
.dendrita-help-toggle:hover, .dendrita-help-toggle[aria-expanded="true"] { color: var(--d-green-700); background: var(--d-green-100); }
.dendrita-card-title .dendrita-help-toggle { margin-inline-start: -5px; }
.dendrita-card-title .dendrita-help-toggle svg { width: 15px; height: 15px; color: inherit; }
/* The help note floats over its own card instead of growing it. The desktop Home stretches both
   columns to the tallest sibling, so an inline disclosure here also grew the neighbouring care
   card — issue 34 decoupled only the leaf, issue 39 the card. Leaving top/bottom auto keeps the
   note exactly where the flow would have placed it, under the card's subtitle. Below the
   two-column breakpoint nothing stretches, so the note stays an ordinary inline disclosure. */
.dendrita-help-note { position: absolute; z-index: 13; right: 18px; left: 18px; margin: 0; padding: 11px 13px; color: var(--d-text); background: var(--d-green-50); border: 1px solid var(--d-green-100); border-radius: 10px; box-shadow: 0 12px 32px rgb(26 29 26 / 14%); font-size: 12px; line-height: 1.55; }
.dendrita-help-note[hidden] { display: none; }
.dendrita-help-note p { margin: 0 0 7px; }
.dendrita-help-note p:last-child { margin: 0; }
.dendrita-topic-card > p { margin: 4px 0 12px; color: var(--d-muted); font-size: 12px; line-height: 1.5; }
.dendrita-topic-search { position: relative; }
.dendrita-topic-search > svg { position: absolute; top: 50%; left: 13px; width: 16px; height: 16px; color: var(--d-muted); transform: translateY(-50%); }
.dendrita-topic-search input { width: 100%; height: 38px; padding: 0 13px 0 38px; box-sizing: border-box; color: var(--d-text); background: var(--d-white); border: 1px solid var(--d-border); border-radius: 8px; outline: none; font-size: 13px; }
.dendrita-topic-search input:focus { border-color: var(--d-green-500); box-shadow: 0 0 0 3px rgb(126 148 101 / 18%); }
.dendrita-topic-list { position: absolute; z-index: 12; top: 42px; right: 0; left: 0; display: grid; padding: 5px; background: var(--d-white); border: 1px solid var(--d-border); border-radius: 8px; box-shadow: 0 8px 24px rgb(26 29 26 / 12%); }
.dendrita-topic-list[hidden] { display: none; }
.dendrita-topic-list button { padding: 8px 9px; color: var(--d-text); background: transparent; border: 0; border-radius: 6px; font-size: 12.5px; text-align: left; cursor: pointer; }
.dendrita-topic-list button:hover { background: var(--d-green-50); }
.dendrita-topic-suggest-head { display: flex; align-items: center; justify-content: space-between; margin: 14px 0 8px; }
.dendrita-topic-suggest-label { color: var(--d-muted); font-size: 10.5px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
.dendrita-topic-shuffle { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; color: var(--d-green-700); background: transparent; border: 0; border-radius: 6px; font-size: 12px; cursor: pointer; }
.dendrita-topic-shuffle:hover:not(:disabled) { background: var(--d-green-100); }
.dendrita-topic-shuffle:disabled { opacity: .55; cursor: default; }
.dendrita-topic-shuffle svg { width: 14px; height: 14px; transition: transform .35s ease; }
.dendrita-topic-chips { display: flex; flex-wrap: wrap; gap: 8px; transition: opacity .18s ease; }
.dendrita-topic-search + .dendrita-topic-chips { margin-top: 10px; }
.dendrita-topic-suggest-head + .dendrita-topic-chips { min-height: 72px; align-content: flex-start; }
.dendrita-topic-chips.is-swapping { opacity: 0; }
.dendrita-topic-chips button { max-width: 230px; overflow: hidden; padding: 7px 14px; color: var(--d-green-800); background: var(--d-green-50); border: 1px solid var(--d-green-100); border-radius: 999px; font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.dendrita-topic-chips button:hover:not(:disabled) { background: var(--d-green-100); border-color: var(--d-green-300); }
.dendrita-topic-chips button:disabled { opacity: .72; cursor: help; }
.dendrita-topic-skeleton { position: relative; display: block; width: var(--d-topic-skeleton-width); height: 34px; overflow: hidden; background: var(--d-green-100); border-radius: 999px; }
.dendrita-topic-skeleton::after { position: absolute; inset: 0; display: block; width: 45%; content: ""; background: linear-gradient(90deg, transparent, rgb(255 255 255 / 55%), transparent); animation: dendrita-shimmer 1.3s linear infinite; }
.dendrita-topic-empty { padding: 7px 0; color: var(--d-muted); font-size: 12.5px; }

.dendrita-side-bottom { display: flex; flex-direction: column; gap: 14px; }
.dendrita-build-card { display: flex; align-items: center; gap: 13px; width: 100%; padding: 12px 16px; color: inherit; text-align: left; cursor: pointer; }
.dendrita-build-card:hover { background: var(--d-green-50); }
.dendrita-build-icon { display: flex; flex: 0 0 auto; align-items: center; justify-content: center; width: 38px; height: 38px; color: var(--d-green-800); background: var(--d-green-100); border-radius: 50%; }
.dendrita-build-icon svg { width: 18px; height: 18px; }
.dendrita-build-copy { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.dendrita-build-copy b { color: var(--d-ink); font: 500 18px/1.2 var(--d-font-display); }
.dendrita-build-copy span { color: var(--d-muted); font-size: 12px; line-height: 1.4; }
.dendrita-build-arrow { width: 18px; height: 18px; margin-left: auto; color: var(--d-ink); }

.dendrita-streak-card { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 14px; }
.dendrita-streak-number { display: flex; flex: 0 0 auto; flex-direction: column; align-items: center; gap: 2px; }
.dendrita-streak-number > b { display: flex; align-items: baseline; gap: 7px; color: var(--d-ink); font-size: 18px; font-weight: 600; }
.dendrita-streak-number svg { width: 16px; height: 16px; color: var(--d-accent-rust); }
.dendrita-streak-number span { color: var(--d-muted); font-size: 11px; }
.dendrita-week { display: flex; gap: 4px; margin-left: auto; }
.dendrita-week-day { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.dendrita-week-dot { display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; box-sizing: border-box; color: var(--d-green-700); border: 1px solid var(--d-border); border-radius: 50%; }
.dendrita-week-day.is-done .dendrita-week-dot { background: var(--d-green-100); border: 0; }
.dendrita-week-day.is-today .dendrita-week-dot { color: var(--d-cream); background: var(--d-green-700); }
.dendrita-week-day.is-future .dendrita-week-dot { background: transparent; border-style: dashed; }
.dendrita-week-day.is-missed .dendrita-week-dot { background: transparent; opacity: .55; }
.dendrita-week-dot svg { width: 11px; height: 11px; }
.dendrita-week-label { color: var(--d-muted); font-size: 9.5px; }
.dendrita-week-day.is-today .dendrita-week-label { color: var(--d-green-700); font-weight: 700; }

.dendrita-garden { min-height: 330px; margin-top: 12px; padding: 20px; box-sizing: border-box; }
.dendrita-garden .dendrita-card-title { font-size: 22px; }
.dendrita-garden .dendrita-card-title svg { width: 24px; height: 24px; }
.dendrita-garden-preview { padding: 28px 4px 12px; color: var(--d-muted); font: italic 13px var(--d-font-body); }

.dendrita-modal { position: fixed; z-index: 50; inset: 0; display: grid; place-items: center; padding: 20px; background: rgb(26 29 26 / 36%); }
.dendrita-modal[hidden] { display: none; }
.dendrita-modal-card { width: min(520px, 100%); padding: 22px; box-sizing: border-box; background: var(--d-paper); border: 1px solid var(--d-border); border-radius: 14px; box-shadow: 0 16px 48px rgb(26 29 26 / 20%); }
.dendrita-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.dendrita-modal-head h2 { margin: 0; color: var(--d-ink); font: 500 24px var(--d-font-display); }
.dendrita-modal-close { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; color: var(--d-muted); background: transparent; border: 0; border-radius: 50%; cursor: pointer; }
.dendrita-modal-close:hover { background: var(--d-green-100); }
.dendrita-modal-close svg { width: 18px; height: 18px; }
.dendrita-block-form { display: grid; gap: 16px; }
.dendrita-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dendrita-block-form label { display: grid; gap: 7px; color: var(--d-muted); font-size: 12.5px; }
.dendrita-block-form select,
.dendrita-block-form input { width: 100%; min-height: 42px; padding: 0 12px; box-sizing: border-box; color: var(--d-text); font-size: 13.5px; background: var(--d-white); border: 1px solid var(--d-border); border-radius: 9px; }
.dendrita-block-form select:focus-visible,
.dendrita-block-form input:focus-visible { outline: none; border-color: var(--d-green-500); box-shadow: 0 0 0 3px var(--d-green-100); }
.dendrita-block-form .dendrita-primary-button { justify-self: stretch; justify-content: center; min-height: 46px; margin-top: 2px; color: var(--d-cream); background: var(--d-green-700); }
.dendrita-block-form .dendrita-primary-button:hover { background: var(--d-green-800); }
.dendrita-block-builder { z-index: 95; }
.dendrita-block-builder .dendrita-modal-card { width: min(620px, 100%); max-height: min(760px, calc(100vh - 32px)); overflow-y: auto; }
.dendrita-block-builder .dendrita-modal-head > div { display: grid; gap: 2px; }
.dendrita-block-builder .dendrita-modal-head span { color: var(--d-green-700); font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.dendrita-block-builder-open { overflow: hidden; }
.dendrita-block-form[aria-busy="true"] { opacity: .7; }
.dendrita-block-scope { display: grid; gap: 9px; }
.dendrita-block-scope > label { color: var(--d-muted); font-size: 12.5px; }
.dendrita-block-scope-search { position: relative; }
.dendrita-block-scope-search > svg { position: absolute; z-index: 2; top: 50%; left: 13px; width: 16px; height: 16px; color: var(--d-green-700); transform: translateY(-50%); pointer-events: none; }
.dendrita-block-scope-search > input { padding-left: 38px; }
.dendrita-block-scope-results { position: absolute; z-index: 6; top: calc(100% + 6px); right: 0; left: 0; max-height: 264px; padding: 6px; overflow-y: auto; background: var(--d-white); border: 1px solid var(--d-border); border-radius: 11px; box-shadow: 0 14px 34px rgb(26 29 26 / 16%); }
.dendrita-block-scope-results[hidden] { display: none; }
.dendrita-block-scope-results button { display: flex; width: 100%; min-height: 50px; justify-content: center; flex-direction: column; gap: 3px; padding: 8px 10px; color: var(--d-text); background: transparent; border: 0; border-radius: 8px; text-align: left; cursor: pointer; }
.dendrita-block-scope-results button:hover,
.dendrita-block-scope-results button:focus-visible { background: var(--d-green-100); outline: none; }
.dendrita-block-scope-results button:disabled { opacity: .45; cursor: not-allowed; }
.dendrita-block-scope-results strong { color: var(--d-ink); font-size: 13.5px; font-weight: 600; }
.dendrita-block-scope-results small { color: var(--d-muted); font-size: 11.5px; }
.dendrita-block-scope-results p { margin: 10px; color: var(--d-muted); font-size: 12.5px; }
/* One sentence — "Escopo do bloco: <matéria>" — with the ancestor trail tucked under the name and a
   single quiet control that exists only while there is a scope to drop. Nothing chosen keeps the
   dashed outline: an empty scope is a state, not a filled card. */
.dendrita-block-scope-selection { display: grid; min-height: 52px; grid-template-columns: auto minmax(0, 1fr) auto; align-items: baseline; gap: 0 8px; padding: 11px 10px 11px 13px; background: var(--d-green-50); border: 1px solid var(--d-green-border); border-radius: 10px; box-sizing: border-box; }
.dendrita-block-scope-selection.is-empty { background: transparent; border-color: var(--d-border); border-style: dashed; }
.dendrita-block-scope-selection > span { color: var(--d-muted); font-size: 12.5px; white-space: nowrap; }
.dendrita-block-scope-selection > strong { min-width: 0; color: var(--d-ink); font-size: 14px; font-weight: 600; line-height: 1.35; }
.dendrita-block-scope-selection.is-empty > strong { color: var(--d-text); font-weight: 500; }
.dendrita-block-scope-trail { display: block; margin-top: 2px; color: var(--d-muted); font-size: 11.5px; font-weight: 400; }
.dendrita-block-scope-selection > button { display: flex; width: 34px; height: 34px; align-self: center; align-items: center; justify-content: center; padding: 0; color: var(--d-muted); background: transparent; border: 0; border-radius: 50%; cursor: pointer; }
.dendrita-block-scope-selection > button:hover { color: var(--d-green-900); background: var(--d-green-100); }
.dendrita-block-scope-selection > button svg { width: 15px; height: 15px; }
.dendrita-block-scope-selection > button[hidden] { display: none; }
.dendrita-form-row.is-count { grid-template-columns: minmax(160px, 1fr) 1fr; }

@media (max-width: 720px) {
  .dendrita-block-builder { align-items: end; padding: 10px; }
  .dendrita-block-builder .dendrita-modal-card { max-height: calc(100dvh - 20px); padding: 18px; border-radius: 16px; }
  .dendrita-block-builder .dendrita-modal-close { width: 44px; height: 44px; }
  .dendrita-block-form select,
  .dendrita-block-form input { min-height: 44px; }
  .dendrita-form-row.is-count { grid-template-columns: 1fr; }
  .dendrita-block-scope-selection > button { width: 44px; height: 44px; }
  .dendrita-block-scope-results { max-height: 220px; }
  .dendrita-block-form .dendrita-primary-button { width: 100%; min-height: 48px; justify-content: center; }
}

.dendrita-toast { position: fixed; z-index: 80; right: 24px; bottom: 24px; max-width: 340px; padding: 11px 14px; color: var(--d-cream); background: var(--d-green-900); border: 1px solid rgb(242 239 230 / 15%); border-radius: 9px; box-shadow: 0 8px 28px rgb(26 29 26 / 18%); font-size: 12px; line-height: 1.5; white-space: pre-line; animation: dendrita-toast-in 180ms ease-out; }
.dendrita-toast[hidden] { display: none; }
/* Both live in the same corner. When a session is parked there, the toast stacks above it. */
body:has(#dendritaResume:not([hidden])) .dendrita-toast { bottom: 76px; }
@keyframes dendrita-toast-in { from { opacity: 0; transform: translateY(8px); } }

/* Paused-session chip (issue 27) — same fixed corner as the toast, one layer below it. */
.dendrita-resume { position: fixed; z-index: 79; right: 24px; bottom: 24px; display: flex; align-items: stretch; max-width: 340px; color: var(--d-cream); background: var(--d-green-900); border: 1px solid rgb(242 239 230 / 15%); border-radius: 999px; box-shadow: 0 8px 28px rgb(26 29 26 / 18%); animation: dendrita-toast-in 180ms ease-out; }
.dendrita-resume[hidden] { display: none; }
.dendrita-resume button { display: flex; align-items: center; gap: 9px; padding: 9px 14px; color: inherit; background: transparent; border: 0; cursor: pointer; font: inherit; }
.dendrita-resume button:hover, .dendrita-resume button:focus-visible { background: rgb(242 239 230 / 10%); outline: none; }
.dendrita-resume svg { flex: 0 0 auto; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dendrita-resume-main { min-width: 0; border-radius: 999px 0 0 999px; }
.dendrita-resume-text { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; text-align: left; }
.dendrita-resume-text strong { font-size: 12.5px; font-weight: 600; }
.dendrita-resume-text small { max-width: 100%; overflow: hidden; color: rgb(242 239 230 / 72%); font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.dendrita-resume-discard { border-left: 1px solid rgb(242 239 230 / 15%); border-radius: 0 999px 999px 0; }

/* Designed confirmation — the platform's answer to window.confirm on destructive actions. */
.dendrita-ask { position: fixed; z-index: 120; inset: 0; display: grid; place-items: center; padding: 20px; background: rgb(26 29 26 / 46%); backdrop-filter: blur(2px); animation: dendrita-ask-veil 140ms ease-out; }
.dendrita-ask[hidden] { display: none; }
.dendrita-ask-open { overflow: hidden; }
.dendrita-ask-card { width: min(420px, 100%); padding: 26px 26px 20px; box-sizing: border-box; text-align: center; background: var(--d-paper); border: 1px solid var(--d-border); border-radius: 18px; box-shadow: 0 22px 60px rgb(26 29 26 / 28%); animation: dendrita-ask-card 180ms cubic-bezier(.2, .8, .3, 1); }
.dendrita-ask-mark { display: grid; width: 46px; height: 46px; margin: 0 auto 14px; place-items: center; color: var(--d-error); background: var(--d-error-bg); border: 1px solid var(--d-error-border); border-radius: 50%; }
.dendrita-ask-mark svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.dendrita-ask-eyebrow { display: block; color: var(--d-green-700); font: 700 9px var(--d-font-body); letter-spacing: .12em; text-transform: uppercase; }
.dendrita-ask-card h2 { margin: 7px 0 0; color: var(--d-ink); font: 500 23px/1.2 var(--d-font-display); }
.dendrita-ask-card p { margin: 9px auto 0; max-width: 34ch; color: var(--d-muted); font: 12.5px/1.55 var(--d-font-body); }
.dendrita-ask-actions { display: flex; gap: 9px; margin-top: 20px; }
.dendrita-ask-actions button { flex: 1 1 0; min-height: 42px; padding: 0 14px; border-radius: 10px; font: 600 13px var(--d-font-body); cursor: pointer; }
.dendrita-ask-cancel { color: var(--d-text); background: var(--d-white); border: 1px solid var(--d-border); }
.dendrita-ask-cancel:hover { background: var(--d-green-50); }
.dendrita-ask-confirm { color: var(--d-cream); background: var(--d-accent-rust); border: 1px solid var(--d-accent-rust); }
.dendrita-ask-confirm:hover { opacity: .92; }
/* An acknowledgement is not destructive: the lone button goes back to the ordinary moss action. */
.dendrita-ask-card.is-notice .dendrita-ask-confirm { color: var(--d-cream); background: var(--d-green-700); border-color: var(--d-green-700); }
.dendrita-ask-card.is-notice .dendrita-ask-confirm:hover { background: var(--d-green-800); opacity: 1; }
.dendrita-ask-actions > .dendrita-ask-confirm:only-child { flex: 0 1 190px; margin-inline: auto; }
.dendrita-ask-actions button:focus-visible { outline: 2px solid var(--d-green-700); outline-offset: 2px; }
:root[data-theme="dark"] .dendrita-ask-confirm,
:root[data-theme="dark"] .dendrita-ask-card.is-notice .dendrita-ask-confirm { color: var(--d-on-primary); }

@keyframes dendrita-ask-veil { from { opacity: 0; } }
@keyframes dendrita-ask-card { from { opacity: 0; transform: translateY(10px) scale(.97); } }

@media (prefers-reduced-motion: reduce) {
  .dendrita-ask, .dendrita-ask-card { animation: none; }
}

@media (max-width: 720px) {
  .dendrita-ask { padding: 16px; }
  .dendrita-ask-card { padding: 24px 20px 18px; }
  .dendrita-ask-actions { flex-direction: column-reverse; }
  .dendrita-ask-actions button { min-height: 48px; }
}

/* Question player — translated from the owner-supplied Question artifact. */
body.dendrita-question-active .dendrita-sidebar,
body.dendrita-question-summary-active .dendrita-sidebar {
  flex-basis: 64px;
  width: 64px;
}

body.dendrita-question-active .dendrita-brand,
body.dendrita-question-summary-active .dendrita-brand { justify-content: center; padding-inline: 0; }
body.dendrita-question-active .dendrita-brand-copy,
body.dendrita-question-active .dendrita-nav button span,
body.dendrita-question-active .dendrita-theme-toggle span,
body.dendrita-question-active .dendrita-constancy,
body.dendrita-question-summary-active .dendrita-brand-copy,
body.dendrita-question-summary-active .dendrita-nav button span,
body.dendrita-question-summary-active .dendrita-theme-toggle span,
body.dendrita-question-summary-active .dendrita-constancy { display: none; }
body.dendrita-question-active .dendrita-nav button,
body.dendrita-question-summary-active .dendrita-nav button { justify-content: center; width: 40px; padding: 0; margin-inline: auto; }
body.dendrita-question-active .dendrita-theme-toggle,
body.dendrita-question-summary-active .dendrita-theme-toggle { justify-content: center; width: 40px; padding: 0; margin-inline: auto; }
body.dendrita-question-active .dendrita-sidebar-toggle,
body.dendrita-question-summary-active .dendrita-sidebar-toggle { display: none; }

body.dendrita-question-active .dendrita-workspace,
body.dendrita-question-summary-active .dendrita-workspace {
  height: 100%;
  padding: 0;
  overflow: hidden;
}

body.dendrita-authenticated.dendrita-question-active .dendrita-app,
body.dendrita-authenticated.dendrita-question-summary-active .dendrita-app {
  width: 100%;
  max-width: none;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0 0 104px;
  overflow-y: auto;
  box-sizing: border-box;
  background: var(--d-ground);
  overscroll-behavior: contain;
}

.dendrita-question-header {
  position: sticky;
  z-index: 30;
  top: 0;
  display: grid;
  grid-template-columns: auto minmax(170px, 270px) minmax(190px, 420px) auto;
  align-items: center;
  gap: 18px;
  min-height: 68px;
  margin: 0;
  padding: 12px 28px;
  box-sizing: border-box;
  color: var(--d-muted);
  background: var(--d-cream-glass);
  border: 0;
  border-bottom: 1px solid var(--d-border);
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: blur(8px);
}

.dendrita-question-header svg,
.dendrita-question-map svg,
.dendrita-question-previous svg {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dendrita-question-exit,
.dendrita-question-timer-toggle,
.dendrita-question-map-toggle,
.dendrita-question-previous {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--d-muted);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.dendrita-question-exit {
  padding: 8px 2px;
  font-size: 13px;
}

.dendrita-question-exit:hover { color: var(--d-ink); }
.dendrita-question-exit svg { width: 16px; height: 16px; }

.dendrita-question-identity {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 1px;
}

.dendrita-question-identity > strong {
  overflow: hidden;
  color: var(--d-ink);
  font: 500 16px/1.2 var(--d-font-display);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dendrita-question-identity #qpos {
  color: var(--d-muted);
  font-size: 11.5px;
  white-space: nowrap;
}

.dendrita-question-identity #qpos strong { font-weight: 400; }

.dendrita-question-progress {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.dendrita-question-progress .progressbar {
  flex: 1 1 auto;
  height: 4px;
  margin: 0;
  overflow: hidden;
  background: var(--d-green-100);
  border-radius: 999px;
}

.dendrita-question-progress .progressbar > i {
  background: var(--d-green-500);
  border-radius: inherit;
  transition: width 200ms ease-out;
}

.dendrita-question-completed {
  flex: 0 0 auto;
  color: var(--d-muted);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.dendrita-question-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.dendrita-question-timer {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  box-sizing: border-box;
  color: var(--d-muted);
  background: var(--d-white);
  border: 1px solid var(--d-border);
  border-radius: 6px;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.dendrita-question-timer[hidden] { display: none; }
.dendrita-question-timer svg { width: 13px; height: 13px; }
.dendrita-question-timer .timer { color: var(--d-muted); font-weight: 400; }

.dendrita-question-timer-toggle {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
}

.dendrita-question-timer-toggle:hover,
.dendrita-question-timer-toggle.is-hidden { background: var(--d-green-100); }
.dendrita-question-timer-toggle svg { width: 15px; height: 15px; }

.dendrita-question-tools .langbtn,
.dendrita-question-map-toggle {
  min-height: 30px;
  padding: 5px 10px;
  box-sizing: border-box;
  color: var(--d-text);
  background: var(--d-white);
  border: 1px solid var(--d-border);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}

.dendrita-question-tools .langbtn:hover,
.dendrita-question-map-toggle:hover,
.dendrita-question-map-toggle.is-active {
  color: var(--d-green-900);
  background: var(--d-green-100);
  border-color: var(--d-green-300);
}

.dendrita-question-map-toggle svg { width: 14px; height: 14px; }

.dendrita-question-map {
  padding: 13px 28px 14px;
  box-sizing: border-box;
  background: var(--d-white);
  border-bottom: 1px solid var(--d-border);
  animation: dendrita-map-in 160ms ease-out;
}

.dendrita-question-map[hidden] { display: none; }
@keyframes dendrita-map-in { from { opacity: 0; transform: translateY(-4px); } }

.dendrita-question-map > * { width: min(760px, 100%); margin-inline: auto; }

.dendrita-question-map-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 10px;
}

.dendrita-question-map-head > span:first-child {
  color: var(--d-muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.dendrita-question-map-legend {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  color: var(--d-muted);
  font-size: 11px;
}

.dendrita-question-map-legend i {
  width: 8px;
  height: 8px;
  margin-left: 9px;
  box-sizing: border-box;
  background: var(--d-white);
  border: 1px solid var(--d-border);
  border-radius: 2px;
}

.dendrita-question-map-legend i.is-correct { background: var(--d-green-500); border-color: var(--d-green-500); }
.dendrita-question-map-legend i.is-incorrect { background: var(--d-error); border-color: var(--d-error); }
.dendrita-question-map-legend i.is-complete { background: var(--d-green-300); border-color: var(--d-green-300); }
.dendrita-question-map-grid { display: flex; flex-wrap: wrap; gap: 6px; }

.dendrita-question-map-cell {
  position: relative;
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  color: var(--d-muted);
  background: var(--d-white);
  border: 1px solid var(--d-border);
  border-radius: 6px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.dendrita-question-map-cell.is-card { border-radius: 50%; }
.dendrita-question-map-cell.is-correct { color: var(--d-cream); background: var(--d-green-500); border-color: var(--d-green-500); }
.dendrita-question-map-cell.is-incorrect { color: var(--d-cream); background: var(--d-error); border-color: var(--d-error); }
.dendrita-question-map-cell.is-complete { color: var(--d-green-900); background: var(--d-green-100); border-color: var(--d-green-300); }
.dendrita-question-map-cell.is-skipped { border-style: dashed; }
.dendrita-question-map-cell.is-current { color: var(--d-green-900); border: 2px solid var(--d-green-700); font-weight: 700; }
.dendrita-question-map-cell.is-current.is-correct,
.dendrita-question-map-cell.is-current.is-incorrect { color: var(--d-cream); }

body.dendrita-question-active .cyclebar { display: none; }

body.dendrita-question-active .qcard {
  width: min(760px, calc(100% - 56px));
  margin: 26px auto 0;
  padding: 0;
  color: var(--d-text);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.dendrita-question-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  margin-bottom: 12px;
}

.dendrita-question-source,
.dendrita-question-topic,
.dendrita-question-warning {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  box-sizing: border-box;
  border-radius: 6px;
  font-size: 11.5px;
}

.dendrita-question-source {
  color: var(--d-green-800);
  background: var(--d-green-100);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.dendrita-question-topic {
  color: var(--d-muted);
  background: var(--d-white);
  border: 1px solid var(--d-border);
}

.dendrita-question-warning { color: var(--d-warning); background: var(--d-warning-bg); }
.dendrita-question-meta-spacer { flex: 1 1 auto; }
.dendrita-question-meta-actions { display: flex; align-items: center; margin-left: auto; }

body.dendrita-question-active #flag {
  min-height: 30px;
  padding: 6px 12px;
  color: var(--d-muted);
  background: var(--d-white);
  border: 1px solid var(--d-border);
  border-radius: 6px;
  font-size: 0;
  line-height: 1;
}

body.dendrita-question-active #flag::before {
  margin-right: 7px;
  content: "◇";
  font-size: 13px;
}

body.dendrita-question-active #flag::after { content: "Marcar questão"; font-size: 12.5px; }
body.dendrita-question-active #flag.on { color: var(--d-warning); background: var(--d-warning-bg); border-color: var(--d-warning-border); }
body.dendrita-question-active #flag.on::before { content: "◆"; }
body.dendrita-question-active #flag.on::after { content: "Marcada"; }

body.dendrita-question-active .stem {
  margin: 0 0 18px;
  padding: 25px 30px;
  color: var(--d-text);
  background: var(--d-paper);
  border: 1px solid var(--d-border);
  border-radius: 14px;
  box-shadow: var(--d-shadow-card);
  font-size: 15.5px;
  line-height: 1.7;
  text-wrap: pretty;
}

body.dendrita-question-active .qcard > .media {
  margin: -5px 0 18px;
  padding: 14px;
  background: var(--d-paper);
  border: 1px solid var(--d-border);
  border-radius: 14px;
}

body.dendrita-question-active .options { gap: 10px; }

body.dendrita-question-active .opt {
  align-items: flex-start;
  gap: 14px;
  padding: 14px 18px;
  color: var(--d-text);
  background: var(--d-paper);
  border: 1px solid var(--d-border);
  border-radius: 10px;
  transition: background 150ms ease-out, border-color 150ms ease-out, box-shadow 150ms ease-out;
}

body.dendrita-question-active .opt:hover:not(.disabled) { background: var(--d-green-50); border-color: var(--d-green-300); }

body.dendrita-question-active .opt .key {
  display: flex;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  color: var(--d-muted);
  background: var(--d-white);
  border: 1px solid var(--d-border);
  border-radius: 50%;
  font-size: 12.5px;
  font-weight: 600;
}

body.dendrita-question-active .opt .txt { padding-top: 2px; color: inherit; font-size: 14px; line-height: 1.6; text-wrap: pretty; }
body.dendrita-question-active .opt.selected { color: var(--d-text); background: var(--d-green-100); border-color: var(--d-green-500); box-shadow: 0 0 0 1px rgb(126 148 101 / 8%); }
body.dendrita-question-active .opt.selected .key,
body.dendrita-question-active .opt.correct .key { color: var(--d-cream); background: var(--d-green-700); border-color: var(--d-green-700); }
body.dendrita-question-active .opt.correct { color: var(--d-text); background: var(--d-success-bg); border-color: var(--d-green-500); }
body.dendrita-question-active .opt.incorrect { color: var(--d-text); background: var(--d-error-bg); border-color: var(--d-error-border); }
body.dendrita-question-active .opt.incorrect .key { color: var(--d-cream); background: var(--d-error); border-color: var(--d-error); }
body.dendrita-question-active .opt.disabled:not(.correct, .incorrect) { color: var(--d-muted); }
body.dendrita-question-active .opt .mark { margin-left: auto; padding-top: 2px; }
body.dendrita-question-active .opt.correct .mark { color: var(--d-green-700); }
body.dendrita-question-active .opt.incorrect .mark { color: var(--d-error); }

body.dendrita-question-active .resultbar {
  gap: 12px;
  margin: 18px 0 14px;
  padding: 14px 18px;
  background: var(--d-success-bg);
  border: 1px solid var(--d-green-500);
  border-left-width: 1px;
  border-radius: 10px;
}

body.dendrita-question-active .resultbar.incorrect { background: var(--d-error-bg); border-color: var(--d-error-border); }
body.dendrita-question-active .resultbar .verdict { color: var(--d-green-800); font: 500 17px var(--d-font-display); }
body.dendrita-question-active .resultbar.incorrect .verdict { color: var(--d-error); }
body.dendrita-question-active .resultbar .meta { margin-left: auto; color: var(--d-muted); font-size: 12.5px; }
body.dendrita-question-active .resultbar .srsnext { width: 100%; color: var(--d-muted); font-size: 12px; }
body.dendrita-question-active .srsnext { padding: 6px 9px; background: var(--d-green-50); border-radius: 6px; }
body.dendrita-question-active .reviewadjustment { display: flex; justify-content: flex-end; }
body.dendrita-question-active .reviewadjustment .adjustmentbtn {
  color: var(--d-text);
  background: var(--d-white);
  border: 1px solid var(--d-border);
}
body.dendrita-question-active .reviewadjustment .adjustmentbtn:hover:not(:disabled) { background: var(--d-green-100); }

body.dendrita-question-active .explanation {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 21px 25px;
  color: var(--d-text);
  background: var(--d-paper);
  border: 1px solid var(--d-border);
  border-radius: 14px;
  box-shadow: var(--d-shadow-card);
}

body.dendrita-question-active .explanation h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 1px;
  color: var(--d-green-800);
  font: 600 11px/1.4 var(--d-font-body);
  letter-spacing: .12em;
  text-transform: uppercase;
}

body.dendrita-question-active .explanation h3::before { content: "❧"; color: var(--d-green-700); font-size: 16px; }
body.dendrita-question-active .explanation p { margin: 0; font-size: 14px; line-height: 1.7; text-wrap: pretty; }
body.dendrita-question-active .explanation ul,
body.dendrita-question-active .explanation ol { margin: 0; padding-left: 22px; font-size: 14px; line-height: 1.7; }
body.dendrita-question-active .explanation code { color: var(--d-green-900); background: var(--d-green-50); }
body.dendrita-question-active .explanation .media { margin: 4px 0; }
body.dendrita-question-active .eduobj { margin: 4px 0 0; padding: 13px 15px; background: var(--d-green-50); border: 1px solid var(--d-green-100); }
body.dendrita-question-active .eduobj .t { color: var(--d-green-800); }
body.dendrita-question-active .qtags { margin-top: 13px; }
body.dendrita-question-active .qtag.topic { color: var(--d-green-800); background: var(--d-green-100); border-color: var(--d-green-300); }
body.dendrita-question-active .qtag.topic:hover { color: var(--d-cream); background: var(--d-green-700); border-color: var(--d-green-700); }

body.dendrita-question-active .qcard > .actions,
body.dendrita-question-active #afterArea > .actions {
  position: fixed;
  z-index: 35;
  right: 0;
  bottom: 0;
  left: 64px;
  min-height: 70px;
  margin: 0;
  padding: 14px max(28px, calc((100vw - 824px) / 2));
  box-sizing: border-box;
  background: var(--d-white-glass);
  border-top: 1px solid var(--d-border);
  backdrop-filter: blur(8px);
}

body.dendrita-question-active .qcard:has(#nextBtn) > .actions { display: none; }

.dendrita-question-previous {
  min-height: 40px;
  padding: 9px 16px;
  color: var(--d-text);
  border: 1px solid var(--d-border);
  border-radius: 6px;
  font-size: 13.5px;
}

.dendrita-question-previous:hover:not(:disabled) { background: var(--d-green-100); }
.dendrita-question-previous:disabled { color: var(--d-muted); cursor: default; opacity: .58; }
.dendrita-question-previous svg { width: 15px; height: 15px; }

body.dendrita-question-active .dendrita-question-primary {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  color: var(--d-cream);
  background: var(--d-green-700);
  border: 0;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
}

body.dendrita-question-active .dendrita-question-primary:hover:not(:disabled) { background: var(--d-green-800); }
body.dendrita-question-active .dendrita-question-primary:disabled { color: var(--d-green-500); background: var(--d-green-100); opacity: 1; }

/* Question-block closeout keeps the same study shell and palette. */
body.dendrita-question-summary-active .dendrita-app { padding: 28px 28px 52px; }
body.dendrita-question-summary-active .dendrita-app > .card {
  width: min(760px, 100%);
  margin-inline: auto;
  box-sizing: border-box;
}

body.dendrita-question-summary-active .dendrita-app > .hero {
  position: relative;
  min-height: 190px;
  padding: 28px 30px;
  overflow: hidden;
  color: var(--d-on-dark);
  background: var(--d-green-800);
  border: 0;
  border-radius: 14px;
  box-shadow: none;
}

body.dendrita-question-summary-active .dendrita-app > .hero::after {
  position: absolute;
  inset: -50px -80px -70px auto;
  width: 380px;
  background: url("/assets/decorative-leaf.png") center / contain no-repeat;
  content: "";
  opacity: .2;
}

body.dendrita-question-summary-active .hero h1,
body.dendrita-question-summary-active .hero p { position: relative; z-index: 1; max-width: 520px; }
body.dendrita-question-summary-active .hero h1 { color: var(--d-cream); font: 500 28px/1.2 var(--d-font-display); }
body.dendrita-question-summary-active .hero p { color: var(--d-on-dark-muted); font-size: 14px; }
body.dendrita-question-summary-active .qcard { margin-top: 16px; padding: 22px 24px; background: var(--d-paper); border: 1px solid var(--d-border); border-radius: 14px; }
body.dendrita-question-summary-active .section-title { color: var(--d-green-800); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
body.dendrita-question-summary-active .grid-items { gap: 7px; }
body.dendrita-question-summary-active .gi { border-color: var(--d-border); }
body.dendrita-question-summary-active .gi.correct { color: var(--d-cream); background: var(--d-green-500); border-color: var(--d-green-500); }
body.dendrita-question-summary-active .gi.incorrect { color: var(--d-cream); background: var(--d-error); border-color: var(--d-error); }
body.dendrita-question-summary-active .qcard .btn { color: var(--d-cream); background: var(--d-green-700); }
body.dendrita-question-summary-active .qcard .btn.ghost { color: var(--d-text); background: var(--d-white); border: 1px solid var(--d-border); }

/* Flashcard player — desktop, tablet, and phone Cloud Design artifacts composed over the shared player. */
body.dendrita-flashcard-active .dendrita-sidebar,
body.dendrita-flashcard-summary-active .dendrita-sidebar { flex-basis: 64px; width: 64px; }
body.dendrita-flashcard-active .dendrita-brand,
body.dendrita-flashcard-summary-active .dendrita-brand { justify-content: center; padding-inline: 0; }
body.dendrita-flashcard-active .dendrita-brand-copy,
body.dendrita-flashcard-active .dendrita-nav button span,
body.dendrita-flashcard-active .dendrita-theme-toggle span,
body.dendrita-flashcard-active .dendrita-constancy,
body.dendrita-flashcard-summary-active .dendrita-brand-copy,
body.dendrita-flashcard-summary-active .dendrita-nav button span,
body.dendrita-flashcard-summary-active .dendrita-theme-toggle span,
body.dendrita-flashcard-summary-active .dendrita-constancy { display: none; }
body.dendrita-flashcard-active .dendrita-nav button,
body.dendrita-flashcard-summary-active .dendrita-nav button { justify-content: center; width: 40px; padding: 0; margin-inline: auto; }
body.dendrita-flashcard-active .dendrita-theme-toggle,
body.dendrita-flashcard-summary-active .dendrita-theme-toggle { justify-content: center; width: 40px; padding: 0; margin-inline: auto; }
body.dendrita-flashcard-active .dendrita-sidebar-toggle,
body.dendrita-flashcard-summary-active .dendrita-sidebar-toggle { display: none; }
body.dendrita-flashcard-active .dendrita-workspace,
body.dendrita-flashcard-summary-active .dendrita-workspace { height: 100%; padding: 0; overflow: hidden; }
body.dendrita-authenticated.dendrita-flashcard-active .dendrita-app,
body.dendrita-authenticated.dendrita-flashcard-summary-active .dendrita-app {
  width: 100%; max-width: none; height: 100%; min-height: 0; margin: 0; box-sizing: border-box;
  overflow-y: auto; overscroll-behavior: contain; background: var(--d-green-100);
}
body.dendrita-authenticated.dendrita-flashcard-active .dendrita-app { padding: 0 0 100px; }
body.dendrita-authenticated.dendrita-flashcard-summary-active .dendrita-app { padding: 28px 28px 52px; }

.dendrita-flashcard-header {
  position: sticky; z-index: 30; top: 0; display: grid;
  grid-template-columns: auto minmax(160px, 250px) minmax(300px, 430px) auto;
  align-items: center; gap: 18px; min-height: 68px; margin: 0; padding: 12px 28px;
  box-sizing: border-box; color: var(--d-muted); background: var(--d-cream-glass);
  border-bottom: 1px solid var(--d-border); backdrop-filter: blur(8px);
}
.dendrita-flashcard-header svg,
.dendrita-flashcard-summary svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dendrita-flashcard-exit,
.dendrita-flashcard-timer-toggle {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; color: var(--d-muted);
  background: transparent; border: 0; cursor: pointer;
}
.dendrita-flashcard-exit { min-height: 40px; padding: 8px 2px; font-size: 13px; }
.dendrita-flashcard-exit:hover { color: var(--d-ink); }
.dendrita-flashcard-exit svg { width: 16px; height: 16px; }
.dendrita-flashcard-identity { display: flex; min-width: 0; flex-direction: column; gap: 1px; }
.dendrita-flashcard-identity strong { overflow: hidden; color: var(--d-ink); font: 500 16px/1.2 var(--d-font-display); text-overflow: ellipsis; white-space: nowrap; }
.dendrita-flashcard-identity span { color: var(--d-muted); font-size: 11.5px; white-space: nowrap; }
.dendrita-flashcard-progress { display: flex; min-width: 0; flex-direction: column; gap: 7px; }
.dendrita-flashcard-queues { display: flex; min-width: 0; align-items: center; justify-content: center; gap: 16px; }
.dendrita-flashcard-queue-item { display: inline-flex; min-width: 0; align-items: center; gap: 6px; color: var(--d-muted); font-size: 11.5px; line-height: 1; white-space: nowrap; }
.dendrita-flashcard-queue-item > i { width: 7px; height: 7px; flex: 0 0 auto; background: var(--d-green-500); border-radius: 50%; }
.dendrita-flashcard-queue-item.is-learning > i { background: var(--d-warning); }
.dendrita-flashcard-queue-item.is-review > i { background: var(--d-green-900); }
.dendrita-flashcard-queue-item.is-current > span { color: var(--d-ink); font-weight: 600; }
.dendrita-flashcard-queue-item b { color: inherit; font-weight: 600; font-variant-numeric: tabular-nums; }
.dendrita-flashcard-remaining { overflow: hidden; color: var(--d-muted); font-size: 11.5px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.dendrita-flashcard-progress-track { height: 4px; overflow: hidden; background: var(--d-green-100); border-radius: 999px; }
.dendrita-flashcard-progress-track i { display: block; height: 100%; background: var(--d-green-500); border-radius: inherit; transition: width 200ms ease-out; }
.dendrita-flashcard-tools { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.dendrita-flashcard-timer { display: inline-flex; min-height: 30px; align-items: center; gap: 6px; padding: 5px 10px; box-sizing: border-box; color: var(--d-muted); background: var(--d-white); border: 1px solid var(--d-border); border-radius: 6px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.dendrita-flashcard-timer[hidden] { display: none; }
.dendrita-flashcard-timer svg { width: 13px; height: 13px; }
.dendrita-flashcard-timer .timer { color: inherit; font-size: inherit; }
.dendrita-flashcard-timer-toggle { width: 32px; height: 32px; padding: 0; border-radius: 50%; }
.dendrita-flashcard-timer-toggle:hover,
.dendrita-flashcard-timer-toggle.is-hidden { background: var(--d-green-100); }
.dendrita-flashcard-timer-toggle svg { width: 15px; height: 15px; }

.dendrita-flashcard-meta {
  display: flex; width: min(704px, calc(100% - 56px)); min-height: 32px; align-items: center;
  gap: 8px; margin: 26px auto 0; box-sizing: border-box;
}
.dendrita-flashcard-subject,
.dendrita-flashcard-state { display: inline-flex; min-width: 0; align-items: center; border-radius: 6px; white-space: nowrap; }
.dendrita-flashcard-subject { overflow: hidden; padding: 3px 9px; color: var(--d-green-800); background: var(--d-white); border: 1px solid var(--d-green-border); font-size: 12px; text-overflow: ellipsis; }
.dendrita-flashcard-state { flex: 0 0 auto; padding: 4px 9px; font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.dendrita-flashcard-state.is-new { color: var(--d-green-700); background: var(--d-green-100); }
.dendrita-flashcard-state.is-learning { color: var(--d-warning); background: var(--d-warning-bg); }
.dendrita-flashcard-state.is-review { color: var(--d-green-900); background: var(--d-border); }

body.dendrita-flashcard-active .cardface {
  display: flex; width: min(704px, calc(100% - 56px)); min-height: 300px; flex-direction: column;
  align-items: center; justify-content: center; gap: 24px; margin: 18px auto 0; padding: 48px 44px;
  box-sizing: border-box; color: var(--d-text); text-align: center; background: var(--d-paper);
  border: 1px solid var(--d-border); border-radius: 14px; box-shadow: var(--d-shadow-card);
}
body.dendrita-flashcard-active .cardface.is-long { align-items: stretch; text-align: left; }
body.dendrita-flashcard-active .cardfront { color: var(--d-ink); font: 500 21px/1.5 var(--d-font-display); text-wrap: pretty; }
body.dendrita-flashcard-active .cardface.is-long .cardfront { font-size: 18px; }
body.dendrita-flashcard-active .cardback,
body.dendrita-flashcard-active .cardextra { color: var(--d-text); font: 400 15px/1.7 var(--d-font-body); text-wrap: pretty; }
body.dendrita-flashcard-active .cardsep { width: 44px; margin: 0; border: 0; border-top: 2px solid var(--d-blue-700); }
body.dendrita-flashcard-active .cardface.is-long .cardsep { align-self: flex-start; }
body.dendrita-flashcard-active .cardface .media { width: 100%; margin: 0; }
body.dendrita-flashcard-active .cardface .media:empty { display: none; }
body.dendrita-flashcard-active .cardface .media img { max-height: 320px; border-radius: 10px; }
/* The gap is the question and stays sage; the answer that fills it is the one blue thing on the
   card, so it separates at a glance from a surface where green means everything else. */
body.dendrita-flashcard-active .clozegap { color: var(--d-green-800); background: var(--d-green-100); border-color: var(--d-green-300); }
body.dendrita-flashcard-active .clozeans { color: var(--d-blue-800); }

/* One turn, two halves: the question face rotates to edge-on, the shared player swaps the DOM,
   and the answer face completes the same sweep. `backface-visibility` is irrelevant here because
   the second half is a different element, not a mirrored back. */
@keyframes dendrita-card-flip-out {
  from { transform: perspective(1400px) rotateY(0deg); }
  to { transform: perspective(1400px) rotateY(-88deg); }
}
@keyframes dendrita-card-flip-in {
  from { transform: perspective(1400px) rotateY(88deg); }
  to { transform: perspective(1400px) rotateY(0deg); }
}
body.dendrita-flashcard-active .cardface.is-flipping-out { animation: dendrita-card-flip-out 170ms cubic-bezier(.4, 0, .8, .4) both; }
body.dendrita-flashcard-active .cardface.is-flipping-in { animation: dendrita-card-flip-in 230ms cubic-bezier(.2, .7, .3, 1) both; }
@media (prefers-reduced-motion: reduce) {
  body.dendrita-flashcard-active .cardface.is-flipping-out,
  body.dendrita-flashcard-active .cardface.is-flipping-in { animation: none; }
}

body.dendrita-flashcard-active .dendrita-flashcard-gradebar {
  position: fixed; z-index: 35; right: 0; bottom: 0; left: 64px; min-height: 72px; margin: 0;
  padding: 10px max(28px, calc((100vw - 824px) / 2)); box-sizing: border-box;
  background: var(--d-white-glass); border-top: 1px solid var(--d-border); backdrop-filter: blur(8px);
}
body.dendrita-flashcard-active .actions.dendrita-flashcard-gradebar { display: flex; align-items: center; justify-content: center; }
body.dendrita-flashcard-active .gradebtns.dendrita-flashcard-gradebar { display: grid; grid-template-columns: repeat(4, minmax(108px, 116px)); justify-content: center; gap: 10px; }
body.dendrita-flashcard-active .dendrita-flashcard-reveal {
  display: inline-flex; min-width: 188px; min-height: 44px; align-items: center; justify-content: center; gap: 10px;
  padding: 10px 24px; color: var(--d-cream); background: var(--d-green-700); border: 0; border-radius: 6px; font-size: 14px; font-weight: 600;
}
body.dendrita-flashcard-active .dendrita-flashcard-reveal:hover { background: var(--d-green-800); }
body.dendrita-flashcard-active .dendrita-flashcard-reveal svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
body.dendrita-flashcard-active .gradebtn {
  position: relative; display: flex; min-width: 0; min-height: 52px; flex-direction: column; align-items: center;
  justify-content: center; gap: 2px; padding: 7px 8px; color: var(--d-text); background: var(--d-white);
  border: 1px solid var(--d-border); border-radius: 6px; box-shadow: none;
}
body.dendrita-flashcard-active .gradebtn b { font-size: 13.5px; font-weight: 600; }
body.dendrita-flashcard-active .gradebtn span { color: var(--d-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
body.dendrita-flashcard-active .gradebtn i { position: absolute; top: 5px; right: 6px; min-width: 14px; padding: 0 3px; color: var(--d-muted); border: 1px solid var(--d-border); border-radius: 4px; font-size: 9px; font-style: normal; line-height: 14px; }
body.dendrita-flashcard-active .gradebtn.g-again b { color: var(--d-error); }
body.dendrita-flashcard-active .gradebtn.g-hard b { color: var(--d-warning); }
body.dendrita-flashcard-active .gradebtn.g-good b { color: var(--d-green-800); }
body.dendrita-flashcard-active .gradebtn.g-easy b { color: var(--d-green-500); }
body.dendrita-flashcard-active .gradebtn.g-again:hover:not(:disabled) { background: var(--d-error-bg); border-color: var(--d-error-border); }
body.dendrita-flashcard-active .gradebtn.g-hard:hover:not(:disabled) { background: var(--d-warning-bg); border-color: var(--d-warning-border); }
body.dendrita-flashcard-active .gradebtn.g-good:hover:not(:disabled),
body.dendrita-flashcard-active .gradebtn.g-easy:hover:not(:disabled) { background: var(--d-green-100); border-color: var(--d-green-500); }
body.dendrita-flashcard-active .gradebtn:disabled { cursor: wait; opacity: .5; }

.dendrita-flashcard-summary { display: flex; width: min(760px, 100%); flex-direction: column; gap: 14px; margin-inline: auto; }
.dendrita-flashcard-summary-hero { position: relative; min-height: 190px; padding: 28px 30px; overflow: hidden; box-sizing: border-box; color: var(--d-on-dark); background: var(--d-green-800) url("/assets/hero-texture.jpg") center / cover no-repeat; border-radius: 14px; }
.dendrita-flashcard-summary-hero::after { position: absolute; inset: -55px -85px -65px auto; width: 380px; background: url("/assets/decorative-leaf.png") center / contain no-repeat; content: ""; opacity: .18; }
.dendrita-flashcard-summary-hero > * { position: relative; z-index: 1; }
.dendrita-flashcard-summary-eyebrow { display: flex; align-items: center; gap: 9px; color: var(--d-cream); font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.dendrita-flashcard-summary-eyebrow svg { width: 17px; height: 17px; }
.dendrita-flashcard-summary h1 { max-width: 560px; margin: 10px 0 0; color: var(--d-cream); font: 500 27px/1.2 var(--d-font-display); text-wrap: pretty; }
.dendrita-flashcard-summary-facts { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 18px; color: var(--d-on-dark-muted); font-size: 13.5px; }
.dendrita-flashcard-summary-facts b { color: var(--d-cream); font-weight: 600; }
.dendrita-flashcard-summary-counts { display: flex; flex-wrap: wrap; gap: 10px; }
.dendrita-flashcard-summary-counts > span { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; color: var(--d-muted); background: var(--d-white); border: 1px solid var(--d-border); border-radius: 6px; font-size: 12.5px; }
.dendrita-flashcard-summary-counts i { width: 8px; height: 8px; background: var(--d-green-500); border-radius: 2px; }
.dendrita-flashcard-summary-counts .is-again i { background: var(--d-error); }
.dendrita-flashcard-summary-counts .is-hard i { background: var(--d-warning); }
.dendrita-flashcard-summary-counts .is-easy i { background: var(--d-green-300); }
.dendrita-flashcard-summary-counts b { color: var(--d-text); font-weight: 600; }
.dendrita-flashcard-summary-actions { display: flex; align-items: center; gap: 18px; margin-top: 4px; }
.dendrita-flashcard-summary-actions button { min-height: 44px; padding: 10px 18px; color: var(--d-green-900); background: transparent; border: 0; font: 600 14px var(--d-font-body); cursor: pointer; }
.dendrita-flashcard-summary-actions button:first-child { display: inline-flex; align-items: center; gap: 9px; color: var(--d-cream); background: var(--d-green-700); border-radius: 8px; }
.dendrita-flashcard-summary-actions button:first-child:hover { background: var(--d-green-800); }
.dendrita-flashcard-summary-actions button:last-child { padding-inline: 2px; text-decoration: underline; text-underline-offset: 4px; }

.dendrita-flashcard-waiting {
  display: grid;
  width: min(760px, calc(100% - 56px));
  min-height: 100%;
  grid-template-rows: auto 1fr;
  gap: 18px;
  margin: 0 auto;
  padding: 22px 0 70px;
  box-sizing: border-box;
}
.dendrita-flashcard-waiting > .dendrita-flashcard-exit { width: fit-content; }
.dendrita-flashcard-waiting > section {
  position: relative;
  align-self: center;
  min-height: 260px;
  padding: 46px;
  overflow: hidden;
  box-sizing: border-box;
  color: var(--d-on-dark);
  background: var(--d-green-800) url("/assets/hero-texture.jpg") center / cover no-repeat;
  border-radius: 14px;
  box-shadow: var(--d-shadow-card);
}
.dendrita-flashcard-waiting > section::after {
  position: absolute;
  inset: -55px -85px -65px auto;
  width: 380px;
  background: url("/assets/decorative-leaf.png") center / contain no-repeat;
  content: "";
  opacity: .16;
}
.dendrita-flashcard-waiting > section > * { position: relative; z-index: 1; }
.dendrita-flashcard-waiting h1 {
  max-width: 570px;
  margin: 18px 0 10px;
  color: var(--d-cream);
  font: 500 31px/1.18 var(--d-font-display);
  text-wrap: balance;
}
.dendrita-flashcard-waiting p {
  max-width: 520px;
  margin: 0;
  color: var(--d-on-dark-muted);
  font-size: 14px;
  line-height: 1.6;
}
.dendrita-flashcard-waiting-pulse { display: flex; gap: 8px; margin-top: 28px; }
.dendrita-flashcard-waiting-pulse i {
  width: 9px;
  height: 9px;
  background: var(--d-green-300);
  border-radius: 50%;
  animation: dendrita-learning-wait 1.4s ease-in-out infinite;
}
.dendrita-flashcard-waiting-pulse i:nth-child(2) { animation-delay: 160ms; }
.dendrita-flashcard-waiting-pulse i:nth-child(3) { animation-delay: 320ms; }
@keyframes dendrita-learning-wait {
  0%, 70%, 100% { opacity: .35; transform: translateY(0); }
  35% { opacity: 1; transform: translateY(-5px); }
}

/* Explore — owner-supplied horizontal taxonomy graph plus phone drill-down. */
.dendrita-explore {
  width: 100%;
  min-height: 100%;
  padding: 18px 28px 24px;
  box-sizing: border-box;
}

.dendrita-explore svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dendrita-explore-header {
  position: relative;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  max-width: 1380px;
  margin: 0 auto 16px;
}

.dendrita-explore-heading-copy { min-width: 0; }

.dendrita-explore-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  color: var(--d-green-700);
  background: rgb(126 148 101 / 10%);
  border: 1px solid rgb(126 148 101 / 20%);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.dendrita-explore-eyebrow svg { width: 13px; height: 13px; }
.dendrita-explore-header h1 { position: relative; width: fit-content; margin: 7px 0 4px; color: var(--d-ink); font: 500 32px/1.08 var(--d-font-display); letter-spacing: -.025em; }
.dendrita-explore-header h1::after { position: absolute; top: 56%; left: calc(100% + 11px); width: 30px; height: 2px; background: linear-gradient(90deg, var(--d-green-500), transparent); border-radius: 999px; content: ''; }
.dendrita-explore-header p { max-width: 380px; margin: 0; color: var(--d-muted); font-size: 13px; line-height: 1.45; text-wrap: balance; }
.dendrita-explore-header-tools { display: flex; width: 320px; flex: 0 0 auto; flex-direction: column; align-items: flex-end; gap: 5px; }

.dendrita-explore-search { position: relative; width: 100%; }
.dendrita-explore-search > svg { position: absolute; z-index: 2; top: 12px; left: 13px; width: 17px; height: 17px; color: var(--d-green-500); pointer-events: none; }
.dendrita-explore-search input {
  width: 100%;
  height: 42px;
  padding: 0 38px;
  color: var(--d-ink);
  background: var(--d-white);
  border: 1px solid var(--d-border);
  border-radius: 9px;
  outline: none;
  box-shadow: var(--d-shadow-card);
  font-size: 12.5px;
  transition: border-color 150ms ease-out, box-shadow 150ms ease-out;
}
.dendrita-explore-search input:focus { border-color: var(--d-green-500); box-shadow: 0 0 0 3px rgb(126 148 101 / 16%); }
.dendrita-explore-results {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  display: grid;
  gap: 2px;
  padding: 6px;
  background: var(--d-paper);
  border: 1px solid var(--d-border);
  border-radius: 10px;
  box-shadow: 0 14px 34px rgb(26 29 26 / 16%);
}
.dendrita-explore-results[hidden] { display: none; }
.dendrita-explore-results button { display: flex; min-height: 42px; flex-direction: column; justify-content: center; padding: 7px 9px; color: var(--d-text); background: transparent; border: 0; border-radius: 7px; text-align: left; cursor: pointer; }
.dendrita-explore-results button:hover,
.dendrita-explore-results button:focus-visible { background: var(--d-green-100); outline: none; }
.dendrita-explore-results strong { color: var(--d-ink); font-size: 12px; font-weight: 600; }
.dendrita-explore-results small { overflow: hidden; color: var(--d-muted); font-size: 9.5px; text-overflow: ellipsis; white-space: nowrap; }
.dendrita-explore-results p { margin: 9px; color: var(--d-muted); font-size: 11.5px; }

.dendrita-explore-trail { display: flex; max-width: 1380px; min-height: 34px; align-items: center; gap: 4px; margin: 0 auto 6px; overflow: hidden; color: var(--d-muted); font-size: 12.5px; white-space: nowrap; }
.dendrita-explore-trail button { min-height: 40px; padding: 0 6px; color: var(--d-green-800); background: transparent; border: 0; border-radius: 6px; font: inherit; cursor: pointer; }
.dendrita-explore-trail button:hover,
.dendrita-explore-trail button:focus-visible { color: var(--d-green-900); background: var(--d-green-100); outline: none; }
.dendrita-explore-trail b { overflow: hidden; padding: 0 6px; color: var(--d-ink); font-weight: 600; text-overflow: ellipsis; }
.dendrita-explore-trail svg { width: 12px; height: 12px; flex: 0 0 auto; color: var(--d-muted); }

.dendrita-explore-graph {
  position: relative;
  max-width: 1380px;
  min-height: 620px;
  margin: 0 auto;
  overflow-x: auto;
  overflow-y: hidden;
  background-color: var(--d-paper);
  background-image: radial-gradient(circle at 1px 1px, rgb(171 188 148 / 21%) 1px, transparent 0);
  background-size: 22px 22px;
  border: 1px solid var(--d-border);
  border-radius: 12px;
  box-shadow: var(--d-shadow-card);
  overscroll-behavior-inline: contain;
}

.dendrita-explore-canvas { position: relative; width: max(100%, var(--d-explore-canvas-width)); min-width: var(--d-explore-canvas-width); }
.dendrita-explore-canvas > svg { position: absolute; z-index: 1; inset: 0 auto 0 0; width: var(--d-explore-canvas-width); height: 100%; pointer-events: none; }
.dendrita-explore-connector { fill: none; stroke: var(--d-border); stroke-width: 1.3; vector-effect: non-scaling-stroke; }
.dendrita-explore-connector.is-active { stroke: var(--d-green-500); stroke-width: 2; }

.dendrita-explore-landing { display: grid; min-height: 618px; grid-template-columns: minmax(320px, 430px) 1fr; gap: 26px; padding: 22px 24px; }
.dendrita-explore-lockups { display: grid; gap: 4px; align-content: start; }
.dendrita-explore-lockup { display: flex; width: 100%; min-height: 64px; align-items: center; gap: 15px; padding: 10px 14px; color: var(--d-text); background: transparent; border: 1px solid transparent; border-radius: 14px; text-align: left; cursor: pointer; }
.dendrita-explore-lockup:hover,
.dendrita-explore-lockup:focus-visible { background: var(--d-paper); border-color: var(--d-border); box-shadow: var(--d-shadow-card); outline: none; }
.dendrita-explore-lockup .dendrita-explore-node-ring { --d-node-size: 56px; }
.dendrita-explore-lockup-copy { display: block; min-width: 0; }
.dendrita-explore-lockup-copy strong { display: block; color: var(--d-ink); font-size: 15px; font-weight: 600; line-height: 1.25; }
.dendrita-explore-lockup-copy small { display: block; margin-top: 2px; color: var(--d-muted); font-size: 12px; }
.dendrita-explore-lockup > svg { width: 18px; height: 18px; flex: 0 0 auto; margin-left: auto; color: var(--d-muted); }
.dendrita-explore-invite { display: flex; align-items: center; flex-direction: column; gap: 14px; padding: 24px 10px 20px 30px; border-left: 1px solid var(--d-border); }
.dendrita-explore-invite > svg { width: min(300px, 100%); height: auto; margin-top: 10px; }
.dendrita-explore-invite p { max-width: 250px; margin: 0; color: var(--d-muted); font-size: 13px; text-align: center; }
.dendrita-explore-legend { display: flex; align-items: center; gap: 16px; margin-top: 8px; color: var(--d-muted); font-size: 11.5px; }
.dendrita-explore-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dendrita-explore-legend svg { width: 14px; height: 14px; color: var(--d-green-700); }
.dendrita-explore-legend-ring { width: 16px; height: 16px; background: conic-gradient(var(--d-green-500) 60%, var(--d-border) 0); border-radius: 50%; }

.dendrita-explore-node {
  --d-node-size: 80px;
  --d-node-r: 40;
  position: absolute;
  z-index: 3;
  left: var(--d-node-x);
  top: var(--d-node-y);
  display: flex;
  width: 124px;
  align-items: center;
  flex-direction: column;
  gap: 7px;
  padding: 0;
  color: var(--d-text);
  background: transparent;
  border: 0;
  border-radius: 10px;
  transform: translate(-50%, calc(var(--d-node-r) * -1px));
  transform-origin: 50% calc(var(--d-node-r) * 1px);
  cursor: pointer;
}
.dendrita-explore-node-ring { --d-node-fill: var(--d-green-700); position: relative; display: grid; width: var(--d-node-size); height: var(--d-node-size); flex: 0 0 auto; place-items: center; color: var(--d-cream); background: conic-gradient(var(--d-green-500) calc(var(--d-coverage) * 1%), var(--d-border) 0); border-radius: 50%; box-sizing: border-box; transition: transform 150ms ease-out, box-shadow 150ms ease-out; }
.dendrita-explore-node-ring::before { position: absolute; content: ''; inset: 3px; background: var(--d-node-fill); border-radius: inherit; }
.dendrita-explore-node:hover .dendrita-explore-node-ring { transform: scale(1.05); }
.dendrita-explore-node:focus-visible { outline: 2px solid var(--d-ink); outline-offset: 2px; }
.dendrita-explore-node.is-selected .dendrita-explore-node-ring { box-shadow: 0 0 0 2px var(--d-ink), 0 0 0 5px var(--d-paper); }
.dendrita-explore-node.is-selected > strong { margin-top: 6px; color: var(--d-ink); font-weight: 700; }
.dendrita-explore-node.is-trunk .dendrita-explore-node-ring { box-shadow: 0 0 0 2px var(--d-ink), 0 0 0 5px var(--d-paper); }
.dendrita-explore-node.is-root-dim { --d-node-size: 36px; opacity: .5; }
.dendrita-explore-node.is-root-dim:hover,
.dendrita-explore-node.is-root-dim:focus-visible { opacity: 1; }
.dendrita-explore-node.is-root-dim > strong { font-size: 12.5px; }
.dendrita-explore-node.is-root-dim .dendrita-explore-node-ring b { font-size: 9.5px; }
.dendrita-explore-node-ring b { position: relative; z-index: 1; font-size: 13px; font-weight: 600; }
.dendrita-explore-node-ring > svg { position: relative; z-index: 1; width: calc(var(--d-node-size) * .42); height: calc(var(--d-node-size) * .42); }
.dendrita-explore-node-ring.is-sprout { --d-node-fill: var(--d-green-50); color: var(--d-green-700); }

@keyframes dendrita-explore-grow {
  from { opacity: 0; transform: translate(-50%, calc(var(--d-node-r) * -1px)) scale(.35); }
  to { opacity: 1; transform: translate(-50%, calc(var(--d-node-r) * -1px)) scale(1); }
}
.dendrita-explore-node.is-growing { animation: dendrita-explore-grow .45s cubic-bezier(.2, .8, .3, 1.15) both; }
@media (prefers-reduced-motion: reduce) {
  .dendrita-explore-node.is-growing { animation: none; }
}
.dendrita-explore-node > strong { display: block; max-width: 118px; color: var(--d-text); font-size: 13.5px; font-weight: 500; line-height: 1.14; text-align: center; text-wrap: balance; }
.dendrita-explore-node.is-depth-1 { --d-node-size: 52px; }
.dendrita-explore-node.is-depth-1 .dendrita-explore-node-ring { --d-node-fill: var(--d-green-500); }
.dendrita-explore-node.is-depth-1 .dendrita-explore-node-ring b { font-size: 11.5px; }
.dendrita-explore-node.is-depth-2 { --d-node-size: 42px; }
.dendrita-explore-node.is-depth-2 .dendrita-explore-node-ring { --d-node-fill: var(--d-green-300); color: var(--d-green-900); }
.dendrita-explore-node.is-depth-2 .dendrita-explore-node-ring b { font-size: 10.5px; }
.dendrita-explore-node.is-depth-2 > strong { font-size: 12.5px; }
.dendrita-explore-node.is-depth-3 { --d-node-size: 32px; }
.dendrita-explore-node.is-depth-3 .dendrita-explore-node-ring { --d-node-fill: var(--d-green-300); color: var(--d-green-900); }
.dendrita-explore-node.is-depth-3 .dendrita-explore-node-ring b { font-size: 9px; }
.dendrita-explore-node.is-depth-3 > strong { font-size: 12px; }
.dendrita-explore-node.is-depth-4 { --d-node-size: 24px; }
.dendrita-explore-node.is-depth-4 .dendrita-explore-node-ring { --d-node-fill: var(--d-green-100); color: var(--d-green-900); }
.dendrita-explore-node.is-depth-4 .dendrita-explore-node-ring b { font-size: 7.5px; }
.dendrita-explore-node.is-depth-4 > strong { font-size: 12px; }

.dendrita-explore-detail {
  position: absolute;
  z-index: 8;
  top: 18px;
  right: 18px;
  width: 264px;
  padding: 17px;
  color: var(--d-text);
  background: var(--d-paper-glass);
  border: 1px solid var(--d-border);
  border-radius: 11px;
  box-shadow: 0 12px 32px rgb(26 29 26 / 15%);
  box-sizing: border-box;
}
.dendrita-explore-detail.is-left { right: auto; left: 18px; }
.dendrita-explore-detail-close,
.dendrita-explore-sheet-close { position: absolute; top: 9px; right: 9px; display: grid; width: 40px; height: 40px; padding: 0; place-items: center; color: var(--d-muted); background: transparent; border: 0; border-radius: 50%; cursor: pointer; }
.dendrita-explore-detail-close:hover,
.dendrita-explore-detail-close:focus-visible,
.dendrita-explore-sheet-close:hover,
.dendrita-explore-sheet-close:focus-visible { color: var(--d-ink); background: var(--d-green-100); outline: none; }
.dendrita-explore-detail-close svg,
.dendrita-explore-sheet-close svg { width: 16px; height: 16px; }
.dendrita-explore-breadcrumb { display: flex; max-width: calc(100% - 30px); align-items: center; gap: 3px; overflow: hidden; color: var(--d-muted); font-size: 8.5px; white-space: nowrap; }
.dendrita-explore-breadcrumb span,
.dendrita-explore-breadcrumb button { overflow: hidden; color: inherit; background: transparent; border: 0; font: inherit; text-overflow: ellipsis; white-space: nowrap; }
.dendrita-explore-breadcrumb button { min-height: 40px; padding: 0 2px; cursor: pointer; }
.dendrita-explore-breadcrumb button:hover,
.dendrita-explore-breadcrumb button:focus-visible { color: var(--d-green-900); text-decoration: underline; outline: none; }
.dendrita-explore-breadcrumb svg { width: 10px; height: 10px; flex: 0 0 auto; }
.dendrita-explore-detail h2,
.dendrita-explore-sheet h2 { margin: 10px 0 15px; color: var(--d-ink); font: 500 21px/1.16 var(--d-font-display); }
.dendrita-explore-coverage-head { display: flex; align-items: center; justify-content: space-between; color: var(--d-muted); font-size: 10.5px; }
.dendrita-explore-coverage-head b { color: var(--d-green-900); font-weight: 700; }
.dendrita-explore-coverage-track { height: 5px; margin-top: 6px; overflow: hidden; background: var(--d-green-100); border-radius: 99px; }
.dendrita-explore-coverage-track i { display: block; height: 100%; background: var(--d-green-700); border-radius: inherit; }
.dendrita-explore-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0; }
.dendrita-explore-facts > span { display: grid; grid-template-columns: auto 1fr; gap: 1px 6px; padding: 9px; background: var(--d-green-50); border-radius: 7px; }
.dendrita-explore-facts svg { grid-row: 1 / span 2; width: 16px; height: 16px; align-self: center; color: var(--d-green-700); }
.dendrita-explore-facts b { color: var(--d-ink); font-size: 14px; font-weight: 600; line-height: 1; }
.dendrita-explore-facts small { color: var(--d-muted); font-size: 8.5px; }
.dendrita-explore-detail-actions,
.dendrita-explore-sheet-actions { display: grid; gap: 6px; }
.dendrita-explore-detail-actions button,
.dendrita-explore-sheet-actions button,
.dendrita-explore-empty button { display: flex; min-height: 40px; align-items: center; justify-content: center; gap: 7px; padding: 8px 10px; color: var(--d-cream); background: var(--d-green-700); border: 0; border-radius: 7px; font-size: 11.5px; font-weight: 600; cursor: pointer; }
.dendrita-explore-detail-actions button:hover,
.dendrita-explore-sheet-actions button:hover,
.dendrita-explore-empty button:hover { background: var(--d-green-800); }
.dendrita-explore-detail-actions button:disabled,
.dendrita-explore-sheet-actions button:disabled { opacity: .42; cursor: not-allowed; }
.dendrita-explore-detail-actions button > svg,
.dendrita-explore-sheet-actions button > svg,
.dendrita-explore-empty button > svg { width: 15px; height: 15px; }
.dendrita-explore-detail-actions button.is-preview,
.dendrita-explore-sheet-actions button.is-preview { color: var(--d-green-900); background: transparent; border: 1px solid var(--d-border); }
.dendrita-explore-detail-actions .dendrita-preview-label,
.dendrita-explore-sheet-actions .dendrita-preview-label { margin-left: auto; }

.dendrita-explore-mobile { display: none; }
.dendrita-explore-empty { display: flex; min-height: 480px; align-items: center; justify-content: center; flex-direction: column; padding: 32px; color: var(--d-muted); text-align: center; }
.dendrita-explore-empty > svg { width: 32px; height: 32px; color: var(--d-green-500); }
.dendrita-explore-empty h1,
.dendrita-explore-empty h2 { margin: 12px 0 4px; color: var(--d-ink); font: 500 24px var(--d-font-display); }
.dendrita-explore-empty p { max-width: 420px; margin: 0 0 16px; font-size: 12.5px; }
.dendrita-explore-empty button { min-width: 150px; }
/* The wait previews the screen that follows: Explore lands as a column of node lockups beside the
   invite panel, so the placeholder is that column at the real row height — not three 340px lozenges
   standing in for a three-column layout this screen never had. */
.dendrita-explore-loading { display: grid; min-height: 618px; grid-template-columns: minmax(320px, 430px) 1fr; gap: 26px; padding: 22px 24px; background: var(--d-paper); border: 1px solid var(--d-border); border-radius: 12px; }
.dendrita-explore-loading-list { display: grid; gap: 4px; align-content: start; }
.dendrita-explore-loading-panel { display: grid; align-content: center; padding: 24px 10px 20px 30px; border-left: 1px solid var(--d-border); }
.dendrita-explore-loading i { display: block; height: 64px; background: linear-gradient(100deg, var(--d-green-50) 20%, var(--d-green-100) 40%, var(--d-green-50) 60%); background-size: 220% 100%; border-radius: 14px; animation: dendrita-sheen 1.4s linear infinite; opacity: .75; }
.dendrita-explore-loading-panel i { height: 232px; border-radius: 12px; }

/* Content panel — the per-node catalog screen, translated from the owner-supplied Painel de Estudo artifact. */
body.dendrita-authenticated.dendrita-content-active .dendrita-app { max-width: 1240px; }
.dendrita-content { display: flex; flex-direction: column; gap: 14px; }
.dendrita-content svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dendrita-content .dendrita-primary-button { color: var(--d-cream); background: var(--d-green-700); }
.dendrita-content .dendrita-primary-button:hover { background: var(--d-green-800); }
.dendrita-content .dendrita-text-action { color: var(--d-green-700); }
.dendrita-content-header { display: flex; flex-direction: column; gap: 6px; }
.dendrita-content-breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; font-size: 11.5px; color: var(--d-muted); }
.dendrita-content-breadcrumb svg { width: 12px; height: 12px; color: var(--d-muted); }
.dendrita-content-breadcrumb button { min-height: 40px; padding: 2px 6px; background: transparent; border: 0; border-radius: 6px; font: 400 11.5px var(--d-font-body); color: var(--d-muted); cursor: pointer; transition: background 120ms ease-out, color 120ms ease-out; }
.dendrita-content-breadcrumb button:hover { background: var(--d-green-50); color: var(--d-green-700); }
.dendrita-content-title-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.dendrita-content-title { display: flex; align-items: center; gap: 12px; min-width: 0; flex-wrap: wrap; }
.dendrita-content-title h1 { margin: 0; font: 500 28px/1.1 var(--d-font-display); color: var(--d-ink); }
.dendrita-content-switch { display: flex; align-items: center; gap: 7px; min-height: 40px; background: var(--d-white); border: 1px solid var(--d-border); border-radius: 999px; padding: 6px 12px; cursor: pointer; font: 400 12px var(--d-font-body); color: var(--d-text); transition: background 120ms ease-out, border-color 120ms ease-out; }
.dendrita-content-switch:hover { background: var(--d-green-50); border-color: var(--d-green-300); }
.dendrita-content-switch svg { width: 14px; height: 14px; color: var(--d-muted); }
.dendrita-content-switch-hint { display: flex; align-items: center; color: var(--d-muted); border-left: 1px solid var(--d-border); padding-left: 7px; }
.dendrita-content-study { min-height: 40px; }
.dendrita-content-study:disabled { opacity: .55; cursor: default; }
.dendrita-content-study-wrap { position: relative; }
.dendrita-content-study-menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 40; min-width: 250px; display: flex; flex-direction: column; gap: 2px; background: var(--d-white); border: 1px solid var(--d-border); border-radius: 12px; padding: 6px; box-shadow: 0 14px 34px rgb(26 29 26 / 14%); }
.dendrita-content-study-menu[hidden] { display: none; }
.dendrita-content-study-menu button { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 8px 10px; background: transparent; border: 0; border-radius: 8px; font: 400 13px var(--d-font-body); color: var(--d-text); cursor: pointer; text-align: left; transition: background 120ms ease-out, color 120ms ease-out; }
.dendrita-content-study-menu button:hover:not(:disabled),
.dendrita-content-study-menu button:focus-visible { background: var(--d-green-50); color: var(--d-green-700); }
.dendrita-content-study-menu button:disabled { opacity: .45; cursor: default; }
.dendrita-content-study-menu button svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--d-muted); }
.dendrita-content-study-menu button span { flex: 1; min-width: 0; }
.dendrita-content-study-menu button small { font-size: 11.5px; color: var(--d-muted); font-variant-numeric: tabular-nums; }
.dendrita-content-study-backdrop { display: none; }
.dendrita-content-subtitle { display: flex; align-items: center; justify-content: space-between; column-gap: 20px; row-gap: 4px; flex-wrap: wrap; }
.dendrita-content-subtitle p { flex: 1 1 200px; min-width: 0; margin: 0; font-size: 13.5px; color: var(--d-muted); }
.dendrita-content-coverage { display: flex; align-items: center; gap: 8px; min-width: 0; }
.dendrita-content-coverage small { font-size: 12px; color: var(--d-muted); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dendrita-content-coverage-track { display: block; width: 120px; min-width: 40px; height: 6px; border-radius: 999px; background: var(--d-border); overflow: hidden; }
.dendrita-content-coverage-track i { display: block; height: 100%; background: var(--d-green-500); border-radius: 999px; }
.dendrita-content-toolbar { display: flex; align-items: center; column-gap: 22px; flex-wrap: wrap; border-bottom: 1px solid var(--d-border); }
.dendrita-content-tabs { display: flex; column-gap: 22px; }
.dendrita-content-tabs button { min-height: 40px; padding: 8px 2px 10px; background: transparent; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; font: 400 13px var(--d-font-body); color: var(--d-muted); cursor: pointer; transition: color 150ms ease-out; }
.dendrita-content-tabs button:hover { color: var(--d-ink); }
.dendrita-content-tabs button.is-active { border-bottom-color: var(--d-green-700); color: var(--d-ink); font-weight: 600; }
.dendrita-content-search { display: flex; flex: 0 1 240px; min-width: 140px; margin-left: auto; margin-bottom: 6px; align-items: center; gap: 8px; background: var(--d-white); border: 1px solid var(--d-border); border-radius: 6px; padding: 8px 10px; }
.dendrita-content-search svg { width: 14px; height: 14px; flex-shrink: 0; color: var(--d-muted); }
.dendrita-content-search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font: 400 12.5px var(--d-font-body); color: var(--d-text); }
.dendrita-content-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.dendrita-content-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.dendrita-content-chips button { min-height: 40px; padding: 7px 13px; border-radius: 999px; font: 500 12px var(--d-font-body); cursor: pointer; background: var(--d-white); color: var(--d-text); border: 1px solid var(--d-border); transition: filter 120ms ease-out; }
.dendrita-content-chips button:hover { filter: brightness(.96); }
.dendrita-content-chips button.is-active { background: var(--d-green-700); color: var(--d-cream); border-color: var(--d-green-700); }
.dendrita-content-legend { display: flex; align-items: center; gap: 16px; font-size: 11.5px; color: var(--d-muted); }
.dendrita-content-legend span { display: flex; align-items: center; gap: 6px; }
.dendrita-content-legend i { width: 10px; height: 10px; border-radius: 50%; }
.dendrita-content-legend i.is-seen { background: var(--d-green-500); }
.dendrita-content-legend i.is-new { background: var(--d-border); }
.dendrita-content-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.dendrita-content-layout.has-preview { grid-template-columns: minmax(0, 1fr) 300px; }
.dendrita-content-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.dendrita-content-recommended h2,
.dendrita-content-section h2 { margin: 0 0 10px; font: 600 11px var(--d-font-body); letter-spacing: .12em; text-transform: uppercase; color: var(--d-muted); }
.dendrita-content-recommended-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.dendrita-content-resource { display: flex; align-items: center; gap: 12px; min-height: 44px; background: var(--d-white); border: 1px solid var(--d-border); border-radius: 10px; padding: 13px 14px; cursor: pointer; text-align: left; font-family: var(--d-font-body); transition: border-color 120ms ease-out, box-shadow 120ms ease-out; }
.dendrita-content-resource:hover { border-color: var(--d-green-300); box-shadow: 0 2px 8px rgb(26 29 26 / 6%); }
.dendrita-content-resource-icon { display: grid; place-items: center; width: 36px; height: 36px; flex-shrink: 0; background: var(--d-green-50); border: 1px solid var(--d-green-border); border-radius: 8px; color: var(--d-green-700); }
.dendrita-content-resource-icon svg { width: 17px; height: 17px; }
.dendrita-content-resource-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.dendrita-content-resource-copy strong { font-size: 13.5px; font-weight: 600; color: var(--d-ink); line-height: 1.3; }
.dendrita-content-resource-copy small { font-size: 11.5px; color: var(--d-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dendrita-content-list { display: flex; flex-direction: column; gap: 10px; }
.dendrita-content-item { display: flex; flex-direction: column; gap: 7px; width: 100%; background: var(--d-white); border: 1px solid var(--d-border); border-radius: 10px; padding: 13px 16px; cursor: pointer; text-align: left; font-family: var(--d-font-body); transition: border-color 120ms ease-out, box-shadow 120ms ease-out; }
.dendrita-content-item:hover { border-color: var(--d-green-300); box-shadow: 0 2px 8px rgb(26 29 26 / 6%); }
.dendrita-content-item.is-selected { border-color: var(--d-green-700); }
.dendrita-content-item.is-family-variant { margin-left: 24px; width: calc(100% - 24px); border-left: 3px solid var(--d-green-300); }
.dendrita-content-item-head { display: flex; align-items: center; gap: 9px; width: 100%; min-width: 0; }
.dendrita-content-item-ordinal { flex-shrink: 0; font: 600 11px var(--d-font-body); color: var(--d-muted); font-variant-numeric: tabular-nums; }
.dendrita-content-item-pill { font-size: 10.5px; color: var(--d-green-700); background: var(--d-green-50); border: 1px solid var(--d-border); padding: 3px 9px; border-radius: 999px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.dendrita-content-family-pill { flex-shrink: 0; font-size: 10.5px; color: var(--d-green-700); background: var(--d-green-50); border: 1px solid var(--d-green-border); padding: 3px 9px; border-radius: 999px; }
.dendrita-content-item-meta { margin-left: auto; font-size: 11px; color: var(--d-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dendrita-content-item-status { display: flex; align-items: center; gap: 5px; flex-shrink: 0; font: 600 11px var(--d-font-body); }
.dendrita-content-item-status i { width: 8px; height: 8px; border-radius: 50%; }
.dendrita-content-item-status.is-seen { color: var(--d-green-700); }
.dendrita-content-item-status.is-seen i { background: var(--d-green-500); }
.dendrita-content-item-status.is-new { color: var(--d-muted); }
.dendrita-content-item-status.is-new i { background: var(--d-border); }
/* the catalog's bookmark mark (issue 25) — the same amber the players use for a marked item */
.dendrita-content-item-flag { flex-shrink: 0; color: var(--d-warning); font: 600 11px var(--d-font-body); }
.dendrita-content-preview-pills .dendrita-content-item-flag { border: 1px solid var(--d-warning-border); border-radius: 999px; padding: 3px 9px; background: var(--d-warning-bg); }
.dendrita-content-item-text { font-size: 13px; color: var(--d-text); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dendrita-content-empty { margin: 0; padding: 14px 2px; color: var(--d-muted); font-size: 12.5px; }
.dendrita-content-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; font-size: 11.5px; color: var(--d-muted); font-variant-numeric: tabular-nums; }
.dendrita-content-pager-controls { display: flex; align-items: center; gap: 6px; }
.dendrita-content-pager-controls > span { min-width: 92px; text-align: center; color: var(--d-text); }
.dendrita-content-pager-controls button { display: grid; place-items: center; width: 40px; height: 40px; background: var(--d-white); border: 1px solid var(--d-border); border-radius: 6px; color: var(--d-text); cursor: pointer; font-size: 16px; line-height: 1; transition: background 120ms ease-out; }
.dendrita-content-pager-controls button:hover:not(:disabled) { background: var(--d-green-50); }
.dendrita-content-pager-controls button:disabled { color: var(--d-muted); cursor: default; opacity: .58; }
.dendrita-content-preview-slot { position: sticky; top: 16px; min-width: 0; }
.dendrita-content-preview { position: relative; display: flex; flex-direction: column; gap: 12px; background: var(--d-paper); border: 1px solid var(--d-border); border-radius: 14px; box-shadow: 0 10px 30px rgb(26 29 26 / 14%); padding: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }
.dendrita-content-preview-close { position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 40px; height: 40px; background: transparent; border: 0; border-radius: 50%; color: var(--d-muted); cursor: pointer; transition: background 120ms ease-out; }
.dendrita-content-preview-close:hover { background: var(--d-green-50); }
.dendrita-content-preview-close svg { width: 15px; height: 15px; }
.dendrita-content-preview-kind { padding-right: 40px; font: 600 10.5px var(--d-font-body); letter-spacing: .12em; text-transform: uppercase; color: var(--d-muted); }
.dendrita-content-preview-pills { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.dendrita-content-preview-pills .dendrita-content-item-status { border: 1px solid var(--d-border); border-radius: 999px; padding: 3px 9px; background: var(--d-white); }
.dendrita-content-preview-pills .dendrita-content-item-status.is-seen { background: var(--d-green-100); border-color: var(--d-green-border); color: var(--d-green-900); }
.dendrita-content-preview-body small { font-size: 11.5px; color: var(--d-muted); }
.dendrita-content-preview-body p { margin: 6px 0 0; font-size: 13px; line-height: 1.55; color: var(--d-text); }
.dendrita-content-preview-face { display: block; }
.dendrita-content-preview-face + .dendrita-content-preview-face { margin-top: 10px; }
.dendrita-content-preview-face > span { font: 600 10.5px var(--d-font-body); letter-spacing: .12em; text-transform: uppercase; color: var(--d-muted); }
.dendrita-content-preview-face p { margin: 6px 0 0; font-size: 13.5px; font-weight: 500; color: var(--d-ink); line-height: 1.5; }
.dendrita-content-preview-face.is-back { background: var(--d-green-50); border: 1px solid var(--d-border); border-radius: 10px; padding: 10px 12px; }
.dendrita-content-preview-face.is-back p { font-weight: 400; color: var(--d-text); }
.dendrita-content-family-variants-toggle { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 9px; width: 100%; min-height: 44px; background: var(--d-green-50); border: 1px solid var(--d-green-border); border-radius: 10px; padding: 10px 12px; color: var(--d-green-900); cursor: pointer; text-align: left; font: 600 12.5px var(--d-font-body); }
.dendrita-content-family-variants-toggle:hover { border-color: var(--d-green-300); }
.dendrita-content-family-variants-toggle svg { width: 16px; height: 16px; }
.dendrita-content-family-variants-toggle svg:last-child { width: 14px; height: 14px; transition: transform 120ms ease-out; }
.dendrita-content-family-variants-toggle[aria-expanded="true"] svg:last-child { transform: rotate(90deg); }
.dendrita-content-family-variants { display: flex; flex-direction: column; gap: 8px; border-left: 2px solid var(--d-green-300); padding-left: 10px; }
.dendrita-content-family-variants-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.dendrita-content-family-variants-head strong { font-size: 12px; color: var(--d-ink); }
.dendrita-content-family-variants-head small { font-size: 10.5px; color: var(--d-muted); }
.dendrita-content-family-variant { display: flex; flex-direction: column; gap: 5px; width: 100%; min-height: 44px; background: var(--d-white); border: 1px solid var(--d-border); border-radius: 9px; padding: 10px 11px; cursor: pointer; text-align: left; font-family: var(--d-font-body); }
.dendrita-content-family-variant:hover { border-color: var(--d-green-300); }
.dendrita-content-family-variant > span { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 7px; }
.dendrita-content-family-variant b { font-size: 10.5px; color: var(--d-green-700); }
.dendrita-content-family-variant small { font-size: 10.5px; color: var(--d-muted); }
.dendrita-content-family-variant svg { width: 13px; height: 13px; color: var(--d-green-700); }
.dendrita-content-family-variant p { margin: 0; color: var(--d-text); font-size: 12px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dendrita-content-preview-backdrop { display: none; }
.dendrita-content-material-slot { position: fixed; z-index: 95; inset: 0; display: grid; place-items: center; padding: 24px; }
.dendrita-content-material-backdrop { position: absolute; inset: 0; background: rgb(26 29 26 / 34%); border: 0; }
.dendrita-content-material { position: relative; display: flex; flex-direction: column; gap: 14px; width: 520px; max-width: 100%; max-height: calc(100vh - 48px); overflow-y: auto; background: var(--d-white); border: 1px solid var(--d-border); border-radius: 14px; box-shadow: 0 24px 60px rgb(26 29 26 / 30%); padding: 22px 24px 20px; }
.dendrita-content-material-close { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 40px; height: 40px; background: transparent; border: 0; border-radius: 50%; color: var(--d-muted); cursor: pointer; transition: background 120ms ease-out; }
.dendrita-content-material-close:hover { background: var(--d-green-50); }
.dendrita-content-material-close svg { width: 15px; height: 15px; }
.dendrita-content-material h3 { margin: 0; padding-right: 34px; font: 500 21px/1.25 var(--d-font-display); color: var(--d-ink); }
.dendrita-content-material-meta { font-size: 12px; color: var(--d-muted); }
.dendrita-content-material-link { display: flex; align-items: center; gap: 12px; min-height: 44px; background: var(--d-green-50); border: 1px solid var(--d-green-border); border-radius: 10px; padding: 12px 14px; text-decoration: none; transition: border-color 120ms ease-out; }
.dendrita-content-material-link:hover { border-color: var(--d-green-300); }
.dendrita-content-material-link > svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--d-green-700); }
.dendrita-content-material-link > span { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.dendrita-content-material-link strong { font-size: 12.5px; font-weight: 600; color: var(--d-green-900); }
.dendrita-content-material-link small { font-size: 11.5px; color: var(--d-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dendrita-content-material-link em { flex-shrink: 0; font: 500 12px var(--d-font-body); font-style: normal; color: var(--d-green-700); white-space: nowrap; }
.dendrita-content-material p { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--d-muted); }
.dendrita-content-material-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; border-top: 1px solid var(--d-border); padding-top: 14px; }
.dendrita-content-material-actions .dendrita-preview-label { margin-left: 6px; }
.dendrita-content-palette-overlay { position: fixed; z-index: 90; inset: 0; display: flex; justify-content: center; align-items: flex-start; padding: 9vh 20px 24px; background: rgb(26 29 26 / 34%); }
.dendrita-content-palette-card { display: flex; flex-direction: column; width: 660px; max-width: 100%; max-height: 78vh; overflow: hidden; background: var(--d-white); border: 1px solid var(--d-border); border-radius: 14px; box-shadow: 0 24px 60px rgb(26 29 26 / 30%); }
.dendrita-content-palette-head { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 16px; border-bottom: 1px solid var(--d-border); }
.dendrita-content-palette-head > svg { width: 17px; height: 17px; flex-shrink: 0; color: var(--d-green-700); }
.dendrita-content-palette-head input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font: 400 15px var(--d-font-body); color: var(--d-text); }
#dendritaContentPaletteScope { display: flex; align-items: center; gap: 5px; min-height: 40px; background: var(--d-green-50); border: 1px solid var(--d-green-border); border-radius: 999px; padding: 4px 10px; font: 400 11px var(--d-font-body); color: var(--d-green-900); cursor: pointer; white-space: nowrap; }
.dendrita-content-palette-esc { flex-shrink: 0; font-size: 10.5px; color: var(--d-muted); border: 1px solid var(--d-border); border-radius: 5px; padding: 3px 6px; }
.dendrita-content-palette-body { overflow-y: auto; padding: 4px 6px 8px; }
.dendrita-content-palette-group { display: flex; flex-direction: column; gap: 2px; padding: 8px 0 6px; }
.dendrita-content-palette-group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 4px 10px 6px; }
.dendrita-content-palette-group-head span { font: 600 10.5px var(--d-font-body); letter-spacing: .12em; text-transform: uppercase; color: var(--d-muted); }
.dendrita-content-palette-group-head small { font-size: 10.5px; color: var(--d-muted); }
.dendrita-content-palette-item { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 44px; background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 9px 10px; cursor: pointer; text-align: left; font-family: var(--d-font-body); transition: background 120ms ease-out; }
.dendrita-content-palette-item:hover,
.dendrita-content-palette-item.is-active { background: var(--d-green-50); border-color: var(--d-green-border); }
.dendrita-content-palette-item > svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--d-green-700); }
.dendrita-content-palette-copy { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.dendrita-content-palette-copy > span { font-size: 13.5px; color: var(--d-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dendrita-content-palette-copy b { font-weight: 700; color: var(--d-green-700); }
.dendrita-content-palette-copy small { font-size: 11px; color: var(--d-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dendrita-content-palette-facts { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.dendrita-content-palette-facts small { font-size: 11px; color: var(--d-muted); font-variant-numeric: tabular-nums; }
.dendrita-content-palette-facts b { width: 40px; text-align: right; font: 400 11px var(--d-font-body); color: var(--d-green-700); font-variant-numeric: tabular-nums; }
.dendrita-content-palette-facts svg { width: 15px; height: 15px; color: var(--d-green-700); }
.dendrita-content-palette-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 26px 12px 22px; }
.dendrita-content-palette-empty span { font-size: 13.5px; color: var(--d-ink); }
.dendrita-content-palette-empty small { font-size: 12px; color: var(--d-muted); }
.dendrita-content-palette-empty button { min-height: 40px; padding: 0; background: transparent; border: 0; font: 500 12px var(--d-font-body); color: var(--d-green-700); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.dendrita-content-palette-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 4px 16px; border-top: 1px solid var(--d-border); background: var(--d-paper); font-size: 11px; color: var(--d-muted); }
.dendrita-content-palette-foot button { display: flex; align-items: center; gap: 6px; min-height: 40px; background: transparent; border: 0; font: 500 11.5px var(--d-font-body); color: var(--d-green-700); cursor: pointer; }
.dendrita-content-palette-foot button svg { width: 14px; height: 14px; }
.dendrita-content-chooser { display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 620px; margin: clamp(20px, 8vh, 84px) auto 32px; text-align: center; }
.dendrita-content-chooser-badge { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 18px; color: var(--d-green-700); background: var(--d-green-50); border: 1px solid var(--d-green-100); border-radius: 18px; }
.dendrita-content-chooser-badge svg { width: 26px; height: 26px; stroke-width: 1.5; }
.dendrita-content-chooser h1 { margin: 0 0 8px; font: 500 30px/1.1 var(--d-font-display); color: var(--d-ink); }
.dendrita-content-chooser > p { margin: 0; font-size: 14px; color: var(--d-muted); }
.dendrita-content-chooser-actions { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.dendrita-content-chooser-explore { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 9px 16px; color: var(--d-green-700); background: var(--d-white); border: 1px solid var(--d-border); border-radius: 10px; font: 500 13.5px var(--d-font-body); cursor: pointer; transition: background 120ms ease-out, border-color 120ms ease-out; }
.dendrita-content-chooser-explore:hover { background: var(--d-green-50); border-color: var(--d-green-300); }
.dendrita-content-chooser-explore svg { width: 15px; height: 15px; }
.dendrita-content-chooser-areas { display: flex; flex-direction: column; gap: 14px; width: 100%; margin-top: 44px; }
.dendrita-content-chooser-areas > span { display: flex; align-items: center; gap: 14px; font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--d-muted); }
.dendrita-content-chooser-areas > span::before,
.dendrita-content-chooser-areas > span::after { content: ''; flex: 1; height: 1px; background: var(--d-border); }
.dendrita-content-chooser-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dendrita-content-chooser-area { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 12px 14px; background: var(--d-white); border: 1px solid var(--d-border); border-radius: 12px; text-align: left; cursor: pointer; transition: border-color 120ms ease-out, box-shadow 120ms ease-out, transform 120ms ease-out; }
.dendrita-content-chooser-area:hover { border-color: var(--d-green-300); box-shadow: 0 4px 14px rgb(61 66 52 / 8%); transform: translateY(-1px); }
.dendrita-content-chooser-area > svg { width: 17px; height: 17px; flex: 0 0 auto; color: var(--d-green-700); }
.dendrita-content-chooser-area-copy { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.dendrita-content-chooser-area-copy > span { overflow: hidden; font: 500 13.5px var(--d-font-body); color: var(--d-ink); text-overflow: ellipsis; white-space: nowrap; }
.dendrita-content-chooser-area-copy > small { font-size: 11.5px; color: var(--d-muted); }
.dendrita-content-chooser-area > b { font: 600 12px var(--d-font-body); color: var(--d-green-700); font-variant-numeric: tabular-nums; }
.dendrita-content-loading { display: flex; flex-direction: column; gap: 12px; padding-top: 6px; }
.dendrita-content-loading i { display: block; height: 72px; background: linear-gradient(100deg, var(--d-green-50) 20%, var(--d-green-100) 40%, var(--d-green-50) 60%); background-size: 220% 100%; border-radius: 10px; animation: dendrita-sheen 1.4s linear infinite; opacity: .75; }
.dendrita-content-loading i:first-child { height: 96px; }
.dendrita-content-failure { display: flex; min-height: 420px; align-items: center; justify-content: center; flex-direction: column; padding: 32px; color: var(--d-muted); text-align: center; }
.dendrita-content-failure > svg { width: 32px; height: 32px; color: var(--d-green-500); }
.dendrita-content-failure h1 { margin: 12px 0 4px; color: var(--d-ink); font: 500 24px var(--d-font-display); }
.dendrita-content-failure p { max-width: 420px; margin: 0 0 16px; font-size: 12.5px; }
.dendrita-content-failure button { display: flex; align-items: center; gap: 8px; min-height: 40px; min-width: 150px; justify-content: center; background: var(--d-green-700); border: 0; border-radius: 8px; padding: 10px 16px; color: var(--d-cream); font: 500 13px var(--d-font-body); cursor: pointer; }
.dendrita-content-failure button svg { width: 15px; height: 15px; }

/* ---- Revisões: the SRS agenda screen ---- */
.dendrita-reviews { display: flex; width: 100%; max-width: 1040px; flex-direction: column; gap: 18px; margin: 0 auto; padding: 12px 36px 40px; box-sizing: border-box; }
.dendrita-reviews svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dendrita-reviews-head h1 { margin: 0; font: 500 28px/1.1 var(--d-font-display); color: var(--d-ink); }
.dendrita-reviews-head p { margin: 6px 0 0; font-size: 13.5px; color: var(--d-muted); }
.dendrita-reviews-hero { position: relative; overflow: hidden; padding: 22px 28px 20px; color: var(--d-on-dark); background: var(--d-green-800) url("/assets/hero-texture.jpg") center / cover; border-radius: 14px; }
.dendrita-reviews-hero .dendrita-care-decoration { top: -20px; right: -110px; height: calc(100% + 70px); opacity: .32; }
.dendrita-reviews-hero-content { position: relative; z-index: 1; }
.dendrita-reviews-hero h2 { max-width: 560px; margin: 0; color: var(--d-cream); font: 500 30px/1.15 var(--d-font-display); letter-spacing: -.015em; text-wrap: pretty; }
.dendrita-reviews-hero.is-caught-up h2 { font-size: 36px; }
.dendrita-reviews-lead { max-width: 430px; margin: 8px 0 0; color: var(--d-on-dark-muted); font-size: 13.5px; line-height: 1.55; }
.dendrita-reviews-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 18px; margin-top: 18px; }
.dendrita-reviews-stats { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.dendrita-reviews-stat { display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 12px; border: 1px solid rgb(242 239 230 / 28%); border-radius: 999px; color: var(--d-on-dark-muted); font-size: 12px; }
.dendrita-reviews-stat b { color: var(--d-cream); font-size: 13px; font-variant-numeric: tabular-nums; }
.dendrita-reviews-stat.is-overdue { background: rgb(184 92 56 / 22%); border-color: rgb(224 152 118 / 55%); }
.dendrita-reviews-stat.is-overdue b { color: #f4c9b2; }
.dendrita-reviews-card { padding: 18px 22px 16px; background: var(--d-white); border: 1px solid var(--d-border); border-radius: 14px; box-shadow: var(--d-shadow-card); }
.dendrita-reviews-forecast-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.dendrita-reviews-card-title { color: var(--d-muted); font: 600 11px var(--d-font-body); letter-spacing: .12em; text-transform: uppercase; }
.dendrita-reviews-seg { display: flex; gap: 8px; }
.dendrita-reviews-seg button { min-height: 40px; padding: 7px 13px; background: var(--d-white); border: 1px solid var(--d-border); border-radius: 999px; color: var(--d-text); font: 500 12px var(--d-font-body); cursor: pointer; transition: filter 120ms ease-out; }
.dendrita-reviews-seg button:hover { filter: brightness(.96); }
.dendrita-reviews-seg button.is-active { background: var(--d-green-700); border-color: var(--d-green-700); color: var(--d-cream); }
.dendrita-reviews-chart { display: flex; gap: 12px; }
.dendrita-reviews-day { display: flex; flex: 1; min-width: 0; flex-direction: column; align-items: center; gap: 6px; }
.dendrita-reviews-plot { display: flex; width: 100%; height: 118px; flex-direction: column; justify-content: flex-end; align-items: center; }
.dendrita-reviews-count { margin-bottom: 5px; color: var(--d-ink); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.dendrita-reviews-bar { display: block; width: 100%; max-width: 42px; flex-shrink: 0; background: var(--d-green-500); border-radius: 4px 4px 0 0; }
.dendrita-reviews-day.is-overdue .dendrita-reviews-bar { background: var(--d-accent-rust); }
.dendrita-reviews-day.is-zero .dendrita-reviews-plot::after { width: 5px; height: 5px; margin-bottom: -2px; content: ""; background: var(--d-border); border-radius: 50%; }
.dendrita-reviews-day:hover .dendrita-reviews-bar { filter: brightness(.94); }
.dendrita-reviews-baseline { height: 1px; margin-top: -1px; background: var(--d-border); }
.dendrita-reviews-day-label { max-width: 100%; overflow: hidden; color: var(--d-muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.dendrita-reviews-day.is-overdue .dendrita-reviews-day-label { color: var(--d-accent-rust); font-weight: 600; }
.dendrita-reviews-day.is-today .dendrita-reviews-day-label { color: var(--d-ink); font-weight: 600; }
.dendrita-reviews-chart.is-dense { gap: 2px; }
.dendrita-reviews-chart.is-dense .dendrita-reviews-day { gap: 4px; }
.dendrita-reviews-chart.is-dense .dendrita-reviews-plot { height: 92px; }
.dendrita-reviews-chart.is-dense .dendrita-reviews-bar { max-width: none; border-radius: 3px 3px 0 0; }
.dendrita-reviews-chart.is-dense .dendrita-reviews-count { margin-bottom: 3px; font-size: 9.5px; }
.dendrita-reviews-chart.is-dense .dendrita-reviews-day-label { font-size: 9px; }
.dendrita-reviews-section-head h2 { margin: 0; color: var(--d-muted); font: 600 11px var(--d-font-body); letter-spacing: .12em; text-transform: uppercase; }
.dendrita-reviews-section-head p { margin: 6px 0 0; color: var(--d-muted); font-size: 12.5px; }
.dendrita-reviews-group { margin-top: 16px; }
.dendrita-reviews-group-label { display: flex; align-items: baseline; gap: 7px; margin: 0 2px 8px; color: var(--d-muted); font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.dendrita-reviews-group-label.is-overdue { color: var(--d-accent-rust); }
.dendrita-reviews-group-label small { color: var(--d-muted); font-size: 11px; font-weight: 400; letter-spacing: 0; text-transform: none; }
.dendrita-reviews-rows { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.dendrita-reviews-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 92px 40px; align-items: center; gap: 16px; padding: 11px 14px; background: var(--d-white); border: 1px solid var(--d-border); border-radius: 10px; transition: border-color 120ms ease-out, box-shadow 120ms ease-out; }
.dendrita-reviews-row:hover { border-color: var(--d-green-300); box-shadow: 0 2px 8px rgb(26 29 26 / 6%); }
.dendrita-reviews-row-main { min-width: 0; }
.dendrita-reviews-topic { display: flex; min-width: 0; align-items: baseline; gap: 8px; color: var(--d-ink); font-size: 13.5px; font-weight: 600; overflow-wrap: anywhere; }
.dendrita-reviews-flag { flex: 0 0 auto; padding: 2px 8px; background: var(--d-warning-bg); border: 1px solid var(--d-warning-border); border-radius: 999px; color: var(--d-warning); font: 600 10px var(--d-font-body); font-style: normal; letter-spacing: .04em; text-transform: uppercase; }
.dendrita-reviews-meta { display: block; margin-top: 3px; color: var(--d-muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.dendrita-reviews-pill { max-width: 240px; overflow: hidden; padding: 3px 10px; background: var(--d-green-50); border: 1px solid var(--d-border); border-radius: 999px; color: var(--d-green-700); font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.dendrita-reviews-due { color: var(--d-muted); font-size: 12.5px; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dendrita-reviews-due.is-overdue { color: var(--d-accent-rust); font-weight: 600; }
.dendrita-reviews-due.is-today { color: var(--d-ink); font-weight: 600; }
.dendrita-reviews-remove { display: grid; width: 40px; height: 40px; padding: 0; place-items: center; background: transparent; border: 0; border-radius: 8px; color: var(--d-muted); cursor: pointer; transition: background 120ms ease-out, color 120ms ease-out; }
.dendrita-reviews-remove:hover { background: var(--d-ground); color: var(--d-text); }
.dendrita-reviews-remove svg { width: 15px; height: 15px; }
.dendrita-reviews-row.is-excluded { grid-template-columns: minmax(0, 1fr) auto auto; background: var(--d-paper); }
.dendrita-reviews-row.is-excluded .dendrita-reviews-topic { color: var(--d-text); font-weight: 500; }
.dendrita-reviews-return { display: inline-flex; min-height: 40px; align-items: center; gap: 7px; padding: 4px 8px; background: transparent; border: 0; color: var(--d-green-700); font: 500 12.5px var(--d-font-body); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; white-space: nowrap; }
.dendrita-reviews-return:hover { color: var(--d-green-900); }
.dendrita-reviews-return svg { width: 14px; height: 14px; }
.dendrita-reviews-empty { margin: 14px 2px 0; color: var(--d-muted); font-size: 12.5px; }
.dendrita-reviews-back { display: inline-flex; align-self: flex-start; min-height: 40px; align-items: center; gap: 8px; padding: 4px 8px; background: transparent; border: 0; color: var(--d-muted); font: 500 13px var(--d-font-body); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; cursor: pointer; }
.dendrita-reviews-back:hover { color: var(--d-ink); }
.dendrita-reviews-back svg { width: 15px; height: 15px; }
.dendrita-reviews-loading { display: flex; flex-direction: column; gap: 12px; }
.dendrita-reviews-loading i { display: block; height: 88px; background: linear-gradient(100deg, var(--d-green-50) 20%, var(--d-green-100) 40%, var(--d-green-50) 60%); background-size: 220% 100%; border-radius: 12px; animation: dendrita-sheen 1.4s linear infinite; opacity: .75; }

/* ---- Aulas e artigos: subjects, cycle state, and their materials (prototype variant B2) ---- */
/* Sage ink is `--d-green-700` throughout, never `--d-green-900`: the dark palette darkens 900 while
   also darkening its green backgrounds, so a 900-on-100 pairing that reads in light mode collapses
   to near-zero contrast in dark. 700 lightens in dark and clears both grounds. */
/* Unlike the single-column screens this one spends its width on two columns, so it uses the
   workspace's own padding instead of adding a second inset the subject rows cannot afford. */
.dendrita-materials { display: flex; width: 100%; max-width: 1040px; flex-direction: column; gap: 18px; margin: 0 auto; padding: 12px 0 40px; box-sizing: border-box; }
.dendrita-materials svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* The shared actions are drawn for dark heroes; this screen is paper, so its ink flips. Both use
   semantic tokens, so the dark palette follows without a second override. */
.dendrita-materials .dendrita-primary-button { color: var(--d-on-primary); background: var(--d-green-700); }
.dendrita-materials .dendrita-primary-button:hover { background: var(--d-green-800); }
.dendrita-materials .dendrita-text-action { color: var(--d-green-700); }
.dendrita-materials .dendrita-eyebrow { margin-bottom: 0; color: var(--d-green-700); font-size: 10.5px; }
.dendrita-materials .dendrita-eyebrow svg { width: 14px; height: 14px; }
.dendrita-materials-head h1 { margin: 0; font: 500 28px/1.1 var(--d-font-display); color: var(--d-ink); }
/* The one sentence the owner asked to be impossible to skim past: the learner is free to study by
   any material, and the confirmation is what matters. */
.dendrita-materials-lead { display: flex; max-width: 680px; align-items: flex-start; gap: 11px; margin: 14px 0 0; padding: 14px 17px; background: var(--d-green-50); border-left: 4px solid var(--d-green-700); border-radius: 10px; color: var(--d-text); font-size: 14.5px; line-height: 1.55; }
.dendrita-materials-lead svg { width: 17px; height: 17px; flex: 0 0 auto; margin-top: 3px; color: var(--d-green-700); }
.dendrita-materials-lead b { color: var(--d-green-700); font-weight: 600; }

.dendrita-materials-layout { display: grid; grid-template-columns: minmax(0, 1fr) 292px; gap: 22px; align-items: start; }
/* The rail gives width back before the subject rows have to stack anything. */
@media (max-width: 1250px) { .dendrita-materials-layout { grid-template-columns: minmax(0, 1fr) 262px; gap: 18px; } }
.dendrita-materials-main { display: flex; min-width: 0; flex-direction: column; gap: 14px; container-type: inline-size; }

.dendrita-materials-score { display: flex; align-items: center; gap: 16px; padding: 14px 18px; background: var(--d-white); border: 1px solid var(--d-border); border-radius: 14px; box-shadow: var(--d-shadow-card); }
.dendrita-materials-score-mark { display: grid; width: 42px; height: 42px; flex: 0 0 auto; place-items: center; color: var(--d-green-700); background: var(--d-green-50); border-radius: 50%; }
.dendrita-materials-score-mark svg { width: 19px; height: 19px; }
.dendrita-materials-score-number { display: flex; align-items: baseline; gap: 9px; }
.dendrita-materials-score-number b { color: var(--d-green-700); font: 600 30px/1 var(--d-font-display); font-variant-numeric: tabular-nums; }
.dendrita-materials-score-number span { max-width: 200px; color: var(--d-text); font-size: 12px; line-height: 1.3; }
.dendrita-materials-score-grow { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; color: var(--d-muted); font-size: 11.5px; text-align: right; }
.dendrita-materials-score-grow svg { width: 14px; height: 14px; flex: 0 0 auto; color: var(--d-green-500); }

.dendrita-materials-tools { display: flex; flex-direction: column; gap: 10px; }
.dendrita-materials-search { display: flex; align-items: center; gap: 8px; padding: 9px 14px; color: var(--d-muted); background: var(--d-white); border: 1px solid var(--d-border); border-radius: 999px; }
.dendrita-materials-search svg { width: 15px; height: 15px; flex: 0 0 auto; }
body[data-platform-view="dendrita"] .dendrita-materials-search input { min-width: 0; flex: 1; height: 26px; padding: 0; color: var(--d-text); background: transparent; border: 0; font: 400 13px var(--d-font-body); outline: none; }
.dendrita-materials-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.dendrita-materials-seg { display: flex; gap: 6px; }
body[data-platform-view="dendrita"] .dendrita-materials-seg button { min-height: 38px; padding: 5px 13px; color: var(--d-text); background: var(--d-white); border: 1px solid var(--d-border); border-radius: 999px; font: 500 11.5px var(--d-font-body); cursor: pointer; transition: filter 120ms ease-out; }
body[data-platform-view="dendrita"] .dendrita-materials-seg button:hover { filter: brightness(.96); }
body[data-platform-view="dendrita"] .dendrita-materials-seg button.is-active { color: var(--d-on-primary); background: var(--d-green-700); border-color: var(--d-green-700); }

.dendrita-materials-area { position: relative; }
body[data-platform-view="dendrita"] .dendrita-materials-area-toggle { display: inline-flex; min-height: 38px; align-items: center; gap: 7px; padding: 5px 13px; color: var(--d-text); background: var(--d-white); border: 1px solid var(--d-border); border-radius: 999px; font: 400 11.5px var(--d-font-body); cursor: pointer; }
body[data-platform-view="dendrita"] .dendrita-materials-area-toggle:hover { border-color: var(--d-green-300); }
.dendrita-materials-area-toggle b { color: var(--d-ink); font-weight: 600; }
.dendrita-materials-area-toggle svg { width: 13px; height: 13px; color: var(--d-muted); transform: rotate(90deg); }
.dendrita-materials-area-menu { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; display: flex; width: 292px; max-width: calc(100vw - 32px); flex-direction: column; overflow: hidden; background: var(--d-white); border: 1px solid var(--d-border); border-radius: 12px; box-shadow: 0 14px 34px rgb(26 29 26 / 18%); }
.dendrita-materials-area-search { display: flex; align-items: center; gap: 8px; padding: 9px 12px; color: var(--d-muted); border-bottom: 1px solid var(--d-border); }
.dendrita-materials-area-search svg { width: 14px; height: 14px; flex: 0 0 auto; }
body[data-platform-view="dendrita"] .dendrita-materials-area-search input { min-width: 0; flex: 1; height: 24px; padding: 0; color: var(--d-text); background: transparent; border: 0; font: 400 12.5px var(--d-font-body); outline: none; }
.dendrita-materials-area-list { display: flex; max-height: 320px; flex-direction: column; gap: 2px; padding: 6px; overflow-y: auto; }
body[data-platform-view="dendrita"] .dendrita-materials-area-list button { display: flex; width: 100%; min-height: 38px; align-items: baseline; justify-content: space-between; gap: 10px; padding: 8px 10px; color: var(--d-text); background: transparent; border: 0; border-radius: 8px; font: 400 12.5px var(--d-font-body); text-align: left; cursor: pointer; }
body[data-platform-view="dendrita"] .dendrita-materials-area-list button:hover,
body[data-platform-view="dendrita"] .dendrita-materials-area-list button:focus-visible { background: var(--d-green-50); outline: none; }
body[data-platform-view="dendrita"] .dendrita-materials-area-list button.is-active { color: var(--d-green-700); background: var(--d-green-100); font-weight: 600; }
.dendrita-materials-area-list small { flex: 0 0 auto; color: var(--d-muted); font-size: 11px; font-weight: 400; font-variant-numeric: tabular-nums; }

.dendrita-materials-list { display: flex; flex-direction: column; gap: 18px; }
.dendrita-materials-group-label { display: flex; align-items: baseline; gap: 7px; margin: 0 2px 8px; color: var(--d-green-700); font-size: 11.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.dendrita-materials-group-label small { color: var(--d-muted); font-size: 11.5px; font-weight: 400; letter-spacing: 0; text-transform: none; }
.dendrita-materials-rows { display: flex; flex-direction: column; gap: 7px; }
body[data-platform-view="dendrita"] .dendrita-materials-row { display: grid; width: 100%; grid-template-columns: 34px minmax(0, 1fr) auto 14px; align-items: center; gap: 12px; padding: 11px 14px; color: inherit; background: var(--d-white); border: 1px solid var(--d-border); border-radius: 11px; font: inherit; text-align: left; cursor: pointer; transition: border-color 120ms ease-out, box-shadow 120ms ease-out; }
body[data-platform-view="dendrita"] .dendrita-materials-row:hover { border-color: var(--d-green-300); box-shadow: 0 2px 8px rgb(26 29 26 / 6%); }
body[data-platform-view="dendrita"] .dendrita-materials-row.is-offer { background: var(--d-green-50); border-color: var(--d-green-700); box-shadow: 0 0 0 1px var(--d-green-700); }
.dendrita-materials-row-mark { display: grid; width: 34px; height: 34px; place-items: center; color: var(--d-green-700); background: var(--d-green-50); border-radius: 50%; }
.dendrita-materials-row-mark svg { width: 16px; height: 16px; }
.dendrita-materials-row.is-out .dendrita-materials-row-mark { color: var(--d-muted); background: transparent; border: 1px dashed var(--d-border); }
.dendrita-materials-row-copy { min-width: 0; }
.dendrita-materials-row-copy strong { display: block; color: var(--d-ink); font-size: 13.5px; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.dendrita-materials-row-copy small { display: block; margin-top: 2px; color: var(--d-muted); font-size: 11px; overflow-wrap: anywhere; }
.dendrita-materials-row > svg { width: 14px; height: 14px; color: var(--d-border); }
.dendrita-materials-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 10.5px; font-weight: 600; white-space: nowrap; }
.dendrita-materials-pill svg { width: 12px; height: 12px; flex: 0 0 auto; }
.dendrita-materials-pill.is-fresh { color: var(--d-green-700); background: var(--d-green-100); }
.dendrita-materials-pill.is-rusty { color: var(--d-warning); background: var(--d-warning-bg); }
.dendrita-materials-pill.is-lost { color: var(--d-accent-rust); background: var(--d-error-bg); }
.dendrita-materials-pill.is-out { color: var(--d-muted); background: transparent; border: 1px dashed var(--d-border); }
.dendrita-materials-pill.is-offer { color: var(--d-on-primary); background: var(--d-green-700); font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; }
body[data-platform-view="dendrita"] .dendrita-materials-more { display: inline-flex; min-height: 36px; align-items: baseline; gap: 6px; margin: 8px 2px 0; padding: 4px 8px; color: var(--d-green-700); background: transparent; border: 0; font: 500 12.5px var(--d-font-body); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
body[data-platform-view="dendrita"] .dendrita-materials-more:hover { color: var(--d-green-800); }
.dendrita-materials-more small { color: var(--d-muted); font-size: 11.5px; text-decoration: none; }
.dendrita-materials-empty { margin: 6px 2px; color: var(--d-muted); font-size: 12.5px; line-height: 1.5; }
/* The owner asked for this sentence to be read, not skimmed, so the closing repetition keeps body
   ink on the workspace ground rather than the muted grey the prototype sketched. */
.dendrita-materials-honesty { display: flex; align-items: flex-start; gap: 8px; margin: 4px 2px 0; color: var(--d-text); font-size: 11.5px; line-height: 1.55; }
.dendrita-materials-honesty svg { width: 14px; height: 14px; flex: 0 0 auto; margin-top: 2px; color: var(--d-green-500); }

.dendrita-materials-rail { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 14px; }
.dendrita-materials-today,
.dendrita-materials-quiet,
.dendrita-materials-recent { background: var(--d-white); border: 1px solid var(--d-border); border-radius: 14px; box-shadow: var(--d-shadow-card); }
.dendrita-materials-today { padding: 16px 18px; border-left: 4px solid var(--d-green-700); }
.dendrita-materials-today h2 { margin: 10px 0 0; color: var(--d-ink); font: 500 19px/1.2 var(--d-font-display); }
.dendrita-materials-today-why { margin: 9px 0 0; color: var(--d-text); font-size: 11.5px; line-height: 1.5; }
.dendrita-materials-today-count { margin: 8px 0 0; color: var(--d-muted); font-size: 10.5px; line-height: 1.45; }
.dendrita-materials-today-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 13px; }
.dendrita-materials-quiet { padding: 18px; text-align: center; }
.dendrita-materials-quiet .dendrita-materials-score-mark { margin: 0 auto 9px; }
.dendrita-materials-quiet h2 { margin: 0 0 4px; color: var(--d-ink); font: 500 17px/1.25 var(--d-font-display); }
.dendrita-materials-quiet p { margin: 0; color: var(--d-muted); font-size: 11.5px; line-height: 1.5; }
.dendrita-materials-quiet.is-failure { max-width: 520px; padding: 26px 24px; }
.dendrita-materials-quiet.is-failure h2 { font-size: 21px; }
.dendrita-materials-quiet.is-failure .dendrita-materials-today-actions { justify-content: center; }
.dendrita-materials-recent { padding: 14px 16px; }
.dendrita-materials-recent h3 { margin: 0 0 10px; color: var(--d-green-700); font: 700 11px var(--d-font-body); letter-spacing: .1em; text-transform: uppercase; }
.dendrita-materials-recent ul { display: flex; flex-direction: column; gap: 9px; margin: 0; padding: 0; list-style: none; }
.dendrita-materials-recent li { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--d-text); font-size: 12px; }
.dendrita-materials-recent li b { min-width: 0; color: var(--d-ink); font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }

/* The subject window: both materials together, the honesty box, and the state-aware action. */
/* The single column is `minmax(0, 1fr)`, not the implicit `auto` track: an auto track sizes to the
   window's 560px max-content and then `max-width: 100%` measures itself against that overflowing
   track instead of the viewport, so a narrow phone would render the window wider than the screen. */
.dendrita-materials-window-slot { position: fixed; z-index: 95; inset: 0; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 24px; }
.dendrita-materials-window-backdrop { position: absolute; inset: 0; background: rgb(26 29 26 / 42%); border: 0; }
.dendrita-materials-window { position: relative; display: flex; width: 560px; max-width: 100%; max-height: calc(100vh - 48px); flex-direction: column; padding: 22px 24px 20px; overflow-y: auto; background: var(--d-white); border: 1px solid var(--d-border); border-radius: 16px; box-shadow: 0 24px 60px rgb(26 29 26 / 30%); }
.dendrita-materials-window:focus-visible { outline: none; }
body[data-platform-view="dendrita"] .dendrita-materials-window-close { position: absolute; top: 10px; right: 10px; display: grid; width: 38px; height: 38px; place-items: center; color: var(--d-muted); background: transparent; border: 0; border-radius: 50%; cursor: pointer; transition: background 120ms ease-out; }
body[data-platform-view="dendrita"] .dendrita-materials-window-close:hover { color: var(--d-ink); background: var(--d-green-100); }
.dendrita-materials-window-close svg { width: 15px; height: 15px; }
.dendrita-materials-window h2 { margin: 9px 0 2px; padding-right: 34px; color: var(--d-ink); font: 500 23px/1.15 var(--d-font-display); }
.dendrita-materials-window-path { color: var(--d-muted); font-size: 11px; line-height: 1.45; }
.dendrita-materials-window-pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.dendrita-materials-window-why { margin: 12px 0 0; color: var(--d-text); font-size: 12.5px; line-height: 1.5; }
.dendrita-materials-window h3 { margin: 18px 0 8px; color: var(--d-green-700); font: 700 11px var(--d-font-body); letter-spacing: .1em; text-transform: uppercase; }
.dendrita-materials-window-list { display: flex; flex-direction: column; gap: 7px; }
.dendrita-materials-resource { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 12px; color: inherit; background: var(--d-paper); border: 1px solid var(--d-border); border-radius: 11px; text-decoration: none; transition: border-color 120ms ease-out; }
.dendrita-materials-resource:hover { border-color: var(--d-green-300); }
.dendrita-materials-resource.is-unavailable { grid-template-columns: 34px minmax(0, 1fr); opacity: .6; }
.dendrita-materials-resource-mark { display: grid; width: 34px; height: 34px; place-items: center; color: var(--d-green-700); background: var(--d-green-50); border-radius: 9px; }
.dendrita-materials-resource-mark svg { width: 16px; height: 16px; }
.dendrita-materials-resource-copy { min-width: 0; }
.dendrita-materials-resource-copy strong { display: block; color: var(--d-ink); font-size: 13px; font-weight: 600; line-height: 1.25; }
.dendrita-materials-resource-copy small { display: block; margin-top: 1px; color: var(--d-muted); font-size: 11px; }
.dendrita-materials-resource-copy em { display: block; margin-top: 2px; color: var(--d-accent-rust); font-size: 10px; font-style: normal; }
.dendrita-materials-resource > svg { width: 14px; height: 14px; color: var(--d-muted); }
.dendrita-materials-window-note { display: flex; align-items: flex-start; gap: 9px; margin: 14px 0 0; padding: 12px 14px; color: var(--d-text); background: var(--d-green-50); border-radius: 9px; font-size: 12.5px; line-height: 1.5; }
.dendrita-materials-window-note svg { width: 15px; height: 15px; flex: 0 0 auto; margin-top: 2px; color: var(--d-green-700); }
.dendrita-materials-window-note b { color: var(--d-green-700); font-weight: 600; }
.dendrita-materials-window-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--d-border); }
/* The same window, after the study is recorded: one centred column that reads as an answer rather
   than a form. Only the note keeps its left-aligned prose, because centred running text is harder
   to read than the three short lines above it. */
.dendrita-materials-window.is-studied { width: 440px; padding: 30px 26px 22px; text-align: center; }
.dendrita-materials-window.is-studied h2 { margin: 6px 0 3px; padding-right: 0; }
.dendrita-materials-window.is-studied .dendrita-eyebrow { justify-content: center; }
.dendrita-materials-window.is-studied .dendrita-materials-window-pills { justify-content: center; margin-top: 12px; }
.dendrita-materials-window.is-studied .dendrita-materials-window-note { text-align: left; margin-top: 18px; }
.dendrita-materials-window.is-studied .dendrita-materials-window-actions { justify-content: center; }
.dendrita-materials-window.is-studied .dendrita-primary-button { min-width: 190px; }
.dendrita-materials-studied-mark { display: grid; width: 54px; height: 54px; margin: 0 auto 14px; place-items: center; color: var(--d-green-700); background: var(--d-green-100); border: 1px solid var(--d-green-300); border-radius: 50%; animation: dendrita-materials-studied 260ms cubic-bezier(.2, .8, .3, 1); }
.dendrita-materials-studied-mark svg { width: 25px; height: 25px; }
@keyframes dendrita-materials-studied { from { opacity: 0; transform: scale(.72); } }
.dendrita-materials-window-loading { display: flex; flex-direction: column; gap: 7px; }
.dendrita-materials-window-loading i,
.dendrita-materials-loading i { display: block; height: 54px; background: linear-gradient(100deg, var(--d-green-50) 20%, var(--d-green-100) 40%, var(--d-green-50) 60%); background-size: 220% 100%; border-radius: 11px; animation: dendrita-sheen 1.4s linear infinite; opacity: .75; }
.dendrita-materials-loading { display: flex; flex-direction: column; gap: 12px; }
.dendrita-materials-loading i { height: 88px; border-radius: 12px; }

/* The rail's own width decides when it stops being a rail: this workspace carries a 220px or a
   collapsed sidebar, so a viewport query would misjudge the space the two columns actually get. */
@container (max-width: 560px) {
  .dendrita-materials-score { flex-wrap: wrap; gap: 12px; }
  .dendrita-materials-score-grow { margin-left: 0; text-align: left; }
  .dendrita-materials-row { grid-template-columns: 34px minmax(0, 1fr) 14px; }
  .dendrita-materials-row .dendrita-materials-pill { grid-column: 2; grid-row: 2; justify-self: start; margin-top: 2px; }
}

/* ---- Desempenho: the performance dashboard ---- */
.dendrita-stats { display: flex; width: 100%; max-width: 1040px; flex-direction: column; gap: 18px; margin: 0 auto; padding: 12px 36px 40px; box-sizing: border-box; }
.dendrita-stats svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dendrita-stats-head h1 { margin: 0; font: 500 28px/1.1 var(--d-font-display); color: var(--d-ink); }
.dendrita-stats-head p { margin: 6px 0 0; font-size: 13.5px; color: var(--d-muted); }
.dendrita-stats-hero { position: relative; overflow: hidden; padding: 22px 28px 20px; color: var(--d-on-dark); background: var(--d-green-800) url("/assets/hero-texture.jpg") center / cover; border-radius: 14px; }
.dendrita-stats-hero .dendrita-care-decoration { top: -20px; right: -110px; height: calc(100% + 70px); opacity: .32; }
.dendrita-stats-hero-content { position: relative; z-index: 1; }
.dendrita-stats-hero h2 { max-width: 560px; margin: 0; color: var(--d-cream); font: 500 30px/1.15 var(--d-font-display); letter-spacing: -.015em; text-wrap: pretty; }
.dendrita-stats-lead { max-width: 470px; margin: 8px 0 0; color: var(--d-on-dark-muted); font-size: 13.5px; line-height: 1.55; }
.dendrita-stats-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 18px; margin-top: 18px; }
.dendrita-stats-pills { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.dendrita-stats-pill { display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 12px; border: 1px solid rgb(242 239 230 / 28%); border-radius: 999px; color: var(--d-on-dark-muted); font-size: 12px; }
.dendrita-stats-pill b { color: var(--d-cream); font-size: 13px; font-variant-numeric: tabular-nums; }
.dendrita-stats-card { padding: 18px 22px 16px; background: var(--d-white); border: 1px solid var(--d-border); border-radius: 14px; box-shadow: var(--d-shadow-card); }
.dendrita-stats-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.dendrita-stats-card-title { color: var(--d-muted); font: 600 11px var(--d-font-body); letter-spacing: .12em; text-transform: uppercase; }
.dendrita-stats-card-note { color: var(--d-muted); font-size: 12px; white-space: nowrap; }
.dendrita-stats-card-note b { color: var(--d-ink); font-variant-numeric: tabular-nums; }
.dendrita-stats-card-sub { margin: 6px 0 14px; color: var(--d-muted); font-size: 12.5px; }
.dendrita-stats-table, .dendrita-stats-topic-list { margin: 0; padding: 0; list-style: none; }
.dendrita-stats-table-head, .dendrita-stats-row { display: grid; grid-template-columns: minmax(0, 1fr) 52px 172px 78px 78px; align-items: center; gap: 14px; }
.dendrita-stats-table-head { padding: 4px 12px 8px; border-bottom: 1px solid var(--d-border); color: var(--d-muted); font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.dendrita-stats-table-head span:not(:first-child) { text-align: right; }
.dendrita-stats-row { padding: 6px 12px; border-bottom: 1px solid var(--d-border); font-size: 13px; }
.dendrita-stats-row small { display: none; }
.dendrita-stats-subject { display: flex; min-width: 0; min-height: 40px; align-items: center; gap: 8px; padding: 0; background: none; border: 0; color: var(--d-ink); font: 600 13px var(--d-font-body); text-align: left; cursor: pointer; }
.dendrita-stats-subject svg { width: 14px; height: 14px; flex: 0 0 auto; color: var(--d-muted); transition: transform 130ms ease-out; }
.dendrita-stats-subject.is-open svg { transform: rotate(90deg); }
.dendrita-stats-subject:hover svg { color: var(--d-text); }
.dendrita-stats-subject span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dendrita-stats-name { min-width: 0; overflow: hidden; padding-left: 22px; color: var(--d-text); font-size: 12.5px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.dendrita-stats-qs { color: var(--d-muted); text-align: right; font-variant-numeric: tabular-nums; }
.dendrita-stats-cov { display: inline-flex; align-items: center; justify-content: flex-end; gap: 9px; }
.dendrita-stats-track { flex: 0 0 96px; height: 6px; overflow: hidden; background: var(--d-green-100); border-radius: 999px; }
.dendrita-stats-track i { display: block; height: 100%; background: var(--d-green-500); border-radius: 999px; }
.dendrita-stats-cov b { min-width: 34px; color: var(--d-text); font-size: 12.5px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.dendrita-stats-ret, .dendrita-stats-acc { color: var(--d-ink); font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.dendrita-stats-ret.is-strong { color: var(--d-green-700); }
.dendrita-stats-ret.is-mid { color: var(--d-warning); }
.dendrita-stats-ret.is-weak { color: var(--d-accent-rust); }
.dendrita-stats-row.is-topic { background: var(--d-paper); border-bottom-color: var(--d-border); font-size: 12.5px; }
.dendrita-stats-row.is-topic .dendrita-stats-track { background: var(--d-green-50); }
.dendrita-stats-row.is-topic .dendrita-stats-track i { background: var(--d-green-300); }
.dendrita-stats-row.is-topic .dendrita-stats-acc { color: var(--d-muted); font-weight: 400; opacity: .7; }
.dendrita-stats-topics { display: block; }
.dendrita-stats-topics[hidden] { display: none; }
.dendrita-stats-topics-note { display: block; padding: 10px 12px; color: var(--d-muted); font-size: 12.5px; }
.dendrita-stats-rest { display: flex; align-items: center; gap: 8px; margin: 0; padding: 11px 12px 4px; color: var(--d-muted); font-size: 12.5px; }
.dendrita-stats-rest svg { width: 14px; height: 14px; flex: 0 0 auto; }
.dendrita-stats-maint { margin: 0; padding: 0; list-style: none; }
.dendrita-stats-maint-row { display: grid; grid-template-columns: 200px minmax(0, 1fr) 156px 78px; align-items: center; gap: 14px; padding: 9px 12px; border-bottom: 1px solid var(--d-border); font-size: 13px; }
.dendrita-stats-maint-row:last-of-type { border-bottom: 0; }
.dendrita-stats-maint-name { min-width: 0; overflow: hidden; color: var(--d-ink); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.dendrita-stats-maint-bar { display: block; height: 8px; overflow: hidden; background: var(--d-green-100); border-radius: 999px; }
.dendrita-stats-maint-bar i { display: block; height: 100%; background: var(--d-green-500); border-radius: 999px; }
.dendrita-stats-maint-week { color: var(--d-muted); font-size: 12.5px; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dendrita-stats-maint-week b { color: var(--d-ink); font-weight: 600; }
.dendrita-stats-maint-day { color: var(--d-text); font-size: 12.5px; font-weight: 600; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dendrita-stats-maint-total { display: flex; align-items: baseline; justify-content: flex-end; gap: 6px; margin-top: 10px; padding: 10px 12px 0; border-top: 1px solid var(--d-border); color: var(--d-muted); font-size: 12.5px; }
.dendrita-stats-maint-total b { color: var(--d-ink); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.dendrita-stats-back { display: inline-flex; align-self: flex-start; min-height: 40px; align-items: center; gap: 8px; padding: 4px 8px; background: transparent; border: 0; color: var(--d-muted); font: 500 13px var(--d-font-body); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; cursor: pointer; }
.dendrita-stats-back:hover { color: var(--d-ink); }
.dendrita-stats-back svg { width: 15px; height: 15px; }
.dendrita-stats-loading { display: flex; flex-direction: column; gap: 12px; }
.dendrita-stats-loading i { display: block; height: 88px; background: linear-gradient(100deg, var(--d-green-50) 20%, var(--d-green-100) 40%, var(--d-green-50) 60%); background-size: 220% 100%; border-radius: 12px; animation: dendrita-sheen 1.4s linear infinite; opacity: .75; }

/* ---- Flashcards: the Anki-style deck tree ---- */
.dendrita-decks { display: flex; width: 100%; max-width: 880px; flex-direction: column; gap: 18px; margin: 0 auto; padding: 12px 36px 40px; box-sizing: border-box; }
.dendrita-decks svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dendrita-decks-head h1 { margin: 0; font: 500 28px/1.1 var(--d-font-display); color: var(--d-ink); }
.dendrita-decks-head p { margin: 6px 0 0; font-size: 13.5px; color: var(--d-muted); }
.dendrita-decks-card { padding: 18px 22px 16px; background: var(--d-white); border: 1px solid var(--d-border); border-radius: 14px; box-shadow: var(--d-shadow-card); }
.dendrita-decks-card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.dendrita-decks-card-title { color: var(--d-muted); font: 600 11px var(--d-font-body); letter-spacing: .12em; text-transform: uppercase; }
.dendrita-decks-review-all { display: inline-flex; min-height: 40px; align-items: center; gap: 8px; padding: 0 16px; background: var(--d-green-700); border: 0; border-radius: 999px; color: var(--d-cream); font: 600 12.5px var(--d-font-body); cursor: pointer; white-space: nowrap; }
.dendrita-decks-review-all:hover { background: var(--d-green-800); }
.dendrita-decks-review-all svg { width: 13px; height: 13px; }
.dendrita-decks-review-all b { font-weight: 700; font-variant-numeric: tabular-nums; }
.dendrita-decks-review-all.is-waiting, .dendrita-decks-name.is-waiting { opacity: .6; pointer-events: none; }
.dendrita-decks-card-sub { margin: 6px 0 12px; color: var(--d-muted); font-size: 12.5px; }
.dendrita-decks-note { margin: 0 0 10px; padding: 8px 12px; background: var(--d-green-50); border-radius: 8px; color: var(--d-text); font-size: 12.5px; }
.dendrita-decks-note[hidden] { display: none; }
.dendrita-decks-table-head { display: grid; grid-template-columns: minmax(0, 1fr) 72px 96px 72px; align-items: center; gap: 12px; padding: 4px 12px 8px; border-bottom: 1px solid var(--d-border); color: var(--d-muted); font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.dendrita-decks-table-head span:not(:first-child) { text-align: right; }
.dendrita-decks-list { margin: 0; padding: 0; list-style: none; }
.dendrita-decks-row { display: grid; grid-template-columns: minmax(0, 1fr) 72px 96px 72px; align-items: center; gap: 12px; padding: 0 12px; border-top: 1px solid var(--d-border); font-size: 13px; }
.dendrita-decks-row:hover { background: var(--d-paper); }
.dendrita-decks-list.is-root > .dendrita-decks-row:first-child { border-top: 0; }
.dendrita-decks-kids { display: block; }
.dendrita-decks-kids[hidden] { display: none; }
.dendrita-decks-deck { display: flex; min-width: 0; align-items: center; gap: 4px; }
.dendrita-decks-deck.is-d1 { padding-left: 24px; }
.dendrita-decks-deck.is-d2 { padding-left: 48px; }
.dendrita-decks-deck.is-d3 { padding-left: 72px; }
.dendrita-decks-deck.is-d4 { padding-left: 96px; }
.dendrita-decks-toggle { display: inline-flex; width: 26px; min-height: 40px; flex: 0 0 auto; align-items: center; justify-content: center; padding: 0; background: none; border: 0; color: var(--d-muted); cursor: pointer; }
.dendrita-decks-toggle svg { width: 14px; height: 14px; transition: transform 130ms ease-out; }
.dendrita-decks-toggle:hover { color: var(--d-ink); }
.dendrita-decks-toggle.is-open svg { transform: rotate(90deg); }
.dendrita-decks-toggle.is-leaf { visibility: hidden; }
.dendrita-decks-name { min-width: 0; min-height: 40px; overflow: hidden; padding: 0; background: none; border: 0; color: var(--d-ink); font: 600 13px var(--d-font-body); text-align: left; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.dendrita-decks-name:hover { color: var(--d-green-700); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.dendrita-decks-kids .dendrita-decks-name { color: var(--d-text); font-size: 12.5px; font-weight: 500; }
.dendrita-decks-kids .dendrita-decks-name:hover { color: var(--d-green-700); }
.dendrita-decks-n { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.dendrita-decks-n.is-new { color: var(--d-blue-700); }
.dendrita-decks-n.is-learn { color: var(--d-warning); }
.dendrita-decks-n.is-due { color: var(--d-green-700); }
.dendrita-decks-n.is-zero { color: var(--d-muted); font-weight: 400; opacity: .7; }
/* the per-count label: audible always, visible only on the phone stack */
.dendrita-decks-n small { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.dendrita-decks-total { display: flex; align-items: baseline; justify-content: flex-end; gap: 6px; margin-top: 10px; padding: 10px 12px 0; border-top: 1px solid var(--d-border); color: var(--d-muted); font-size: 12.5px; }
.dendrita-decks-total b { color: var(--d-ink); font-variant-numeric: tabular-nums; }
.dendrita-decks-card.is-empty, .dendrita-decks-card.is-failure { padding: 26px 24px; }
.dendrita-decks-empty-title { margin: 0; color: var(--d-ink); font: 500 20px/1.25 var(--d-font-display); }
.dendrita-decks-empty-lead { margin: 8px 0 0; color: var(--d-muted); font-size: 13px; }
.dendrita-decks-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 18px; margin-top: 16px; }
.dendrita-decks-back { display: inline-flex; align-self: flex-start; min-height: 40px; align-items: center; gap: 8px; padding: 4px 8px; background: transparent; border: 0; color: var(--d-muted); font: 500 13px var(--d-font-body); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; cursor: pointer; }
.dendrita-decks-back:hover { color: var(--d-ink); }
.dendrita-decks-back svg { width: 15px; height: 15px; }
.dendrita-decks-loading { display: flex; flex-direction: column; gap: 12px; }
.dendrita-decks-loading i { display: block; height: 88px; background: linear-gradient(100deg, var(--d-green-50) 20%, var(--d-green-100) 40%, var(--d-green-50) 60%); background-size: 220% 100%; border-radius: 12px; animation: dendrita-sheen 1.4s linear infinite; opacity: .75; }

/* ---- Configurações: the account screen ---- */
.dendrita-account { display: flex; width: 100%; max-width: 860px; flex-direction: column; gap: 18px; margin: 0 auto; padding: 12px 36px 40px; box-sizing: border-box; }
.dendrita-account svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dendrita-account-head h1 { margin: 0; font: 500 28px/1.1 var(--d-font-display); color: var(--d-ink); }
.dendrita-account-head p { margin: 6px 0 0; font-size: 13.5px; color: var(--d-muted); }
.dendrita-account-card { padding: 18px 22px; background: var(--d-white); border: 1px solid var(--d-border); border-radius: 14px; box-shadow: var(--d-shadow-card); }
.dendrita-account-card.is-identity { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.dendrita-account-avatar { display: grid; flex: none; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--d-green-100); color: var(--d-green-900); font: 600 17px var(--d-font-body); letter-spacing: .02em; }
.dendrita-account-who { min-width: 0; flex: 1; }
.dendrita-account-name { display: inline-flex; align-items: center; gap: 8px; color: var(--d-ink); font-size: 16px; font-weight: 600; }
.dendrita-account-role { padding: 3px 9px; border: 1px solid var(--d-green-100); border-radius: 999px; background: var(--d-green-50); color: var(--d-green-700); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.dendrita-account-usage { margin: 5px 0 0; color: var(--d-muted); font-size: 13px; }
.dendrita-account-usage b { color: var(--d-text); font-weight: 600; font-variant-numeric: tabular-nums; }
.dendrita-account-signout { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 14px; border: 1px solid var(--d-border); border-radius: 9px; background: var(--d-paper); color: var(--d-text); font: 500 13px var(--d-font-body); cursor: pointer; }
.dendrita-account-signout:hover { border-color: var(--d-green-500); color: var(--d-ink); }
.dendrita-account-signout svg { width: 15px; height: 15px; }
.dendrita-account-card-title { display: block; color: var(--d-ink); font-size: 14px; font-weight: 600; }
.dendrita-account-card-sub { max-width: 560px; margin: 6px 0 14px; color: var(--d-muted); font-size: 13px; line-height: 1.55; }
.dendrita-account-email-summary { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin-bottom: 12px; color: var(--d-ink); font-size: 13px; }
.dendrita-account-email-state { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border: 1px solid var(--d-border); border-radius: 999px; color: var(--d-muted); font-size: 11.5px; font-weight: 600; }
.dendrita-account-email-state.is-verified { color: var(--d-green-700); background: var(--d-green-50); border-color: var(--d-green-100); }
.dendrita-account-email-state.is-pending { color: var(--d-warning); background: var(--d-warning-bg); border-color: var(--d-warning-border); }
.dendrita-account-email-state svg { width: 14px; height: 14px; }
.dendrita-account-pending { margin: -2px 0 12px; color: var(--d-warning); font-size: 12.5px; }
.dendrita-account-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; max-width: 680px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--d-border); }
.dendrita-account-form label { display: grid; gap: 6px; color: var(--d-muted); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.dendrita-account-form input { width: 100%; min-height: 42px; padding: 9px 11px; color: var(--d-ink); background: var(--d-paper); border: 1px solid var(--d-border); border-radius: 8px; font: 400 14px var(--d-font-body); letter-spacing: 0; text-transform: none; box-sizing: border-box; }
.dendrita-account-form input:focus { outline: 2px solid var(--d-green-300); outline-offset: 1px; border-color: var(--d-green-500); }
.dendrita-account-secret { position: relative; display: block; }
.dendrita-account-secret input { padding-right: 44px; }
.dendrita-account-secret .dendrita-auth-reveal { position: absolute; top: 50%; right: 6px; display: grid; width: 32px; height: 32px; padding: 0; transform: translateY(-50%); place-items: center; color: var(--d-muted); background: transparent; border: 0; border-radius: 7px; cursor: pointer; }
.dendrita-account-secret .dendrita-auth-reveal:hover { color: var(--d-ink); background: var(--d-green-50); }
.dendrita-account-secret .dendrita-auth-reveal svg { width: 17px; height: 17px; }
.dendrita-account-form-actions, .dendrita-account-form-message { grid-column: 1 / -1; }
.dendrita-account-form-message { min-height: 18px; margin: 0; color: var(--d-error); font-size: 12.5px; line-height: 1.45; }
.dendrita-account-form-message:empty { display: none; }
.dendrita-account-form-message.is-success { color: var(--d-green-700); }
.dendrita-account-primary, .dendrita-account-secondary { min-height: 42px; padding: 8px 15px; border-radius: 9px; font: 600 13px var(--d-font-body); cursor: pointer; }
.dendrita-account-primary { color: var(--d-on-primary); background: var(--d-green-700); border: 1px solid var(--d-green-700); }
.dendrita-account-primary:hover { background: var(--d-green-800); }
.dendrita-account-secondary { color: var(--d-text); background: var(--d-paper); border: 1px solid var(--d-border); }
.dendrita-account-secondary:hover { color: var(--d-ink); border-color: var(--d-green-500); }
.dendrita-account-primary:disabled, .dendrita-account-secondary:disabled { opacity: .55; cursor: default; }
.dendrita-account-danger { min-height: 40px; padding: 8px 16px; border: 1px solid var(--d-error-border); border-radius: 9px; background: var(--d-white); color: var(--d-error); font: 600 13px var(--d-font-body); cursor: pointer; }
.dendrita-account-danger:hover { background: var(--d-error-bg); }
.dendrita-account-danger.is-solid { background: var(--d-accent-rust); border-color: var(--d-accent-rust); color: var(--d-cream); }
.dendrita-account-danger.is-solid:hover { opacity: .92; }
.dendrita-account-danger[disabled] { opacity: .55; cursor: default; }
.dendrita-account-danger[disabled]:hover { background: var(--d-accent-rust); }
.dendrita-account-confirm { display: grid; gap: 10px; max-width: 560px; margin-top: 4px; padding: 14px 16px; border: 1px solid var(--d-error-border); border-radius: 10px; background: var(--d-error-bg); }
.dendrita-account-confirm label { color: var(--d-text); font-size: 12.5px; }
.dendrita-account-confirm label b { letter-spacing: .06em; }
.dendrita-account-confirm-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dendrita-account-confirm input { flex: 1; min-width: 140px; min-height: 40px; padding: 8px 12px; border: 1px solid var(--d-error-border); border-radius: 8px; background: var(--d-white); color: var(--d-ink); font: 500 14px var(--d-font-body); letter-spacing: .06em; text-transform: uppercase; box-sizing: border-box; }
.dendrita-account-cancel { min-height: 40px; padding: 4px 8px; background: transparent; border: 0; color: var(--d-muted); font: 500 13px var(--d-font-body); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; cursor: pointer; }
.dendrita-account-cancel:hover { color: var(--d-ink); }
.dendrita-account-retry { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 16px; border: 1px solid var(--d-green-700); border-radius: 9px; background: var(--d-green-700); color: var(--d-cream); font: 600 13px var(--d-font-body); cursor: pointer; }
.dendrita-account-retry:hover { background: var(--d-green-800); }
.dendrita-account-retry svg { width: 15px; height: 15px; }
.dendrita-account-back { display: inline-flex; align-self: flex-start; min-height: 40px; align-items: center; gap: 8px; padding: 4px 8px; background: transparent; border: 0; color: var(--d-muted); font: 500 13px var(--d-font-body); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; cursor: pointer; }
.dendrita-account-back:hover { color: var(--d-ink); }
.dendrita-account-back svg { width: 15px; height: 15px; }
.dendrita-account-loading { display: flex; flex-direction: column; gap: 12px; }
.dendrita-account-loading i { display: block; height: 96px; background: linear-gradient(100deg, var(--d-green-50) 20%, var(--d-green-100) 40%, var(--d-green-50) 60%); background-size: 220% 100%; border-radius: 12px; animation: dendrita-sheen 1.4s linear infinite; opacity: .75; }

@media (max-width: 720px) {
  .dendrita-account { padding: 8px 16px 32px; }
  .dendrita-account-head h1 { font-size: 24px; }
  .dendrita-account-card { padding: 16px; }
  .dendrita-account-card.is-identity { align-items: flex-start; }
  .dendrita-account-signout { width: 100%; min-height: 44px; justify-content: center; }
  .dendrita-account-form { grid-template-columns: 1fr; }
  .dendrita-account-primary, .dendrita-account-secondary { width: 100%; min-height: 44px; }
  .dendrita-account-form input { min-height: 44px; }
  .dendrita-account-danger { min-height: 44px; }
  .dendrita-account-cancel { min-height: 44px; }
  .dendrita-account-confirm input { min-height: 44px; }
  .dendrita-account-back { min-height: 44px; }
}

/* ---- study plan (theme overview) ---- */

body.dendrita-plan-active .dendrita-app { max-width: none; margin: 0; padding: 0; }

.dendrita-plan {
  display: flex;
  width: 100%;
  max-width: 880px;
  flex-direction: column;
  gap: 22px;
  box-sizing: border-box;
  margin: 0 auto;
  padding: 36px 32px 44px;
}

.dendrita-plan-header { display: flex; flex-direction: column; gap: 8px; }
.dendrita-plan-header h1 { margin: 0; color: var(--d-ink); font: 500 32px/1.12 var(--d-font-display); letter-spacing: -.01em; text-wrap: pretty; }
.dendrita-plan-cycle { margin: 0; color: var(--d-muted); font-size: 13.5px; }
.dendrita-plan-mix { display: flex; align-items: center; gap: 14px; margin-top: 4px; }

.dendrita-plan-mix-bar {
  display: flex;
  overflow: hidden;
  width: 180px;
  height: 8px;
  flex: 0 0 auto;
  gap: 2px;
  background: var(--d-border);
  border-radius: 999px;
}

.dendrita-plan-mix-bar i { height: 100%; flex: 0 0 0; transition: flex-basis 200ms cubic-bezier(.22, .61, .36, 1); }
.dendrita-plan-mix-bar i[data-plan-mix="c"] { background: var(--d-green-300); }
.dendrita-plan-mix-bar i[data-plan-mix="q"] { background: var(--d-green-700); }
.dendrita-plan-mix-legend { display: flex; gap: 14px; color: var(--d-muted); font-size: 11.5px; }
.dendrita-plan-mix-legend span { display: flex; align-items: center; gap: 6px; }
.dendrita-plan-mix-legend span::before { width: 9px; height: 9px; border-radius: 50%; content: ""; }
.dendrita-plan-mix-legend .is-cards::before { background: var(--d-green-300); }
.dendrita-plan-mix-legend .is-questions::before { background: var(--d-green-700); }

.dendrita-plan-card {
  background: var(--d-white);
  border: 1px solid var(--d-border);
  border-radius: 10px;
  box-shadow: var(--d-shadow-card);
  /* The card's own width decides when its rows stack: the same viewport carries a 220px or a
     collapsed sidebar, so a media query would misjudge the space these controls actually get. */
  container-type: inline-size;
}

.dendrita-plan-card-head,
.dendrita-plan-group,
.dendrita-plan-foot { padding: 18px 22px; border-bottom: 1px solid var(--d-border); }
.dendrita-plan-foot { padding: 16px 22px; border-bottom: 0; }

.dendrita-plan-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.dendrita-plan-label { display: flex; align-items: baseline; gap: 8px; color: var(--d-muted); font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.dendrita-plan-label small { color: var(--d-muted); font-size: 11.5px; font-weight: 400; letter-spacing: 0; text-transform: none; font-variant-numeric: tabular-nums; }

.dendrita-plan-modes {
  display: inline-flex;
  align-items: stretch;
  gap: 2px;
  padding: 3px;
  background: var(--d-paper);
  border: 1px solid var(--d-border);
  border-radius: 8px;
}

/* The platform control reset (`body[data-platform-view="dendrita"] button { font: inherit }`)
   outranks a bare class, so every control below carries the same prefix to own its own type. */
body[data-platform-view="dendrita"] .dendrita-plan-modes button {
  padding: 7px 15px;
  color: var(--d-text);
  background: transparent;
  border: 0;
  border-radius: 6px;
  font: 400 12.5px var(--d-font-body);
  cursor: pointer;
  transition: background 150ms ease-out, color 150ms ease-out;
}

.dendrita-plan-modes button:hover:not(:disabled, .is-active) { color: var(--d-ink); background: rgb(85 107 63 / 8%); }
body[data-platform-view="dendrita"] .dendrita-plan-modes button.is-active { color: var(--d-cream); background: var(--d-green-700); font-weight: 600; }
.dendrita-plan-modes button:disabled { opacity: .45; cursor: default; }

.dendrita-plan-prefs { display: flex; flex-wrap: wrap; gap: 12px 28px; padding: 13px 22px; border-bottom: 1px solid var(--d-border); }
.dendrita-plan-pref { display: grid; gap: 5px; justify-items: start; }
.dendrita-plan-pref[hidden] { display: none; }
.dendrita-plan-pref > small { color: var(--d-muted); font-size: 10px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
.dendrita-plan-seg { display: inline-flex; overflow: hidden; border: 1px solid var(--d-border); border-radius: 7px; }
body[data-platform-view="dendrita"] .dendrita-plan-seg button { padding: 6px 12px; color: var(--d-text); background: var(--d-white); border: 0; font: 400 12px var(--d-font-body); cursor: pointer; }
body[data-platform-view="dendrita"] .dendrita-plan-seg button + button { border-left: 1px solid var(--d-border); }
.dendrita-plan-seg button:hover:not(.is-active) { color: var(--d-ink); background: rgb(85 107 63 / 8%); }
body[data-platform-view="dendrita"] .dendrita-plan-seg button.is-active { color: var(--d-cream); background: var(--d-green-700); font-weight: 600; }

.dendrita-plan-group { display: flex; flex-direction: column; gap: 14px; }
.dendrita-plan-group[hidden] { display: none; }
.dendrita-plan-group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.dendrita-plan-group-actions { display: flex; align-items: center; gap: 14px; flex: 0 0 auto; }

body[data-platform-view="dendrita"] .dendrita-plan-group-actions button,
body[data-platform-view="dendrita"] .dendrita-plan-link {
  padding: 0;
  color: var(--d-muted);
  background: transparent;
  border: 0;
  font: 400 12px var(--d-font-body);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

body[data-platform-view="dendrita"] .dendrita-plan-group-actions button:first-child { color: var(--d-green-700); font-weight: 500; }
.dendrita-plan-group-actions button:hover,
.dendrita-plan-link:hover { color: var(--d-ink); }
.dendrita-plan-group-actions button:first-child:hover { color: var(--d-green-800); }

.dendrita-plan-row { display: grid; align-items: center; gap: 18px; grid-template-columns: 200px 1fr auto; }
.dendrita-plan-row-name { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.dendrita-plan-row-name b { overflow: hidden; color: var(--d-ink); font-size: 13.5px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.dendrita-plan-row-name small { color: var(--d-muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }

.dendrita-plan-slider {
  width: 100%;
  height: 6px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 999px;
  outline: none;
  appearance: none;
  cursor: pointer;
}

.dendrita-plan-slider::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  background: var(--d-white);
  border: 2px solid var(--d-green-700);
  border-radius: 50%;
  box-shadow: 0 1px 2px rgb(26 29 26 / 18%);
  appearance: none;
  cursor: pointer;
  transition: transform 120ms ease-out;
}

.dendrita-plan-slider::-webkit-slider-thumb:hover { transform: scale(1.12); }
.dendrita-plan-slider::-moz-range-thumb { width: 14px; height: 14px; background: var(--d-white); border: 2px solid var(--d-green-700); border-radius: 50%; box-shadow: 0 1px 2px rgb(26 29 26 / 18%); cursor: pointer; }
.dendrita-plan-slider:focus-visible { outline: 2px solid var(--d-green-500); outline-offset: 4px; }

.dendrita-plan-count { display: flex; align-items: center; gap: 9px; }
.dendrita-plan-count small { min-width: 34px; color: var(--d-muted); font-size: 12px; font-variant-numeric: tabular-nums; }

.dendrita-plan-stepper {
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  background: var(--d-white);
  border: 1px solid var(--d-border);
  border-radius: 8px;
}

body[data-platform-view="dendrita"] .dendrita-plan-stepper button {
  width: 32px;
  height: 36px;
  color: var(--d-text);
  background: transparent;
  border: 0;
  font: 400 15px/1 var(--d-font-body);
  cursor: pointer;
}

.dendrita-plan-stepper button:hover:not(:disabled) { background: var(--d-green-50); }
.dendrita-plan-stepper button:disabled { opacity: .35; cursor: default; }

body[data-platform-view="dendrita"] .dendrita-plan-stepper input {
  width: 46px;
  min-width: 0;   /* the shared sheet floors every number field at 150px */
  height: 36px;
  padding: 0;
  color: var(--d-ink);
  background: transparent;
  border: 0;
  border-inline: 1px solid var(--d-border);
  outline: none;
  font: 500 13px var(--d-font-body);
  font-variant-numeric: tabular-nums;
  text-align: center;
  appearance: textfield;
}

.dendrita-plan-stepper input::-webkit-inner-spin-button,
.dendrita-plan-stepper input::-webkit-outer-spin-button { margin: 0; appearance: none; }
.dendrita-plan-stepper input:focus { background: var(--d-green-50); }

.dendrita-plan-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.dendrita-plan-session { display: flex; align-items: center; gap: 8px; color: var(--d-muted); font-size: 12.5px; }
.dendrita-plan-session svg { width: 14px; height: 14px; flex: 0 0 auto; color: var(--d-green-500); }
.dendrita-plan-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

body[data-platform-view="dendrita"] .dendrita-plan-secondary {
  padding: 10px 16px;
  color: var(--d-cream);
  background: var(--d-blue-700);
  border: 1px solid var(--d-blue-800);
  border-radius: 6px;
  font: 500 13px var(--d-font-body);
  cursor: pointer;
  transition: background 120ms ease-out;
}

.dendrita-plan-secondary:hover { background: var(--d-blue-800); }

body[data-platform-view="dendrita"] .dendrita-plan-start {
  padding: 10px 18px;
  color: var(--d-cream);
  background: var(--d-green-700);
  border: 1px solid var(--d-green-800);
  border-radius: 6px;
  font: 500 13px var(--d-font-body);
  cursor: pointer;
  transition: background 120ms ease-out;
}

.dendrita-plan-start:hover:not(:disabled) { background: var(--d-green-800); }
.dendrita-plan-start:disabled { opacity: .45; cursor: default; }

.dendrita-plan-tip { display: flex; align-items: flex-start; gap: 8px; margin: 0; color: var(--d-muted); font-size: 12.5px; line-height: 1.5; text-wrap: pretty; }
.dendrita-plan-tip svg { width: 14px; height: 14px; flex: 0 0 auto; margin-top: 3px; color: var(--d-green-500); }
.dendrita-plan-tip b { color: var(--d-green-900); font-weight: 600; }

/* The name needs its own line once the control column stops shrinking, so the slider keeps a
   usable drag distance next to the stepper. */
@container (max-width: 640px) {
  .dendrita-plan-row { grid-template-columns: minmax(0, 1fr) auto; gap: 10px 12px; }
  .dendrita-plan-row-name { grid-column: 1 / -1; }
}

@container (max-width: 470px) {
  .dendrita-plan-card-head { flex-direction: column; align-items: stretch; }
  .dendrita-plan-modes { width: 100%; }
  body[data-platform-view="dendrita"] .dendrita-plan-modes button { flex: 1 1 0; padding-inline: 8px; }
  .dendrita-plan-group-head { flex-wrap: wrap; gap: 6px 14px; }
  .dendrita-plan-foot { flex-direction: column; align-items: stretch; }
  .dendrita-plan-actions { justify-content: space-between; }
}

@container (max-width: 370px) {
  .dendrita-plan-count small { display: none; }
  .dendrita-plan-actions { flex-wrap: wrap; gap: 10px; }
  .dendrita-plan-link { order: 3; width: 100%; text-align: center; }
  .dendrita-plan-secondary,
  .dendrita-plan-start { flex: 1 1 auto; }
}

@media (max-width: 900px) {
  .dendrita-plan { padding: 26px 22px 36px; }
  .dendrita-plan-card-head,
  .dendrita-plan-group,
  .dendrita-plan-foot { padding: 16px 18px; }
  .dendrita-plan-prefs { padding: 13px 18px; }
}

@media (max-width: 720px) {
  .dendrita-plan { gap: 18px; padding: 20px 16px 32px; }
  .dendrita-plan-header h1 { font-size: 26px; }
  .dendrita-plan-mix { flex-wrap: wrap; gap: 8px 14px; }
  .dendrita-plan-mix-bar { width: 100%; }
  .dendrita-plan-card-head,
  .dendrita-plan-group,
  .dendrita-plan-foot { padding: 16px; }
  .dendrita-plan-prefs { padding: 13px 16px; }
  .dendrita-plan-modes button { min-height: 40px; }
  .dendrita-plan-seg button { min-height: 40px; }
  body[data-platform-view="dendrita"] .dendrita-plan-stepper button { width: 40px; height: 40px; }
  body[data-platform-view="dendrita"] .dendrita-plan-stepper input { height: 40px; }
  .dendrita-plan-secondary,
  .dendrita-plan-start { min-height: 44px; }
}

@media (max-width: 520px) {
  .dendrita-plan-header h1 { font-size: 23px; }
}

@media (min-width: 721px) and (max-width: 1280px) {
  body.dendrita-explore-active .dendrita-sidebar { width: 84px; flex-basis: 84px; padding: 18px 8px; }
  body.dendrita-explore-active .dendrita-sidebar-toggle { left: 71px; }
  body.dendrita-explore-active .dendrita-brand { justify-content: center; padding-inline: 0; }
  body.dendrita-explore-active .dendrita-brand-copy { display: none; }
  body.dendrita-explore-active .dendrita-nav button { width: 68px; height: 50px; flex-direction: column; justify-content: center; gap: 3px; padding: 0 2px; margin-inline: auto; font-size: 8.5px; text-align: center; }
  body.dendrita-explore-active .dendrita-nav button span { display: block; width: 100%; overflow: hidden; text-overflow: ellipsis; }
  body.dendrita-explore-active .dendrita-constancy { display: block; padding: 7px 5px; }
  body.dendrita-explore-active .dendrita-constancy-head { justify-content: center; margin-bottom: 6px; }
  body.dendrita-explore-active .dendrita-constancy-head > span { flex-direction: column; gap: 3px; font-size: 7px; letter-spacing: .03em; }
  body.dendrita-explore-active .dendrita-constancy-streak { flex-direction: column; gap: 4px; padding: 6px 3px; }
  body.dendrita-explore-active .dendrita-constancy-flame { width: 24px; height: 24px; }
  body.dendrita-explore-active .dendrita-constancy-copy { align-items: center; text-align: center; }
  body.dendrita-explore-active .dendrita-constancy-copy b { font-size: 10px; }
  body.dendrita-explore-active .dendrita-constancy-copy small { font-size: 7.5px; }
}

@media (max-width: 1050px) {
  .dendrita-home-grid { grid-template-columns: 1fr; }
  .dendrita-care { min-height: 340px; }
  .dendrita-care-decoration { width: 406px; }
  .dendrita-home-side { display: grid; grid-template-columns: 1.15fr .85fr; }
  .dendrita-help-note { position: static; margin: 0 0 12px; box-shadow: none; }
  .dendrita-side-bottom { min-width: 0; }
  .dendrita-explore { padding: 16px 20px 18px; }
  .dendrita-explore-header h1 { font-size: 30px; }
  .dendrita-explore-header-tools { width: 300px; }
  .dendrita-explore-detail { width: 272px; }
  .dendrita-explore-node.is-depth-1 { --d-node-size: 54px; }
  .dendrita-explore-node.is-depth-2 { --d-node-size: 44px; }
  .dendrita-explore-node.is-depth-3 { --d-node-size: 34px; }
  .dendrita-explore-node.is-depth-4 { --d-node-size: 26px; }
  .dendrita-content-layout.has-preview { grid-template-columns: minmax(0, 1fr) 272px; }
  .dendrita-content-title h1 { font-size: 26px; }
  .dendrita-reviews { padding: 12px 24px 32px; }
  .dendrita-reviews-hero h2 { font-size: 27px; }
  .dendrita-reviews-hero.is-caught-up h2 { font-size: 32px; }
  .dendrita-stats { padding: 12px 24px 32px; }
  .dendrita-stats-hero h2 { font-size: 27px; }
  .dendrita-stats-table-head, .dendrita-stats-row { grid-template-columns: minmax(0, 1fr) 44px 148px 70px 70px; gap: 12px; }
  .dendrita-stats-track { flex-basis: 78px; }
  .dendrita-stats-maint-row { grid-template-columns: 168px minmax(0, 1fr) 148px 70px; gap: 12px; }
  .dendrita-decks { padding: 12px 24px 32px; }
  .dendrita-decks-table-head, .dendrita-decks-row { grid-template-columns: minmax(0, 1fr) 58px 84px 58px; gap: 10px; }
}

@media (max-width: 900px) {
  /* Below two comfortable columns the day's care leads the page and the list follows it. */
  .dendrita-materials-layout { grid-template-columns: minmax(0, 1fr); }
  .dendrita-materials-rail { position: static; order: -1; }
  .dendrita-question-header {
    grid-template-columns: auto minmax(150px, 1fr) auto;
    gap: 7px 14px;
  }
  .dendrita-question-progress { grid-column: 2; grid-row: 2; }
  .dendrita-question-tools { grid-column: 3; grid-row: 1 / span 2; }
  .dendrita-question-completed { font-size: 10.5px; }
  .dendrita-flashcard-header { grid-template-columns: auto minmax(150px, 1fr) auto; gap: 7px 14px; }
  .dendrita-flashcard-progress { grid-column: 2; grid-row: 2; }
  .dendrita-flashcard-tools { grid-column: 3; grid-row: 1 / span 2; }
}

@media (max-width: 720px) {
  html:has(body[data-platform-view="dendrita"]),
  body[data-platform-view="dendrita"],
  .dendrita-shell { overflow: auto; height: auto; min-height: 100%; }
  .dendrita-workspace { height: auto; min-height: 100vh; overflow: visible; padding-bottom: calc(var(--d-mobile-nav-height) + 2px); }
  .dendrita-sidebar { position: fixed; z-index: 40; inset: auto 0 0; display: block; width: 100%; height: var(--d-mobile-nav-height); padding: 7px 8px max(7px, env(safe-area-inset-bottom)); overflow: visible; background-position: bottom; }
  .dendrita-brand,
  .dendrita-constancy,
  .dendrita-sidebar-tools,
  .dendrita-sidebar-toggle { display: none !important; }
  .dendrita-nav { display: grid; width: 100%; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; }
  body[data-platform-view="dendrita"] .dendrita-nav button { display: flex; width: 100%; min-width: 0; height: 48px; flex-direction: column; justify-content: center; gap: 3px; padding: 0 2px; margin: 0; font-size: 8.5px; }
  /* A phone boots ≤1050px, so view.js marks the shell collapsed; the desktop rail rules must not reach the bottom bar. */
  .dendrita-shell.is-collapsed .dendrita-sidebar { flex-basis: auto; width: 100%; }
  .dendrita-shell.is-collapsed .dendrita-nav button { width: 100%; padding: 0 2px; margin: 0; }
  .dendrita-shell.is-collapsed .dendrita-nav button span { display: block; }
  body[data-platform-view="dendrita"] .dendrita-nav [data-d-mobile-secondary] { display: none; }
  body.dendrita-explore-active .dendrita-nav [data-d-mobile-secondary][data-d-nav="browse"] { display: flex; }
  body.dendrita-explore-active .dendrita-nav .dendrita-nav-more {
    position: fixed;
    z-index: 45;
    right: 10px;
    bottom: calc(var(--d-mobile-nav-height) + 9px);
    width: 44px;
    height: 44px;
    color: var(--d-cream);
    background: var(--d-green-900);
    border: 1px solid rgb(242 239 230 / 24%);
    border-radius: 50%;
    box-shadow: 0 5px 16px rgb(26 29 26 / 22%);
  }
  body.dendrita-explore-active .dendrita-nav .dendrita-nav-more span { display: none; }
  .dendrita-nav button span { display: block; width: 100%; overflow: hidden; text-overflow: ellipsis; text-align: center; }
  .dendrita-nav svg { width: 17px; height: 17px; }
  .dendrita-nav-more i { height: 17px; font-size: 18px; font-style: normal; font-weight: 700; line-height: 8px; letter-spacing: 2px; }
  .dendrita-mobile-menu {
    position: fixed;
    z-index: 70;
    right: 12px;
    bottom: calc(var(--d-mobile-nav-height) + 8px);
    left: 12px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 8px;
    color: var(--d-text);
    background: var(--d-paper);
    border: 1px solid var(--d-border);
    border-radius: 12px;
    box-shadow: 0 14px 38px rgb(26 29 26 / 24%);
  }
  .dendrita-mobile-menu[hidden] { display: none; }
  .dendrita-mobile-menu button { display: flex; min-width: 0; min-height: 48px; align-items: center; gap: 10px; padding: 8px 10px; color: var(--d-text); background: transparent; border: 0; border-radius: 8px; text-align: left; cursor: pointer; }
  .dendrita-mobile-menu button:hover,
  .dendrita-mobile-menu button:focus-visible,
  .dendrita-mobile-menu button.is-active { color: var(--d-green-900); background: var(--d-green-100); outline: none; }
  .dendrita-mobile-menu svg { flex: 0 0 auto; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .dendrita-mobile-menu span { min-width: 0; font-size: 12px; font-weight: 600; }
  .dendrita-shell.is-collapsed .dendrita-mobile-menu .dendrita-theme-toggle { justify-content: flex-start; width: 100%; padding: 8px 10px; margin: 0; }
  .dendrita-shell.is-collapsed .dendrita-mobile-menu .dendrita-theme-toggle span { display: block; }
  .dendrita-mobile-menu small { display: block; color: var(--d-muted); font-size: 9px; font-weight: 400; }
  .dendrita-toast { right: 12px; bottom: calc(var(--d-mobile-nav-height) + 12px); left: 12px; max-width: none; }
  body.dendrita-question-active .dendrita-toast { bottom: calc(var(--d-mobile-nav-height) + 82px); }
  body.dendrita-flashcard-active .dendrita-toast { bottom: calc(var(--d-mobile-nav-height) + 84px); }
  body:has(#dendritaResume:not([hidden])) .dendrita-toast { bottom: calc(var(--d-mobile-nav-height) + 64px); }
  .dendrita-resume { right: 12px; bottom: calc(var(--d-mobile-nav-height) + 12px); max-width: calc(100vw - 24px); }
  .dendrita-home { padding: 14px 14px 24px; }
  .dendrita-home-header h1 { font-size: 27px; }
  .dendrita-home-header p { font-size: 12.5px; }
  .dendrita-user-tools { gap: 6px; }
  .dendrita-home-grid,
  .dendrita-home-side { display: flex; flex-direction: column; }
  .dendrita-care { min-height: 390px; padding: 19px 18px 14px; }
  .dendrita-care-decoration { right: -210px; width: 456px; }
  .dendrita-care h2 { font-size: 30px; }
  .dendrita-care.is-caught-up h2 { font-size: 38px; }
  .dendrita-due-split { gap: 8px; }
  .dendrita-due-kind { padding: 6px 9px; }
  .dendrita-due-kind > i { display: none; }
  .dendrita-garden { min-height: 190px; }
  .dendrita-form-row { grid-template-columns: 1fr; }
  body.dendrita-authenticated:not(.dendrita-home-active) .dendrita-app { padding: 18px 14px 32px; }
  body.dendrita-authenticated.dendrita-explore-active .dendrita-app { max-width: none; padding: 0; }

  .dendrita-materials { gap: 15px; padding: 0 0 16px; }
  .dendrita-materials-head h1 { font-size: 26px; }
  .dendrita-materials-lead { margin-top: 12px; padding: 13px 15px; font-size: 13.5px; }
  .dendrita-materials-score { padding: 13px 15px; }
  .dendrita-materials-score-number b { font-size: 26px; }
  body[data-platform-view="dendrita"] .dendrita-materials-seg button,
  body[data-platform-view="dendrita"] .dendrita-materials-area-toggle { min-height: 40px; }
  .dendrita-materials-area-menu { width: min(320px, calc(100vw - 40px)); }
  body[data-platform-view="dendrita"] .dendrita-materials-row { padding: 12px; }
  .dendrita-materials-window-slot { padding: 14px 14px calc(var(--d-mobile-nav-height) + 14px); }
  .dendrita-materials-window { max-height: calc(100vh - var(--d-mobile-nav-height) - 28px); padding: 20px 18px 18px; }
  .dendrita-materials-window h2 { font-size: 21px; }
  .dendrita-materials-window-actions { flex-wrap: wrap; justify-content: stretch; }
  .dendrita-materials-window-actions .dendrita-primary-button { flex: 1; min-height: 46px; }

  .dendrita-explore { min-height: calc(100vh - var(--d-mobile-nav-height)); padding: 15px 14px 22px; }
  .dendrita-explore-header { align-items: stretch; flex-direction: column; gap: 15px; margin-bottom: 14px; }
  .dendrita-explore-header h1 { font-size: 28px; }
  .dendrita-explore-header p { max-width: 350px; font-size: 12px; }
  .dendrita-explore-header-tools { width: 100%; align-items: stretch; }
  .dendrita-explore-search input { height: 46px; padding-left: 41px; font-size: 13px; }
  .dendrita-explore-search > svg { top: 14px; left: 14px; }
  .dendrita-explore-results { position: absolute; }
  .dendrita-explore-results button { min-height: 46px; }
  .dendrita-explore-graph { display: none; }
  .dendrita-explore-loading { min-height: 420px; grid-template-columns: 1fr; gap: 4px; padding: 14px; }
  .dendrita-explore-loading-panel { display: none; }
  .dendrita-explore-trail { display: none; }
  .dendrita-explore-mobile { display: block; }

  .dendrita-explore-mobile-breadcrumb {
    display: flex;
    min-height: 44px;
    align-items: center;
    gap: 3px;
    margin: -2px 0 10px;
    overflow-x: auto;
    color: var(--d-muted);
    scrollbar-width: none;
    white-space: nowrap;
  }
  .dendrita-explore-mobile-breadcrumb::-webkit-scrollbar { display: none; }
  .dendrita-explore-mobile-breadcrumb button,
  .dendrita-explore-mobile-breadcrumb span { flex: 0 0 auto; padding: 7px 3px; color: var(--d-muted); background: transparent; border: 0; font-size: 11px; }
  .dendrita-explore-mobile-breadcrumb button { min-height: 44px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
  .dendrita-explore-mobile-breadcrumb span[aria-current="page"] { color: var(--d-ink); font-weight: 600; text-decoration: none; }
  .dendrita-explore-mobile-breadcrumb svg { width: 11px; height: 11px; flex: 0 0 auto; }

  .dendrita-explore-branch {
    position: relative;
    display: grid;
    min-height: 154px;
    grid-template-columns: 44px minmax(0, 1fr) 48px;
    grid-template-rows: auto auto;
    gap: 8px 10px;
    padding: 17px 15px 14px;
    overflow: hidden;
    color: var(--d-cream);
    background: var(--d-green-900) url("/assets/hero-texture.jpg") center / cover no-repeat;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgb(26 29 26 / 13%);
  }
  .dendrita-explore-branch::after { position: absolute; inset: 0; background: linear-gradient(90deg, rgb(55 69 41 / 18%), rgb(55 69 41 / 78%)); content: ""; pointer-events: none; }
  .dendrita-explore-branch > * { position: relative; z-index: 1; }
  .dendrita-explore-branch-back { display: grid; width: 44px; height: 44px; padding: 0; place-items: center; color: var(--d-cream); background: rgb(242 239 230 / 10%); border: 1px solid rgb(242 239 230 / 16%); border-radius: 50%; cursor: pointer; }
  .dendrita-explore-branch-back svg { width: 18px; height: 18px; }
  .dendrita-explore-branch-copy { align-self: center; }
  .dendrita-explore-branch-copy > span { color: var(--d-green-300); font-size: 8.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
  .dendrita-explore-branch h2 { margin: 3px 0 2px; color: var(--d-cream); font: 500 22px/1.08 var(--d-font-display); }
  .dendrita-explore-branch p { margin: 0; color: var(--d-on-dark-muted); font-size: 10.5px; }
  .dendrita-explore-mobile-ring { position: relative; display: grid; width: 44px; height: 44px; flex: 0 0 auto; place-items: center; color: var(--d-green-900); background: conic-gradient(var(--d-green-500) calc(var(--d-coverage) * 1%), var(--d-border) 0); border-radius: 50%; box-sizing: border-box; }
  .dendrita-explore-mobile-ring::before { position: absolute; content: ''; inset: 3px; background: var(--d-green-100); border-radius: inherit; }
  .dendrita-explore-mobile-ring b { position: relative; z-index: 1; font-size: 10px; font-weight: 700; }
  .dendrita-explore-mobile-ring.is-on-dark { align-self: center; color: var(--d-cream); }
  .dendrita-explore-mobile-ring.is-on-dark::before { background: var(--d-green-800); }
  .dendrita-explore-mobile-ring > svg { position: relative; z-index: 1; width: 19px; height: 19px; color: var(--d-green-700); }
  .dendrita-explore-mobile-ring.is-on-dark > svg { color: var(--d-cream); }
  .dendrita-explore-branch-actions { display: grid; grid-column: 2 / 4; grid-template-columns: 1fr 1fr; gap: 8px; }
  .dendrita-explore-branch-actions button { display: flex; min-height: 46px; align-items: center; justify-content: center; gap: 7px; padding: 8px 10px; color: var(--d-cream); background: rgb(242 239 230 / 10%); border: 1px solid rgb(242 239 230 / 24%); border-radius: 8px; font-size: 11.5px; font-weight: 600; cursor: pointer; }
  .dendrita-explore-branch-actions button:last-child { color: var(--d-green-900); background: var(--d-cream); border-color: var(--d-cream); }
  .dendrita-explore-branch-actions svg { width: 15px; height: 15px; }
  .dendrita-explore-branch-actions .dendrita-preview-label { font-size: 7px; }

  .dendrita-explore-list-count { margin: 16px 2px 8px; color: var(--d-muted); font-size: 9px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
  .dendrita-explore-list { display: grid; gap: 8px; }
  .dendrita-explore-list-card {
    display: flex;
    width: 100%;
    min-height: 64px;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    color: var(--d-text);
    background: var(--d-white);
    border: 1px solid var(--d-border);
    border-radius: 10px;
    box-shadow: var(--d-shadow-card);
    text-align: left;
    cursor: pointer;
  }
  .dendrita-explore-list-card:hover,
  .dendrita-explore-list-card:focus-visible { border-color: var(--d-green-500); outline: none; box-shadow: 0 0 0 3px rgb(126 148 101 / 13%); }
  .dendrita-explore-list-card > span:nth-child(2) { display: flex; min-width: 0; flex: 1 1 auto; flex-direction: column; gap: 3px; }
  .dendrita-explore-list-card strong { overflow: hidden; color: var(--d-ink); font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
  .dendrita-explore-list-card small { color: var(--d-muted); font-size: 9.5px; }
  .dendrita-explore-list-card > svg { width: 17px; height: 17px; flex: 0 0 auto; color: var(--d-green-500); }
  .dendrita-explore-empty.is-mobile { min-height: 120px; padding: 20px; background: var(--d-paper); border: 1px dashed var(--d-border); border-radius: 10px; }

  .dendrita-explore-sheet-backdrop { position: fixed; z-index: 75; inset: 0; background: rgb(26 29 26 / 48%); animation: dendrita-explore-fade 160ms ease-out; }
  .dendrita-explore-sheet {
    position: fixed;
    z-index: 80;
    right: 0;
    bottom: 0;
    left: 0;
    max-height: min(80vh, 680px);
    padding: 44px 20px max(22px, env(safe-area-inset-bottom));
    overflow-y: auto;
    color: var(--d-text);
    background: var(--d-paper);
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -18px 50px rgb(26 29 26 / 22%);
    box-sizing: border-box;
    animation: dendrita-explore-sheet-in 180ms ease-out;
    transition: transform 160ms ease-out;
  }
  .dendrita-explore-sheet.is-dragging { transition: none; }
  .dendrita-explore-sheet-handle { position: absolute; top: 0; right: 54px; left: 54px; display: flex; height: 44px; align-items: center; justify-content: center; padding: 0; background: transparent; border: 0; cursor: grab; touch-action: none; }
  .dendrita-explore-sheet-handle i { width: 42px; height: 4px; background: var(--d-border); border-radius: 99px; }
  .dendrita-explore-sheet-close { top: 8px; right: 10px; width: 44px; height: 44px; }
  .dendrita-explore-breadcrumb.is-sheet { margin-top: 0; font-size: 9px; }
  .dendrita-explore-breadcrumb.is-sheet button { min-height: 44px; }
  .dendrita-explore-sheet h2 { margin: 11px 42px 17px 0; font-size: 24px; }
  .dendrita-explore-sheet .dendrita-explore-facts { margin: 17px 0; }
  .dendrita-explore-sheet .dendrita-explore-facts > span { min-height: 49px; }
  .dendrita-explore-sheet-actions { gap: 8px; }
  .dendrita-explore-sheet-actions button { min-height: 48px; font-size: 12.5px; }
  body.dendrita-explore-sheet-open { overflow: hidden; }

  @keyframes dendrita-explore-fade { from { opacity: 0; } }
  @keyframes dendrita-explore-sheet-in { from { transform: translateY(100%); } }

  .dendrita-reviews { gap: 14px; padding: 8px 14px 30px; }
  .dendrita-reviews-head h1 { font-size: 24px; }
  .dendrita-reviews-hero { padding: 18px 18px 16px; }
  .dendrita-reviews-hero h2 { font-size: 24px; }
  .dendrita-reviews-hero.is-caught-up h2 { font-size: 30px; }
  .dendrita-reviews-card { padding: 14px 14px 12px; }
  .dendrita-reviews-seg button { min-height: 44px; }
  .dendrita-reviews-chart { gap: 6px; }
  .dendrita-reviews-plot { height: 92px; }
  .dendrita-reviews-day-label { font-size: 9.5px; }
  .dendrita-reviews-chart.is-dense .dendrita-reviews-count { display: none; }
  .dendrita-reviews-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "main remove"
      "pill due";
    gap: 8px 12px;
  }
  .dendrita-reviews-row-main { grid-area: main; }
  .dendrita-reviews-pill { grid-area: pill; justify-self: start; }
  .dendrita-reviews-due { grid-area: due; }
  .dendrita-reviews-remove { grid-area: remove; width: 44px; height: 44px; }
  .dendrita-reviews-row.is-excluded {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "main main"
      "pill return";
  }
  .dendrita-reviews-row.is-excluded .dendrita-reviews-pill { grid-area: pill; }
  .dendrita-reviews-return { grid-area: return; min-height: 44px; justify-self: end; }

  .dendrita-stats { gap: 14px; padding: 8px 14px 30px; }
  .dendrita-stats-head h1 { font-size: 24px; }
  .dendrita-stats-hero { padding: 18px 18px 16px; }
  .dendrita-stats-hero h2 { font-size: 24px; }
  .dendrita-stats-card { padding: 14px 14px 12px; }
  .dendrita-stats-table-head { display: none; }
  .dendrita-stats-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "subject ret"
      "cov cov"
      "qs acc";
    gap: 4px 12px;
    padding: 10px 8px;
  }
  .dendrita-stats-row small { display: inline; color: var(--d-muted); font-size: 10.5px; font-weight: 400; }
  .dendrita-stats-subject { grid-area: subject; min-height: 44px; }
  .dendrita-stats-name { grid-area: subject; display: flex; align-items: center; min-height: 32px; padding-left: 22px; }
  .dendrita-stats-ret { grid-area: ret; align-self: center; }
  .dendrita-stats-cov { grid-area: cov; justify-content: flex-start; }
  .dendrita-stats-track { flex: 1 1 auto; }
  .dendrita-stats-qs { grid-area: qs; text-align: left; }
  .dendrita-stats-acc { grid-area: acc; }
  .dendrita-stats-maint-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "name day"
      "bar bar"
      "week week";
    gap: 5px 12px;
    padding: 10px 8px;
  }
  .dendrita-stats-maint-name { grid-area: name; }
  .dendrita-stats-maint-day { grid-area: day; }
  .dendrita-stats-maint-bar { grid-area: bar; }
  .dendrita-stats-maint-week { grid-area: week; text-align: left; }

  .dendrita-decks { gap: 14px; padding: 8px 14px 30px; }
  .dendrita-decks-head h1 { font-size: 24px; }
  .dendrita-decks-card { padding: 14px 14px 12px; }
  .dendrita-decks-card-head { flex-wrap: wrap; }
  .dendrita-decks-review-all { min-height: 44px; }
  .dendrita-decks-table-head { display: none; }
  .dendrita-decks-row {
    grid-template-columns: auto auto minmax(0, 1fr);
    grid-template-areas:
      "deck deck deck"
      "new learn due";
    gap: 0 14px;
    padding: 4px 8px 10px;
  }
  .dendrita-decks-deck { grid-area: deck; }
  .dendrita-decks-deck.is-d1 { padding-left: 16px; }
  .dendrita-decks-deck.is-d2 { padding-left: 32px; }
  .dendrita-decks-deck.is-d3 { padding-left: 48px; }
  .dendrita-decks-deck.is-d4 { padding-left: 64px; }
  .dendrita-decks-toggle { min-height: 44px; }
  .dendrita-decks-name { min-height: 44px; }
  .dendrita-decks-n { text-align: left; font-size: 12.5px; }
  .dendrita-decks-n.is-new { grid-area: new; padding-left: 30px; }
  .dendrita-decks-n.is-learn { grid-area: learn; }
  .dendrita-decks-n.is-due { grid-area: due; }
  .dendrita-decks-n small { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; white-space: inherit; color: var(--d-muted); font-size: 10.5px; font-weight: 400; }
  .dendrita-decks-total { justify-content: flex-start; padding: 10px 8px 0; }

  html:has(body.dendrita-question-active),
  html:has(body.dendrita-question-summary-active),
  html:has(body.dendrita-flashcard-active),
  html:has(body.dendrita-flashcard-summary-active),
  body.dendrita-question-active,
  body.dendrita-question-summary-active,
  body.dendrita-flashcard-active,
  body.dendrita-flashcard-summary-active,
  body.dendrita-question-active .dendrita-shell,
  body.dendrita-question-summary-active .dendrita-shell,
  body.dendrita-flashcard-active .dendrita-shell,
  body.dendrita-flashcard-summary-active .dendrita-shell {
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }
  body.dendrita-question-active .dendrita-workspace,
  body.dendrita-question-summary-active .dendrita-workspace,
  body.dendrita-flashcard-active .dendrita-workspace,
  body.dendrita-flashcard-summary-active .dendrita-workspace {
    height: calc(100vh - var(--d-mobile-nav-height));
    min-height: 0;
    padding: 0;
    overflow: hidden;
  }
  body.dendrita-question-active .dendrita-sidebar,
  body.dendrita-question-summary-active .dendrita-sidebar,
  body.dendrita-flashcard-active .dendrita-sidebar,
  body.dendrita-flashcard-summary-active .dendrita-sidebar {
    flex-basis: auto;
    width: 100%;
  }
  body.dendrita-question-active .dendrita-nav button,
  body.dendrita-question-summary-active .dendrita-nav button,
  body.dendrita-flashcard-active .dendrita-nav button,
  body.dendrita-flashcard-summary-active .dendrita-nav button {
    width: auto;
    margin: 0;
  }
  body.dendrita-question-active .dendrita-nav button span,
  body.dendrita-question-summary-active .dendrita-nav button span,
  body.dendrita-flashcard-active .dendrita-nav button span,
  body.dendrita-flashcard-summary-active .dendrita-nav button span { display: block; }
  body.dendrita-authenticated.dendrita-question-active .dendrita-app,
  body.dendrita-authenticated.dendrita-question-summary-active .dendrita-app,
  body.dendrita-authenticated.dendrita-flashcard-active .dendrita-app,
  body.dendrita-authenticated.dendrita-flashcard-summary-active .dendrita-app {
    height: 100%;
    min-height: 0;
    padding: 0 0 102px;
    overflow-y: auto;
  }
  .dendrita-question-header { padding: 10px 14px; }
  body.dendrita-question-active .qcard { width: calc(100% - 28px); margin-top: 18px; }
  .dendrita-question-map { padding-inline: 14px; }
  body.dendrita-question-active .qcard > .actions,
  body.dendrita-question-active #afterArea > .actions {
    right: 0;
    bottom: var(--d-mobile-nav-height);
    left: 0;
    min-height: 66px;
    padding: 12px 14px;
  }
  body.dendrita-question-summary-active .dendrita-app { padding: 16px 14px 32px; }
  body.dendrita-authenticated.dendrita-flashcard-active .dendrita-app { padding: 0 0 88px; }
  body.dendrita-authenticated.dendrita-flashcard-summary-active .dendrita-app { padding: 16px 14px 32px; }
  .dendrita-flashcard-header { padding: 10px 14px; }
  .dendrita-flashcard-meta,
  body.dendrita-flashcard-active .cardface { width: calc(100% - 32px); }
  .dendrita-flashcard-meta { margin-top: 16px; }
  body.dendrita-flashcard-active .cardface { min-height: 300px; margin-top: 14px; padding: 38px 32px; }
  body.dendrita-flashcard-active .dendrita-flashcard-gradebar {
    right: 0; bottom: var(--d-mobile-nav-height); left: 0; min-height: 68px; padding: 8px 14px 10px;
  }
  .dendrita-flashcard-summary { width: 100%; }
  .dendrita-content-title-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .dendrita-content-title h1 { font-size: 24px; }
  .dendrita-content-study { justify-content: center; width: 100%; }
  .dendrita-content-study-backdrop:not([hidden]) { display: block; position: fixed; z-index: 60; inset: 0; background: rgb(26 29 26 / 40%); border: 0; }
  .dendrita-content-study-menu { position: fixed; z-index: 61; top: auto; right: 0; bottom: 0; left: 0; min-width: 0; border-radius: 16px 16px 0 0; box-shadow: 0 -12px 40px rgb(26 29 26 / 24%); padding: 10px 12px calc(12px + env(safe-area-inset-bottom)); }
  .dendrita-content-study-menu button { min-height: 48px; }
  body.dendrita-content-study-open { overflow: hidden; }
  .dendrita-content-breadcrumb button { min-height: 44px; }
  .dendrita-content-switch { min-height: 44px; }
  .dendrita-content-tabs button,
  .dendrita-content-chips button { min-height: 44px; }
  .dendrita-content-search { flex: 1 1 100%; min-height: 44px; }
  .dendrita-content-pager { flex-wrap: wrap; }
  .dendrita-content-pager-controls button { width: 44px; height: 44px; }
  .dendrita-content-layout.has-preview { grid-template-columns: minmax(0, 1fr); }
  .dendrita-content-preview-slot { position: static; }
  .dendrita-content-preview-backdrop { display: block; position: fixed; z-index: 60; inset: 0; background: rgb(26 29 26 / 40%); border: 0; }
  .dendrita-content-preview {
    position: fixed; z-index: 61; right: 0; bottom: 0; left: 0;
    max-height: min(80vh, 620px); border-radius: 16px 16px 0 0;
    box-shadow: 0 -12px 40px rgb(26 29 26 / 24%);
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }
  body.dendrita-content-sheet-open { overflow: hidden; }
  .dendrita-content-preview-close,
  .dendrita-content-material-close { width: 44px; height: 44px; }
  .dendrita-content-material-slot { padding: 16px 12px calc(var(--d-mobile-nav-height) + 12px); }
  .dendrita-content-palette-overlay { padding: 4vh 10px calc(var(--d-mobile-nav-height) + 12px); }
  .dendrita-content-palette-card { max-height: min(82vh, calc(100vh - 4vh - var(--d-mobile-nav-height) - 12px)); }
  .dendrita-content-palette-item { min-height: 48px; }
  .dendrita-content-chooser { margin-top: clamp(12px, 5vh, 40px); }
  .dendrita-content-chooser-actions { width: 100%; flex-direction: column; }
  .dendrita-content-chooser-actions button { width: 100%; min-height: 48px; justify-content: center; }
  .dendrita-content-chooser-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 520px) {
  .dendrita-question-header {
    grid-template-columns: 32px minmax(0, 1fr) auto;
    gap: 7px 9px;
  }
  .dendrita-question-exit { width: 32px; height: 32px; padding: 0; }
  .dendrita-question-exit span,
  .dendrita-question-map-toggle span { display: none; }
  .dendrita-question-identity > strong { font-size: 14.5px; }
  .dendrita-question-identity #qpos { font-size: 10.5px; }
  .dendrita-question-progress { grid-column: 1 / -1; grid-row: 2; }
  .dendrita-question-tools { grid-column: 3; grid-row: 1; gap: 4px; }
  .dendrita-question-timer-toggle { display: none; }
  .dendrita-question-timer { padding-inline: 7px; }
  .dendrita-question-tools .langbtn { padding-inline: 7px; font-size: 10.5px; }
  .dendrita-question-map-toggle { width: 30px; padding: 0; }
  .dendrita-question-map-head { align-items: flex-start; }
  .dendrita-question-map-legend { display: none; }
  .dendrita-question-meta { align-items: flex-start; flex-wrap: wrap; }
  .dendrita-question-meta-spacer { display: none; }
  .dendrita-question-meta-actions { width: 100%; margin-left: 0; }
  body.dendrita-question-active .stem { padding: 20px; font-size: 15px; }
  body.dendrita-question-active .opt { gap: 11px; padding: 13px 14px; }
  body.dendrita-question-active .opt .txt { font-size: 13.5px; }
  body.dendrita-question-active .resultbar .meta { width: 100%; margin-left: 0; }
  body.dendrita-question-active .explanation { padding: 18px; }
  .dendrita-question-previous { width: 42px; padding-inline: 0; }
  .dendrita-question-previous span { display: none; }
  body.dendrita-question-active .dendrita-question-primary { padding-inline: 18px; }
  body.dendrita-question-summary-active .dendrita-app > .hero { min-height: 210px; padding: 24px 22px; }
  body.dendrita-question-summary-active .hero h1 { font-size: 25px; }
  body.dendrita-question-summary-active .qcard { padding: 18px; }

  .dendrita-flashcard-header {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    gap: 4px 8px;
    padding: 8px 14px 0;
  }
  .dendrita-flashcard-exit { width: 40px; height: 40px; padding: 0; }
  .dendrita-flashcard-exit span,
  .dendrita-flashcard-timer-toggle:not(.is-hidden) { display: none; }
  .dendrita-flashcard-identity strong { font-size: 15px; }
  .dendrita-flashcard-identity span { font-size: 11.5px; }
  .dendrita-flashcard-progress { grid-column: 1 / -1; grid-row: 2; gap: 8px; margin-inline: -14px; }
  .dendrita-flashcard-queues { gap: 14px; padding: 0 14px 8px; }
  .dendrita-flashcard-queue-item { gap: 5px; font-size: 11px; }
  .dendrita-flashcard-progress-track { height: 3px; border-radius: 0; }
  .dendrita-flashcard-tools { grid-column: 3; grid-row: 1; }
  .dendrita-flashcard-timer { min-height: 40px; padding: 0 10px; }
  .dendrita-flashcard-timer-toggle.is-hidden { width: 40px; height: 40px; }
  .dendrita-flashcard-meta { min-height: 40px; gap: 8px; }
  .dendrita-flashcard-subject { max-width: calc(100% - 102px); font-size: 12px; }
  .dendrita-flashcard-state { font-size: 10px; }
  body.dendrita-flashcard-active .cardface {
    min-height: 280px; padding: 30px 22px; gap: 20px;
  }
  body.dendrita-flashcard-active .cardfront { font-size: 19px; }
  body.dendrita-flashcard-active .cardface.is-long .cardfront { font-size: 17px; }
  body.dendrita-flashcard-active .cardback,
  body.dendrita-flashcard-active .cardextra { font-size: 14.5px; }
  body.dendrita-flashcard-active .gradebtns.dendrita-flashcard-gradebar { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  body.dendrita-flashcard-active .gradebtn { min-height: 54px; padding: 7px 3px; }
  body.dendrita-flashcard-active .gradebtn b { font-size: 12.5px; }
  body.dendrita-flashcard-active .gradebtn span { font-size: 10px; white-space: nowrap; }
  body.dendrita-flashcard-active .gradebtn i,
  body.dendrita-flashcard-active .dendrita-flashcard-reveal .kbd { display: none; }
  body.dendrita-flashcard-active .dendrita-flashcard-reveal { width: 100%; min-height: 48px; }
  .dendrita-flashcard-summary-hero { min-height: 230px; padding: 22px 20px; }
  .dendrita-flashcard-summary h1 { font-size: 22px; }
  .dendrita-flashcard-summary-facts { flex-direction: column; gap: 4px; margin-top: 14px; }
  .dendrita-flashcard-summary-counts { gap: 8px; }
  .dendrita-flashcard-summary-counts > span { padding: 7px 10px; }
  .dendrita-flashcard-summary-actions { flex-direction: column; align-items: stretch; gap: 8px; }
  .dendrita-flashcard-summary-actions button:first-child { justify-content: center; width: 100%; min-height: 48px; }
  .dendrita-flashcard-summary-actions button:last-child { align-self: center; }
  .dendrita-content-palette-facts small { display: none; }
  .dendrita-content-item-pill { max-width: 130px; }
  .dendrita-content-subtitle { flex-direction: column; align-items: stretch; }
  .dendrita-content-coverage-track { flex: 1; width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .dendrita-sidebar,
  .dendrita-sidebar-toggle,
  .dendrita-skeleton::after,
  .dendrita-topic-skeleton::after,
  .dendrita-topic-shuffle svg,
  .dendrita-topic-chips,
  .dendrita-question-map,
  .dendrita-explore-node-ring,
  .dendrita-explore-sheet,
  .dendrita-explore-sheet-backdrop,
  .dendrita-explore-loading i,
  .dendrita-content-loading i,
  .dendrita-reviews-loading i,
  .dendrita-materials-loading i,
  .dendrita-stats-loading i,
  .dendrita-decks-loading i,
  .dendrita-materials-studied-mark,
  .dendrita-account-loading i { transition: none; animation: none; }
}

/* ---- problem reports: the student → owner channel (issue 23) ---- */
/* The players restyle the shared #reportOpen control like its chrome neighbors; the visible
   label lives in ::after (the shared text is collapsed by font-size: 0, flag-style). */
body.dendrita-question-active #reportOpen {
  min-height: 30px;
  margin-left: 8px;
  padding: 6px 12px;
  color: var(--d-error);
  background: var(--d-white);
  border: 1px solid var(--d-border);
  border-radius: 6px;
  font-size: 0;
  line-height: 1;
}
body.dendrita-question-active #reportOpen::before { margin-right: 7px; content: "△"; font-size: 13px; }
body.dendrita-question-active #reportOpen::after { content: "Reportar problema"; font-size: 12.5px; }
/* The hover keeps the white ground: the rust label clears 4.5:1 on white but only 3.8:1 on
   --d-error-bg, and this label is 12.5px normal text. */
body.dendrita-question-active #reportOpen:hover { border-color: var(--d-error-border); }

/* The card bookmark (issue 25) shares the tools-row shape with the report control; only the
   colour and the label differ. Like the question flag, the shared text collapses to font-size: 0
   and the visible label lives in ::after. */
.dendrita-flashcard-tools #flag {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 5px 10px;
  color: var(--d-muted);
  background: var(--d-white);
  border: 1px solid var(--d-border);
  border-radius: 6px;
  font-size: 0;
  line-height: 1;
  cursor: pointer;
}
.dendrita-flashcard-tools #flag::before { margin-right: 6px; content: "◇"; font-size: 13px; }
.dendrita-flashcard-tools #flag::after { content: "Marcar"; font-size: 12.5px; }
.dendrita-flashcard-tools #flag:hover { color: var(--d-ink); border-color: var(--d-green-500); }
.dendrita-flashcard-tools #flag.on { color: var(--d-warning); background: var(--d-warning-bg); border-color: var(--d-warning-border); }
.dendrita-flashcard-tools #flag.on::before { content: "◆"; }
.dendrita-flashcard-tools #flag.on::after { content: "Marcado"; }

.dendrita-flashcard-tools #reportOpen {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 5px 10px;
  color: var(--d-error);
  background: var(--d-white);
  border: 1px solid var(--d-border);
  border-radius: 6px;
  font-size: 0;
  line-height: 1;
  cursor: pointer;
}
.dendrita-flashcard-tools #reportOpen::before { margin-right: 6px; content: "△"; font-size: 13px; }
.dendrita-flashcard-tools #reportOpen::after { content: "Reportar problema"; font-size: 12.5px; }
.dendrita-flashcard-tools #reportOpen:hover { border-color: var(--d-error-border); }

body.dendrita-question-active .reportpanel,
body.dendrita-flashcard-active .reportpanel {
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
  padding: 16px;
  background: var(--d-paper);
  border: 1px solid var(--d-border);
  border-radius: 14px;
}
body.dendrita-question-active .reportpanel[hidden],
body.dendrita-flashcard-active .reportpanel[hidden] { display: none; }
body.dendrita-flashcard-active .reportpanel { width: min(704px, calc(100% - 56px)); margin: 14px auto 0; box-sizing: border-box; }
body.dendrita-question-active .reportpanel .reportnote,
body.dendrita-flashcard-active .reportpanel .reportnote { color: var(--d-muted); font-size: 12.5px; }
body.dendrita-question-active .reportpanel textarea,
body.dendrita-flashcard-active .reportpanel textarea {
  min-height: 76px;
  padding: 10px 12px;
  resize: vertical;
  background: var(--d-white);
  color: var(--d-text);
  border: 1px solid var(--d-border);
  border-radius: 10px;
  font: 400 13.5px var(--d-font-body);
}
body.dendrita-question-active .reportpanel .actions,
body.dendrita-flashcard-active .reportpanel .actions { display: flex; align-items: center; gap: 10px; margin: 0; flex-wrap: wrap; }
body.dendrita-question-active .reportpanel #reportSend,
body.dendrita-flashcard-active .reportpanel #reportSend {
  min-height: 40px;
  padding: 8px 16px;
  color: var(--d-cream);
  background: var(--d-green-700);
  border: 1px solid var(--d-green-700);
  border-radius: 9px;
  font: 600 13px var(--d-font-body);
  cursor: pointer;
}
body.dendrita-question-active .reportpanel #reportSend:hover,
body.dendrita-flashcard-active .reportpanel #reportSend:hover { background: var(--d-green-800); }
body.dendrita-question-active .reportpanel #reportSend:disabled,
body.dendrita-flashcard-active .reportpanel #reportSend:disabled { opacity: .5; cursor: default; }
body.dendrita-question-active .reportpanel #reportCancel,
body.dendrita-flashcard-active .reportpanel #reportCancel {
  min-height: 40px;
  padding: 4px 8px;
  background: transparent;
  border: 0;
  color: var(--d-muted);
  font: 500 13px var(--d-font-body);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  cursor: pointer;
}
body.dendrita-question-active .reportpanel #reportMsg,
body.dendrita-flashcard-active .reportpanel #reportMsg { color: var(--d-muted); font-size: 12.5px; }

/* Configurações: the student report form and the admin inbox */
.dendrita-account-report { display: grid; gap: 10px; max-width: 560px; }
.dendrita-account-report textarea {
  min-height: 84px;
  padding: 10px 12px;
  resize: vertical;
  background: var(--d-white);
  color: var(--d-text);
  border: 1px solid var(--d-border);
  border-radius: 10px;
  font: 400 13.5px var(--d-font-body);
  box-sizing: border-box;
}
.dendrita-account-report-send {
  justify-self: start;
  min-height: 40px;
  padding: 8px 18px;
  color: var(--d-cream);
  background: var(--d-green-700);
  border: 1px solid var(--d-green-700);
  border-radius: 9px;
  font: 600 13px var(--d-font-body);
  cursor: pointer;
}
.dendrita-account-report-send:hover { background: var(--d-green-800); }
.dendrita-account-report-send:disabled { opacity: .5; cursor: default; }
.dendrita-account-reports { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.dendrita-account-report-item { display: grid; gap: 6px; padding: 12px 14px; background: var(--d-paper); border: 1px solid var(--d-border); border-radius: 10px; }
.dendrita-account-report-item.is-resolved { opacity: .62; }
.dendrita-account-report-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; color: var(--d-muted); font-size: 12px; }
.dendrita-account-report-head b { color: var(--d-ink); font-size: 13px; }
.dendrita-account-report-context { padding: 2px 8px; border: 1px solid var(--d-green-100); border-radius: 999px; background: var(--d-green-50); color: var(--d-green-700); font-size: 11px; font-weight: 600; }
.dendrita-account-report-item p { margin: 0; color: var(--d-text); font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }
.dendrita-account-report-item button {
  justify-self: start;
  min-height: 40px;
  padding: 6px 12px;
  background: var(--d-white);
  color: var(--d-text);
  border: 1px solid var(--d-border);
  border-radius: 9px;
  font: 500 12.5px var(--d-font-body);
  cursor: pointer;
}
.dendrita-account-report-item button:hover { border-color: var(--d-green-500); color: var(--d-ink); }

@media (max-width: 720px) {
  body.dendrita-question-active #reportOpen { min-height: 44px; }
  body.dendrita-question-active #flag { min-height: 44px; }
  .dendrita-flashcard-tools #reportOpen,
  .dendrita-flashcard-tools #flag { min-width: 44px; min-height: 44px; justify-content: center; padding: 0; }
  .dendrita-flashcard-tools #reportOpen::after,
  .dendrita-flashcard-tools #flag::after,
  .dendrita-flashcard-tools #flag.on::after { content: none; }   /* the marked state collapses too */
  .dendrita-flashcard-tools #reportOpen::before,
  .dendrita-flashcard-tools #flag::before { margin-right: 0; }
  body.dendrita-flashcard-active .reportpanel { width: calc(100% - 32px); }
  body.dendrita-question-active .reportpanel #reportSend,
  body.dendrita-flashcard-active .reportpanel #reportSend,
  body.dendrita-question-active .reportpanel #reportCancel,
  body.dendrita-flashcard-active .reportpanel #reportCancel { min-height: 44px; }
  .dendrita-account-report-send { width: 100%; min-height: 44px; justify-self: stretch; }
  .dendrita-account-report-item button { min-height: 44px; }
}
