:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #142033;
  --muted: #64748b;
  --line: #d7dee8;
  --blue: #2456d6;
  --cyan: #0f9eaa;
  --green: #15946b;
  --shadow: 0 18px 42px rgba(19, 32, 51, 0.1);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

/* Library material types and document-backed Ambientes. */
.orion-file-icon {
  width: 34px;
  height: 40px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  color: currentColor;
}

.orion-file-icon svg {
  width: 100%;
  height: 100%;
  fill: rgba(255, 255, 255, 0.7);
  stroke: currentColor;
  stroke-width: 1.45;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.library-material-tabs {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid rgba(17, 17, 17, 0.16);
  border-radius: 6px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.46);
}

.library-material-tabs button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 4px;
  padding: 0 14px;
  color: rgba(17, 17, 17, 0.64);
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.library-material-tabs button small {
  min-width: 20px;
  min-height: 20px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: inherit;
  background: rgba(17, 17, 17, 0.07);
  font-size: 10px;
}

.library-material-tabs button.active {
  color: #ffffff;
  background: #111111;
}

.library-material-tabs button.active small {
  background: rgba(255, 255, 255, 0.18);
}

.library-material-tabs button:disabled {
  opacity: 0.38;
  cursor: default;
}

.library-material-tabs button:focus-visible,
.env-modal-add-document:focus-visible,
.env-modal-document-option:focus-visible,
.env-modal-selected-document button:focus-visible {
  outline: 2px solid #176fc2;
  outline-offset: 2px;
}

.book-choice-copy {
  grid-area: title;
  min-width: 0;
  display: grid;
  gap: 5px;
}

.book-choice-copy strong,
.book-choice-copy small {
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
}

.book-choice-card .book-choice-copy strong {
  grid-area: auto;
}

.book-choice-card .book-choice-copy small {
  grid-area: auto;
  color: rgba(17, 17, 17, 0.56);
  font-size: 10px;
}

.book-choice-file-icon {
  grid-area: number;
  width: 31px;
  height: 37px;
  color: #176fc2;
}

.book-choice-card.document::after {
  background: #176fc2;
  opacity: 0.72;
}

.library-material-empty {
  min-height: 84px;
  display: flex;
  align-items: center;
  gap: 13px;
  border: 1px dashed rgba(17, 17, 17, 0.2);
  border-radius: 5px;
  padding: 14px 18px;
  color: rgba(17, 17, 17, 0.54);
  background: rgba(255, 255, 255, 0.28);
}

.library-material-empty-icon {
  width: 27px;
  height: 33px;
}

.library-material-empty strong {
  font-size: 12px;
  font-weight: 600;
}

.env-modal-document-source {
  display: grid;
  justify-items: start;
  gap: 9px;
  margin-top: -3px;
}

.env-modal-add-document {
  width: fit-content;
  max-width: min(100%, 320px);
  min-height: 40px;
  display: inline-grid;
  grid-template-columns: 20px minmax(0, 1fr) 21px;
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(17, 17, 17, 0.2);
  border-radius: 5px;
  padding: 8px 10px;
  color: rgba(17, 17, 17, 0.76);
  background: rgba(17, 17, 17, 0.035);
  text-align: left;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease, transform 150ms ease;
}

.env-modal-add-document:hover {
  border-color: rgba(17, 17, 17, 0.48);
  color: #111111;
  background: rgba(17, 17, 17, 0.07);
  transform: translateY(-1px) scale(1.01);
}

.env-modal-add-document.has-selection {
  border-color: rgba(22, 130, 54, 0.46);
  color: #126f31;
  background: rgba(238, 249, 241, 0.84);
}

.env-modal-add-document .orion-file-icon {
  width: 18px;
  height: 22px;
}

.env-modal-add-document-copy {
  min-width: 0;
  display: block;
}

.env-modal-add-document-copy strong,
.env-modal-add-document-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.env-modal-add-document-copy strong {
  color: currentColor;
  font-size: 12px;
  font-weight: 650;
}

.env-modal-add-document-mark {
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 13px;
}

.env-modal-add-document:focus-visible {
  outline-color: #111111;
}

#new-env-fascicle-section.is-subject-locked .env-modal-row,
#new-env-fascicle-section.is-subject-locked .env-modal-range,
#new-env-fascicle-section.is-subject-locked .env-modal-range-hint,
#new-env-fascicle-section.is-subject-locked .env-modal-document-source {
  opacity: 0.46;
  filter: grayscale(1);
}

#new-env-fascicle-section.is-subject-locked input:disabled,
#new-env-fascicle-section.is-subject-locked .env-modal-add-document:disabled {
  color: rgba(17, 17, 17, 0.66);
  background: rgba(17, 17, 17, 0.055);
  cursor: not-allowed;
}

.env-modal-source-lock {
  position: absolute;
  z-index: 4;
  inset: 62px 0 0;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: not-allowed;
}

.env-modal-source-lock[hidden] {
  display: none;
}

@keyframes env-modal-subject-lift {
  0%, 100% { transform: translateY(0); }
  45% { transform: translateY(-6px); }
}

.env-modal-section.needs-attention {
  animation: env-modal-subject-lift 420ms cubic-bezier(0.2, 0.75, 0.25, 1);
}

#new-env-fascicle-section {
  transition: gap 170ms ease, padding 170ms ease, opacity 170ms ease;
}

#new-env-fascicle-section.is-collapsed {
  gap: 8px;
  padding-top: 20px;
  padding-bottom: 18px;
  opacity: 0.58;
}

#new-env-fascicle-section.is-collapsed .env-modal-range {
  display: none;
}

#new-env-fascicle-section.is-collapsed .env-modal-range-hint {
  margin-top: 0;
  color: #126f31;
}

.env-modal-document-panel {
  display: grid;
  gap: 10px;
}

.env-modal-document-panel[hidden] {
  display: none;
}

.env-modal-selected-document,
.env-modal-document-option {
  min-width: 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(17, 17, 17, 0.14);
  border-radius: 6px;
  padding: 12px 13px;
  background: rgba(255, 255, 255, 0.72);
}

.env-modal-selected-document {
  border-color: rgba(22, 130, 54, 0.34);
}

.env-modal-selected-file-icon,
.env-modal-option-file-icon {
  width: 27px;
  height: 33px;
  color: #176fc2;
}

.env-modal-selected-document > span,
.env-modal-document-option > span {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.env-modal-selected-document strong,
.env-modal-document-option strong,
.env-modal-selected-document small,
.env-modal-document-option small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.env-modal-selected-document strong,
.env-modal-document-option strong {
  font-size: 12px;
  font-weight: 700;
}

.env-modal-selected-document small,
.env-modal-document-option small {
  color: rgba(17, 17, 17, 0.56);
  font-size: 10px;
}

.env-modal-selected-document button,
.env-modal-document-picker header button {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: rgba(17, 17, 17, 0.64);
  background: rgba(17, 17, 17, 0.06);
  font-size: 18px;
}

.env-modal-document-picker {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(17, 17, 17, 0.16);
  border-radius: 7px;
  padding: 12px;
  background: rgba(248, 249, 248, 0.96);
  box-shadow: 0 16px 34px rgba(17, 17, 17, 0.09);
}

.env-modal-document-picker > header {
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: rgba(17, 17, 17, 0.62);
  font-size: 10px;
  font-weight: 650;
}

.env-modal-document-list {
  max-height: 244px;
  display: grid;
  gap: 7px;
  overflow-y: auto;
  padding: 1px;
}

.env-modal-document-option {
  width: 100%;
  color: #111111;
  text-align: left;
}

.env-modal-document-option:hover,
.env-modal-document-option.active {
  border-color: rgba(23, 111, 194, 0.46);
  background: #f1f7fd;
}

.env-modal-document-option i {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(23, 111, 194, 0.38);
  border-radius: 50%;
  color: #176fc2;
  font-size: 13px;
  font-style: normal;
}

.env-modal-document-message {
  margin: 0;
  padding: 17px 10px;
  color: rgba(17, 17, 17, 0.58);
  font-size: 11px;
  text-align: center;
}

.env-number-placeholder {
  min-height: 1.2em;
}

@media (max-width: 620px) {
  .library-material-tabs {
    width: 100%;
  }

  .library-material-tabs button {
    flex: 1;
    justify-content: center;
  }

  .env-modal-add-document {
    max-width: 100%;
  }
}

/* Orion microphone dictation stays inside the existing Library and Ambiente
   composers. These final, tightly scoped rules intentionally override older
   composer variants above without changing their surrounding layouts. */
.ambiente-input-row textarea {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 36px;
  max-height: 112px;
  border: 0;
  margin: 0;
  padding: 7px 0;
  resize: none;
  overflow: hidden;
  color: #111111;
  background: transparent;
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
}

.ambiente-input-row textarea::placeholder {
  color: #777777;
}

.ambiente-input-row textarea:focus {
  outline: none;
}

.ambiente-input-row textarea:disabled {
  opacity: 0.62;
}

.ambiente-environment-compose .ambiente-input-row textarea {
  min-height: 38px;
  padding-top: 9px;
  padding-bottom: 9px;
  font-size: 13px;
}

.ambiente-input-row.reader-input-row.dictation-supported {
  grid-template-columns: minmax(0, 1fr) 36px 36px;
  align-items: end;
}

.ambiente-environment-compose .ambiente-input-row.dictation-supported {
  grid-template-columns: auto minmax(0, 1fr) 38px 38px;
  align-items: end;
}

.reader-compose-panel,
.ambiente-environment-compose {
  overflow: visible;
}

.orion-dictation-button {
  box-sizing: border-box;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  padding: 0;
  color: #303630;
  background: transparent;
  cursor: pointer;
  transition:
    color 150ms ease,
    background-color 150ms ease,
    transform 150ms ease;
}

.reader-input-row .orion-dictation-button {
  width: 36px;
  height: 36px;
  color: #111111;
}

.orion-dictation-button:hover:not(:disabled) {
  color: var(--ambiente-accent-strong, #111111);
  background: rgba(17, 17, 17, 0.065);
}

.orion-dictation-button:active:not(:disabled) {
  transform: scale(0.94);
}

.orion-dictation-button:focus-visible,
.orion-dictation-session button:focus-visible {
  outline: 2px solid rgba(var(--ambiente-accent-rgb, 17, 17, 17), 0.48);
  outline-offset: 2px;
}

.orion-dictation-button:disabled {
  cursor: default;
  opacity: 0.5;
}

.orion-dictation-button.unavailable:not(:disabled) {
  opacity: 0.58;
}

.orion-dictation-button.pending {
  color: var(--ambiente-accent, #111111);
  animation: orion-dictation-pending 900ms ease-in-out infinite alternate;
}

.orion-dictation-microphone-icon {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.orion-dictation-session[hidden] {
  display: none !important;
}

.orion-dictation-session {
  min-width: 0;
  min-height: 38px;
  grid-column: 1 / -2;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto 38px;
  align-items: center;
  gap: 7px;
  color: #202520;
}

.reader-input-row .orion-dictation-session {
  min-height: 36px;
  grid-template-columns: 36px minmax(0, 1fr) auto 36px;
}

form[data-dictation-state="recording"] .ambiente-input-row > :not(.orion-dictation-session):not(.orion-dictation-live):not(button[type="submit"]),
form[data-dictation-state="stopping"] .ambiente-input-row > :not(.orion-dictation-session):not(.orion-dictation-live):not(button[type="submit"]),
form[data-dictation-state="transcribing"] .ambiente-input-row > :not(.orion-dictation-session):not(.orion-dictation-live):not(button[type="submit"]) {
  display: none;
}

.orion-dictation-session button {
  box-sizing: border-box;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(17, 17, 17, 0.16);
  border-radius: 50%;
  padding: 0;
  color: #272c27;
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  transition:
    border-color 150ms ease,
    background-color 150ms ease,
    transform 150ms ease;
}

.reader-input-row .orion-dictation-session button {
  width: 36px;
  height: 36px;
}

.orion-dictation-session button:hover:not(:disabled) {
  border-color: rgba(17, 17, 17, 0.34);
  background: #ffffff;
}

.orion-dictation-session button:active:not(:disabled) {
  transform: scale(0.94);
}

.orion-dictation-session button:disabled {
  cursor: default;
  opacity: 0.55;
}

.orion-dictation-session button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.orion-dictation-finish {
  border-color: var(--ambiente-accent, #111111) !important;
  color: #ffffff !important;
  background: var(--ambiente-accent, #111111) !important;
}

.orion-dictation-waveform {
  width: 100%;
  min-width: 0;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  overflow: hidden;
  color: var(--ambiente-accent, #111111);
}

.orion-dictation-waveform i {
  width: 2px;
  flex: 0 0 2px;
  height: 7px;
  display: block;
  border-radius: 999px;
  background: currentColor;
  transition: height 55ms ease-out;
}

.orion-dictation-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.orion-dictation-timer {
  min-width: 3.4ch;
  color: rgba(37, 42, 37, 0.68);
  font-family: "IBM Plex Mono", "Cascadia Mono", "Courier New", monospace;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.orion-dictation-session[data-state="transcribing"] .orion-dictation-waveform {
  opacity: 0.66;
}

.orion-dictation-live {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.orion-dictation-live.error {
  right: 10px;
  bottom: calc(100% + 8px);
  z-index: 30;
  width: min(390px, calc(100vw - 36px));
  height: auto;
  overflow: visible;
  clip: auto;
  clip-path: none;
  border: 1px solid rgba(155, 44, 44, 0.24);
  border-radius: 10px;
  padding: 8px 10px;
  color: #7f2525;
  background: rgba(255, 248, 248, 0.98);
  box-shadow: 0 8px 22px rgba(61, 21, 21, 0.12);
  font-size: 11px;
  line-height: 1.35;
  white-space: normal;
}

@keyframes orion-dictation-pending {
  from {
    opacity: 0.5;
  }
  to {
    opacity: 1;
  }
}

@media (max-width: 680px) {
  .ambiente-compose-panel[class~="ambiente-environment-compose"] {
    bottom: max(18px, env(safe-area-inset-bottom)) !important;
  }

  .ambiente-environment-compose .ambiente-input-row.dictation-supported {
    grid-template-columns: 44px minmax(72px, 1fr) 44px 44px;
  }

  .ambiente-input-row.reader-input-row.dictation-supported {
    grid-template-columns: minmax(72px, 1fr) 44px 44px;
  }

  .orion-dictation-button,
  .reader-input-row .orion-dictation-button,
  .orion-dictation-session button,
  .reader-input-row .orion-dictation-session button {
    width: 44px;
    height: 44px;
  }

  .ambiente-environment-compose .ambiente-input-row.dictation-supported button[type="submit"],
  .ambiente-environment-compose .ambiente-input-row.dictation-supported .ambiente-attachment-button[class] {
    width: 44px !important;
    height: 44px !important;
  }

  .orion-dictation-session,
  .reader-input-row .orion-dictation-session {
    min-height: 44px;
    grid-template-columns: 44px minmax(0, 1fr) auto 44px;
    gap: 5px;
  }
}

@media (max-width: 420px) {
  .orion-dictation-session,
  .reader-input-row .orion-dictation-session {
    grid-template-columns: 40px minmax(0, 1fr) auto 44px;
  }

  .orion-dictation-timer {
    justify-self: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .orion-dictation-button.pending {
    animation: none;
  }

  .orion-dictation-waveform i {
    transition-duration: 220ms;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background:
    radial-gradient(circle at 1px 1px, var(--dot-grid) 1px, transparent 1.6px) 0 0 / 34px 34px,
    var(--bg);
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(36, 86, 214, 0.1), rgba(245, 247, 251, 0) 360px),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

.orion-auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.orion-auth-shell {
  width: min(100%, 520px);
  display: grid;
  gap: 22px;
}

.orion-auth-card,
.orion-role-card {
  display: grid;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: clamp(24px, 6vw, 42px);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.orion-auth-card h1,
.orion-role-card h1 {
  font-size: clamp(42px, 10vw, 72px);
  line-height: 0.95;
}

.orion-auth-copy,
.orion-role-card > p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.6;
}

.orion-auth-card form {
  display: grid;
  gap: 10px;
}

.orion-auth-card label {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.orion-auth-card input {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: white;
  font: inherit;
}

.orion-auth-card input:focus {
  border-color: var(--blue);
  outline: 3px solid rgba(36, 86, 214, 0.12);
}

.orion-auth-card button,
.orion-role-logout {
  min-height: 48px;
  display: inline-grid;
  place-items: center;
  margin-top: 8px;
  border-radius: 8px;
  padding: 0 18px;
  color: white;
  background: var(--blue);
  font-weight: 850;
  text-decoration: none;
}

.orion-auth-status {
  min-height: 20px;
  color: #b42318;
  font-size: 13px;
}

.teacher-studio-body {
  min-height: 100vh;
  background: var(--bg);
}

.teacher-studio-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 64px;
}

.teacher-studio-header,
.teacher-studio-account,
.teacher-studio-panel > header {
  display: flex;
  align-items: center;
}

.teacher-studio-header {
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.teacher-studio-account {
  gap: 16px;
}

.teacher-studio-account > span {
  display: grid;
  text-align: right;
}

.teacher-studio-account small,
.teacher-class-card small {
  color: var(--muted);
}

.teacher-studio-account .orion-role-logout {
  margin-top: 0;
}

.teacher-studio-hero {
  padding: clamp(44px, 8vw, 88px) 0;
}

.teacher-studio-hero h1 {
  margin: 8px 0 12px;
  font-size: clamp(48px, 9vw, 92px);
  line-height: 0.95;
  letter-spacing: -0.055em;
}

.teacher-studio-hero > p:not(.eyebrow) {
  max-width: 620px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.teacher-school-badge,
.teacher-scope-list span {
  display: inline-flex;
  border: 1px solid rgba(36, 86, 214, 0.22);
  border-radius: 999px;
  color: var(--blue);
  background: rgba(36, 86, 214, 0.07);
  font-size: 12px;
  font-weight: 800;
}

.teacher-school-badge {
  margin-top: 16px;
  padding: 9px 14px;
}

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

.teacher-studio-panel {
  display: grid;
  align-content: start;
  gap: 22px;
  min-height: 270px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.teacher-classes-panel {
  grid-row: span 2;
}

.teacher-studio-panel > header {
  align-items: flex-start;
  gap: 14px;
}

.teacher-studio-panel > header > span {
  min-width: 38px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.teacher-studio-panel h2,
.teacher-studio-panel .eyebrow {
  margin: 0;
}

.teacher-studio-panel h2 {
  margin-top: 5px;
  font-size: 24px;
}

.teacher-class-grid {
  display: grid;
  gap: 10px;
}

.teacher-class-card,
.teacher-studio-empty {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #f9fbff;
}

.teacher-class-card span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.teacher-placeholder-panel > p,
.teacher-studio-empty span {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.teacher-scope-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.teacher-scope-list span {
  padding: 6px 9px;
}

.teacher-placeholder-panel button {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #eef2f7;
  font: inherit;
  font-weight: 750;
}

@media (max-width: 760px) {
  .teacher-studio-header,
  .teacher-studio-account {
    align-items: flex-start;
  }

  .teacher-studio-header {
    flex-direction: column;
  }

  .teacher-studio-account > span {
    text-align: left;
  }

  .teacher-studio-grid {
    grid-template-columns: 1fr;
  }

  .teacher-classes-panel {
    grid-row: auto;
  }
}

.school-admin-body {
  min-height: 100vh;
  background: var(--bg);
}

.school-admin-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.school-admin-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  margin-bottom: 28px;
}

.school-admin-header h1 {
  margin-top: 4px;
  font-size: clamp(40px, 7vw, 76px);
  line-height: 0.95;
}

.school-admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.school-admin-tabs button,
.school-grade-editor button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--muted);
  background: white;
  font-size: 13px;
  font-weight: 800;
}

.school-admin-tabs button.active {
  color: white;
  border-color: var(--blue);
  background: var(--blue);
}

.school-admin-card {
  display: grid;
  gap: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: clamp(22px, 4vw, 38px);
  background: white;
  box-shadow: var(--shadow);
}

.school-admin-card h2 {
  margin-top: 5px;
  font-size: 30px;
}

.school-admin-card label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.school-admin-card input,
.school-admin-card textarea,
.school-admin-card select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--ink);
  background: white;
  font: inherit;
  text-transform: none;
}

.school-form-grid,
.school-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.school-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.school-summary-grid article {
  display: grid;
  gap: 8px;
  min-height: 112px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  background: white;
  box-shadow: var(--shadow);
}

.school-summary-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.school-summary-grid strong {
  color: var(--ink);
  font-size: clamp(18px, 2vw, 25px);
  overflow-wrap: anywhere;
}

.school-admin-workspace {
  display: grid;
  grid-template-columns: minmax(300px, 0.8fr) minmax(0, 1.2fr);
  gap: 16px;
  align-items: start;
}

.school-list-card {
  min-height: 100%;
}

.school-users-card {
  margin-top: 16px;
}

.school-create-user-card {
  max-width: 720px;
}

.school-create-class-card {
  max-width: none;
}

.school-users-filter {
  max-width: 260px;
}

.school-entity-list {
  display: grid;
  gap: 9px;
}

.school-entity-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  background: #f8fafc;
}

.school-entity-row strong,
.school-entity-row small {
  display: block;
  overflow-wrap: anywhere;
}

.school-entity-row strong {
  color: var(--ink);
  font-size: 15px;
}

.school-entity-row small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.school-entity-row > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.school-role-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 9px;
  color: var(--blue) !important;
  background: white;
  text-transform: capitalize;
}

.school-bulk-copy,
.school-usage-placeholder > p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.school-bulk-copy code {
  color: var(--ink);
  font-size: 12px;
}

.school-key-banner {
  border: 1px solid #b8d3ff;
  border-radius: 8px;
  padding: 13px 14px;
  color: #174ea6;
  background: #eef5ff;
  font-size: 13px;
  font-weight: 750;
}

.school-grade-editor {
  display: grid;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

.school-grade-editor > header,
.school-grade-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.school-grade-editor small,
.school-empty-state {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

#my-school-grade-list,
.school-class-list {
  display: grid;
  gap: 10px;
}

.school-grade-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f8fafc;
}

.school-grade-row label {
  flex: 1;
}

.school-class-list label {
  grid-template-columns: 70px 1fr auto;
  align-items: center;
}

.school-primary-button {
  min-height: 48px;
  border-radius: 8px;
  padding: 0 18px;
  color: white;
  background: var(--blue);
  font-weight: 850;
}

.school-secondary-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: white;
  font-weight: 800;
}

.school-class-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.school-class-provider-note {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  background: #f8fafc;
}

.school-class-provider-note span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.school-class-provider-note small {
  color: var(--muted);
  font-size: 12px;
}

.school-class-assignment-group {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.school-class-assignment-group > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.school-class-assignment-group header span,
.school-member-picker-help {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.school-class-assignment-group header small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.school-member-add-button {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 50%;
  color: white;
  background: var(--blue);
  font-size: 22px;
  font-weight: 500;
  line-height: 1;
}

.school-member-card-list,
.school-member-search-results {
  display: grid;
  gap: 8px;
}

.school-member-card,
.school-member-search-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  background: #f8fafc;
}

.school-member-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: var(--blue);
  background: #eaf2ff;
  font-size: 13px;
  font-weight: 900;
}

.school-member-card strong,
.school-member-card small,
.school-member-search-card strong,
.school-member-search-card small {
  display: block;
  overflow-wrap: anywhere;
}

.school-member-card small,
.school-member-search-card small,
.school-member-empty,
.school-member-picker-empty {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.school-member-card button,
.school-member-search-card button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  color: var(--blue);
  background: white;
  font-size: 12px;
  font-weight: 800;
}

.school-member-search-card button:disabled {
  color: var(--muted);
  background: #eef1f5;
}

.school-member-picker {
  min-height: 520px;
  align-content: start;
}

.school-member-picker-help {
  line-height: 1.55;
  text-transform: none;
}

.school-member-picker-empty,
.school-member-empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fbfcfe;
}

.school-action-status {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
}

.school-metric-grid article,
.school-status-list article {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #f8fafc;
}

.school-metric-grid span,
.school-status-list span {
  color: var(--muted);
  font-size: 12px;
  text-transform: capitalize;
}

.school-metric-grid strong,
.school-status-list strong {
  font-size: 22px;
}

.school-status-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 720px) {
  .school-admin-header {
    grid-template-columns: 1fr;
  }

  .school-form-grid,
  .school-metric-grid,
  .school-status-list,
  .school-summary-grid,
  .school-admin-workspace {
    grid-template-columns: 1fr;
  }

  .school-grade-row,
  .school-grade-editor > header {
    align-items: stretch;
    flex-direction: column;
  }
}

[hidden] {
  display: none !important;
}

button {
  border: 0;
  font: inherit;
  cursor: pointer;
}

a {
  color: inherit;
}

h1,
h2,
p {
  margin: 0;
}

.orion-app {
  min-height: 100vh;
}

.appbar {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 24px rgba(19, 32, 51, 0.06);
  backdrop-filter: blur(14px);
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 850;
  text-decoration: none;
}

.app-links {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.app-links a {
  min-height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.58);
}

.app-links a:hover {
  color: var(--ink);
  border-color: rgba(60, 73, 96, 0.34);
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: white;
  background: linear-gradient(135deg, #2456d6, #0f9eaa);
}

.system-status {
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.hero-band {
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 38px clamp(16px, 4vw, 40px) 24px;
}

.hero-band h1 {
  margin-top: 8px;
  font-size: clamp(58px, 11vw, 128px);
  line-height: 0.9;
  font-weight: 920;
}

.hero-copy {
  max-width: 560px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.5;
}

.eyebrow {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-stats,
.orion-start,
.mode-page,
.blank-workspace {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.hero-stats {
  min-width: 172px;
  display: grid;
  gap: 4px;
  padding: 16px;
}

.hero-stats span {
  color: var(--muted);
  font-size: 12px;
}

.hero-stats strong {
  font-size: 28px;
}

.orion-start,
.mode-page,
.blank-workspace {
  margin: 0 clamp(16px, 4vw, 40px) 34px;
  padding: 18px;
}

.section-heading,
.workspace-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.section-heading h2,
.workspace-topbar h2,
.mode-heading h2 {
  margin-top: 4px;
  font-size: 22px;
}

.ghost-button {
  min-height: 36px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  color: var(--muted);
  background: white;
  font-size: 13px;
  font-weight: 750;
}

.ghost-button:hover {
  color: var(--ink);
  border-color: #aebcd0;
  background: #f8fafc;
}

.subject-card-grid,
.mode-card-grid {
  max-width: 760px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.subject-card,
.mode-card {
  min-height: 108px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-content: space-between;
  gap: 12px;
  border: 1px solid transparent;
  border-radius: 16px;
  padding: 18px;
  color: white;
  text-align: left;
  box-shadow: 0 18px 42px rgba(38, 64, 105, 0.14);
}

.subject-card:hover,
.subject-card.active,
.mode-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 36px rgba(19, 32, 51, 0.16);
}

.subject-card span,
.mode-card span {
  width: fit-content;
  min-width: 42px;
  border-radius: 999px;
  padding: 6px 9px;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.18);
  font-size: 12px;
  font-weight: 850;
}

.subject-card strong,
.mode-card strong {
  align-self: end;
  font-size: 18px;
  font-weight: 820;
}

.subject-card small,
.mode-card p {
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  line-height: 1.45;
}

.subject-card.green {
  background: linear-gradient(145deg, #16855c, #0f6b48);
}

.subject-card.blue,
.mode-card:first-child {
  background: linear-gradient(145deg, #4c9ee8, #2f77c8);
}

.subject-card.red {
  background: linear-gradient(145deg, #de4d5c, #bd2f43);
}

.subject-card.orange,
.mode-card:last-child {
  background: linear-gradient(145deg, #ed8a22, #c96412);
}

.subject-card.green:hover:not(:disabled) {
  background: linear-gradient(145deg, #189765, #0d6a47);
}

.subject-card.blue:hover:not(:disabled),
.mode-card:first-child:hover:not(:disabled) {
  background: linear-gradient(145deg, #57aaf2, #2d77ca);
}

.subject-card.red:hover:not(:disabled) {
  background: linear-gradient(145deg, #e95866, #bf2f44);
}

.subject-card.orange:hover:not(:disabled),
.mode-card:last-child:hover:not(:disabled) {
  background: linear-gradient(145deg, #f2952d, #c96412);
}

.mode-panel {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.mode-heading {
  margin-bottom: 12px;
}

.mode-page,
.blank-workspace {
  min-height: calc(100vh - 98px);
  background: white;
}

.workspace-topbar {
  min-height: 58px;
  justify-content: flex-start;
  border-bottom: 1px solid var(--line);
}

.workspace-body {
  padding-top: 18px;
}

.workspace-empty {
  max-width: 620px;
  margin: 28px auto;
}

.pdf-reader-workspace {
  display: grid;
  gap: 16px;
}

.pdf-reader-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.page-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-controls strong {
  min-width: 148px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.debug-toggle {
  display: flex !important;
  grid-auto-flow: column;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.book-choice-strip {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  padding: 2px;
}

.book-picker {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(244, 248, 255, 0.92)),
    #f8fafc;
  box-shadow: 0 12px 32px rgba(19, 32, 51, 0.08);
}

.book-picker-heading {
  display: grid;
  gap: 4px;
}

.book-picker-heading h3 {
  margin: 0;
  font-size: 22px;
  overflow-wrap: anywhere;
}

.book-choice-card {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 84px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "number title arrow";
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(215, 222, 232, 0.9);
  border-radius: 8px;
  padding: 12px 13px;
  color: var(--ink);
  background: #ffffff;
  text-align: left;
  box-shadow: 0 8px 20px rgba(19, 32, 51, 0.06);
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease, background 140ms ease;
}

.book-choice-card::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  border-radius: 8px 0 0 8px;
  background: #2456d6;
  opacity: 0;
  transition: opacity 140ms ease;
}

.book-choice-card:hover,
.book-choice-card.active {
  border-color: rgba(36, 86, 214, 0.42);
  background: #f8fbff;
  transform: translateY(-1px);
}

.book-choice-card.active {
  box-shadow:
    0 0 0 2px rgba(36, 86, 214, 0.1),
    0 12px 24px rgba(19, 32, 51, 0.1);
}

.book-choice-card:hover::after,
.book-choice-card.active::after {
  opacity: 1;
}

.book-choice-subject {
  grid-area: badge;
  width: fit-content;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(21, 148, 107, 0.22);
  border-radius: 999px;
  padding: 3px 8px;
  color: var(--green);
  background: rgba(21, 148, 107, 0.08);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.book-choice-number {
  grid-area: number;
  color: rgba(17, 17, 17, 0.72);
  font-size: 13px;
  font-weight: 400;
  white-space: nowrap;
}

.book-choice-card strong {
  grid-area: title;
  min-width: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: normal;
}

.book-choice-card small {
  grid-area: meta;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.book-choice-arrow {
  grid-area: arrow;
  align-self: center;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(174, 188, 208, 0.8);
  border-radius: 50%;
  color: var(--blue);
  background: rgba(255, 255, 255, 0.72);
  font-size: 20px;
  line-height: 1;
}

.book-choice-card.active .book-choice-arrow,
.book-choice-card:hover .book-choice-arrow {
  border-color: rgba(36, 86, 214, 0.32);
  background: rgba(36, 86, 214, 0.08);
}

.active-book-summary {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.active-book-summary div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.active-book-summary span {
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
}

.active-book-summary strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdf-reader-layout {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}

.reader-side-panel {
  position: sticky;
  top: 88px;
  display: grid;
  gap: 12px;
}

.pdf-page-stage {
  min-height: 72vh;
  max-height: calc(100vh - 190px);
  overflow: auto;
  display: grid;
  gap: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #dfe5ee;
  scroll-behavior: smooth;
}

.pdf-page-frame {
  position: relative;
  width: min(980px, 100%);
  margin: 0 auto;
  background: white;
  box-shadow: 0 18px 36px rgba(19, 32, 51, 0.18);
}

.reader-pdf-page {
  width: 100%;
  height: auto;
  display: block;
}

.floating-page-label {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.86);
  font-size: 11px;
  font-weight: 800;
  pointer-events: none;
}

.pdf-interaction-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.pdf-hotspot {
  position: absolute;
  border: 1px solid transparent;
  padding: 0;
  background: transparent;
  pointer-events: auto;
}

.pdf-hotspot[data-selection-kind="heading"] {
  border-color: transparent;
  background: transparent;
}

.pdf-hotspot-label {
  position: absolute;
  left: 0;
  top: 0;
  max-width: 100%;
  overflow: hidden;
  padding: 2px 4px;
  color: #0f2e71;
  background: rgba(255, 255, 255, 0.88);
  font-size: 10px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdf-selection-hotspot {
  position: absolute;
  z-index: 10000;
  pointer-events: none;
  border-color: rgba(36, 86, 214, 0.9);
  border: 1px solid rgba(36, 86, 214, 0.9);
  background: rgba(36, 86, 214, 0.12);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.75);
}

.pdf-selection-hotspot[data-selection-kind="heading"] {
  border-color: rgba(21, 148, 107, 0.92);
  background: rgba(21, 148, 107, 0.14);
}

.pdf-selection-hotspot[data-selection-kind="fragment"] {
  border-style: dashed;
  border-color: rgba(191, 133, 28, 0.92);
  background: rgba(191, 133, 28, 0.14);
}

.pdf-hotspot.topic-selected {
  outline: 2px solid rgba(36, 86, 214, 0.72);
  outline-offset: 2px;
}

.debug-overlays .pdf-hotspot {
  border-color: rgba(36, 86, 214, 0.42);
  background: rgba(36, 86, 214, 0.08);
}

.debug-overlays .pdf-hotspot[data-selection-kind="heading"] {
  border-color: rgba(21, 148, 107, 0.72);
  background: rgba(21, 148, 107, 0.12);
}

.debug-overlays .pdf-hotspot.fragment {
  border-style: dashed;
  border-color: rgba(191, 133, 28, 0.64);
  background: rgba(191, 133, 28, 0.1);
}

.selection-debug {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
}

.selection-debug span {
  color: var(--cyan);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.selection-debug code {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-family: inherit;
  font-size: 12px;
  font-weight: 750;
}

.reader-debug-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f8fafc;
}

.reader-debug-grid {
  display: grid;
  gap: 10px;
}

.reader-debug-grid article {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(196, 205, 217, 0.7);
  border-radius: 8px;
  padding: 10px;
  background: white;
}

.reader-debug-grid strong {
  font-size: 13px;
}

.reader-debug-grid small {
  color: var(--muted);
  font-size: 12px;
}

.reader-debug-grid code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-family: inherit;
  font-size: 12px;
  line-height: 1.45;
}

.orion-chat-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: white;
}

.orion-chat-panel strong {
  font-size: 18px;
}

.orion-chat-panel p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.chat-toolbar {
  display: grid;
  gap: 8px;
}

.reader-chat-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

.reader-chat-expand-handle {
  position: absolute;
  left: -18px;
  top: 50%;
  z-index: 4;
  width: 24px;
  height: 72px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(17, 17, 17, 0.3);
  border-right: 0;
  border-radius: 999px 0 0 999px;
  color: #111111;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: -8px 0 20px rgba(17, 17, 17, 0.12);
  font-size: 18px;
  line-height: 1;
  transform: translateY(-50%);
}

.reader-chat-expand-handle:hover {
  border-color: #111111;
  background: #ffffff;
}

.reader-chat-thread {
  min-height: 220px;
  max-height: min(54vh, 520px);
  gap: 12px;
  padding-right: 3px;
}

.reader-chat-turn {
  gap: 9px;
}

.reader-chat-bubble {
  max-width: min(620px, 88%);
  gap: 8px;
  border-radius: 12px 12px 12px 4px;
  padding: 10px 12px;
}

.reader-chat-turn.user .reader-chat-bubble {
  border-radius: 12px 12px 4px 12px;
}

.reader-chat-message-content {
  display: grid;
  gap: 8px;
}

.reader-compose-panel {
  min-height: auto;
  grid-template-rows: auto;
  gap: 0;
  padding: 6px 7px 6px 16px;
}

.reader-input-row {
  grid-template-columns: minmax(0, 1fr) 36px;
  align-items: center;
  gap: 8px;
}

.reader-input-row input {
  min-height: 36px;
}

.reader-input-row button {
  width: 36px;
  height: 36px;
  font-size: 22px;
}

.chat-action-pill {
  min-height: 34px;
  width: fit-content;
  border: 1px solid rgba(36, 86, 214, 0.22);
  border-radius: 999px;
  padding: 0 12px;
  color: #1b3d8e;
  background: #edf3ff;
  font-size: 12px;
  font-weight: 850;
}

.chat-action-pill:disabled {
  opacity: 0.6;
}

.chat-context-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.chat-thread {
  max-height: 320px;
  overflow: auto;
  display: grid;
  gap: 10px;
  padding-right: 2px;
}

.chat-message {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(196, 205, 217, 0.7);
  border-radius: 8px;
  padding: 10px 12px;
  background: #f8fafc;
}

.chat-message.user {
  background: #edf3ff;
  border-color: rgba(36, 86, 214, 0.24);
}

.chat-message.error {
  background: #fff5f5;
  border-color: rgba(197, 48, 48, 0.22);
}

.chat-message span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.chat-message p {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.6;
}

.chat-message p strong {
  font-size: inherit;
  font-weight: 750;
  letter-spacing: 0;
}

.selected-topic-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(36, 86, 214, 0.2);
  border-left: 3px solid #2456d6;
  border-radius: 8px;
  padding: 9px 10px;
  background: #f8fbff;
}

.selected-topic-card div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.selected-topic-card strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-topic-card span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-topic-card button {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(36, 86, 214, 0.18);
  border-radius: 999px;
  color: var(--muted);
  background: white;
  font-size: 16px;
  line-height: 1;
}

.selected-topic-card button:hover {
  color: var(--ink);
  border-color: rgba(36, 86, 214, 0.34);
  background: #eef4ff;
}

.chat-compose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.chat-compose input {
  min-width: 0;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #f8fafc;
  font: inherit;
}

.chat-compose button {
  min-height: 38px;
  border-radius: 8px;
  padding: 0 12px;
  color: white;
  background: #2456d6;
  font-size: 13px;
  font-weight: 800;
}

.chat-compose button:disabled,
.chat-compose input:disabled {
  opacity: 0.65;
}

.chat-payload {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 10px;
  margin: 0;
  font-size: 12px;
}

.chat-payload dt {
  color: var(--muted);
  font-weight: 800;
}

.chat-payload dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.chunk-action-menu {
  position: fixed;
  z-index: 20000;
  width: max-content;
  max-width: min(340px, calc(100vw - 24px));
  display: block;
  border: 1px solid rgba(36, 86, 214, 0.18);
  border-radius: 999px;
  padding: 9px 14px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 32px rgba(19, 32, 51, 0.16);
  backdrop-filter: blur(16px);
}

.chunk-action-menu strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: #142033;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chunk-action-preview {
  display: grid;
  gap: 8px;
}

.chunk-preview-group {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(196, 205, 217, 0.78);
  border-radius: 6px;
  padding: 8px;
  background: #f8fafc;
}

.chunk-preview-group span {
  color: #0e2d69;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.chunk-preview-group p,
.chunk-preview-empty {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.45;
}

.chunk-action-menu button {
  min-height: 34px;
  border-radius: 6px;
  padding: 0 8px;
  color: var(--ink);
  background: transparent;
  font-size: 13px;
  font-weight: 750;
  text-align: left;
}

.chunk-action-menu button:hover {
  background: #eef4ff;
}

.study-chat-workspace,
.study-chat-detail {
  display: grid;
  gap: 16px;
}

.study-chat-grid,
.material-link-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.study-chat-card,
.material-link-card,
.official-chat-panel {
  min-height: 132px;
  display: grid;
  align-content: start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  color: var(--ink);
  background: white;
  text-align: left;
  box-shadow: 0 12px 30px rgba(19, 32, 51, 0.08);
}

.study-chat-card {
  background: linear-gradient(145deg, #2456d6, #0f9eaa);
  color: white;
}

.study-chat-card.personal {
  background: linear-gradient(145deg, #ed8a22, #c96412);
}

.study-chat-card span,
.material-link-card span {
  width: fit-content;
  border-radius: 999px;
  padding: 5px 8px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.study-chat-card strong,
.material-link-card strong {
  font-size: 18px;
}

.study-chat-card small {
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  font-weight: 750;
}

.official-chat-panel {
  min-height: auto;
}

.official-chat-panel h3 {
  margin: 0;
  font-size: 24px;
}

.official-chat-panel p,
.official-chat-panel small,
.material-link-card small {
  color: var(--muted);
  line-height: 1.55;
}

.official-chat-panel small {
  font-size: 13px;
  font-weight: 800;
}

.material-link-card {
  min-height: 150px;
}

.material-link-card span {
  color: white;
  background: var(--green);
}

.empty-state {
  min-height: 136px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  color: var(--muted);
  background: white;
  text-align: center;
}

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

@media (max-width: 760px) {
  .appbar,
  .hero-band,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .app-links {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .hero-band {
    min-height: 220px;
  }

  .hero-band h1 {
    font-size: 58px;
  }

  .blank-workspace {
    min-height: calc(100vh - 150px);
  }

  .mode-page {
    min-height: calc(100vh - 150px);
  }

  .pdf-reader-toolbar,
  .pdf-reader-layout {
    grid-template-columns: 1fr;
  }

  .pdf-reader-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .orion-chat-panel {
    position: static;
  }

  .study-chat-grid,
  .material-link-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .subject-card-grid,
  .mode-card-grid {
    grid-template-columns: 1fr;
  }
}

/* ORION workstation skin */
:root {
  --bg: #f8f8f6;
  --panel: #fbfbfa;
  --ink: #111111;
  --muted: #656565;
  --faint: #9b9b9b;
  --line: #cfcfca;
  --line-strong: #9f9f98;
  --blue: #1662b6;
  --cyan: #111111;
  --green: #168236;
  --red: #e53935;
  --orange: #f07716;
  --shadow: none;
  font-family: "MS LineDraw", "IBM Plex Mono", "Cascadia Mono", "Courier New", monospace;
}

body {
  color: var(--ink);
  background: var(--bg);
}

button,
input {
  font-family: inherit;
}

.orion-app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
}

.orion-sidebar {
  position: sticky;
  top: 0;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 36px;
  border-right: 1px solid var(--line);
  padding: 26px 22px 24px;
  background: rgba(251, 251, 250, 0.94);
}

.orion-main {
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
}

.brand-link {
  gap: 28px;
  color: var(--ink);
  font-size: 27px;
  font-weight: 400;
  letter-spacing: 0;
}

.brand-title {
  display: inline-flex;
  align-items: baseline;
  gap: 18px;
}

.brand-title small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border: 1px solid #000;
  border-radius: 6px;
  color: #fff;
  background: #050505;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.24);
  font-size: 20px;
  font-weight: 500;
}

.orion-mode-nav,
.orion-lower-nav {
  display: grid;
  align-content: start;
  gap: 14px;
}

.orion-lower-nav {
  align-self: end;
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

.side-nav-link {
  min-height: 56px;
  display: grid;
  grid-template-columns: 34px 30px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  border-radius: 4px;
  padding: 0 14px;
  color: var(--ink);
  text-decoration: none;
  background: transparent;
}

.side-nav-link.active {
  background: rgba(17, 17, 17, 0.055);
}

.side-nav-link:hover {
  background: rgba(17, 17, 17, 0.08);
}

.side-nav-link.muted {
  color: #202020;
}

.side-icon {
  font-size: 25px;
  line-height: 1;
}

.side-index {
  color: rgba(17, 17, 17, 0.72);
  text-decoration: none;
}

.core-card {
  position: relative;
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  margin-top: 26px;
  padding: 18px 16px;
  background: rgba(255, 255, 255, 0.42);
}

.core-card > span {
  font-size: 15px;
}

.core-card small {
  color: #333;
  font-size: 12px;
}

.core-card i {
  position: absolute;
  top: 26px;
  right: 24px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}

.appbar {
  position: sticky;
  min-height: 99px;
  padding: 24px 36px;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 251, 250, 0.88);
  box-shadow: none;
}

.app-links {
  gap: 10px;
}

.app-links a {
  min-height: 32px;
  border-color: var(--line);
  border-radius: 4px;
  color: #111;
  background: rgba(255, 255, 255, 0.34);
  font-size: 12px;
  font-weight: 400;
}

.top-status {
  display: grid;
  justify-items: end;
  gap: 10px;
  color: #111;
  font-size: 13px;
}

.system-status {
  position: relative;
  color: #111;
  font-size: 12px;
  font-weight: 400;
  text-transform: uppercase;
}

.system-status::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 9px;
  background: var(--green);
  vertical-align: 1px;
}

.hero-band {
  min-height: auto;
  display: block;
  padding: 38px 48px 16px;
}

.hero-band::after {
  content: "";
  display: block;
  border-bottom: 1px dashed #4d4d4d;
  margin-top: 34px;
}

.hero-band h1 {
  margin-top: 22px;
  font-size: 30px;
  line-height: 1;
  font-weight: 400;
  letter-spacing: 0;
}

.hero-copy {
  max-width: none;
  margin-top: 22px;
  color: #151515;
  font-size: 15px;
  line-height: 1.6;
}

.eyebrow {
  color: #111;
  font-size: 14px;
  font-weight: 400;
  text-transform: uppercase;
}

.hero-stats {
  display: none;
}

.orion-start,
.mode-page,
.blank-workspace {
  margin: 0;
  border: 0;
  border-radius: 0;
  padding: 24px 48px 44px;
  background: transparent;
  box-shadow: none;
}

.blank-workspace,
.mode-page {
  min-height: calc(100vh - 99px);
}

.section-heading,
.workspace-topbar {
  min-height: auto;
  margin-bottom: 26px;
  border-bottom: 0;
}

.workspace-topbar {
  display: grid;
  grid-template-columns: auto 1fr;
}

.section-heading h2,
.workspace-topbar h2,
.mode-heading h2,
.book-picker-heading h3 {
  margin-top: 8px;
  font-size: 26px;
  font-weight: 400;
}

.ghost-button {
  min-height: 34px;
  border-color: var(--line);
  border-radius: 4px;
  color: #111;
  background: rgba(255, 255, 255, 0.4);
  font-size: 13px;
  font-weight: 400;
}

.ghost-button:hover {
  border-color: var(--line-strong);
  background: rgba(17, 17, 17, 0.045);
}

.subject-card-grid,
.mode-card-grid {
  max-width: none;
  margin: 0;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 18px 32px;
}

.subject-card,
.mode-card {
  min-height: 74px;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  grid-template-rows: 1fr;
  align-items: center;
  gap: 22px;
  border: 1px solid var(--line);
  border-left: 2px solid #111;
  border-radius: 2px;
  padding: 0 24px;
  color: #111;
  background: rgba(255, 255, 255, 0.26);
  box-shadow: none;
  transition: none;
}

.subject-card:hover,
.subject-card.active,
.mode-card:hover {
  transform: none;
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.58);
  box-shadow: none;
}

.subject-card span,
.mode-card span {
  min-width: 0;
  padding: 0;
  border-radius: 0;
  color: #111;
  background: transparent;
  font-size: 30px;
  font-weight: 400;
}

.subject-card strong,
.mode-card strong {
  align-self: center;
  font-size: 16px;
  font-weight: 400;
}

.subject-card small,
.mode-card p {
  color: #111;
  font-size: 28px;
  line-height: 1;
}

.subject-card.green,
.subject-card.green:hover:not(:disabled) {
  border-left-color: #17a84b;
  background: rgba(255, 255, 255, 0.26);
}

.subject-card.blue,
.subject-card.blue:hover:not(:disabled),
.mode-card:first-child,
.mode-card:first-child:hover:not(:disabled) {
  border-left-color: #176fc2;
  background: rgba(255, 255, 255, 0.26);
}

.subject-card.red,
.subject-card.red:hover:not(:disabled) {
  border-left-color: #ef2d2d;
  background: rgba(255, 255, 255, 0.26);
}

.subject-card.orange,
.subject-card.orange:hover:not(:disabled),
.mode-card:last-child,
.mode-card:last-child:hover:not(:disabled) {
  border-left-color: #f07716;
  background: rgba(255, 255, 255, 0.26);
}

.book-picker,
.pdf-reader-toolbar,
.selection-debug,
.reader-debug-panel,
.orion-chat-panel,
.official-chat-panel,
.study-chat-card,
.material-link-card,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 2px;
  color: #111;
  background: rgba(255, 255, 255, 0.42);
  box-shadow: none;
}

.study-chat-card.personal {
  color: #111;
  background: rgba(255, 255, 255, 0.42);
}

.study-chat-card span,
.material-link-card span,
.book-choice-subject {
  border-radius: 2px;
  color: #111;
  background: rgba(255, 255, 255, 0.38);
  font-weight: 400;
}

.book-picker {
  padding: 20px;
}

.book-choice-card {
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.38);
  box-shadow: none;
}

.book-choice-card::after {
  border-radius: 0;
}

.book-choice-card:hover,
.book-choice-card.active {
  transform: none;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: none;
}

.book-choice-arrow {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.pdf-reader-layout {
  grid-template-columns: minmax(0, 1fr) 328px;
}

.pdf-page-stage {
  border-radius: 2px;
  background: #d9dde2;
}

.pdf-page-frame {
  box-shadow: 0 1px 0 rgba(17, 17, 17, 0.35);
}

.chat-action-pill,
.chat-compose button {
  border-radius: 2px;
  color: #111;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.54);
}

.chat-compose input {
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.58);
}

.chat-message,
.chat-message.user,
.chat-message.error {
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.44);
}

@media (max-width: 980px) {
  .subject-card-grid,
  .mode-card-grid,
  .pdf-reader-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .appbar,
  .hero-band,
  .orion-start,
  .mode-page,
  .blank-workspace {
    padding-left: 18px;
    padding-right: 18px;
  }

  .appbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand-link {
    font-size: 22px;
  }
}

/* Density + quieting pass */
body {
  color: rgba(17, 17, 17, 0.82);
  background: var(--bg);
}

.orion-app {
  grid-template-columns: 160px minmax(0, 1fr);
}

.orion-sidebar {
  gap: 16px;
  padding: 14px 8px 12px;
  background: rgba(251, 251, 250, 0.84);
}

.brand-link {
  gap: 10px;
  padding-left: 2px;
  font-size: 14px;
  opacity: 0.88;
}

.brand-title small {
  font-size: 9px;
  opacity: 0.74;
}

.brand-mark {
  width: 26px;
  height: 26px;
  font-size: 12px;
}

.orion-mode-nav,
.orion-lower-nav {
  gap: 6px;
}

.side-nav-link {
  min-height: 40px;
  grid-template-columns: 18px 22px minmax(0, 1fr);
  gap: 6px;
  padding: 0 7px;
  font-size: 11px;
  opacity: 0.86;
}

.side-icon {
  font-size: 14px;
}

.core-card {
  gap: 6px;
  margin-top: 10px;
  padding: 10px 9px;
  background: rgba(255, 255, 255, 0.28);
  opacity: 0.84;
}

.core-card > span {
  font-size: 11px;
}

.core-card small {
  font-size: 11px;
}

.core-card i {
  top: 21px;
  right: 18px;
  width: 5px;
  height: 5px;
}

.appbar {
  min-height: 76px;
  padding: 18px 32px;
  background: rgba(251, 251, 250, 0.76);
}

.app-links a {
  min-height: 28px;
  padding: 0 10px;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.24);
}

.top-status,
.system-status {
  font-size: 11px;
  opacity: 0.8;
}

.hero-band {
  padding: 30px 40px 12px;
}

.hero-band::after {
  margin-top: 28px;
  opacity: 0.6;
}

.hero-band h1 {
  margin-top: 18px;
  font-size: 25px;
  opacity: 0.88;
}

.hero-copy {
  margin-top: 18px;
  font-size: 13px;
  opacity: 0.82;
}

.eyebrow {
  font-size: 12px;
  opacity: 0.82;
}

.orion-start,
.mode-page,
.blank-workspace {
  padding: 20px 40px 36px;
}

.section-heading,
.workspace-topbar {
  margin-bottom: 20px;
}

.section-heading h2,
.workspace-topbar h2,
.mode-heading h2,
.book-picker-heading h3 {
  font-size: 22px;
}

.ghost-button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.28);
}

.subject-card-grid,
.mode-card-grid {
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 14px 26px;
}

.subject-card,
.mode-card {
  min-height: 62px;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 18px;
  padding: 0 18px;
  background: rgba(255, 255, 255, 0.16);
  opacity: 0.9;
}

.subject-card:hover,
.subject-card.active,
.mode-card:hover {
  background: rgba(255, 255, 255, 0.42);
}

.subject-card span,
.mode-card span {
  font-size: 24px;
}

.subject-card strong,
.mode-card strong {
  font-size: 14px;
}

.subject-card small,
.mode-card p {
  font-size: 22px;
}

.book-picker,
.pdf-reader-toolbar,
.selection-debug,
.reader-debug-panel,
.orion-chat-panel,
.official-chat-panel,
.study-chat-card,
.material-link-card,
.empty-state {
  background: rgba(255, 255, 255, 0.28);
  opacity: 0.92;
}

.book-picker {
  padding: 16px;
}

.book-choice-card {
  min-height: 58px;
  padding: 10px 11px;
  background: rgba(255, 255, 255, 0.26);
}

.book-choice-card strong,
.active-book-summary strong {
  font-size: 13px;
}

.book-choice-card small,
.active-book-summary span,
.chat-context-label {
  font-size: 11px;
}

.pdf-reader-layout {
  grid-template-columns: minmax(0, 1fr) 258px;
  gap: 14px;
}

.pdf-reader-workspace.chat-expanded .pdf-reader-layout {
  grid-template-columns: minmax(0, 1fr) 258px;
}

.pdf-reader-workspace.chat-expanded .reader-side-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 25;
  width: clamp(520px, 64%, 760px);
}

.pdf-reader-workspace.chat-expanded .orion-chat-panel {
  height: 100%;
  max-height: calc(100vh - 158px);
  border-left-width: 3px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: -24px 0 42px rgba(17, 17, 17, 0.18);
  backdrop-filter: blur(14px);
}

.reader-side-panel {
  top: 78px;
  gap: 9px;
}

.pdf-reader-toolbar {
  padding: 10px;
}

.pdf-page-stage {
  max-height: calc(100vh - 158px);
  gap: 20px;
  padding: 14px;
}

.selection-debug,
.reader-debug-panel,
.orion-chat-panel {
  padding: 10px;
}

.reader-debug-grid article,
.chat-message {
  padding: 8px;
}

.reader-debug-grid strong,
.orion-chat-panel strong,
.study-chat-card strong,
.material-link-card strong {
  font-size: 13px;
}

.reader-debug-grid small,
.reader-debug-grid code,
.orion-chat-panel p,
.chat-message p,
.chat-payload,
.chunk-action-menu button {
  font-size: 11px;
}

.chat-thread {
  max-height: 250px;
}

/* Active Ambientes dashboard */
.active-env-panel {
  display: grid;
  grid-column: 1 / -1;
  gap: 18px;
  min-width: 0;
  width: 100%;
}

.active-env-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: rgba(17, 17, 17, 0.74);
  font-size: 11px;
}

.active-env-toolbar::after {
  content: "";
  flex: 1;
  order: 1;
  border-top: 1px dashed rgba(17, 17, 17, 0.34);
}

.active-env-toolbar .eyebrow {
  order: 0;
}

.active-env-toolbar span {
  order: 2;
  white-space: nowrap;
}

.active-env-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.env-type-section {
  display: grid;
  gap: 12px;
}

.env-type-section header {
  min-height: 28px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(17, 17, 17, 0.72);
  font-size: 11px;
}

.env-type-section header::after {
  content: "";
  flex: 1;
  border-top: 1px dashed rgba(17, 17, 17, 0.22);
}

.env-type-section header small {
  order: 3;
  min-width: 24px;
  color: rgba(17, 17, 17, 0.54);
  text-align: right;
}

.env-card-shell,
.study-chat-card-shell {
  position: relative;
}

.env-card-shell,
.env-card,
.new-env-card {
  box-sizing: border-box;
  min-width: 0;
  width: 100%;
  min-height: 196px;
  height: 196px;
}

.env-card,
.new-env-card {
  position: relative;
  border: 1px solid rgba(17, 17, 17, 0.16);
  border-left: 4px solid #176fc2;
  border-radius: 5px;
  padding: 16px 20px 18px;
  color: rgba(17, 17, 17, 0.9);
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.76) 44%, rgba(255, 255, 255, 0.64)),
    rgba(255, 255, 255, 0.74);
  box-shadow: 0 10px 26px rgba(17, 17, 17, 0.06);
  text-align: left;
  text-decoration: none;
  opacity: 1;
  overflow: hidden;
}

.env-card:hover,
.new-env-card:hover {
  border-color: rgba(17, 17, 17, 0.28);
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.84) 44%, rgba(255, 255, 255, 0.72)),
    rgba(255, 255, 255, 0.8);
  box-shadow: 0 14px 28px rgba(17, 17, 17, 0.1);
}

.env-card.theme-green {
  border-left-color: #3f8d49;
}

.env-card.theme-blue {
  border-left-color: #2f5fb8;
}

.env-card.theme-red {
  border-left-color: #b84b58;
}

.env-card.theme-orange {
  border-left-color: #b5791c;
}

.env-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 22px;
  border: 2px solid rgba(17, 17, 17, 0.1);
  border-radius: 3px;
  padding: 0 7px;
  color: rgba(17, 17, 17, 0.72);
  background: rgba(255, 255, 255, 0.88);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.env-card.theme-green .env-code {
  border-color: rgba(63, 141, 73, 0.44);
  color: #316b38;
  background: rgba(63, 141, 73, 0.12);
}

.env-card.theme-blue .env-code {
  border-color: rgba(47, 95, 184, 0.42);
  color: #244a93;
  background: rgba(47, 95, 184, 0.12);
}

.env-card.theme-red .env-code {
  border-color: rgba(184, 75, 88, 0.42);
  color: #983847;
  background: rgba(184, 75, 88, 0.12);
}

.env-card.theme-orange .env-code {
  border-color: rgba(181, 121, 28, 0.42);
  color: #8b5b10;
  background: rgba(181, 121, 28, 0.12);
}

.env-id,
.env-menu {
  position: absolute;
  top: 22px;
  color: rgba(17, 17, 17, 0.58);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.study-chat-card {
  width: 100%;
}

.env-id {
  right: 40px;
}

.env-menu {
  right: 22px;
}

.env-title-block {
  min-width: 0;
  max-width: 100%;
  margin-top: 18px;
}

.env-card strong {
  display: block;
  max-width: 100%;
  color: rgba(17, 17, 17, 0.88);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.env-card em {
  display: block;
  max-width: 100%;
  margin-top: 4px;
  color: rgba(17, 17, 17, 0.86);
  font-size: 12px;
  font-style: normal;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.env-divider {
  display: block;
  margin: 16px 0 12px;
  border-top: 1px dashed rgba(17, 17, 17, 0.24);
}

.env-meta-group + .env-meta-group {
  margin-top: 10px;
}

.env-meta-inline {
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
}

.env-meta-inline span {
  color: rgba(17, 17, 17, 0.5);
  font-size: 10px;
}

.env-card small {
  display: block;
  color: rgba(17, 17, 17, 0.5);
  font-size: 9px;
  letter-spacing: 0.02em;
}

.env-card p {
  margin: 4px 0 0;
  color: rgba(17, 17, 17, 0.8);
  font-size: 12px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.env-meta-inline small,
.env-meta-inline p {
  min-width: 0;
  margin: 0;
}

.env-card footer {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 18px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: rgba(17, 17, 17, 0.56);
  font-size: 10px;
  letter-spacing: 0.02em;
}

.env-delete-button {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0;
  color: rgba(17, 17, 17, 0.42);
  background: transparent;
  font-size: 14px;
  line-height: 1;
  opacity: 0.72;
}

.env-delete-button:hover {
  color: rgba(17, 17, 17, 0.88);
  border-color: rgba(17, 17, 17, 0.16);
  background: rgba(255, 255, 255, 0.86);
  opacity: 1;
}

.new-env-card {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  border: none;
  overflow: hidden;
  background: transparent;
  box-shadow: none;
}

.new-env-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 5px;
  pointer-events: none;
  background:
    repeating-linear-gradient(to right, rgba(17, 17, 17, 0.18) 0 4px, transparent 4px 8px) top / calc(100% - 8px) 1px no-repeat,
    repeating-linear-gradient(to bottom, rgba(17, 17, 17, 0.18) 0 4px, transparent 4px 8px) right 0 top 4px / 1px calc(100% - 8px) no-repeat,
    repeating-linear-gradient(to right, rgba(17, 17, 17, 0.18) 0 4px, transparent 4px 8px) bottom / calc(100% - 8px) 1px no-repeat,
    repeating-linear-gradient(to bottom, rgba(17, 17, 17, 0.18) 0 4px, transparent 4px 8px) left 0 top 4px / 1px calc(100% - 8px) no-repeat;
}

.new-env-card strong {
  font-size: 36px;
  font-weight: 400;
}

.new-env-card span {
  min-width: 0;
  max-width: 100%;
  color: rgba(17, 17, 17, 0.62);
  font-size: 14px;
  overflow-wrap: anywhere;
  text-align: center;
}

.recent-env-list {
  display: grid;
  border: 1px solid rgba(17, 17, 17, 0.18);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.18);
}

.recent-env-list header,
.recent-env-list button {
  min-height: 30px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(17, 17, 17, 0.12);
  padding: 0 12px;
  color: rgba(17, 17, 17, 0.72);
  background: transparent;
  font-size: 11px;
  text-align: left;
}

.recent-env-list header {
  grid-template-columns: minmax(0, 1fr) auto;
  color: rgba(17, 17, 17, 0.82);
}

.recent-env-list a {
  text-decoration: none;
}

.recent-env-list button:last-child {
  border-bottom: 0;
}

.recent-env-list button span {
  width: fit-content;
  border: 1px solid rgba(17, 17, 17, 0.18);
  padding: 2px 5px;
}

.recent-env-list button strong {
  min-width: 0;
  overflow: hidden;
  font-size: 11px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-env-list button small {
  min-width: 0;
  overflow: hidden;
  color: rgba(17, 17, 17, 0.58);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1160px) {
  .active-env-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .active-env-grid,
  .recent-env-list header,
  .recent-env-list button {
    grid-template-columns: 1fr;
  }
}

.chat-compose input,
.chat-compose button,
.chat-action-pill {
  min-height: 30px;
  font-size: 11px;
}

.subject-card .subject-mark {
  position: relative;
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
}

.subject-card .subject-mark[data-subject="BIOLOGIA"],
.subject-card .subject-mark[data-subject="PORTUGUES"],
.subject-card .subject-mark[data-subject="GEOGRAFIA"] {
  color: rgba(17, 17, 17, 0.86);
  font-size: 0;
}

.subject-card .subject-mark[data-subject="BIOLOGIA"]::before {
  content: "";
  width: 20px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 100% 0 100% 0;
  transform: rotate(-34deg);
}

.subject-card .subject-mark[data-subject="BIOLOGIA"]::after {
  content: "";
  position: absolute;
  width: 15px;
  height: 2px;
  background: currentColor;
  transform: rotate(-34deg);
  transform-origin: center;
}

.subject-card .subject-mark[data-subject="PORTUGUES"]::before {
  content: "";
  width: 21px;
  height: 6px;
  border: 2px solid currentColor;
  border-radius: 2px;
  transform: rotate(-42deg);
}

.subject-card .subject-mark[data-subject="PORTUGUES"]::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 2px;
  background: currentColor;
  transform: rotate(-42deg) translate(-2px, 8px);
}

.subject-card .subject-mark[data-subject="GEOGRAFIA"]::before {
  content: "";
  width: 22px;
  height: 22px;
  border: 2px solid currentColor;
  border-radius: 50%;
  background:
    linear-gradient(currentColor, currentColor) 50% 0 / 2px 100% no-repeat,
    linear-gradient(currentColor, currentColor) 0 50% / 100% 2px no-repeat;
}

.subject-card .subject-mark[data-subject="GEOGRAFIA"]::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 22px;
  border: 1.5px solid currentColor;
  border-top: 0;
  border-bottom: 0;
  border-radius: 50%;
}

@media (max-width: 980px) {
  .pdf-reader-layout,
  .subject-card-grid,
  .mode-card-grid {
    grid-template-columns: 1fr;
  }
}

/* Readability pass */
:root {
  --muted: #4d4d4d;
  --faint: #707070;
  --dot-grid: rgba(124, 124, 124, 0.13);
}

body {
  color: #111111;
  background:
    radial-gradient(circle at 1px 1px, var(--dot-grid) 1px, transparent 1.4px) 0 0 / 28px 28px,
    var(--bg);
  font-family: "IBM Plex Mono", "Cascadia Mono", "Courier New", monospace;
  font-weight: 500;
  -webkit-font-smoothing: auto;
  text-rendering: optimizeLegibility;
}

button,
input {
  font-weight: 500;
}

.orion-chat-panel {
  position: relative;
  border: 2px solid rgba(17, 17, 17, 0.48);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.045);
}

.orion-chat-panel::before {
  content: "";
  position: absolute;
  top: -2px;
  right: -2px;
  left: -2px;
  height: 4px;
  background: #111111;
}

.orion-chat-panel strong {
  font-size: 14px;
  letter-spacing: 0;
}

.chat-thread {
  min-height: 210px;
}

.reader-chat-thread {
  min-height: 220px;
  max-height: min(56vh, 520px);
}

.orion-chat-panel.expanded .reader-chat-thread {
  max-height: calc(100vh - 318px);
}

.chat-compose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 6px;
  border: 1px solid rgba(17, 17, 17, 0.4);
  background: #ffffff;
}

.chat-compose:focus-within {
  border-color: #111111;
  box-shadow: 0 0 0 2px rgba(17, 17, 17, 0.1);
}

.chat-compose input {
  min-height: 40px;
  border: 0;
  background: #ffffff;
}

.chat-compose input:focus {
  outline: 0;
}

.chat-compose button {
  min-height: 40px;
  color: #ffffff;
  border-color: #111111;
  background: #111111;
}

.chat-action-pill {
  border-color: rgba(17, 17, 17, 0.36);
  background: rgba(255, 255, 255, 0.9);
}

.reader-chat-header .eyebrow {
  margin: 0;
}

.reader-chat-toolbar {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}

.reader-chat-toolbar .chat-context-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reader-chat-bubble {
  border-color: rgba(17, 17, 17, 0.18);
  border-radius: 12px 12px 12px 4px;
  padding: 10px 12px;
  box-shadow: none;
}

.reader-chat-turn.user .reader-chat-bubble {
  border-color: #111111;
  border-radius: 12px 12px 4px 12px;
  color: #ffffff;
  background: #111111;
}

.reader-chat-bubble p,
.reader-chat-bubble .ambiente-chat-list {
  font-size: 12px;
}

.ambiente-compose-panel.reader-compose-panel {
  min-height: auto;
  grid-template-rows: auto;
  gap: 0;
  border-color: rgba(17, 17, 17, 0.4);
  border-radius: 22px;
  padding: 6px 7px 6px 16px;
  background: #ffffff;
}

.ambiente-compose-panel.reader-compose-panel:focus-within {
  border-color: #111111;
  box-shadow: 0 0 0 2px rgba(17, 17, 17, 0.08);
}

.ambiente-input-row.reader-input-row {
  grid-template-columns: minmax(0, 1fr) 36px;
  align-items: center;
  gap: 8px;
}

.ambiente-input-row.reader-input-row input {
  min-height: 36px;
  border-bottom: 0;
}

.ambiente-input-row.reader-input-row input:focus {
  border-bottom: 0;
}

.ambiente-input-row.reader-input-row button {
  width: 36px;
  height: 36px;
  border-color: #111111;
  border-radius: 999px;
  color: #ffffff;
  background: #111111;
  font-size: 22px;
}

.selected-topic-card {
  border-color: rgba(17, 17, 17, 0.36);
  border-left-color: #111111;
  background: rgba(255, 255, 255, 0.92);
}

.selected-topic-card strong {
  font-size: 12px;
}

.selected-topic-card button {
  border-color: rgba(17, 17, 17, 0.28);
}

@media (max-width: 980px) {
  .pdf-reader-workspace.chat-expanded .pdf-reader-layout {
    grid-template-columns: 1fr;
  }

  .pdf-reader-workspace.chat-expanded .reader-side-panel {
    position: relative;
    inset: auto;
    width: 100%;
  }

  .pdf-reader-workspace.chat-expanded .orion-chat-panel {
    max-height: none;
  }
}

.subject-card-grid {
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 14px 26px;
}

.subject-card {
  min-height: 62px;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 18px;
  border-left-width: 4px;
  padding: 0 18px;
  background: #ffffff;
  opacity: 1;
}

.subject-card:hover,
.subject-card.active {
  background: #ffffff;
}

.subject-card.green,
.subject-card.green:hover:not(:disabled),
.subject-card.blue,
.subject-card.blue:hover:not(:disabled),
.subject-card.red,
.subject-card.red:hover:not(:disabled),
.subject-card.orange,
.subject-card.orange:hover:not(:disabled) {
  background: #ffffff;
}

.subject-card span {
  font-size: 24px;
}

.subject-card strong {
  font-size: 14px;
}

.subject-card small {
  font-size: 22px;
}

.brand-link,
.side-nav-link,
.core-card,
.top-status,
.system-status,
.hero-band h1,
.hero-copy,
.eyebrow,
.subject-card,
.mode-card,
.book-picker,
.pdf-reader-toolbar,
.selection-debug,
.reader-debug-panel,
.orion-chat-panel,
.official-chat-panel,
.study-chat-card,
.material-link-card,
.empty-state,
.env-card,
.new-env-card {
  opacity: 1;
}

.brand-link,
.hero-band h1,
.section-heading h2,
.workspace-topbar h2,
.mode-heading h2,
.book-picker-heading h3,
.subject-card strong,
.mode-card strong,
.book-choice-card strong,
.active-book-summary strong,
.reader-debug-grid strong,
.orion-chat-panel strong,
.study-chat-card strong,
.material-link-card strong,
.official-chat-panel h3,
.env-card strong,
.recent-env-list button strong {
  font-weight: 600;
}

/* Material collections behave like the two quiet ears of one paper folder. */
.book-picker {
  --library-folder-border: rgba(17, 17, 17, 0.16);
  --library-folder-surface: #fdfdfd;
  position: relative;
  margin-top: 32px;
  overflow: visible;
  border-color: var(--library-folder-border);
  border-top-left-radius: 0;
  background: var(--library-folder-surface);
}

.book-picker .library-material-tabs {
  position: absolute;
  z-index: 2;
  top: -32px;
  left: -1px;
  width: auto;
  max-width: calc(100% + 2px);
  height: 32px;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
}

.book-picker .library-material-tabs button {
  position: relative;
  min-height: 31px;
  height: 31px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(17, 17, 17, 0.11);
  border-bottom-color: var(--library-folder-border);
  border-radius: 7px 7px 0 0;
  padding: 0 17px;
  color: rgba(17, 17, 17, 0.43);
  background: rgba(17, 17, 17, 0.025);
  font: inherit;
  font-size: 10px;
  font-weight: 520;
  letter-spacing: 0.025em;
  box-shadow: none;
  cursor: pointer;
  transition: color 140ms ease, background 140ms ease, border-color 140ms ease;
}

.book-picker .library-material-tabs button.active {
  z-index: 1;
  color: rgba(17, 17, 17, 0.7);
  border-color: var(--library-folder-border);
  border-bottom-color: transparent;
  background: var(--library-folder-surface);
}

.book-picker .library-material-tabs button.active::after {
  /* The opaque bridge hides the panel border under the selected tab. */
  content: "";
  position: absolute;
  right: 0;
  bottom: -2px;
  left: 0;
  height: 3px;
  background: var(--library-folder-surface);
}

.book-picker .library-material-tabs button:hover:not(:disabled):not(.active) {
  color: rgba(17, 17, 17, 0.68);
  border-color: rgba(17, 17, 17, 0.2);
  background: rgba(255, 255, 255, 0.44);
}

.book-picker .library-material-tabs button:disabled {
  opacity: 0.3;
  cursor: default;
}

.book-picker .library-material-tabs button:focus-visible {
  outline: 2px solid rgba(17, 17, 17, 0.58);
  outline-offset: 2px;
}

.book-choice-card:focus-visible {
  outline: 2px solid #176fc2;
  outline-offset: 2px;
}

.app-links a,
.system-status,
.ghost-button,
.subject-card span,
.subject-card small,
.mode-card span,
.mode-card p,
.book-choice-number,
.book-choice-card small,
.active-book-summary span,
.chat-context-label,
.reader-debug-grid small,
.reader-debug-grid code,
.orion-chat-panel p,
.chat-message span,
.chat-message p,
.chat-payload,
.chunk-action-menu button,
.env-card em,
.env-card p,
.env-card footer,
.recent-env-list header,
.recent-env-list button,
.recent-env-list button small {
  font-weight: 500;
}

.brand-title small,
.side-index,
.core-card small,
.top-status,
.hero-copy,
.book-choice-card small,
.active-book-summary span,
.chat-context-label,
.active-env-toolbar,
.env-id,
.env-menu,
.env-card small,
.env-card footer,
.new-env-card span,
.recent-env-list button small {
  color: #4d4d4d;
}

.orion-sidebar .brand-link,
.orion-sidebar .side-nav-link,
.orion-sidebar .side-index {
  color: #111111;
  font-weight: 650;
}

.orion-sidebar .brand-title small {
  color: #111111;
  font-weight: 600;
}

.env-modal-open {
  overflow: hidden;
}

.env-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(17, 17, 17, 0.3);
  backdrop-filter: blur(9px) saturate(0.72);
}

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

.env-modal {
  width: min(860px, calc(100vw - 40px));
  max-height: calc(100vh - 56px);
  display: grid;
  gap: 0;
  overflow: auto;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 12px;
  padding: 32px 40px 36px;
  color: #111111;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 26px 80px rgba(17, 17, 17, 0.18);
}

.env-modal-compact {
  width: min(520px, calc(100vw - 40px));
  padding-bottom: 28px;
}

.env-modal-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 20px;
  padding: 4px 0 28px;
  border-bottom: 1px dashed rgba(17, 17, 17, 0.32);
}

.env-modal-icon {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  color: rgba(17, 17, 17, 0.58);
  font-size: 31px;
  line-height: 1;
}

.env-modal-header h2 {
  margin: 0;
  font-size: 23px;
  font-weight: 650;
  letter-spacing: 0;
}

.env-modal-header p {
  margin-top: 18px;
  color: rgba(17, 17, 17, 0.72);
  font-size: 13px;
}

.env-modal-close {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border: 0;
  color: #111111;
  background: transparent;
  font-size: 33px;
  font-weight: 300;
  line-height: 1;
}

.env-modal-section {
  position: relative;
  display: grid;
  gap: 16px;
  padding: 30px 0;
  border-bottom: 1px dashed rgba(17, 17, 17, 0.32);
}

.env-modal-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: #111111;
  font-size: 13px;
  font-weight: 650;
}

.env-modal-row span span,
.env-modal-row label span {
  color: #176fc2;
  font-weight: 650;
}

.env-modal input,
.env-modal select,
.env-modal textarea {
  width: 100%;
  border: 1px solid rgba(17, 17, 17, 0.22);
  border-radius: 5px;
  padding: 0 18px;
  color: #111111;
  background: rgba(255, 255, 255, 0.72);
  font: inherit;
  font-size: 14px;
}

.env-modal input,
.env-modal select {
  min-height: 56px;
}

.env-modal select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 48px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%23555555' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
  background-size: 12px 8px;
}

.env-modal textarea {
  min-height: 134px;
  padding-top: 16px;
  padding-bottom: 28px;
  resize: vertical;
}

.env-modal input:focus,
.env-modal select:focus,
.env-modal textarea:focus {
  outline: 0;
  border-color: #176fc2;
  box-shadow: 0 0 0 2px rgba(23, 111, 194, 0.12);
}

.env-modal-range {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 20px;
}

.env-modal-range-field {
  display: grid;
  gap: 8px;
}

.env-modal-range label {
  color: #111111;
  font-size: 11px;
  font-weight: 700;
}

.env-modal-range-field input {
  width: 100%;
}

.env-modal-range > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  color: rgba(17, 17, 17, 0.62);
  font-size: 24px;
  line-height: 1;
  letter-spacing: 0;
  transform: translateY(10px);
}

.env-modal-range-hint {
  margin: -4px 0 0;
  color: rgba(17, 17, 17, 0.58);
  font-size: 11px;
}

.env-modal output {
  position: absolute;
  right: 16px;
  bottom: 42px;
  color: rgba(17, 17, 17, 0.58);
  font-size: 12px;
}

.env-modal-toggle {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  font-size: 13px;
}

.env-modal-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.env-modal-toggle > span {
  width: 58px;
  height: 30px;
  position: relative;
  border: 1px solid rgba(17, 17, 17, 0.24);
  border-radius: 999px;
  background: #ffffff;
}

.env-modal-toggle > span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(17, 17, 17, 0.28);
  transition: transform 140ms ease, background 140ms ease;
}

.env-modal-toggle input:checked + span {
  border-color: #176fc2;
}

.env-modal-toggle input:checked + span::after {
  transform: translateX(28px);
  background: #176fc2;
}

.env-modal-toggle strong {
  font-size: 13px;
  font-weight: 650;
}

.env-modal-note {
  margin-left: 74px;
  color: rgba(17, 17, 17, 0.58);
  font-size: 12px;
}

.env-modal-submit {
  min-height: 58px;
  display: inline-grid;
  grid-auto-flow: column;
  place-content: center;
  gap: 18px;
  margin-top: 30px;
  border: 1px solid #176fc2;
  border-radius: 5px;
  color: #176fc2;
  background: rgba(255, 255, 255, 0.74);
  font-size: 20px;
  font-weight: 650;
  letter-spacing: 0.08em;
}

.env-modal-submit:hover {
  color: #ffffff;
  background: #176fc2;
}

.env-modal-status {
  min-height: 18px;
  margin-top: 12px;
  color: rgba(17, 17, 17, 0.72);
  font-size: 12px;
  text-align: center;
}

.env-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 28px;
}

.env-modal-cancel,
.env-modal-danger {
  min-height: 48px;
  border-radius: 5px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 650;
}

.env-modal-cancel {
  border: 1px solid rgba(17, 17, 17, 0.18);
  color: #111111;
  background: rgba(255, 255, 255, 0.72);
}

.env-modal-danger {
  border: 1px solid #111111;
  color: #ffffff;
  background: #111111;
}

.env-modal-danger:hover {
  background: #2d2d2d;
}

.feedback-modal {
  width: min(560px, calc(100vw - 40px));
}

.feedback-modal-header {
  border-bottom-color: rgba(17, 17, 17, 0.24);
}

.feedback-modal-icon {
  border: 1px solid rgba(17, 17, 17, 0.28);
  border-radius: 5px;
  color: #111111;
  font-size: 13px;
  font-weight: 650;
}

.feedback-modal-section {
  padding: 26px 0;
  border-bottom-color: rgba(17, 17, 17, 0.24);
}

.feedback-count {
  position: absolute;
  right: 0;
  bottom: 26px;
  color: rgba(17, 17, 17, 0.58);
  font-size: 12px;
}

.feedback-privacy {
  margin: 24px 0 0;
  color: rgba(17, 17, 17, 0.62);
  font-size: 12px;
}

.feedback-submit {
  border-color: #111111;
  color: #111111;
  background: rgba(255, 255, 255, 0.74);
  font-size: 15px;
  letter-spacing: 0.06em;
}

.feedback-submit:hover:not(:disabled) {
  border-color: var(--green);
  color: #ffffff;
  background: var(--green);
}

.feedback-submit:disabled {
  color: rgba(17, 17, 17, 0.46);
  border-color: rgba(17, 17, 17, 0.18);
  background: rgba(255, 255, 255, 0.46);
  cursor: wait;
}

.feedback-status {
  min-height: 20px;
}

@media (max-width: 560px) {
  .feedback-modal {
    width: min(100%, calc(100vw - 24px));
    padding: 24px 22px 28px;
  }
}

.side-icon {
  position: relative;
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  color: #111111;
  font-size: 0;
}

.side-icon::before,
.side-icon::after {
  content: "";
  position: absolute;
  box-sizing: border-box;
}

.side-icon-env::before {
  width: 11px;
  height: 11px;
  border: 1.5px solid currentColor;
}

.side-icon-library::before {
  width: 14px;
  height: 13px;
  border: 1.5px solid currentColor;
}

.side-icon-library::after {
  width: 8px;
  height: 1.5px;
  background: currentColor;
  box-shadow:
    0 -4px 0 currentColor,
    0 4px 0 currentColor;
}

.side-icon-config::before {
  width: 14px;
  height: 14px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}

.side-icon-config::after {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

.side-icon-morphos::before {
  width: 13px;
  height: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translate(-1px, -1px) skewX(-12deg);
}

.side-icon-morphos::after {
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translate(3px, 2px) rotate(-45deg);
}

.subject-card .subject-mark {
  color: rgba(17, 17, 17, 0.88);
}

.subject-card .subject-mark:not([data-subject="BIOLOGIA"]):not([data-subject="PORTUGUES"]):not([data-subject="GEOGRAFIA"]) {
  font-size: 11px;
  font-weight: 700;
}

/* Ambiente mockup shell */
:root {
  --bg: #fbfbfa;
  --panel: rgba(255, 255, 255, 0.42);
  --ink: #0d0d0d;
  --muted: #575757;
  --faint: #8c8c8c;
  --line: #d5d5d0;
  --line-strong: #b9b9b2;
  --green: #4d8b45;
}

body {
  color: var(--ink);
  background:
    radial-gradient(circle at 1px 1px, var(--dot-grid) 1px, transparent 1.6px) 0 0 / 34px 34px,
    var(--bg);
  font-family: "IBM Plex Mono", "Cascadia Mono", "Courier New", monospace;
  font-size: 14px;
  font-weight: 500;
}

.class-code-gate {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 1px 1px, var(--dot-grid) 1px, transparent 1.6px) 0 0 / 34px 34px,
    var(--bg);
}

.class-code-gate[hidden] {
  display: none;
}

.mobile-wip-notice {
  display: none;
}

.mobile-wip-notice[hidden] {
  display: none !important;
}

body.mobile-wip-notice-open {
  overflow: hidden;
}

body.mobile-wip-notice-open .orion-app {
  filter: blur(3px) saturate(0.86);
  opacity: 0.58;
  pointer-events: none;
  user-select: none;
}

.mobile-wip-notice:not([hidden]) {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  place-items: center;
  padding:
    max(20px, env(safe-area-inset-top))
    max(18px, env(safe-area-inset-right))
    max(20px, env(safe-area-inset-bottom))
    max(18px, env(safe-area-inset-left));
  background: rgba(251, 251, 250, 0.94);
  backdrop-filter: blur(10px) saturate(80%);
  -webkit-backdrop-filter: blur(10px) saturate(80%);
  overscroll-behavior: contain;
  animation: mobile-wip-backdrop-in 180ms ease-out both;
}

.mobile-wip-notice-card {
  width: min(100%, 410px);
  display: grid;
  gap: 15px;
  border: 1px solid rgba(17, 17, 17, 0.13);
  border-radius: 22px;
  padding: 24px;
  color: #111111;
  background:
    linear-gradient(145deg, #ffffff, #fafafa),
    #ffffff;
  box-shadow:
    0 28px 80px rgba(17, 24, 39, 0.18),
    0 4px 18px rgba(17, 24, 39, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.96);
  animation: mobile-wip-card-in 230ms cubic-bezier(0.22, 0.8, 0.24, 1) both;
}

.mobile-wip-notice-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(77, 139, 69, 0.24);
  border-radius: 13px;
  color: var(--green);
  background: rgba(77, 139, 69, 0.075);
}

.mobile-wip-notice-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mobile-wip-notice-eyebrow,
.mobile-wip-notice-card h2,
.mobile-wip-notice-copy p {
  margin: 0;
}

.mobile-wip-notice-eyebrow {
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.mobile-wip-notice-card h2 {
  max-width: 18ch;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.025em;
}

.mobile-wip-notice-copy {
  display: grid;
  gap: 10px;
  color: rgba(17, 17, 17, 0.67);
  font-size: 13px;
  line-height: 1.55;
}

.mobile-wip-notice-open {
  min-height: 40px;
  justify-self: end;
  margin-top: 14px;
  border: 1px solid rgba(17, 17, 17, 0.2);
  border-radius: 11px;
  padding: 0 16px;
  color: var(--green);
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(17, 24, 39, 0.06);
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  touch-action: manipulation;
}

.mobile-wip-notice-open:focus-visible {
  outline: 3px solid rgba(77, 139, 69, 0.2);
  outline-offset: 3px;
}

@keyframes mobile-wip-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes mobile-wip-card-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-wip-notice:not([hidden]),
  .mobile-wip-notice-card {
    animation: none;
  }
}

.class-code-card {
  width: min(430px, 100%);
  display: grid;
  gap: 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 5px;
  padding: 30px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 16px 42px rgba(17, 17, 17, 0.08);
}

.class-code-card h1,
.class-code-card p {
  margin: 0;
}

.class-code-card h1 {
  font-size: 28px;
  line-height: 1.1;
}

.class-code-card p {
  color: rgba(17, 17, 17, 0.68);
}

.class-code-card label {
  margin-top: 8px;
  color: #111111;
  font-size: 13px;
  font-weight: 650;
}

.class-code-card input {
  min-height: 50px;
  border: 1px solid rgba(17, 17, 17, 0.22);
  border-radius: 5px;
  padding: 0 16px;
  color: #111111;
  background: #ffffff;
  font: inherit;
}

.class-code-card input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(77, 139, 69, 0.12);
}

.class-code-card button {
  min-height: 50px;
  border: 1px solid #111111;
  border-radius: 5px;
  color: #111111;
  background: #ffffff;
  font: inherit;
  font-weight: 650;
}

.class-code-card button:hover {
  border-color: var(--green);
  color: #ffffff;
  background: var(--green);
}

.class-code-card button:disabled {
  opacity: 0.58;
  cursor: wait;
}

.class-code-status {
  min-height: 20px;
  color: #8f1d1d !important;
  font-size: 12px;
}

.orion-app {
  grid-template-columns: 244px minmax(0, 1fr);
}

.orion-sidebar {
  height: 100vh;
  gap: 20px;
  padding: 18px 14px 16px;
  background: rgba(251, 251, 250, 0.9);
  overflow-y: auto;
}

.orion-sidebar-navigation {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 20px;
}

.brand-link {
  gap: 12px;
  padding-left: 2px;
  font-size: 17px;
  line-height: 1;
}

.brand-title small {
  font-size: 10px;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  font-size: 14px;
}

.orion-mode-nav {
  gap: 10px;
  padding-top: 22px;
}

.orion-lower-nav {
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.side-nav-link {
  position: relative;
  min-height: 56px;
  grid-template-columns: 22px 30px minmax(0, 1fr);
  gap: 12px;
  border-radius: 5px;
  padding: 0 14px;
  font-size: 13px;
  color: #111111;
}

.sidebar-action {
  width: 100%;
  text-align: left;
}

.side-nav-link.active {
  background: rgba(17, 17, 17, 0.045);
  font-weight: 700;
}

.side-nav-link.active::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  border-radius: 2px;
  background: var(--green);
}

.side-index {
  color: #111111;
}

.side-icon {
  width: 18px;
  height: 18px;
}

.side-icon::before,
.side-icon::after {
  border-color: currentColor;
}

.side-icon-home::before {
  width: 15px;
  height: 13px;
  border: 1.6px solid currentColor;
  border-top: 0;
  border-radius: 2px;
  transform: translateY(4px);
}

.side-icon-home::after {
  width: 14px;
  height: 14px;
  border-top: 1.6px solid currentColor;
  border-left: 1.6px solid currentColor;
  transform: translateY(-3px) rotate(45deg);
}

.side-icon-env::before {
  width: 16px;
  height: 16px;
  border: 1.6px solid currentColor;
  transform: rotate(30deg) skewY(-18deg);
}

.side-icon-env::after {
  width: 10px;
  height: 10px;
  border-left: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: translate(3px, 4px) rotate(30deg) skewY(-18deg);
}

.side-icon-library::before {
  width: 18px;
  height: 6px;
  border: 1.6px solid currentColor;
  border-radius: 50%;
  box-shadow: 0 6px 0 -1px var(--bg), 0 6px 0 0 currentColor, 0 12px 0 -1px var(--bg), 0 12px 0 0 currentColor;
}

.side-icon-library::after {
  display: none;
}

.side-icon-feather {
  width: 24px;
  height: 24px;
  background: #111111;
  -webkit-mask: url("/orion/assets/orion-feather-mark.png") center / contain no-repeat;
  mask: url("/orion/assets/orion-feather-mark.png") center / contain no-repeat;
}

.side-icon-feather::before,
.side-icon-feather::after {
  content: none;
}

.side-icon-feedback::before {
  width: 16px;
  height: 12px;
  border: 1.6px solid currentColor;
  border-radius: 3px;
  transform: translateY(-2px);
}

.side-icon-feedback::after {
  width: 6px;
  height: 6px;
  border-left: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: translate(-4px, 5px) skewY(-35deg);
}

.side-icon-favorite::before {
  content: "☆";
  inset: -5px auto auto -3px;
  border: 0;
  font-size: 29px;
  font-weight: 400;
  line-height: 1;
}

.side-icon-history::before {
  width: 19px;
  height: 19px;
  border: 1.6px solid currentColor;
  border-radius: 50%;
}

.side-icon-history::after {
  width: 8px;
  height: 7px;
  border-left: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: translate(1px, -1px);
}

.side-icon-exit::before {
  width: 13px;
  height: 16px;
  border-left: 1.6px solid currentColor;
  border-top: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: translateX(-3px);
}

.side-icon-exit::after {
  width: 11px;
  height: 11px;
  border-right: 1.6px solid currentColor;
  border-top: 1.6px solid currentColor;
  transform: translate(4px, 0) rotate(45deg);
}

.core-card {
  margin: 14px 5px 0;
  border-radius: 5px;
  padding: 22px 20px;
  background: rgba(255, 255, 255, 0.38);
}

.core-card > span {
  font-size: 15px;
}

.core-card small {
  font-size: 12px;
}

.core-card .core-release-value {
  font-size: inherit;
}

.core-card .core-release-date {
  opacity: 0.72;
}

.core-card i {
  top: 30px;
  right: 24px;
  width: 6px;
  height: 6px;
}

.appbar {
  min-height: 91px;
  padding: 24px 34px;
  background: rgba(251, 251, 250, 0.9);
}

.top-navigation {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 30px;
}

.mobile-nav-toggle {
  display: none;
}

.app-breadcrumb {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 24px;
  color: #111111;
  font-size: 13px;
}

.app-breadcrumb span {
  white-space: nowrap;
}

.app-breadcrumb .breadcrumb-link {
  padding: 0;
  border: none;
  color: inherit;
  background: transparent;
  white-space: nowrap;
}

.app-breadcrumb .breadcrumb-link:hover {
  text-decoration: underline;
}

.app-breadcrumb i {
  color: #111111;
  font-style: normal;
}

.top-navigation .app-links {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 26px;
  border-left: 1px solid var(--line);
  overflow-x: auto;
}

.top-navigation .app-links a {
  min-height: 30px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 10px;
  color: #111111;
  background: rgba(255, 255, 255, 0.28);
  font-size: 11px;
  font-weight: 500;
  text-decoration: none;
}

.top-navigation .app-links a[aria-current="page"] {
  border-color: rgba(77, 139, 69, 0.6);
  color: var(--green);
}

.top-status {
  gap: 9px;
  font-size: 13px;
}

.system-status {
  font-size: 12px;
}

.blank-workspace.ambiente-view-active {
  min-height: calc(100vh - 91px);
  padding: 0;
}

.ambiente-view-active .workspace-topbar {
  display: none;
}

.ambiente-view-active .workspace-body {
  padding-top: 0;
}

.ambiente-shell {
  --ambiente-accent: #4d8b45;
  --ambiente-accent-strong: #326c2c;
  --ambiente-accent-rgb: 77, 139, 69;
  position: relative;
  min-height: calc(100vh - 91px);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.ambiente-shell.theme-blue {
  --ambiente-accent: #176fc2;
  --ambiente-accent-strong: #125a9c;
  --ambiente-accent-rgb: 23, 111, 194;
}

.ambiente-shell.theme-orange {
  --ambiente-accent: #f07716;
  --ambiente-accent-strong: #c65d0b;
  --ambiente-accent-rgb: 240, 119, 22;
}

.ambiente-shell.theme-red {
  --ambiente-accent: #ef2d2d;
  --ambiente-accent-strong: #c92424;
  --ambiente-accent-rgb: 239, 45, 45;
}

.ambiente-shell.theme-green {
  --ambiente-accent: #4d8b45;
  --ambiente-accent-strong: #326c2c;
  --ambiente-accent-rgb: 77, 139, 69;
}

.ambiente-main {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  height: calc(100vh - 91px);
  padding: 24px 72px 20px 28px;
  background: transparent;
}

.ambiente-kicker,
.ambiente-info-window h3 {
  margin: 0;
  color: #111111;
  font-size: 13px;
  font-weight: 500;
}

.ambiente-assistant-card {
  min-height: 0;
  display: flex;
  min-width: 0;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  overflow: hidden;
}

.ambiente-assistant-icon,
.ambiente-chat-avatar {
  position: relative;
  flex: 0 0 auto;
  width: 45px;
  height: 45px;
  display: inline-block;
  background: var(--ambiente-accent);
  -webkit-mask: url("/orion/assets/orion-feather-avatar.png") center / contain no-repeat;
  mask: url("/orion/assets/orion-feather-avatar.png") center / contain no-repeat;
  transition: background-color 180ms ease;
}

.ambiente-assistant-icon::before,
.ambiente-chat-avatar::before {
  content: none;
}

.ambiente-assistant-icon::after,
.ambiente-chat-avatar::after {
  content: none;
}

.ambiente-chat-thread {
  width: 100%;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 30px;
  padding: 4px 0 88px;
  overflow: auto;
  scroll-padding-bottom: 88px;
}

.orion-visual-placeholder {
  display: grid;
  gap: 6px;
  margin: 12px 0;
  border: 1px dashed rgba(var(--ambiente-accent-rgb, 77, 139, 69), 0.46);
  border-left: 3px solid var(--ambiente-accent, #4d8b45);
  border-radius: 5px;
  padding: 12px 14px;
  background: rgba(var(--ambiente-accent-rgb, 77, 139, 69), 0.055);
}

.orion-visual-placeholder-label {
  color: var(--ambiente-accent-strong, #326c2c);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.orion-visual-placeholder strong,
.orion-visual-placeholder p {
  margin: 0;
}

.orion-visual-placeholder p {
  color: rgba(17, 17, 17, 0.62);
  font-size: 12px;
}

.orion-visual-block {
  display: grid;
  gap: 12px;
  margin: 12px 0;
  border: 1px solid rgba(196, 205, 217, 0.82);
  border-left: 3px solid var(--ambiente-accent, #4d8b45);
  border-radius: 8px;
  padding: 14px 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 8px 22px rgba(17, 24, 39, 0.045);
}

.orion-visual-block h4 {
  margin: 0;
  color: #202733;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.orion-visual-block code {
  color: inherit;
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}

.orion-formula-box {
  background: linear-gradient(135deg, rgba(var(--ambiente-accent-rgb, 77, 139, 69), 0.07), #fff 62%);
}

.orion-formula-expression {
  display: block;
  border-radius: 6px;
  padding: 13px 14px;
  color: var(--ambiente-accent-strong, #326c2c);
  background: rgba(var(--ambiente-accent-rgb, 77, 139, 69), 0.09);
  font-size: clamp(15px, 2vw, 19px);
  font-weight: 700;
  text-align: center;
}

.orion-formula-box dl,
.orion-formula-box dl div {
  margin: 0;
}

.orion-formula-box dl {
  display: grid;
  gap: 6px;
}

.orion-formula-box dl div {
  display: grid;
  grid-template-columns: minmax(58px, auto) 1fr;
  gap: 10px;
  align-items: baseline;
}

.orion-formula-box dt {
  color: var(--ambiente-accent-strong, #326c2c);
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  font-weight: 750;
}

.orion-formula-box dd {
  margin: 0;
  color: #667085;
  font-size: 12px;
}

.orion-worked-solution ol,
.orion-equation-steps ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 24px;
}

.orion-worked-solution li,
.orion-equation-steps li {
  padding-left: 3px;
  color: var(--ambiente-accent-strong, #326c2c);
}

.orion-worked-solution li span,
.orion-worked-solution li code {
  display: block;
}

.orion-worked-solution li span {
  margin-bottom: 2px;
  color: #77808f;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.orion-worked-solution li code,
.orion-equation-steps li code {
  color: #202733;
  font-size: 13px;
  white-space: normal;
}

.orion-solution-given,
.orion-solution-answer {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.orion-solution-given > span,
.orion-solution-answer > span {
  color: #77808f;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.orion-solution-given code {
  border: 1px solid #e3e7ec;
  border-radius: 999px;
  padding: 4px 8px;
  background: #f8fafc;
  font-size: 11px;
}

.orion-solution-answer {
  border-top: 1px solid #e8ebef;
  padding-top: 11px;
}

.orion-solution-answer strong {
  color: var(--ambiente-accent-strong, #326c2c);
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}

.orion-known-values-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
  gap: 8px;
}

.orion-known-values-grid > div {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 6px;
  align-items: baseline;
  border-radius: 6px;
  padding: 9px 10px;
  background: #f7f9fb;
}

.orion-known-values-grid code {
  color: var(--ambiente-accent-strong, #326c2c);
  font-weight: 800;
}

.orion-known-values-grid span {
  color: #77808f;
  font-size: 11px;
}

.orion-molecule-label {
  color: var(--ambiente-accent-strong, #326c2c);
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 22px;
  font-weight: 800;
  text-align: center;
}

.orion-bond-list {
  display: grid;
  gap: 5px;
}

.orion-bond-list > div,
.orion-bond-totals {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  border-radius: 5px;
  padding: 7px 10px;
  background: #f7f9fb;
  font-size: 12px;
}

.orion-bond-list code,
.orion-bond-totals strong {
  min-width: 42px;
  color: var(--ambiente-accent-strong, #326c2c);
  text-align: right;
}

.orion-bond-totals {
  border-top: 1px solid rgba(var(--ambiente-accent-rgb, 77, 139, 69), 0.2);
  background: rgba(var(--ambiente-accent-rgb, 77, 139, 69), 0.08);
}

.orion-force-stage {
  position: relative;
  width: min(100%, 430px);
  height: 250px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 8px;
  background-image: radial-gradient(circle, rgba(148, 163, 184, 0.34) 1px, transparent 1px);
  background-size: 18px 18px;
}

.orion-force-body {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 74px;
  transform: translate(-50%, -50%);
  border: 2px solid #202733;
  border-radius: 5px;
  padding: 20px 13px;
  background: #fff;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.orion-force-arrow {
  position: absolute;
  display: grid;
  gap: 1px;
  color: var(--ambiente-accent-strong, #326c2c);
  font-size: 11px;
  text-align: center;
}

.orion-force-arrow span {
  position: relative;
  display: block;
  background: var(--ambiente-accent, #4d8b45);
}

.orion-force-arrow span::after {
  content: "";
  position: absolute;
  width: 0;
  height: 0;
  border: 6px solid transparent;
}

.orion-force-arrow small {
  color: #77808f;
  font-size: 10px;
}

.orion-force-arrow.direction-up,
.orion-force-arrow.direction-down {
  left: 50%;
  transform: translateX(-50%);
}

.orion-force-arrow.direction-up { top: 13px; }
.orion-force-arrow.direction-down { bottom: 13px; }
.orion-force-arrow.direction-up span,
.orion-force-arrow.direction-down span {
  width: 3px;
  height: 62px;
  margin: 0 auto;
}
.orion-force-arrow.direction-up span::after {
  top: -10px;
  left: -5px;
  border-bottom-color: var(--ambiente-accent, #4d8b45);
}
.orion-force-arrow.direction-down span::after {
  bottom: -10px;
  left: -5px;
  border-top-color: var(--ambiente-accent, #4d8b45);
}

.orion-force-arrow.direction-left,
.orion-force-arrow.direction-right {
  top: 50%;
  transform: translateY(-50%);
}
.orion-force-arrow.direction-left { left: 18px; }
.orion-force-arrow.direction-right { right: 18px; }
.orion-force-arrow.direction-left span,
.orion-force-arrow.direction-right span {
  width: 92px;
  height: 3px;
}
.orion-force-arrow.direction-left span::after {
  top: -5px;
  left: -10px;
  border-right-color: var(--ambiente-accent, #4d8b45);
}
.orion-force-arrow.direction-right span::after {
  top: -5px;
  right: -10px;
  border-left-color: var(--ambiente-accent, #4d8b45);
}

.orion-process-flow-track {
  display: flex;
  align-items: stretch;
  gap: 7px;
  overflow-x: auto;
  padding: 3px 0 8px;
}

.orion-process-node {
  display: grid;
  place-items: center;
  min-width: 124px;
  border: 1px solid rgba(var(--ambiente-accent-rgb, 77, 139, 69), 0.35);
  border-radius: 7px;
  padding: 12px;
  background: rgba(var(--ambiente-accent-rgb, 77, 139, 69), 0.06);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.orion-process-arrow {
  display: grid;
  place-items: center;
  min-width: 30px;
  color: var(--ambiente-accent-strong, #326c2c);
  font-size: 22px;
}

.orion-process-arrow span {
  align-self: end;
  max-width: 70px;
  color: #77808f;
  font-size: 9px;
  text-align: center;
}

.orion-graph-sketch svg {
  width: 100%;
  max-height: 290px;
  border-radius: 7px;
  background: #fbfcfd;
}

.orion-graph-axis {
  stroke: #84909f;
  stroke-width: 1;
}

.orion-graph-line {
  fill: none;
  stroke: var(--ambiente-accent, #4d8b45);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.orion-graph-sketch text {
  fill: #667085;
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
}

@media (max-width: 620px) {
  .orion-visual-block {
    padding: 12px;
  }

  .orion-force-stage {
    height: 220px;
  }

  .orion-process-flow-track {
    align-items: center;
    flex-direction: column;
    overflow: visible;
  }

  .orion-process-node {
    width: 100%;
  }

  .orion-process-arrow {
    transform: rotate(90deg);
  }

  .orion-process-arrow span {
    display: none;
  }
}

.ambiente-chat-turn {
  display: flex;
  align-items: flex-start;
  gap: 0;
}

.ambiente-chat-turn.assistant.viewport-anchor {
  min-height: calc(100% - 4px);
  flex: 0 0 auto;
}

.ambiente-chat-turn.user {
  justify-content: flex-end;
}

.ambiente-user-message-stack {
  width: fit-content;
  max-width: min(720px, 72%);
  display: grid;
  justify-items: end;
  gap: 7px;
}

.ambiente-chat-turn.error .ambiente-chat-bubble {
  color: #9b2c2c;
}

.ambiente-chat-turn.warning .ambiente-chat-bubble {
  color: #555f6c;
}

.ambiente-chat-bubble {
  width: min(940px, calc(100% - 58px));
  max-width: min(900px, 88%);
  display: grid;
  gap: 10px;
  border: 1px solid rgba(196, 205, 217, 0.78);
  border-radius: 16px 16px 16px 4px;
  padding: 14px 16px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(17, 24, 39, 0.05);
}

.ambiente-chat-turn.user .ambiente-chat-bubble {
  width: fit-content;
  max-width: 100%;
  grid-template-columns: minmax(0, auto) auto;
  align-items: end;
  gap: 24px;
  border-color: rgba(var(--ambiente-accent-rgb), 0.14);
  border-radius: 15px;
  padding: 9px 13px;
  color: #172018;
  background: rgba(var(--ambiente-accent-rgb), 0.105);
  box-shadow: none;
}

.ambiente-chat-turn.assistant .ambiente-chat-bubble,
.ambiente-chat-turn.starter .ambiente-chat-bubble {
  width: min(1280px, 100%);
  max-width: 100%;
  gap: 12px;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.ambiente-chat-name {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #6b7280;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.ambiente-chat-name-orion {
  color: var(--ambiente-accent-strong);
}

.ambiente-chat-name-separator {
  color: var(--ambiente-accent);
}

.ambiente-chat-bubble p {
  margin: 0;
  color: inherit;
  font-size: 14px;
  line-height: 1.62;
}

.ambiente-chat-message-content {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.ambiente-chat-turn.assistant .ambiente-chat-message-content {
  max-width: min(100%, 82ch);
}

.ambiente-chat-turn.user .ambiente-chat-message-content {
  display: block;
}

.ambiente-chat-turn.user .ambiente-chat-bubble p {
  font-size: 13px;
  line-height: 1.45;
}

.ambiente-user-time {
  align-self: end;
  color: #7f8a80;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.ambiente-message-footer {
  min-height: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  margin-top: 4px;
  padding-top: 2px;
  color: #9298a1;
  font-size: 10px;
}

.ambiente-message-footer time {
  flex: 0 0 auto;
  color: #9298a1;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.ambiente-message-meta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #9298a1;
}

.ambiente-message-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #858b94;
}

.ambiente-message-status::before {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #a1a6ae;
  content: "";
}

.ambiente-message-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
}

.ambiente-message-action {
  min-height: 20px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  border-radius: 5px;
  padding: 2px 4px;
  color: #858b94;
  background: transparent;
  font: inherit;
  font-size: 10px;
  cursor: pointer;
  transition: color 140ms ease, background-color 140ms ease;
}

.ambiente-message-action svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.ambiente-message-action:hover:not(:disabled),
.ambiente-message-action:focus-visible {
  color: #5f6670;
  background: rgba(107, 114, 128, 0.08);
}

.ambiente-message-action:disabled {
  cursor: default;
  opacity: 0.42;
}

.ambiente-message-action.copied {
  color: #648269;
}

.ambiente-sources-action.active {
  color: var(--ambiente-accent-strong, #5f6670);
  background: rgba(var(--ambiente-accent-rgb, 107, 114, 128), 0.08);
}

.ambiente-message-action.failed {
  color: #a46161;
}

.ambiente-chat-list {
  margin: 0;
  padding-left: 18px;
  color: inherit;
  font-size: 14px;
  line-height: 1.58;
}

.ambiente-chat-list li + li {
  margin-top: 4px;
}

.ambiente-chat-heading {
  margin: 8px 0 0;
  color: #202521;
  font-family: var(--font-heading);
  font-size: 17px;
  line-height: 1.3;
}

.ambiente-chat-message-content > .ambiente-chat-heading:first-child {
  margin-top: 0;
}

.ambiente-chat-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.ambiente-chat-table {
  width: 100%;
  border-collapse: collapse;
  color: inherit;
  font-size: 13px;
  line-height: 1.45;
}

.ambiente-chat-table th,
.ambiente-chat-table td {
  border-bottom: 1px solid rgba(17, 17, 17, 0.12);
  padding: 7px 9px;
  text-align: left;
  vertical-align: top;
}

.ambiente-chat-table th {
  color: #3f4741;
  font-weight: 700;
}

.ambiente-chat-math {
  color: #252a26;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.96em;
  font-variant-numeric: lining-nums tabular-nums;
  white-space: nowrap;
}

.ambiente-chat-math-block {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 620px);
  margin: 2px 0;
  border-radius: 8px;
  padding: 9px 14px;
  background: rgba(17, 17, 17, 0.035);
  font-size: 14px;
  overflow-x: auto;
}

.ambiente-chat-math-fraction {
  display: inline-grid;
  grid-template-rows: auto auto;
  margin: 0 0.24em;
  text-align: center;
  vertical-align: middle;
}

.ambiente-chat-math-fraction > span {
  min-width: 1.1em;
  padding: 0 0.2em;
  line-height: 1.15;
}

.ambiente-chat-math-fraction > span:first-child {
  border-bottom: 1px solid currentColor;
  padding-bottom: 0.08em;
}

.ambiente-chat-math-fraction > span:last-child {
  padding-top: 0.08em;
}

.ambiente-chat-math sub,
.ambiente-chat-math sup {
  font-size: 0.72em;
  line-height: 0;
}

.ambiente-chat-code {
  border-radius: 4px;
  padding: 0.08em 0.32em;
  color: #303630;
  background: rgba(17, 17, 17, 0.055);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
  overflow-wrap: anywhere;
}

.ambiente-source-grounding {
  display: grid;
  gap: 7px;
  max-width: min(100%, 82ch);
  margin-top: 4px;
  border: 1px solid rgba(var(--ambiente-accent-rgb), 0.12);
  border-radius: 8px;
  padding: 9px 10px;
  color: #5f6761;
  background: rgba(var(--ambiente-accent-rgb), 0.035);
  font-size: 10px;
}

.ambiente-source-grounding[hidden] {
  display: none;
}

.ambiente-source-grounding > strong {
  color: #707871;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ambiente-source-grounding ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ambiente-source-grounding li {
  max-width: min(100%, 330px);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 4px 7px;
  border: 1px solid rgba(var(--ambiente-accent-rgb), 0.14);
  border-radius: 8px;
  padding: 6px 8px;
  background: rgba(var(--ambiente-accent-rgb), 0.045);
}

.ambiente-source-grounding li > span {
  color: var(--ambiente-accent-strong);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ambiente-source-grounding li > strong {
  min-width: 0;
  overflow: hidden;
  color: #343a35;
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ambiente-source-grounding li > small {
  grid-column: 2 / -1;
  overflow: hidden;
  color: #747b75;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ambiente-source-grounding li > em {
  color: #676e68;
  font-size: 9px;
  font-style: normal;
  white-space: nowrap;
}

.ambiente-source-empty {
  margin: 0;
  color: #747b75;
  font-size: 10px !important;
  line-height: 1.4 !important;
}

.exercise-list-artifact {
  display: grid;
  gap: 16px;
}

.exercise-list-header {
  display: grid;
  gap: 4px;
  border-bottom: 1px solid rgba(17, 17, 17, 0.12);
  padding-bottom: 12px;
}

.exercise-list-header > span,
.exercise-question-kind {
  width: max-content;
  border-radius: 999px;
  padding: 3px 7px;
  color: var(--ambiente-accent-strong);
  background: rgba(var(--ambiente-accent-rgb), 0.1);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.exercise-list-header h3,
.exercise-list-header p,
.exercise-list-header small,
.exercise-list-more {
  margin: 0;
}

.exercise-list-header h3 {
  color: #202733;
  font-size: 18px;
}

.exercise-list-header small,
.exercise-source {
  color: #6b7280;
  font-size: 11px !important;
}

.exercise-list-items {
  display: grid;
  gap: 18px;
  margin: 0;
  padding-left: 28px;
}

.exercise-list-item {
  padding-left: 4px;
}

.exercise-list-item::marker {
  color: var(--ambiente-accent-strong);
  font-weight: 850;
}

.exercise-question-statement {
  margin-top: 7px !important;
}

.exercise-alternatives {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.exercise-alternatives li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 5px;
  align-items: start;
  line-height: 1.5;
}

.exercise-alternatives strong {
  color: var(--ambiente-accent-strong);
}

.exercise-source {
  margin-top: 9px !important;
}

.exercise-list-more {
  border-left: 3px solid var(--ambiente-accent);
  padding: 9px 11px;
  background: rgba(var(--ambiente-accent-rgb), 0.055);
}

.ambiente-chat-bubble p strong,
.ambiente-chat-list strong {
  font-size: inherit;
  font-weight: 750;
  letter-spacing: 0;
}

.ambiente-assistant-copy {
  display: grid;
  align-content: start;
  gap: 18px;
  padding-top: 8px;
  line-height: 1.65;
}

.ambiente-assistant-copy p,
.ambiente-question {
  margin: 0;
  color: #111111;
  font-size: 14px;
}

.ambiente-greeting {
  font-size: 15px;
  font-weight: 700;
}

.ambiente-document-source {
  color: #6a7180;
  font-weight: 500;
}

.ambiente-document-source a {
  color: #1769d2;
  font-weight: 650;
  text-decoration: none;
  text-underline-offset: 3px;
}

.ambiente-document-source a:hover,
.ambiente-document-source a:focus-visible {
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

.ambiente-document-source a:focus-visible {
  border-radius: 2px;
  outline: 2px solid rgba(23, 105, 210, 0.24);
  outline-offset: 2px;
}

.ambiente-teacher-observation {
  display: grid;
  gap: 5px;
  border-left: 3px solid var(--ambiente-accent);
  padding: 3px 0 3px 11px;
  background: transparent;
}

.ambiente-teacher-observation strong {
  color: var(--ambiente-accent);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.ambiente-teacher-observation p {
  margin: 0;
  color: #111111;
  font-size: 14px;
  line-height: 1.45;
}

.ambiente-greeting strong,
.ambiente-topic h4 {
  color: var(--ambiente-accent);
}

.ambiente-chat-turn.user .ambiente-greeting strong,
.ambiente-chat-turn.user .ambiente-topic h4 {
  color: inherit;
}

.ambiente-topic-list {
  display: grid;
  gap: 16px;
  padding-top: 5px;
}

.ambiente-topic-list hr {
  width: 100%;
  border: 0;
  border-top: 1px dashed rgba(17, 17, 17, 0.28);
  margin: 10px 0 5px;
}

.ambiente-topic {
  display: grid;
  gap: 10px;
}

.ambiente-topic h4 {
  margin: 0;
  display: flex;
  gap: 16px;
  font-size: 15px;
  font-weight: 700;
}

.ambiente-topic h4 span {
  min-width: 15px;
}

.ambiente-topic ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 30px;
  color: #111111;
}

.ambiente-topic li {
  padding-left: 10px;
}

.ambiente-mastery-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 2px 0 0;
  list-style: none;
}

.ambiente-mastery-groups {
  display: grid;
  gap: 14px;
}

.ambiente-mastery-group h4 {
  margin: 0 0 8px;
  color: #111111;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.ambiente-mastery-list li {
  position: relative;
  padding-left: 20px;
  color: #111111;
  font-size: 14px;
  line-height: 1.5;
}

.ambiente-topic-button {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  display: inline;
  font: inherit;
  line-height: inherit;
  padding: 0;
  text-align: left;
}

.ambiente-topic-button:hover,
.ambiente-topic-button:focus-visible {
  color: var(--ambiente-accent-strong);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.ambiente-topic-button:focus-visible {
  outline: 2px solid rgba(var(--ambiente-accent-rgb), 0.35);
  outline-offset: 3px;
}

.ambiente-mastery-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.72em;
  width: 7px;
  height: 7px;
  border: 1px solid var(--ambiente-accent);
  border-radius: 50%;
  transform: translateY(-50%);
}

.ambiente-mastery-status {
  color: #5f6b5c;
  font-size: 14px;
}

.loading-dots,
.ambiente-loading-dots {
  display: inline-block;
  position: relative;
  top: 0.26em;
  width: 3ch;
  text-align: left;
  white-space: nowrap;
}

.loading-dots::before,
.ambiente-loading-dots::before {
  content: "...";
  display: inline-block;
  width: 1ch;
  overflow: hidden;
  animation: ambiente-loading-dots 1.05s steps(1, end) infinite;
}

@keyframes ambiente-loading-dots {
  0%,
  33% {
    width: 1ch;
  }

  34%,
  66% {
    width: 2ch;
  }

  67%,
  100% {
    width: 3ch;
  }
}

.ambiente-mastery-status.error {
  color: #9b2c2c;
}

.ambiente-question {
  margin-top: 6px;
}

.ambiente-assistant-copy time {
  color: #969696;
  font-size: 11px;
}

.ambiente-compose-panel {
  min-height: 58px;
  display: grid;
  border: 1px solid rgba(17, 17, 17, 0.18);
  border-radius: 999px;
  margin-bottom: 12px;
  padding: 6px 7px 6px 20px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.08);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.ambiente-compose-panel.ambiente-environment-compose {
  position: absolute;
  right: 72px;
  bottom: 20px;
  left: 28px;
  z-index: 10;
  min-height: 0;
  grid-template-rows: auto;
  gap: 10px;
  border: 0;
  border-radius: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.ambiente-compose-panel.ambiente-environment-compose:focus-within {
  border-color: transparent;
  box-shadow: none;
}

.ambiente-environment-compose .ambiente-input-row {
  min-height: 50px;
  grid-template-columns: auto minmax(0, 1fr) 38px;
  gap: 8px;
  border: 1px solid rgba(17, 17, 17, 0.16);
  border-radius: 25px;
  padding: 4px 5px 4px 6px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: none;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.ambiente-environment-compose .ambiente-input-row.composer-expanded,
.ambiente-compose-panel.reader-compose-panel.composer-expanded {
  border-radius: 20px;
}

.ambiente-environment-compose .ambiente-input-row:focus-within {
  border-color: rgba(var(--ambiente-accent-rgb), 0.68);
  box-shadow: 0 0 0 3px rgba(var(--ambiente-accent-rgb), 0.075);
}

.ambiente-compose-panel:focus-within {
  border-color: rgba(var(--ambiente-accent-rgb), 0.74);
  box-shadow: 0 0 0 3px rgba(var(--ambiente-accent-rgb), 0.09), 0 12px 28px rgba(17, 24, 39, 0.08);
}

.ambiente-input-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 44px;
  gap: 10px;
  align-items: center;
}

.ambiente-input-row input {
  min-width: 0;
  min-height: 44px;
  border: 0;
  padding: 0;
  color: #111111;
  background: transparent;
  font: inherit;
  font-size: 14px;
}

.ambiente-environment-compose .ambiente-input-row input {
  min-height: 38px;
  font-size: 13px;
}

.ambiente-input-row input::placeholder {
  color: #777777;
}

.ambiente-input-row input:focus {
  outline: none;
}

.ambiente-input-row button[type="submit"] {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ambiente-accent);
  border-radius: 50%;
  padding: 0;
  color: #ffffff;
  background: var(--ambiente-accent);
  box-shadow: 0 7px 16px rgba(var(--ambiente-accent-rgb), 0.22);
  cursor: pointer;
  transition: background-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.ambiente-environment-compose .ambiente-input-row button[type="submit"] {
  width: 38px;
  height: 38px;
}

.ambiente-send-icon {
  width: 20px;
  height: 20px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ambiente-input-row button[type="submit"]:hover:not(:disabled) {
  background: var(--ambiente-accent-strong);
  transform: translateY(-1px);
}

.ambiente-input-row button[type="submit"]:disabled,
.ambiente-input-row input:disabled {
  opacity: 0.62;
}

.ambiente-input-row button[type="submit"]:disabled {
  cursor: default;
}

.ambiente-attachment-stage {
  display: grid;
  justify-items: start;
  gap: 6px;
  min-width: 0;
}

.ambiente-attachment-tray,
.ambiente-sent-attachments {
  display: flex;
  align-items: stretch;
  gap: 9px;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: thin;
}

.ambiente-attachment-tray {
  max-width: min(100%, 680px);
  padding: 2px;
  background: transparent;
}

.ambiente-attachment-item {
  position: relative;
  flex: 0 0 auto;
  box-sizing: border-box;
  height: 74px;
}

.ambiente-attachment-item.image {
  width: 74px;
  border: 0;
  border-radius: 12px;
  background: #f2f4f2;
  box-shadow: 0 5px 15px rgba(17, 24, 39, 0.09);
  overflow: hidden;
}

.ambiente-attachment-image-button {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  border-radius: inherit;
  padding: 0;
  background: transparent;
  cursor: zoom-in;
  overflow: hidden;
}

.ambiente-attachment-item.image img,
.ambiente-attachment-image-button img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.ambiente-attachment-image-button:hover img {
  transform: scale(1.035);
}

.ambiente-attachment-image-button:focus-visible {
  outline: 2px solid rgba(var(--ambiente-accent-rgb), 0.58);
  outline-offset: 2px;
}

.ambiente-attachment-image-button img {
  transition: transform 180ms ease;
}

.ambiente-attachment-item.image .ambiente-attachment-name {
  position: absolute;
  right: 4px;
  bottom: 4px;
  left: 4px;
  border-radius: 6px;
  padding: 3px 5px;
  color: #ffffff;
  background: rgba(17, 17, 17, 0.72);
  font-size: 8px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

.ambiente-attachment-item.file {
  width: min(230px, 54vw);
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 12px;
  padding: 11px 32px 11px 11px;
  background: #f2f3f1;
  box-shadow: 0 5px 15px rgba(17, 24, 39, 0.075);
  overflow: hidden;
}

.ambiente-attachment-file-icon {
  width: 34px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--ambiente-accent-strong);
  background: rgba(var(--ambiente-accent-rgb), 0.11);
}

.ambiente-attachment-file-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.ambiente-attachment-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.ambiente-attachment-copy strong,
.ambiente-attachment-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ambiente-attachment-copy strong {
  color: #222722;
  font-size: 11px;
  font-weight: 700;
}

.ambiente-attachment-copy small {
  color: #7b817c;
  font-size: 9px;
}

.ambiente-attachment-remove {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 2;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 50%;
  padding: 0 0 2px;
  color: #ffffff;
  background: #202420;
  box-shadow: 0 3px 8px rgba(17, 17, 17, 0.18);
  font: inherit;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.ambiente-attachment-remove:hover,
.ambiente-attachment-remove:focus-visible {
  background: #000000;
  transform: scale(1.04);
}

.ambiente-attachment-remove:focus-visible,
.ambiente-attachment-button:focus-visible,
.ambiente-attachment-menu button:focus-visible {
  outline: 2px solid rgba(var(--ambiente-accent-rgb), 0.48);
  outline-offset: 2px;
}

.ambiente-attachment-status {
  margin: 0 0 0 10px;
  color: #9b2c2c;
  font-size: 10px;
  line-height: 1.35;
}

.ambiente-attachment-status:empty {
  display: none;
}

.ambiente-attachment-control {
  position: relative;
  display: grid;
  place-items: center;
}

.ambiente-attachment-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  padding: 0;
  color: #323832;
  background: transparent;
  cursor: pointer;
  transition: color 160ms ease, transform 160ms ease;
}

.ambiente-attachment-button:hover:not(:disabled),
.ambiente-attachment-button[aria-expanded="true"] {
  color: var(--ambiente-accent-strong);
  background: transparent;
}

.ambiente-attachment-button:active:not(:disabled) {
  transform: scale(0.95);
}

.ambiente-attachment-button:disabled {
  cursor: default;
  opacity: 0.5;
}

.ambiente-attachment-plus-icon {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}

.ambiente-attachment-menu {
  position: absolute;
  bottom: calc(100% + 12px);
  left: -2px;
  z-index: 40;
  width: 188px;
  display: grid;
  gap: 3px;
  border: 1px solid rgba(17, 17, 17, 0.13);
  border-radius: 15px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.985);
  box-shadow: 0 16px 42px rgba(17, 24, 39, 0.16);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transform-origin: 22px calc(100% + 12px);
  animation: ambiente-attachment-menu-enter 190ms cubic-bezier(0.16, 1, 0.3, 1) both;
  will-change: opacity, transform;
}

.ambiente-attachment-menu[hidden] {
  display: none;
}

@keyframes ambiente-attachment-menu-enter {
  from {
    opacity: 0;
    transform: translate3d(0, 8px, 0) scale(0.965);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

.ambiente-attachment-menu button {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 10px;
  padding: 7px 9px;
  color: #262b26;
  background: transparent;
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.ambiente-attachment-menu button:hover,
.ambiente-attachment-menu button:focus-visible {
  color: var(--ambiente-accent-strong);
  background: rgba(var(--ambiente-accent-rgb), 0.08);
}

.ambiente-attachment-menu button:disabled {
  color: rgba(38, 43, 38, 0.42);
  cursor: not-allowed;
}

.ambiente-attachment-menu button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.65;
}

.ambiente-attachment-quota {
  margin: 3px 5px 2px;
  padding: 8px 4px 2px;
  border-top: 1px solid rgba(17, 17, 17, 0.09);
  color: rgba(38, 43, 38, 0.62);
  font-size: 9px;
  line-height: 1.35;
}

.ambiente-attachment-limits {
  margin: 0 5px 3px;
  padding: 0 4px 2px;
  color: rgba(38, 43, 38, 0.5);
  font-size: 8px;
  line-height: 1.35;
}

.ambiente-attachment-input {
  display: none !important;
}

.ambiente-sent-attachments {
  max-width: 100%;
  justify-content: flex-end;
  padding: 0 1px;
  overflow: visible;
}

.ambiente-sent-attachments .ambiente-attachment-item.image {
  width: 108px;
  height: 108px;
  border: 1px solid rgba(17, 24, 39, 0.1);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(17, 24, 39, 0.1);
}

.ambiente-sent-attachments .ambiente-attachment-item.image .ambiente-attachment-name {
  display: none;
}

.ambiente-sent-attachments .ambiente-attachment-item.file {
  width: min(248px, 58vw);
  height: 60px;
  min-height: 60px;
  grid-template-columns: 34px minmax(0, 1fr);
  border: 1px solid rgba(17, 24, 39, 0.1);
  border-radius: 13px;
  padding: 9px 12px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(17, 24, 39, 0.075);
}

.ambiente-sent-attachments .ambiente-attachment-file-icon {
  width: 30px;
  height: 36px;
  border-radius: 7px;
}

.ambiente-attachment-only-time {
  margin-right: 3px;
}

.ambiente-image-preview-layer {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(17, 24, 39, 0.3);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: ambiente-image-preview-fade 150ms ease-out both;
}

.ambiente-image-preview-dialog {
  position: relative;
  width: min(560px, calc(100vw - 48px), calc(100vh - 48px));
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid rgba(17, 24, 39, 0.12);
  border-radius: 20px;
  padding: 18px;
  background: #f8faf8;
  box-shadow: 0 28px 80px rgba(17, 24, 39, 0.26);
  overflow: hidden;
  animation: ambiente-image-preview-enter 180ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.ambiente-image-preview-dialog > img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.ambiente-image-preview-name {
  position: absolute;
  right: 18px;
  bottom: 14px;
  left: 18px;
  overflow: hidden;
  color: rgba(25, 31, 26, 0.72);
  font-size: 10px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ambiente-image-preview-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(17, 24, 39, 0.12);
  border-radius: 50%;
  padding: 0 0 2px;
  color: #1c221d;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 5px 16px rgba(17, 24, 39, 0.12);
  font: inherit;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.ambiente-image-preview-close:hover,
.ambiente-image-preview-close:focus-visible {
  color: #ffffff;
  background: #1c221d;
  outline: none;
}

@keyframes ambiente-image-preview-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes ambiente-image-preview-enter {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.ambiente-add-button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(var(--ambiente-accent-rgb), 0.36);
  border-radius: 50%;
  color: var(--ambiente-accent);
  background: #ffffff;
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
  cursor: default;
}

.ambiente-info-button {
  position: absolute;
  top: 25px;
  right: 24px;
  z-index: 8;
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(17, 17, 17, 0.26);
  border-radius: 50%;
  color: #333333;
  background: rgba(255, 255, 255, 0.68);
  font-size: 15px;
  font-style: italic;
  font-weight: 700;
}

.ambiente-info-button:hover,
.ambiente-info-button[aria-expanded="true"] {
  border-color: rgba(var(--ambiente-accent-rgb), 0.68);
  color: var(--ambiente-accent);
  background: #ffffff;
}

.ambiente-info-window {
  position: absolute;
  top: 66px;
  right: 24px;
  z-index: 12;
  width: min(320px, calc(100% - 48px));
  display: grid;
  gap: 18px;
  border: 1px solid rgba(17, 17, 17, 0.22);
  border-radius: 7px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 60px rgba(17, 24, 39, 0.16);
}

.ambiente-info-window[hidden] {
  display: none;
}

.ambiente-info-window header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ambiente-info-window header button {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(17, 17, 17, 0.18);
  border-radius: 50%;
  color: #333333;
  background: transparent;
  font-size: 18px;
  line-height: 1;
}

.ambiente-about {
  display: grid;
  gap: 27px;
}

.ambiente-about dl {
  display: grid;
  gap: 17px;
  min-height: 345px;
  margin: 0;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  padding: 20px 16px;
  background: rgba(255, 255, 255, 0.28);
}

.ambiente-info-window .ambiente-about {
  gap: 0;
}

.ambiente-info-window .ambiente-about dl {
  min-height: 0;
  border: 0;
  padding: 0;
  background: transparent;
}

.ambiente-about dt {
  margin-top: 7px;
  color: #333333;
  font-size: 12px;
  font-weight: 500;
}

.ambiente-about dt:first-child {
  margin-top: 0;
}

.ambiente-about dd {
  margin: -8px 0 0;
  color: #111111;
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

@media (max-width: 1180px) {
  .orion-app {
    grid-template-columns: 222px minmax(0, 1fr);
  }

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

  .ambiente-assistant-card {
    min-height: 0;
  }
}

@media (max-width: 980px) {
  .ambiente-shell {
    grid-template-columns: 1fr;
  }

  .ambiente-side-panel {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 680px) {
  body {
    font-size: 13px;
  }

  .appbar {
    min-height: auto;
    padding: 18px;
  }

  .app-breadcrumb {
    max-width: 100%;
    gap: 12px;
    overflow-x: auto;
  }

  .top-navigation {
    width: 100%;
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .top-navigation .app-links {
    width: 100%;
    padding-left: 0;
    border-left: 0;
  }

  .ambiente-main,
  .ambiente-side-panel {
    padding: 24px 18px;
  }

  .ambiente-assistant-card {
    min-height: 0;
    grid-template-columns: 1fr;
    padding: 20px 18px;
  }

  .ambiente-view-active .ambiente-assistant-card {
    padding: 0;
  }

  .ambiente-chat-thread {
    gap: 24px;
  }

  .ambiente-chat-turn.user .ambiente-chat-bubble {
    max-width: 100%;
    gap: 12px;
  }

  .ambiente-user-message-stack {
    max-width: 88%;
  }

  .ambiente-sent-attachments .ambiente-attachment-item.image {
    width: 88px;
    height: 88px;
  }

  .ambiente-input-row {
    grid-template-columns: auto minmax(90px, 1fr) 42px;
    gap: 6px;
  }

  .ambiente-compose-panel {
    padding-left: 7px;
  }

  .ambiente-compose-panel.ambiente-environment-compose {
    right: 18px;
    bottom: 18px;
    left: 18px;
    padding: 0;
  }
}
body[data-demo-core-mode="true"] .demo-core-disabled {
  display: none !important;
}

/* Biblioteca subject selection refinement. Content styles stay scoped; the
   student sidebar above is universal across every Orion student surface. */
body.library-subject-selection .appbar {
  border-bottom-color: rgba(17, 17, 17, 0.18);
}

body.library-subject-selection .hero-band {
  padding: 38px 46px 16px;
}

body.library-subject-selection .hero-band h1 {
  margin-top: 18px;
  font-size: 25px;
  font-weight: 600;
  letter-spacing: 0;
  opacity: 0.88;
}

body.library-subject-selection .hero-copy {
  margin-top: 16px;
  color: rgba(17, 17, 17, 0.76);
  font-size: 13px;
}

body.library-subject-selection .hero-band::after {
  margin-top: 26px;
  border-bottom-color: rgba(17, 17, 17, 0.34);
  border-bottom-width: 1px;
  opacity: 1;
}

body.library-subject-selection .orion-start {
  padding: 22px 46px 30px;
}

body.library-subject-selection .section-heading {
  min-height: 42px;
  margin-bottom: 16px;
}

body.library-subject-selection .section-heading .eyebrow {
  color: rgba(17, 17, 17, 0.8);
  font-size: 12px;
}

body.library-subject-selection #reset-orion {
  min-height: 40px;
  border-color: rgba(17, 17, 17, 0.42);
  border-radius: 5px;
  padding: 0 18px;
  color: #111111;
  background: rgba(255, 255, 255, 0.24);
  font-size: 12px;
  font-weight: 500;
}

body.library-subject-selection #reset-orion:hover {
  border-color: rgba(17, 17, 17, 0.72);
  background: rgba(17, 17, 17, 0.035);
}

body.library-subject-selection .subject-card-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 10px 24px;
}

body.library-subject-selection .subject-card {
  min-height: 76px;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 24px;
  border: 1px solid rgba(17, 17, 17, 0.16);
  border-left: 4px solid #111111;
  border-radius: 5px;
  padding: 0 24px;
  color: #111111;
  background: rgba(255, 255, 255, 0.44);
  opacity: 1;
  box-shadow: none;
}

body.library-subject-selection .subject-card:hover,
body.library-subject-selection .subject-card.active {
  border-color: rgba(17, 17, 17, 0.28);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: none;
}

body.library-subject-selection .subject-card.green,
body.library-subject-selection .subject-card.green:hover:not(:disabled) {
  border-left-color: #22a447;
  background: rgba(255, 255, 255, 0.44);
}

body.library-subject-selection .subject-card.blue,
body.library-subject-selection .subject-card.blue:hover:not(:disabled) {
  border-left-color: #2376ba;
  background: rgba(255, 255, 255, 0.44);
}

body.library-subject-selection .subject-card.red,
body.library-subject-selection .subject-card.red:hover:not(:disabled) {
  border-left-color: #df3943;
  background: rgba(255, 255, 255, 0.44);
}

body.library-subject-selection .subject-card.orange,
body.library-subject-selection .subject-card.orange:hover:not(:disabled) {
  border-left-color: #e97918;
  background: rgba(255, 255, 255, 0.44);
}

body.library-subject-selection .subject-card .subject-mark {
  position: relative;
  width: 32px;
  height: 32px;
  min-width: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  color: rgba(17, 17, 17, 0.9);
  background: transparent;
  font-size: 0;
}

body.library-subject-selection .subject-card .subject-mark::before,
body.library-subject-selection .subject-card .subject-mark::after {
  content: none !important;
}

body.library-subject-selection .subject-mark svg {
  width: 30px;
  height: 30px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

body.library-subject-selection .subject-mark .subject-icon-type {
  fill: currentColor;
  stroke: none;
}

body.library-subject-selection .subject-icon-type text {
  font-family: "IBM Plex Mono", "Cascadia Mono", "Courier New", monospace;
  font-size: 20px;
  font-style: italic;
  font-weight: 600;
}

body.library-subject-selection .subject-icon-sigma text {
  font-size: 23px;
  font-style: normal;
}

body.library-subject-selection .subject-icon-language text {
  font-size: 19px;
  font-style: normal;
}

body.library-subject-selection .subject-icon-fallback {
  color: currentColor;
  font-size: 10px;
  font-weight: 700;
}

body.library-subject-selection .subject-card strong {
  align-self: center;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
}

body.library-subject-selection .subject-card small {
  color: rgba(17, 17, 17, 0.84);
  font-size: 26px;
  font-weight: 600;
  line-height: 1;
}

@media (max-width: 1180px) {
  body.library-subject-selection .hero-band,
  body.library-subject-selection .orion-start {
    padding-right: 34px;
    padding-left: 34px;
  }

  body.library-subject-selection .subject-card {
    gap: 18px;
    padding-right: 18px;
    padding-left: 18px;
  }
}

@media (max-width: 980px) {
  body.library-subject-selection .subject-card-grid {
    grid-template-columns: minmax(0, 1fr);
    column-gap: 16px;
  }
}

@media (max-width: 720px) {
  body.library-subject-selection .hero-band,
  body.library-subject-selection .orion-start {
    padding-right: 18px;
    padding-left: 18px;
  }

  body.library-subject-selection .subject-card-grid {
    grid-template-columns: 1fr;
  }

  body.library-subject-selection .subject-card {
    min-height: 72px;
  }
}

/* Biblioteca PDF reader: document-first, with no semantic overlay layer. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.pdf-reader-workspace {
  min-width: 0;
  gap: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #ffffff;
  box-shadow: none;
}

.blank-workspace.library-reader-active {
  height: auto;
  min-height: 0;
  overflow: visible;
  padding: 18px clamp(18px, 3vw, 38px) 28px;
  background: transparent;
}

.library-reader-active .workspace-topbar {
  display: none;
}

.library-reader-active .workspace-body {
  height: auto;
  min-height: 0;
  padding: 0;
}

.library-reader-active .pdf-reader-workspace {
  width: min(100%, 980px);
  height: clamp(560px, calc(100vh - 138px), 820px);
  grid-template-rows: auto minmax(0, 1fr);
  margin: 0 auto;
  border: 1px solid rgba(17, 17, 17, 0.16);
  border-radius: 6px;
  box-shadow: 0 18px 42px rgba(17, 17, 17, 0.09);
}

.library-reader-active .pdf-reader-layout {
  height: auto;
}

.pdf-reader-toolbar {
  min-width: 0;
  align-items: center;
  padding: 12px 14px;
  border: 0;
  border-radius: 0;
  background: #ffffff;
}

.active-book-summary {
  gap: 14px;
}

.active-book-summary > div {
  gap: 2px;
}

.active-book-summary span {
  color: #555b64;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.active-book-summary strong {
  max-width: min(52vw, 680px);
  font-size: 14px;
  font-weight: 650;
}

.reader-back-button,
.reader-toolbar-button,
.pdf-viewer-controls button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid rgba(17, 17, 17, 0.22);
  border-radius: 3px;
  padding: 0 10px;
  color: #17191c;
  background: #ffffff;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}

.reader-back-button:hover,
.reader-toolbar-button:hover,
.pdf-viewer-controls button:hover:not(:disabled) {
  border-color: #111111;
  background: #f1f3f5;
}

.reader-back-button:focus-visible,
.reader-toolbar-button:focus-visible,
.pdf-viewer-controls button:focus-visible,
.reader-page-field input:focus-visible,
.pdf-page-stage:focus-visible {
  outline: 2px solid #2456d6;
  outline-offset: 2px;
}

.reader-back-button svg,
.reader-toolbar-button svg,
.pdf-viewer-controls button svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.reader-back-button {
  min-width: 36px;
  border-color: transparent;
  padding-left: 6px;
}

.reader-document-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.reader-document-meta {
  margin-right: 4px;
  color: #676d75;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.pdf-viewer-controls {
  min-height: 52px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #ffffff;
  background: #17191c;
}

.reader-control-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.reader-page-navigation {
  justify-self: start;
}

.reader-zoom-controls {
  justify-self: end;
}

.pdf-viewer-controls button {
  min-width: 34px;
  min-height: 32px;
  border-color: rgba(255, 255, 255, 0.18);
  padding: 0 8px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
  font-size: 15px;
}

.pdf-viewer-controls button:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.48);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
}

.pdf-viewer-controls button:disabled {
  opacity: 0.28;
  cursor: default;
}

.reader-page-field {
  height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 3px;
  padding: 0 9px 0 4px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 11px;
}

.reader-page-field input {
  width: 46px;
  height: 24px;
  border: 0;
  border-radius: 2px;
  padding: 0 4px;
  color: #111111;
  background: #ffffff;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  text-align: center;
  appearance: textfield;
}

.reader-page-field input::-webkit-inner-spin-button,
.reader-page-field input::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}

.reader-page-field strong {
  color: #ffffff;
  font-weight: 600;
}

.reader-position {
  justify-self: center;
  color: rgba(255, 255, 255, 0.76);
  font-size: 11px;
  font-weight: 550;
  white-space: nowrap;
}

.reader-zoom-controls output {
  min-width: 46px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 11px;
  text-align: center;
}

.pdf-viewer-controls .reader-fit-button {
  margin-left: 3px;
  padding-right: 10px;
  font-size: 10px;
}

.pdf-page-stage {
  min-height: 70vh;
  max-height: calc(100vh - 230px);
  display: block;
  overflow: auto;
  border: 0;
  border-radius: 0;
  padding: 30px;
  background: #34383e;
  scroll-behavior: smooth;
  scroll-padding: 24px;
  scrollbar-gutter: stable both-edges;
  overscroll-behavior: contain;
}

.pdf-page-frame {
  position: relative;
  width: var(--reader-page-width, 100%);
  min-height: 260px;
  aspect-ratio: 210 / 297;
  margin: 0 auto 30px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #ffffff;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.34);
  transition: width 140ms ease;
}

.pdf-page-frame:last-child {
  margin-bottom: 0;
}

.pdf-page-frame.is-loaded {
  min-height: 0;
  aspect-ratio: auto;
}

.reader-pdf-page {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  display: block;
  opacity: 0;
  transition: opacity 160ms ease;
}

.pdf-page-frame.is-loaded .reader-pdf-page {
  opacity: 1;
}

.floating-page-label {
  top: 12px;
  right: 12px;
  z-index: 3;
  min-width: 28px;
  border: 1px solid rgba(17, 17, 17, 0.12);
  border-radius: 3px;
  padding: 5px 7px;
  color: #383d44;
  background: rgba(255, 255, 255, 0.9);
  font-size: 10px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(17, 17, 17, 0.1);
  backdrop-filter: blur(8px);
}

.reader-page-loading,
.reader-page-error {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.reader-page-loading {
  z-index: 0;
  background: linear-gradient(110deg, #f5f5f3 24%, #ffffff 42%, #f5f5f3 60%);
  background-size: 240% 100%;
  animation: reader-page-loading 1.3s linear infinite;
}

.reader-page-loading span {
  width: 28px;
  height: 28px;
  border: 2px solid rgba(17, 17, 17, 0.16);
  border-top-color: #111111;
  border-radius: 50%;
  animation: reader-page-spin 700ms linear infinite;
}

.pdf-page-frame.is-loaded .reader-page-loading,
.pdf-page-frame.has-error .reader-page-loading {
  display: none;
}

.reader-page-error {
  z-index: 2;
  align-content: center;
  gap: 8px;
  padding: 28px;
  color: #4c5158;
  background: #f3f4f5;
  text-align: center;
}

.reader-page-error[hidden] {
  display: none;
}

.reader-page-error strong {
  color: #17191c;
  font-size: 14px;
}

.reader-page-error span {
  font-size: 11px;
}

@keyframes reader-page-loading {
  to { background-position: -240% 0; }
}

@keyframes reader-page-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 900px) {
  .pdf-reader-toolbar {
    align-items: flex-start;
  }

  .reader-document-meta {
    display: none;
  }

  .reader-document-actions .reader-toolbar-button span {
    display: none;
  }

  .active-book-summary strong {
    max-width: 42vw;
  }

  .pdf-viewer-controls {
    grid-template-columns: auto 1fr auto;
  }
}

@media (max-width: 620px) {
  .pdf-reader-toolbar {
    gap: 8px;
    padding: 9px;
  }

  .reader-back-button span,
  .reader-position,
  .reader-fit-button span {
    display: none;
  }

  .reader-back-button {
    padding: 0;
  }

  .active-book-summary {
    gap: 6px;
  }

  .active-book-summary strong {
    max-width: 38vw;
    font-size: 12px;
  }

  .pdf-viewer-controls {
    grid-template-columns: 1fr auto;
    gap: 8px;
    padding: 7px 8px;
  }

  .reader-zoom-controls output {
    display: none;
  }

  .pdf-viewer-controls .reader-fit-button {
    margin-left: 0;
    padding: 0 8px;
  }

  .pdf-page-stage {
    min-height: 68vh;
    max-height: calc(100vh - 205px);
    padding: 14px;
  }

  .pdf-page-frame {
    margin-bottom: 14px;
  }
}

/* Contained Library reader: PDF-only scroll view with roughly one page per screen. */
.pdf-reader-layout {
  height: auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
  overflow: hidden;
  background: #e7e9e7;
}

.reader-document-pane {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
}

.reader-document-pane .pdf-page-stage {
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  padding: 16px;
  background: #e7e9e7;
  scroll-padding: 16px;
  scroll-snap-type: y proximity;
  scrollbar-gutter: auto;
}

.reader-document-pane .pdf-page-frame {
  width: min(520px, calc((100vh - 230px) * 0.707), calc(100% - 32px));
  max-width: 100%;
  flex: 0 0 auto;
  margin: 0;
  border: 1px solid rgba(17, 17, 17, 0.16);
  box-shadow: 0 8px 22px rgba(17, 17, 17, 0.14);
  scroll-snap-align: start;
  transition: none;
}

.reader-side-panel {
  position: relative;
  top: auto;
  min-width: 0;
  min-height: 0;
  display: block;
  border-left: 1px solid rgba(17, 17, 17, 0.18);
  background: #fbfbfa;
}

.orion-chat-panel.reader-file-chat {
  --ambiente-accent: #2463d4;
  --ambiente-accent-strong: #174aa8;
  --ambiente-accent-rgb: 36, 99, 212;
  width: 100%;
  height: 100%;
  max-height: none;
  min-height: 0;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 10px;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  padding: 14px;
  background: #fbfbfa;
  box-shadow: none;
  opacity: 1;
}

.orion-chat-panel.reader-file-chat::before {
  display: none;
}

.reader-file-chat .reader-chat-header {
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.reader-file-chat .reader-chat-header > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.reader-file-chat .reader-chat-header strong {
  color: #1f2420;
  font-size: 13px;
  font-weight: 700;
}

.reader-chat-file-badge {
  flex: 0 0 auto;
  border: 1px solid rgba(var(--ambiente-accent-rgb, 77, 139, 69), 0.22);
  border-radius: 999px;
  padding: 4px 7px;
  color: var(--ambiente-accent-strong, #326c2c);
  background: rgba(var(--ambiente-accent-rgb, 77, 139, 69), 0.07);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.reader-chat-scope {
  min-width: 0;
  overflow: hidden;
  border-bottom: 1px solid rgba(17, 17, 17, 0.08);
  margin: 0;
  padding-bottom: 9px;
  color: #747a75 !important;
  font-size: 9px !important;
  line-height: 1.35 !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reader-file-chat .reader-chat-thread {
  min-height: 0;
  max-height: none;
  display: flex;
  gap: 14px;
  overflow-y: auto;
  padding: 4px 4px 8px 0;
  scrollbar-width: thin;
}

.reader-file-chat .reader-chat-turn {
  width: 100%;
}

.reader-file-chat .reader-chat-bubble {
  width: 100%;
  max-width: 100%;
  gap: 7px;
  padding: 0;
}

.reader-file-chat .reader-chat-turn.user {
  justify-content: flex-end;
}

.reader-file-chat .reader-chat-turn.user .reader-chat-bubble {
  width: fit-content;
  max-width: 92%;
  border: 1px solid rgba(17, 17, 17, 0.1);
  border-radius: 10px 10px 3px 10px;
  padding: 7px 9px;
  color: #202520;
  background: rgba(17, 17, 17, 0.055);
}

.reader-file-chat .reader-chat-message-content {
  gap: 7px;
}

.reader-file-chat .reader-chat-message-content p,
.reader-file-chat .reader-chat-message-content .ambiente-chat-list {
  font-size: 11px;
  line-height: 1.5;
}

.reader-file-chat .ambiente-message-footer {
  flex-wrap: wrap;
  row-gap: 4px;
}

.reader-file-chat .reader-compose-panel {
  min-width: 0;
  border-radius: 12px;
  padding: 5px 6px 5px 10px;
}

.reader-file-chat .reader-input-row,
.reader-file-chat .reader-input-row.dictation-supported {
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 6px;
}

.reader-file-chat .reader-input-row:not(.dictation-supported) {
  grid-template-columns: minmax(0, 1fr) auto;
}

.reader-file-chat .reader-input-row textarea {
  min-height: 34px;
  max-height: 92px;
  padding: 7px 0;
  font-size: 11px;
}

.reader-file-chat .reader-input-row .orion-dictation-button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 0;
  padding: 0;
  color: #111111;
  background: transparent;
  box-shadow: none;
}

.reader-file-chat .reader-input-row .orion-dictation-button:hover,
.reader-file-chat .reader-input-row .orion-dictation-button:focus-visible {
  color: var(--ambiente-accent-strong);
  background: transparent;
  box-shadow: none;
}

.reader-file-chat .reader-input-row button.reader-send-button {
  width: auto !important;
  min-width: 68px;
  height: 34px;
  gap: 5px;
  border-color: var(--ambiente-accent-strong);
  border-radius: 9px;
  padding: 0 10px;
  color: #ffffff;
  background: var(--ambiente-accent);
  box-shadow: none;
  font-size: 10px;
  font-weight: 750;
}

.reader-file-chat .reader-input-row button.reader-send-button:hover,
.reader-file-chat .reader-input-row button.reader-send-button:focus-visible {
  border-color: var(--ambiente-accent-strong);
  color: #ffffff;
  background: var(--ambiente-accent-strong);
}

.reader-file-chat .reader-send-button .ambiente-send-icon {
  width: 14px;
  height: 14px;
}

@media (max-width: 1050px) {
  .pdf-reader-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .reader-file-chat .reader-chat-file-badge {
    display: none;
  }
}

@media (max-width: 760px) {
  .blank-workspace.library-reader-active,
  .library-reader-active .pdf-reader-workspace {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .pdf-reader-layout {
    height: auto;
    max-height: none;
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .reader-document-pane {
    height: 72vh;
  }

  .reader-side-panel {
    min-height: 390px;
    border-top: 1px solid rgba(17, 17, 17, 0.18);
    border-left: 0;
  }

  .orion-chat-panel.reader-file-chat {
    min-height: 390px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .loading-dots::before,
  .ambiente-loading-dots::before {
    width: 3ch;
    animation: none;
  }

  .ambiente-attachment-menu {
    animation: none;
  }

  .pdf-page-stage,
  .reader-pdf-page {
    scroll-behavior: auto;
    transition: none;
  }

  .reader-page-loading,
  .reader-page-loading span {
    animation: none;
  }
}

/* Orion landing pages: portrait/mobile workstation layout. */
@media (max-width: 980px) {
  html,
  body {
    touch-action: pan-x pan-y;
    -webkit-text-size-adjust: 100%;
  }

  input,
  select,
  textarea {
    font-size: 16px !important;
  }

  a,
  button,
  input,
  select,
  textarea {
    -webkit-tap-highlight-color: transparent;
  }

  body.environments-home {
    padding-bottom: calc(68px + env(safe-area-inset-bottom));
  }

  body.environments-home .orion-app {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
  }

  body.environments-home .orion-sidebar,
  body.environments-home .orion-mode-nav,
  body.environments-home .orion-lower-nav {
    display: contents;
  }

  body.environments-home .orion-sidebar-navigation {
    position: fixed;
    right: max(10px, env(safe-area-inset-right));
    bottom: calc(3px + env(safe-area-inset-bottom) + var(--orion-visual-viewport-bottom, 0px));
    left: max(10px, env(safe-area-inset-left));
    z-index: 60;
    min-height: 58px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.78);
    border-radius: 22px;
    padding: 4px;
    background:
      linear-gradient(145deg, rgba(255, 255, 255, 0.68), rgba(242, 246, 242, 0.48)),
      rgba(251, 251, 250, 0.46);
    box-shadow:
      0 18px 50px rgba(17, 24, 39, 0.16),
      0 3px 12px rgba(17, 24, 39, 0.08),
      inset 0 1px 0 rgba(255, 255, 255, 0.92),
      inset 0 -1px 0 rgba(17, 17, 17, 0.06);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    isolation: isolate;
  }

  body.environments-home .orion-sidebar-navigation::before {
    content: "";
    position: absolute;
    inset: 1px;
    z-index: -1;
    border-radius: inherit;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.42), transparent 42%);
    pointer-events: none;
  }

  body.environments-home .brand-link {
    order: 1;
    width: 100%;
    min-height: calc(68px + env(safe-area-inset-top));
    display: inline-flex;
    padding: calc(10px + env(safe-area-inset-top)) 40px 10px;
    border-bottom: 1px solid rgba(17, 17, 17, 0.08);
    background: rgba(251, 251, 250, 0.72);
    backdrop-filter: blur(18px) saturate(130%);
    -webkit-backdrop-filter: blur(18px) saturate(130%);
  }

  body.environments-home .brand-link::after {
    content: "";
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-radius: 50%;
    margin-left: auto;
    background: var(--green);
  }

  body.environments-home .brand-mark {
    width: 44px;
    height: 44px;
    font-size: 18px;
  }

  body.environments-home .brand-title {
    gap: 24px;
  }

  body.environments-home .brand-title small {
    font-size: 13px;
  }

  body.environments-home .orion-main {
    order: 2;
    width: 100%;
  }

  body.environments-home .appbar {
    display: none;
  }

  body.environments-home .hero-band {
    padding: 30px 40px 14px;
  }

  body.environments-home .hero-band h1 {
    margin-top: 22px;
    font-size: clamp(25px, 3.5vw, 31px);
  }

  body.environments-home .hero-copy {
    margin-top: 20px;
    font-size: clamp(13px, 1.7vw, 15px);
  }

  body.environments-home .hero-band::after {
    margin-top: 28px;
  }

  body.environments-home .orion-start {
    padding: 18px 40px 34px;
  }

  body.environments-home .subject-card-grid {
    width: 100%;
    max-width: none;
    display: block;
    margin: 0;
  }

  body.library-subject-selection .subject-card-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px 18px;
  }

  body.environments-home .active-env-panel {
    gap: 20px;
  }

  body.environments-home .active-env-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 20px;
  }

  body.environments-home .recent-env-list header {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  body.environments-home .recent-env-list button {
    grid-template-columns: 42px minmax(0, 1fr) auto;
  }

  body.environments-home .recent-env-list header,
  body.environments-home .recent-env-list button {
    min-height: 48px;
    padding-right: 18px;
    padding-left: 18px;
  }

  body.environments-home .core-card {
    order: 3;
    width: auto;
    min-height: 176px;
    align-content: center;
    gap: 10px;
    margin: 0 40px 32px;
    padding: 26px 28px;
    background: rgba(255, 255, 255, 0.46);
    opacity: 1;
  }

  body.environments-home .core-card > span {
    font-size: 20px;
  }

  body.environments-home .core-card small {
    font-size: 14px;
  }

  body.environments-home .core-card i {
    top: 36px;
    right: 32px;
    width: 8px;
    height: 8px;
  }

  body.environments-home .side-nav-link {
    position: relative;
    inset: auto;
    z-index: 1;
    width: auto;
    min-width: 0;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 2px;
    border: 1px solid transparent;
    border-radius: 17px;
    padding: 3px 2px;
    color: #111111;
    background: transparent;
    font-size: 9px;
    opacity: 0.62;
    text-align: center;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    transition: color 150ms ease, opacity 150ms ease, background 150ms ease, border-color 150ms ease;
  }

  body.environments-home .side-index {
    display: none;
  }

  body.environments-home .side-icon {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
  }

  body.environments-home .side-icon-library {
    width: 16px;
    height: 16px;
    transform: translateY(-2px);
  }

  body.environments-home .side-icon-library::before {
    width: 15px;
    height: 5px;
    box-shadow:
      0 5px 0 -1px var(--bg),
      0 5px 0 0 currentColor,
      0 10px 0 -1px var(--bg),
      0 10px 0 0 currentColor;
  }

  body.environments-home .side-icon-feather {
    background: currentColor;
  }

  body.environments-home .side-nav-link.active {
    color: var(--green);
    border-color: rgba(255, 255, 255, 0.72);
    background: rgba(255, 255, 255, 0.52);
    box-shadow:
      0 4px 16px rgba(17, 24, 39, 0.07),
      inset 0 1px 0 rgba(255, 255, 255, 0.9);
    opacity: 1;
  }

  body.environments-home .side-nav-link.active::before {
    content: none;
  }

  body.environments-home .side-nav-link:hover {
    background: transparent;
  }

  body.environments-home .side-nav-link.active:hover {
    background: rgba(255, 255, 255, 0.52);
  }

  body.environments-home.orion-workspace-active .core-card {
    display: none;
  }

  body.environments-home.orion-workspace-active .blank-workspace {
    width: 100%;
    min-height: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
    padding: 34px 40px calc(96px + env(safe-area-inset-bottom));
    background: transparent;
    box-shadow: none;
  }

  body.environments-home.orion-workspace-active .workspace-topbar {
    display: none;
  }

  body.environments-home.orion-workspace-active .workspace-body {
    padding-top: 0;
  }

  body.environments-home.orion-workspace-active .book-picker {
    border-radius: 0 14px 14px;
    background: var(--library-folder-surface);
    box-shadow: 0 16px 42px rgba(17, 24, 39, 0.08);
  }
}

@media (max-width: 560px) {
  body.library-subject-selection .subject-card-grid {
    grid-template-columns: 1fr;
  }

  body.environments-home .brand-link,
  body.environments-home .hero-band,
  body.environments-home .orion-start {
    padding-right: 18px;
    padding-left: 18px;
  }

  body.environments-home .brand-link {
    gap: 14px;
    font-size: 18px;
  }

  body.environments-home .brand-title {
    gap: 14px;
  }

  body.environments-home .brand-title small {
    font-size: 11px;
  }

  body.environments-home .brand-mark {
    width: 38px;
    height: 38px;
    font-size: 16px;
  }

  body.environments-home .active-env-grid {
    gap: 14px;
  }

  body.environments-home .env-card {
    padding: 13px 12px 14px;
  }

  body.environments-home .env-id {
    top: 18px;
    right: 32px;
    font-size: 9px;
  }

  body.environments-home .env-delete-button {
    top: 7px;
    right: 7px;
  }

  body.environments-home .env-title-block {
    margin-top: 14px;
  }

  body.environments-home .env-card strong {
    font-size: 14px;
  }

  body.environments-home .env-card em,
  body.environments-home .env-card p {
    font-size: 10px;
  }

  body.environments-home .env-divider {
    margin: 12px 0 10px;
  }

  body.environments-home .env-meta-group + .env-meta-group {
    margin-top: 8px;
  }

  body.environments-home .new-env-card span {
    font-size: 12px;
  }

  body.environments-home .recent-env-list header,
  body.environments-home .recent-env-list button {
    min-height: 42px;
    padding-right: 12px;
    padding-left: 12px;
  }

  body.environments-home .core-card {
    min-height: 164px;
    margin-right: 18px;
    margin-left: 18px;
    padding: 24px;
  }

  body.environments-home .core-card > span {
    font-size: 17px;
  }

  body.environments-home .core-card small {
    font-size: 12px;
  }

  body.environments-home .side-nav-link {
    min-height: 48px;
    gap: 2px;
    padding: 3px 2px;
    font-size: 9px;
  }

  body.environments-home.orion-workspace-active .blank-workspace {
    padding: 30px 18px calc(88px + env(safe-area-inset-bottom));
  }

  body.environments-home.orion-workspace-active .book-picker {
    gap: 12px;
    padding: 14px;
  }
}

/* The creation form is a compact, safe-area-aware sheet on phones. Its
   default state fits as one card, while the document list remains its only
   intentionally scrollable expansion. */
@media (max-width: 680px) {
  #new-env-dialog.env-modal-backdrop {
    place-items: center;
    padding:
      max(52px, calc(env(safe-area-inset-top) + 14px))
      14px
      max(16px, calc(env(safe-area-inset-bottom) + 10px));
  }

  #new-env-form.env-modal {
    width: min(100%, 410px);
    max-height: none;
    overflow: visible;
    border-radius: 16px;
    padding: 16px 16px 14px;
    background: rgba(255, 255, 255, 0.98);
  }

  #new-env-form .env-modal-header {
    grid-template-columns: 26px minmax(0, 1fr) 30px;
    gap: 10px;
    padding: 0 0 13px;
  }

  #new-env-form .env-modal-icon {
    width: 26px;
    height: 26px;
    font-size: 23px;
  }

  #new-env-form .env-modal-header h2 {
    font-size: 18px;
  }

  #new-env-form .env-modal-header p {
    margin-top: 5px;
    font-size: 10px;
    line-height: 1.35;
  }

  #new-env-form .env-modal-close {
    width: 30px;
    height: 30px;
    font-size: 26px;
  }

  #new-env-form .env-modal-section {
    gap: 8px;
    padding: 12px 0;
  }

  #new-env-form .env-modal-row {
    font-size: 11px;
  }

  #new-env-form input,
  #new-env-form select {
    min-height: 40px;
    padding-right: 12px;
    padding-left: 12px;
  }

  #new-env-form select {
    padding-right: 36px;
    background-position: right 12px center;
  }

  #new-env-form .env-modal-range {
    gap: 9px;
  }

  #new-env-form .env-modal-range-field {
    gap: 4px;
  }

  #new-env-form .env-modal-range label,
  #new-env-form .env-modal-range-hint {
    font-size: 9px;
  }

  #new-env-form .env-modal-range > span {
    font-size: 18px;
    transform: translateY(7px);
  }

  #new-env-form .env-modal-document-source {
    gap: 6px;
    margin-top: -1px;
  }

  #new-env-form .env-modal-add-document {
    min-height: 36px;
    padding: 6px 9px;
  }

  #new-env-form .env-modal-source-lock {
    inset: 34px 0 0;
  }

  #new-env-form .env-modal-document-list {
    max-height: 164px;
  }

  #new-env-form .env-modal-submit {
    min-height: 44px;
    gap: 10px;
    margin-top: 12px;
    font-size: 13px;
  }

  #new-env-form .env-modal-status {
    min-height: 12px;
    margin-top: 4px;
    font-size: 10px;
  }
}

/* Active Ambiente uses the compact chat as soon as the desktop sidebar no
   longer fits. Keep this breakpoint aligned with ORION_COMPACT_CHAT_MEDIA_QUERY. */
@media (max-width: 980px) {
  body.ambiente-chat-active {
    width: 100%;
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
  }

  body.ambiente-chat-active .orion-app {
    position: fixed;
    top: var(--orion-visual-viewport-top, 0px);
    right: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    height: var(--orion-visual-viewport-height, 100dvh);
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background:
      radial-gradient(circle at 1px 1px, var(--dot-grid) 1px, transparent 1.6px) 0 0 / 34px 34px,
      var(--bg);
  }

  body.ambiente-chat-active .orion-sidebar {
    position: relative;
    top: 0;
    z-index: 70;
    width: 100%;
    height: 0;
    min-height: 0;
    flex: 0 0 0;
    display: block;
    border: 0;
    padding: 0;
    background: transparent;
    overflow: visible;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  body.ambiente-chat-active .brand-link {
    display: none;
  }

  body.ambiente-chat-active .brand-mark {
    width: 46px;
    height: 46px;
    border-radius: 9px;
    font-size: 19px;
  }

  body.ambiente-chat-active .brand-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  body.ambiente-chat-active .brand-title small {
    font-size: 10px;
  }

  body.ambiente-chat-active .orion-sidebar-navigation {
    position: absolute;
    top: calc(66px + env(safe-area-inset-top));
    right: 12px;
    left: 12px;
    z-index: 100;
    max-height: calc(var(--orion-visual-viewport-height, 100dvh) - 82px - env(safe-area-inset-top));
    display: none;
    grid-template-rows: auto auto;
    gap: 8px;
    overflow-y: auto;
    border: 1px solid rgba(17, 17, 17, 0.16);
    border-radius: 16px;
    padding: 10px;
    background: rgba(251, 251, 250, 0.985);
    box-shadow: 0 24px 70px rgba(17, 17, 17, 0.18);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
  }

  body.ambiente-chat-active.mobile-nav-open .orion-sidebar-navigation {
    display: grid;
    filter: none;
    opacity: 1;
  }

  body.ambiente-chat-active.mobile-nav-open .orion-sidebar {
    z-index: 90;
  }

  body.ambiente-chat-active.mobile-nav-open::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 60;
    background: rgba(17, 17, 17, 0.06);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    pointer-events: none;
  }

  body.ambiente-chat-active.mobile-nav-open .orion-main {
    filter: blur(2px) saturate(0.72);
    opacity: 0.7;
  }

  body.ambiente-chat-active .orion-mode-nav,
  body.ambiente-chat-active .orion-lower-nav {
    min-height: 0;
    display: grid;
    gap: 6px;
    border: 0;
    padding: 0;
  }

  body.ambiente-chat-active .orion-lower-nav {
    border-top: 1px solid var(--line);
    padding-top: 8px;
  }

  body.ambiente-chat-active .orion-sidebar-navigation .side-nav-link {
    position: relative;
    inset: auto;
    width: 100%;
    min-height: 50px;
    display: grid;
    grid-template-columns: 28px 30px minmax(0, 1fr);
    align-items: center;
    justify-content: initial;
    flex-direction: initial;
    gap: 10px;
    border: 0;
    border-radius: 10px;
    padding: 0 12px;
    color: #111111;
    background: transparent;
    box-shadow: none;
    font-size: 12px;
    opacity: 1;
    text-align: left;
    pointer-events: auto;
    touch-action: manipulation;
  }

  body.ambiente-chat-active .orion-sidebar-navigation .side-nav-link.active {
    color: var(--green);
    background: rgba(77, 139, 69, 0.07);
  }

  body.ambiente-chat-active .orion-sidebar-navigation .side-nav-link.active::before {
    inset: 8px auto 8px 0;
    width: 2px;
    height: auto;
    border-radius: 2px;
  }

  body.ambiente-chat-active .orion-sidebar-navigation .side-index {
    display: inline;
  }

  body.ambiente-chat-active .orion-sidebar-navigation .side-icon {
    width: 24px;
    height: 24px;
  }

  body.ambiente-chat-active .orion-sidebar-navigation .core-card {
    display: none;
  }

  body.ambiente-chat-active .orion-sidebar > .core-card {
    display: none;
  }

  body.ambiente-chat-active .orion-main {
    position: relative;
    z-index: 71;
    width: 100%;
    height: 100%;
    min-height: 0;
    flex: 1 1 auto;
    display: block;
    overflow: hidden;
  }

  body.ambiente-chat-active .appbar {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    z-index: 75;
    width: 100%;
    min-height: calc(56px + env(safe-area-inset-top));
    height: calc(56px + env(safe-area-inset-top));
    display: block;
    border: 0;
    padding: env(safe-area-inset-top) 14px 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  body.ambiente-chat-active .appbar::before {
    content: none;
  }

  body.ambiente-chat-active .top-navigation {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 36px;
    align-items: center;
    gap: 12px;
  }

  body.ambiente-chat-active .top-navigation::after {
    content: "";
    width: 36px;
    height: 36px;
    grid-column: 3;
  }

  body.ambiente-chat-active .mobile-nav-toggle {
    position: relative;
    width: 36px;
    height: 36px;
    grid-column: 1;
    display: grid;
    place-items: center;
    border: 1px solid rgba(17, 17, 17, 0.1);
    border-radius: 50%;
    padding: 0;
    color: #111111;
    background: rgba(255, 255, 255, 0.22);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.54);
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
  }

  body.ambiente-chat-active .mobile-nav-toggle span,
  body.ambiente-chat-active .mobile-nav-toggle span::before,
  body.ambiente-chat-active .mobile-nav-toggle span::after {
    content: "";
    position: absolute;
    width: 15px;
    height: 1.5px;
    border-radius: 2px;
    background: currentColor;
    transition: transform 150ms ease, width 150ms ease;
  }

  body.ambiente-chat-active .mobile-nav-toggle span {
    position: relative;
  }

  body.ambiente-chat-active .mobile-nav-toggle span::before {
    top: -5px;
    left: 0;
    width: 12px;
  }

  body.ambiente-chat-active .mobile-nav-toggle span::after {
    top: 5px;
    left: 0;
    width: 9px;
  }

  body.ambiente-chat-active.mobile-nav-open .mobile-nav-toggle span {
    background: transparent;
  }

  body.ambiente-chat-active.mobile-nav-open .mobile-nav-toggle span::before,
  body.ambiente-chat-active.mobile-nav-open .mobile-nav-toggle span::after {
    top: 0;
    width: 15px;
  }

  body.ambiente-chat-active.mobile-nav-open .mobile-nav-toggle span::before {
    transform: rotate(45deg);
  }

  body.ambiente-chat-active.mobile-nav-open .mobile-nav-toggle span::after {
    transform: rotate(-45deg);
  }

  body.ambiente-chat-active .app-breadcrumb {
    display: none;
  }

  body.ambiente-chat-active .top-navigation .app-links {
    display: none !important;
  }

  body.ambiente-chat-active .top-status {
    display: none;
  }

  body.ambiente-chat-active .top-status::after {
    content: "";
    position: absolute;
    top: 9px;
    right: 2px;
    width: 9px;
    height: 9px;
    border-right: 2px solid #111111;
    border-bottom: 2px solid #111111;
    transform: rotate(45deg);
  }

  body.ambiente-chat-active .system-status {
    color: #111111;
    font-size: 10px;
    opacity: 1;
    white-space: nowrap;
  }

  body.ambiente-chat-active .system-status::before {
    width: 6px;
    height: 6px;
    margin-right: 8px;
  }

  body.ambiente-chat-active .blank-workspace.ambiente-view-active {
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
    overflow: hidden;
  }

  body.ambiente-chat-active .ambiente-view-active .workspace-body {
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 0;
    overflow: hidden;
  }

  body.ambiente-chat-active .ambiente-shell,
  body.ambiente-chat-active .ambiente-main {
    width: 100%;
    height: 100%;
    min-height: 0;
  }

  body.ambiente-chat-active .ambiente-shell {
    display: block;
  }

  body.ambiente-chat-active .ambiente-main {
    position: relative;
    display: block;
    gap: 0;
    padding: 0;
    overflow: hidden;
  }

  body.ambiente-chat-active .ambiente-kicker {
    display: none;
  }

  body.ambiente-chat-active .ambiente-assistant-card {
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 0;
    overflow: hidden;
  }

  body.ambiente-chat-active .ambiente-chat-thread {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 0;
    gap: 32px;
    padding: calc(64px + env(safe-area-inset-top)) 28px calc(74px + env(safe-area-inset-bottom)) 18px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: auto;
    -webkit-overflow-scrolling: touch;
    overflow-anchor: none;
    contain: layout paint;
    scroll-padding-bottom: calc(74px + env(safe-area-inset-bottom));
  }

  body.ambiente-chat-active .ambiente-chat-turn {
    overflow-anchor: none;
  }

  body.ambiente-chat-active .ambiente-chat-turn.assistant.viewport-anchor {
    min-height: 0;
  }

  body.ambiente-chat-active .ambiente-chat-turn.assistant .ambiente-chat-bubble,
  body.ambiente-chat-active .ambiente-chat-turn.starter .ambiente-chat-bubble {
    width: 100%;
    max-width: 100%;
  }

  body.ambiente-chat-active .ambiente-chat-bubble p,
  body.ambiente-chat-active .ambiente-chat-list,
  body.ambiente-chat-active .ambiente-mastery-list li {
    font-size: 14px;
    line-height: 1.62;
  }

  body.ambiente-chat-active .ambiente-greeting {
    font-size: 15px;
    line-height: 1.58;
  }

  body.ambiente-chat-active .ambiente-mastery-groups {
    gap: 18px;
  }

  body.ambiente-chat-active .ambiente-mastery-group h4 {
    margin-bottom: 9px;
    font-size: 15px;
    line-height: 1.45;
  }

  body.ambiente-chat-active .ambiente-mastery-list {
    gap: 9px;
  }

  body.ambiente-chat-active .ambiente-topic-button:disabled {
    color: inherit;
    cursor: default;
    pointer-events: none;
    text-decoration: none;
  }

  body.ambiente-chat-active .ambiente-user-message-stack {
    max-width: 90%;
  }

  body.ambiente-chat-active .ambiente-chat-turn.user .ambiente-chat-bubble {
    max-width: 100%;
    gap: 12px;
    border-radius: 16px;
    padding: 11px 14px;
  }

  body.ambiente-chat-active .ambiente-user-time::after {
    content: "✓✓";
    margin-left: 7px;
    color: var(--ambiente-accent-strong);
    font-size: 10px;
    letter-spacing: -0.16em;
  }

  body.ambiente-chat-active .ambiente-compose-panel.ambiente-environment-compose {
    position: absolute;
    right: 20px;
    bottom: max(15px, env(safe-area-inset-bottom)) !important;
    left: 20px;
    z-index: 50;
    width: auto;
    max-width: 520px;
    gap: 8px;
    margin: 0 auto;
    padding: 0;
    transform: none;
    transition: none;
  }

  html.orion-keyboard-visible body.ambiente-chat-active .ambiente-compose-panel.ambiente-environment-compose {
    bottom: 15px !important;
  }

  body.ambiente-chat-active .ambiente-compose-attachments:empty {
    display: none;
  }

  body.ambiente-chat-active .ambiente-environment-compose .ambiente-input-row,
  body.ambiente-chat-active .ambiente-environment-compose .ambiente-input-row.dictation-supported {
    min-height: 50px;
    grid-template-columns: 34px minmax(0, 1fr) 34px 38px;
    gap: 2px;
    border: 1px solid rgba(255, 255, 255, 0.78);
    border-radius: 999px;
    padding: 4px;
    background:
      linear-gradient(145deg, rgba(255, 255, 255, 0.76), rgba(242, 247, 242, 0.5)),
      rgba(251, 251, 250, 0.46);
    box-shadow:
      0 18px 48px rgba(17, 24, 39, 0.16),
      0 3px 12px rgba(17, 24, 39, 0.08),
      0 0 0 1px rgba(var(--ambiente-accent-rgb), 0.14),
      inset 0 1px 0 rgba(255, 255, 255, 0.94),
      inset 0 -1px 0 rgba(17, 17, 17, 0.05);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
  }

  body.ambiente-chat-active .ambiente-environment-compose .ambiente-input-row:not(.dictation-supported) {
    grid-template-columns: 34px minmax(0, 1fr) 38px;
  }

  body.ambiente-chat-active .ambiente-environment-compose .ambiente-input-row.composer-expanded {
    border-radius: 22px;
  }

  body.ambiente-chat-active .ambiente-environment-compose .ambiente-input-row textarea {
    min-height: 40px;
    max-height: 120px;
    padding: 8px 2px;
    font-size: 16px;
    line-height: 1.45;
  }

  body.ambiente-chat-active .ambiente-environment-compose .ambiente-input-row.dictation-supported .ambiente-attachment-button[class] {
    width: 34px !important;
    height: 34px !important;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.54);
    box-shadow: 0 5px 14px rgba(17, 24, 39, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  }

  body.ambiente-chat-active .orion-dictation-button {
    width: 34px;
    height: 34px;
  }

  body.ambiente-chat-active .ambiente-environment-compose .ambiente-input-row button[type="submit"] {
    width: 38px !important;
    height: 38px !important;
    box-shadow: 0 7px 18px rgba(var(--ambiente-accent-rgb), 0.28);
  }

  body.ambiente-chat-active .ambiente-info-button {
    position: absolute;
    top: calc(10px + env(safe-area-inset-top));
    right: 14px;
    z-index: 82;
    width: 36px;
    height: 36px;
    border-color: rgba(17, 17, 17, 0.1);
    background: rgba(255, 255, 255, 0.22);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.54);
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    font-size: 15px;
  }

  body.ambiente-chat-active .ambiente-info-window {
    top: calc(66px + env(safe-area-inset-top));
    right: 18px;
    left: 18px;
    z-index: 90;
    width: auto;
    max-height: calc(100% - 28px);
    overflow-y: auto;
  }
}

@media (max-width: 380px) {
  body.ambiente-chat-active .orion-sidebar {
    padding-right: 14px;
    padding-left: 14px;
  }

  body.ambiente-chat-active .brand-link {
    gap: 10px;
    font-size: 15px;
  }

  body.ambiente-chat-active .brand-mark {
    width: 42px;
    height: 42px;
    font-size: 17px;
  }

  body.ambiente-chat-active .brand-title small,
  body.ambiente-chat-active .system-status,
  body.ambiente-chat-active .top-status {
    font-size: 9px;
  }

  body.ambiente-chat-active .top-status {
    right: 14px;
    width: 46vw;
  }

  body.ambiente-chat-active .appbar {
    padding-right: 14px;
    padding-left: 14px;
  }

  body.ambiente-chat-active .top-navigation {
    gap: 12px;
  }

  body.ambiente-chat-active .app-breadcrumb {
    gap: 9px;
    font-size: 11px;
  }

  body.ambiente-chat-active .ambiente-chat-thread {
    padding-right: 24px;
    padding-left: 14px;
  }

  body.ambiente-chat-active .ambiente-compose-panel.ambiente-environment-compose {
    right: 16px;
    left: 16px;
  }
}
