:root {
  --ink: #14201c;
  --paper: #f3efe6;
  --paper-deep: #e7e0d2;
  --accent: #0f6a5f;
  --line: rgba(20, 32, 28, 0.12);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Source Sans 3", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  background:
    radial-gradient(circle at 12% 10%, rgba(15, 106, 95, 0.14), transparent 36%),
    radial-gradient(circle at 88% 0%, rgba(196, 112, 48, 0.12), transparent 30%),
    linear-gradient(160deg, #f7f3ea 0%, #ebe4d6 55%, #e2dccf 100%);
}

.brand,
.brand-link,
.brand-logo {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

.brand-logo {
  display: inline-block;
  line-height: 0;
}

.brand-logo img {
  display: block;
  width: auto;
  height: 2.5rem;
}

.brand-logo-sm img {
  height: 2rem;
}

.brand-logo-md img {
  height: 2.5rem;
}

.brand-logo-lg img {
  height: 3.25rem;
}

.brand-logo-hero {
  display: block;
  margin: 0 0 0.85rem;
}

.brand-logo-hero img {
  height: clamp(4rem, 10vw, 6.5rem);
}

.brand-logo-link {
  text-decoration: none;
}

.brand-logo-link:hover {
  opacity: 0.92;
}

.home-top {
  padding: 0.35rem 0;
}

.home-top-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-height: 2.25rem;
}

.user-nav-cluster {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.user-nav {
  display: flex;
  align-items: center;
}

.user-nav-toggle,
.manual-nav-link,
.manual-pdf-link {
  --bs-btn-padding-y: 0.15rem;
  --bs-btn-padding-x: 0.5rem;
  --bs-btn-font-size: 0.75rem;
  --bs-btn-border-radius: 0.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  line-height: 1.2;
}

.manual-nav-link {
  min-width: 2rem;
}

.manual-pdf-link {
  text-decoration: none;
}

.user-nav-name {
  max-width: 8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.9;
}

.user-nav .dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.user-nav .dropdown-item i {
  width: 1rem;
  text-align: center;
  opacity: 0.75;
}

.user-nav form {
  margin: 0;
}

/* Light surfaces (home, admin, account, handout, manual) */
.home .user-nav-toggle,
.home .manual-nav-link,
.admin-page .user-nav-toggle,
.admin-page .manual-nav-link,
.auth-page .user-nav-toggle,
.auth-page .manual-nav-link,
.handout .user-nav-toggle,
.handout .manual-nav-link,
.manual-body .user-nav-toggle,
.manual-body .manual-nav-link,
.manual-body .manual-pdf-link {
  --bs-btn-color: var(--ink);
  --bs-btn-bg: transparent;
  --bs-btn-border-color: rgba(20, 32, 28, 0.35);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--ink);
  --bs-btn-hover-border-color: var(--ink);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: var(--ink);
  --bs-btn-active-border-color: var(--ink);
}

/* Dark editor bar */
.editor-shell .user-nav-toggle,
.editor-shell .manual-nav-link {
  --bs-btn-color: #f2eee6;
  --bs-btn-bg: transparent;
  --bs-btn-border-color: rgba(255, 255, 255, 0.35);
  --bs-btn-hover-color: #0d100e;
  --bs-btn-hover-bg: #f2eee6;
  --bs-btn-hover-border-color: #f2eee6;
  --bs-btn-active-color: #0d100e;
  --bs-btn-active-bg: #f2eee6;
  --bs-btn-active-border-color: #f2eee6;
}

.editor-bar-actions > .user-nav-cluster {
  margin-inline-start: 0.55rem;
  padding-inline-start: 0.7rem;
  border-inline-start: 1px solid rgba(255, 255, 255, 0.16);
}

.app-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  min-height: 2.25rem;
  margin-bottom: 1rem;
}

.app-top-bar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.app-top-bar-actions > .btn,
.app-top-bar-actions .user-nav-cluster .btn {
  --bs-btn-padding-y: 0.25rem;
  --bs-btn-padding-x: 0.5rem;
  --bs-btn-font-size: 0.875rem;
  --bs-btn-border-radius: 0.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  line-height: 1.5;
}

.app-top-bar-actions .manual-nav-link {
  min-width: 2rem;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.85rem;
  padding-left: 0.4rem !important;
  padding-right: 0.4rem !important;
}

.btn i + span,
.btn span + i {
  margin-inline-start: 0.35rem;
}

.auth-page,
.admin-page {
  min-height: 100vh;
}

.auth-card {
  max-width: 28rem;
  margin: 0 auto;
  padding: 1.75rem 1.5rem;
  background: rgba(255, 255, 255, 0.55);
  border-top: 1px solid var(--line);
}

.auth-card .brand-logo {
  display: block;
  margin: 0 0 1rem;
}

.auth-card .brand-logo img {
  height: 4.5rem;
}

.auth-card h1 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin: 0 0 0.5rem;
}

.admin-page .brand-logo {
  margin: 0;
}

.home-hero {
  padding: 4.5rem 0 3.5rem;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(120deg, rgba(15, 106, 95, 0.18), transparent 50%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.35), transparent);
}

.home-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  margin: 0 0 0.75rem;
  font-weight: 500;
}

.home-hero .lede {
  max-width: 36rem;
  font-size: 1.1rem;
  margin-bottom: 1.15rem;
}

.home-view-switch {
  display: inline-flex;
  align-items: stretch;
  gap: 0;
  margin-bottom: 1.25rem;
  border: 1px solid rgba(20, 32, 28, 0.28);
  background: rgba(255, 255, 255, 0.55);
}

.home-view-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 8.5rem;
  padding: 0.45rem 1rem;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: rgba(20, 32, 28, 0.72);
  text-decoration: none;
  border-right: 1px solid rgba(20, 32, 28, 0.18);
}

.home-view-tab:last-child {
  border-right: none;
}

.home-view-tab:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
}

.home-view-tab.is-active {
  color: #fff;
  background: var(--ink);
}

.home-view-tab:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  z-index: 1;
}

.home-hero-action {
  display: block;
}

.home-hero-action .btn {
  display: inline-flex;
  align-items: center;
}

.home-theme-rail {
  padding-top: 0.15rem;
}

.home .theme-admin-card[hidden] {
  display: none;
}

.deck-empty .btn i + span {
  margin-inline-start: 0.35rem;
}

.deck-list {
  display: grid;
  gap: 0.75rem;
}

.deck-row {
  display: grid;
  grid-template-columns: 9.5rem minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid transparent;
  background: rgba(255, 255, 255, 0.35);
}

.deck-thumb {
  display: block;
  text-decoration: none;
  color: inherit;
  background: #0b0d0c;
  padding: 0.35rem;
  border: 1px solid rgba(20, 32, 28, 0.08);
}

.deck-thumb:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.deck-thumb-slide.slide.mini {
  width: 100%;
  aspect-ratio: 16 / 9;
  pointer-events: none;
}

.deck-thumb-slide.slide.mini .slide-inner {
  padding: 0.45rem 0.55rem;
  gap: 0.15rem;
}

.deck-thumb-slide.slide.mini h1 {
  font-size: 0.72rem;
}

.deck-thumb-slide.slide.mini h2 {
  font-size: 0.64rem;
}

.deck-thumb-slide.slide.mini p,
.deck-thumb-slide.slide.mini li {
  font-size: 0.5rem;
}

.deck-thumb-empty {
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  color: rgba(247, 242, 232, 0.55);
  font-size: 0.7rem;
  background: #1a1f1c;
}

.deck-meta {
  min-width: 0;
}

.deck-title {
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.25rem;
}

.deck-title:hover {
  color: var(--accent);
}

.deck-sub {
  margin: 0.2rem 0 0;
  color: rgba(20, 32, 28, 0.65);
  font-size: 0.9rem;
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.deck-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
  align-items: center;
}

.deck-actions .deck-present {
  --bs-btn-padding-x: 0.85rem;
  font-weight: 600;
}

.deck-actions-expanded {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.deck-actions-expanded form {
  display: contents;
}

.deck-actions-expanded .btn i + span,
.deck-actions > a.btn i + span {
  margin-inline-start: 0.35rem;
}

.deck-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.deck-search {
  max-width: 18rem;
  width: 100%;
}

.deck-more {
  position: relative;
  display: none;
}

.deck-more-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.3rem);
  min-width: 9rem;
  padding: 0.3rem;
  background: #fff;
  border: 1px solid rgba(20, 32, 28, 0.14);
  z-index: 5;
}

.deck-more-menu[hidden] {
  display: none !important;
}

.deck-more-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.4rem 0.55rem;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
}

.deck-more-item:hover {
  background: rgba(20, 32, 28, 0.06);
}

.deck-row[hidden] {
  display: none !important;
}

.deck-empty {
  padding: 1.5rem 0;
}

.deck-empty .lede {
  max-width: 32rem;
}

body.editor-body {
  height: 100vh;
  overflow: hidden;
}

.editor-shell {
  position: relative;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #121614;
  color: #f2eee6;
}

.editor-bar {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.28rem 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: #0d100e;
}

.editor-bar-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.editor-back {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.brand-link {
  color: #f2eee6;
  text-decoration: none;
}

.brand-link:hover {
  color: #fff;
}

.editor-bar-left .brand-logo {
  flex-shrink: 0;
}

.sep {
  opacity: 0.35;
}

.bar-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.85;
}

.save-status {
  flex-shrink: 0;
  margin-left: 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.55;
}

.save-status[data-state='dirty'] {
  opacity: 0.8;
  color: #f0c674;
}

.save-status[data-state='saving'] {
  opacity: 0.75;
}

.save-status[data-state='error'] {
  opacity: 1;
  color: #ff8a80;
}

.save-status[data-state='saved'] {
  opacity: 0.45;
}

.editor-bar-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  align-items: center;
}

.editor-bar-actions > .btn,
.editor-bar-actions .btn-group > .btn,
.editor-bar-actions .user-nav-toggle,
.editor-bar-actions .manual-nav-link {
  --bs-btn-padding-y: 0.2rem;
  --bs-btn-padding-x: 0.5rem;
  --bs-btn-font-size: 0.75rem;
  --bs-btn-border-radius: 0.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  line-height: 1.2;
  min-height: 1.9rem;
  height: 1.9rem;
  box-sizing: border-box;
}

.editor-focus-modes.btn-group {
  margin-right: 0.1rem;
}

.editor-focus-modes.btn-group > .btn {
  border-radius: 0;
}

.editor-focus-modes.btn-group > .btn:first-child {
  border-top-left-radius: 0.25rem;
  border-bottom-left-radius: 0.25rem;
}

.editor-focus-modes.btn-group > .btn:last-child {
  border-top-right-radius: 0.25rem;
  border-bottom-right-radius: 0.25rem;
}

.editor-focus-modes .btn.is-active {
  background: rgba(242, 238, 230, 0.92);
  color: #0d100e;
  border-color: rgba(242, 238, 230, 0.92);
  z-index: 1;
}


.editor-export,
.editor-share,
.editor-templates {
  position: relative;
}

.save-restore {
  flex-shrink: 0;
  margin-left: 0.15rem;
}

.editor-export-menu,
.editor-toolbar-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.3rem);
  min-width: 9.5rem;
  padding: 0.3rem;
  background: #141816;
  border: 1px solid rgba(255, 255, 255, 0.12);
  z-index: 20;
}

.editor-share .editor-export-menu {
  min-width: 16rem;
}

.editor-share-email {
  margin-top: 0.35rem;
  padding: 0.55rem 0.45rem 0.45rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.editor-share-email-label {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.editor-share-email .form-control,
.editor-share-email .form-select {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.16);
  color: #f4f7f5;
}

.editor-share-email .form-control::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.editor-share-email .form-control:focus,
.editor-share-email .form-select:focus {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.35);
  color: #f4f7f5;
  box-shadow: none;
}

.editor-share-status {
  margin: 0.45rem 0.35rem 0.2rem;
  font-size: 0.78rem;
}

.editor-templates .editor-toolbar-menu {
  left: 0;
  right: auto;
  min-width: 11rem;
}

.editor-export-menu[hidden],
.editor-toolbar-menu[hidden] {
  display: none !important;
}

.editor-export-item,
.editor-toolbar-menu-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  padding: 0.4rem 0.6rem;
  color: #f2eee6;
  text-decoration: none;
  font-size: 0.82rem;
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
}

.editor-export-item:hover,
.editor-toolbar-menu-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.editor-shell.focus-write .preview-pane,
.editor-shell.focus-write .editor-splitter {
  display: none;
}

.editor-shell.focus-write .editor-pane {
  flex: 1 1 auto;
}

.editor-shell.focus-preview .editor-sidebar {
  display: none;
}

.editor-shell.focus-preview .editor-pane,
.editor-shell.focus-preview .editor-splitter {
  display: none;
}

.editor-shell.focus-preview .editor-grid {
  grid-template-columns: 1fr;
}

.editor-shell.focus-preview .preview-pane {
  border-left: 0;
  flex: 1 1 auto;
}

.editor-grid {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

.editor-workspace {
  display: flex;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  --editor-split: 50%;
}

.editor-pane {
  min-height: 0;
  min-width: 12rem;
  height: 100%;
  flex: 0 0 var(--editor-split, 50%);
  max-width: calc(100% - 12rem - 6px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  background: #101412;
}

.editor-splitter {
  flex: 0 0 6px;
  align-self: stretch;
  cursor: col-resize;
  background: rgba(255, 255, 255, 0.06);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  z-index: 2;
}

.editor-splitter:hover,
.editor-splitter:focus-visible,
.editor-shell.is-resizing .editor-splitter {
  background: rgba(215, 195, 154, 0.35);
  outline: none;
}

.editor-shell.is-resizing {
  cursor: col-resize;
  user-select: none;
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.45rem 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: #151a17;
  flex: 0 0 auto;
}

.editor-toolbar .btn {
  --bs-btn-padding-y: 0.2rem;
  --bs-btn-padding-x: 0.55rem;
  --bs-btn-font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.editor-sidebar {
  min-height: 0;
  height: 100%;
  overflow: auto;
  padding: 1rem;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  background: #151a17;
}

.deck-settings {
  margin: 0 0 0.75rem;
  flex: 0 0 auto;
}

.deck-settings-summary,
.slide-nav-summary {
  display: none;
  cursor: pointer;
  list-style: none;
  user-select: none;
  color: rgba(242, 238, 230, 0.9);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.55rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
}

.deck-settings-summary::-webkit-details-marker,
.slide-nav-summary::-webkit-details-marker {
  display: none;
}

.deck-settings-summary::before,
.slide-nav-summary::before {
  content: '▶';
  display: inline-block;
  width: 1rem;
  font-size: 0.65rem;
  opacity: 0.7;
}

.deck-settings[open] > .deck-settings-summary::before,
.slide-nav[open] > .slide-nav-summary::before {
  content: '▼';
}

.deck-settings-body,
.slide-nav-body {
  min-width: 0;
}

.deck-delete-btn {
  justify-content: center;
  margin-top: 0.25rem;
}

.slide-nav {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}

.slide-nav[open] > .slide-nav-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.editor-sidebar .form-label {
  color: rgba(242, 238, 230, 0.75);
  font-size: 0.8rem;
}

.editor-sidebar .form-control,
.editor-sidebar .form-select {
  background: #0f1311;
  border-color: rgba(255, 255, 255, 0.12);
  color: #f2eee6;
}

.theme-picker-label {
  color: rgba(242, 238, 230, 0.75);
  font-size: 0.8rem;
  margin-bottom: 0.4rem;
}

#theme-open {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.45rem;
}

.theme-modal-content,
.uploads-modal-content {
  background: #151a17;
  color: #f2eee6;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.theme-modal-content .modal-header,
.uploads-modal-content .modal-header {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.theme-modal-content .modal-body,
.uploads-modal-content .modal-body {
  padding-top: 0.85rem;
}

.uploads-modal-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.uploads-modal-toolbar .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.uploads-modal-status {
  margin: 0;
  font-size: 0.8rem;
  opacity: 0.65;
}

.uploads-modal-progress {
  margin: 0 0 0.75rem;
}

.uploads-modal-progress[hidden] {
  display: none !important;
}

.uploads-modal-progress .progress {
  height: 0.45rem;
  background: rgba(255, 255, 255, 0.08);
}

.uploads-modal-progress .progress-bar {
  width: 0%;
  background: #d7c39a;
  transition: width 0.12s linear;
}

.uploads-modal-progress-label {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  opacity: 0.7;
}

.uploads-dropzone {
  min-height: 12rem;
  padding: 0.75rem;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.uploads-dropzone.is-dragover {
  border-color: rgba(215, 195, 154, 0.7);
  background: rgba(215, 195, 154, 0.08);
}

.uploads-dropzone-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin: 0 0 0.75rem;
  padding: 0.35rem 0.5rem;
  font-size: 0.82rem;
  opacity: 0.7;
  text-align: center;
}

.uploads-modal-empty {
  margin: 0;
  padding: 1.5rem 0.5rem;
  text-align: center;
  opacity: 0.65;
  font-size: 0.92rem;
}

.uploads-modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
  gap: 0.75rem;
}

.uploads-card {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  min-width: 0;
}

.uploads-card-thumb {
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.35);
}

.uploads-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.uploads-card-name {
  font-size: 0.78rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.85;
}

.uploads-card-usage {
  font-size: 0.68rem;
  line-height: 1.3;
  opacity: 0.55;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.uploads-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem;
}

.uploads-card-actions .btn {
  --bs-btn-padding-y: 0.15rem;
  --bs-btn-padding-x: 0.35rem;
  font-size: 0.72rem;
  justify-content: center;
}

.theme-modal-lede {
  margin: 0 0 1rem;
  opacity: 0.7;
  font-size: 0.92rem;
}

.theme-modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
  gap: 0.85rem;
}

.theme-modal-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.theme-modal-card.is-active {
  border-color: rgba(242, 238, 230, 0.7);
  background: rgba(255, 255, 255, 0.08);
}

.theme-modal-card:hover {
  border-color: rgba(242, 238, 230, 0.4);
}

.theme-picker-thumb.slide.mini {
  width: 100%;
  aspect-ratio: 16 / 9;
  pointer-events: none;
  border: 0;
}

.theme-picker-thumb.slide.mini .slide-inner {
  padding: 0.55rem 0.65rem;
  gap: 0.2rem;
}

.theme-picker-thumb.slide.mini h1 {
  font-size: 0.85rem;
  margin: 0;
}

.theme-picker-thumb.slide.mini p {
  font-size: 0.65rem;
  margin: 0;
  opacity: 0.75;
}

.theme-modal-card-meta {
  display: grid;
  gap: 0.2rem;
  padding: 0.55rem 0.65rem 0.7rem;
}

.theme-modal-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.theme-modal-card-meta strong {
  font-size: 0.9rem;
}

.theme-modal-card-meta > span {
  font-size: 0.75rem;
  line-height: 1.3;
  opacity: 0.65;
}

.theme-origin-badge {
  flex-shrink: 0;
  font-size: 0.62rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
  padding: 0.22rem 0.4rem;
  border: 1px solid currentColor;
  opacity: 0.85;
}

.theme-origin-badge.is-default {
  color: rgba(255, 255, 255, 0.72);
}

.theme-origin-badge.is-yours {
  color: #9fd6c0;
}

.theme-origin-badge.is-other {
  color: rgba(255, 214, 160, 0.9);
}

.deck-logo-fields .form-label {
  margin-bottom: 0.25rem;
}

.deck-logo-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
  align-items: center;
}

.deck-logo-row .form-control {
  min-width: 0;
}

.deck-logo-upload {
  margin: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
}

.deck-handout-fields .form-check {
  margin: 0;
  min-height: 0;
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
}

.deck-handout-fields .form-check-input {
  margin-top: 0.2rem;
  flex: 0 0 auto;
}

.deck-handout-fields .form-check-label {
  color: rgba(242, 238, 230, 0.92);
  font-size: 0.86rem;
  line-height: 1.35;
}

.deck-handout-hint {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  line-height: 1.35;
  color: rgba(242, 238, 230, 0.55) !important;
}

.theme-meta {
  margin: 0 0 1rem;
  padding: 0.65rem 0.7rem;
  background: rgba(255, 255, 255, 0.04);
  border-left: 3px solid rgba(215, 195, 154, 0.65);
}

.theme-meta .theme-desc {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  line-height: 1.35;
  color: rgba(242, 238, 230, 0.72);
}

.theme-meta .theme-fonts {
  margin: 0;
  font-size: 0.78rem;
  color: rgba(215, 195, 154, 0.95);
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.sidebar-help {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}

.sidebar-help .btn {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
}

.sidebar-hint,
.help-panel {
  font-size: 0.82rem;
  line-height: 1.45;
  color: rgba(242, 238, 230, 0.62);
  margin: 0;
}

.sidebar-hint[hidden],
.help-panel[hidden] {
  display: none !important;
}

.sidebar-hint code,
.help-panel code {
  color: #d7c39a;
}

.help-section {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.35rem 0;
}

.help-section:first-child {
  border-top: 0;
}

.help-section summary {
  display: block;
  cursor: pointer;
  color: rgba(242, 238, 230, 0.85);
  font-weight: 600;
  list-style: none;
  padding: 0.15rem 0;
  user-select: none;
}

.help-section summary::-webkit-details-marker {
  display: none;
}

.help-section summary::before {
  content: '▶';
  display: inline-block;
  width: 1rem;
  font-size: 0.65rem;
  opacity: 0.7;
}

.help-section[open] summary::before {
  content: '▼';
}

.help-section p {
  margin: 0.35rem 0 0.15rem;
  padding-left: 1rem;
}

.editor-sidebar .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.editor-shell.is-overview .editor-grid {
  visibility: hidden;
}

.editor-overview.present-overview {
  position: absolute;
}

.present-overview-card.is-draggable {
  cursor: grab;
}

.present-overview-card.is-dragging {
  opacity: 0.45;
  cursor: grabbing;
}

.overview-drop-indicator {
  position: absolute;
  z-index: 5;
  width: 3px;
  border-radius: 2px;
  background: #f2eee6;
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.overview-drop-indicator[hidden] {
  display: none !important;
}

.slide-search {
  margin-bottom: 0.55rem;
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.14);
  color: #f2eee6;
}

.slide-search::placeholder {
  color: rgba(242, 238, 230, 0.45);
}

.slide-search-empty {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  opacity: 0.55;
}

.slide-index {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
  margin-bottom: 0;
  align-content: flex-start;
}

.slide-index-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.25rem;
  align-items: center;
  flex: 0 0 auto;
}

.slide-index-item {
  display: grid;
  grid-template-columns: 1.35rem minmax(0, 1fr);
  gap: 0.4rem;
  align-items: center;
  width: 100%;
  min-height: 0;
  padding: 0.32rem 0.45rem;
  line-height: 1.25;
  border: 0;
  border-left: 3px solid hsl(var(--accent-hue), 55%, 48%);
  color: rgba(242, 238, 230, 0.8);
  text-align: left;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.02);
  font: inherit;
  cursor: pointer;
}

.slide-index-row.is-inactive .slide-index-item {
  opacity: 0.45;
}

.slide-index-skip {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: transparent;
  color: rgba(242, 238, 230, 0.7);
  border-radius: 0.25rem;
  min-width: 1.7rem;
  height: 1.7rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: 0 0 auto;
}

.slide-index-skip:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}

.slide-index-row.is-inactive .slide-index-skip {
  color: rgba(255, 180, 120, 0.95);
  border-color: rgba(255, 180, 120, 0.45);
}

.present-overview-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}

.present-overview-label-row .present-overview-label {
  margin-bottom: 0;
  flex: 1;
  min-width: 0;
}

.present-overview-card.is-inactive {
  opacity: 0.55;
}

.present-overview-card.is-inactive .overview-slide {
  filter: grayscale(0.35);
}

.overview-skip-toggle {
  --bs-btn-padding-y: 0.1rem;
  --bs-btn-padding-x: 0.35rem;
  flex-shrink: 0;
}

.slide-index-item:hover,
.slide-index-row.is-active .slide-index-item {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.slide-index-item .num {
  font-size: 0.75rem;
  opacity: 0.7;
}

.slide-index-item .label {
  font-size: 0.86rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.editor-textarea {
  display: none;
}

.editor-pane .CodeMirror {
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  font-family: "IBM Plex Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.95rem;
  line-height: 1.55;
  background: #101412;
  color: #f4f0e7;
}

.editor-pane .CodeMirror-scroll {
  min-height: 0;
}

.editor-pane .CodeMirror-gutters {
  background: #121614;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.editor-pane .CodeMirror-linenumber {
  color: rgba(242, 238, 230, 0.45);
}

/* Full-width slide break: content + line-number gutter */
.editor-pane .CodeMirror-linebackground.cm-slide-divider,
.editor-pane .CodeMirror-gutter-wrapper.cm-slide-divider {
  border-top: 1px solid hsl(170, 45%, 46%);
}

.editor-pane .CodeMirror-gutter-wrapper.cm-slide-divider {
  margin-top: 0;
}

/* Slide headlines pick up the same per-slide accent as the list border */
.editor-pane .CodeMirror-line.cm-slide-headline .cm-header {
  color: hsl(170, 45%, 46%);
  font-weight: 600;
}

/* Fenced/inline code in GFM uses comment tokens when no nested mode loads */
.editor-pane .cm-s-material-darker .cm-comment {
  color: #b7c4bc;
}

/* Mermaid / chart fences — higher contrast than material-darker comments */
.editor-pane .cm-s-material-darker .cm-keyword {
  color: #89ddff;
}

.editor-pane .cm-s-material-darker .cm-operator {
  color: #f78c6c;
}

.editor-pane .cm-s-material-darker .cm-string {
  color: #c3e88d;
}

.editor-pane .cm-s-material-darker .cm-variable-2 {
  color: #eeffff;
}

.editor-pane .cm-s-material-darker .cm-attribute {
  color: #ffcb6b;
}

.editor-pane .cm-s-material-darker .cm-number {
  color: #f78c6c;
}

.editor-pane .cm-s-material-darker .cm-atom {
  color: #82aaff;
}

.editor-pane .cm-s-material-darker .cm-meta {
  color: #c792ea;
}

.editor-pane .cm-s-material-darker .cm-bracket {
  color: #89ddff;
}

.editor-pane .CodeMirror-cursor {
  border-left-color: #f2eee6;
}

.preview-pane {
  flex: 1 1 auto;
  min-width: 12rem;
  min-height: 0;
  height: 100%;
  border-left: 0;
  background: #1a201c;
  overflow: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
}

.preview-toolbar {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  color: rgba(242, 238, 230, 0.65);
  font-size: 0.85rem;
}

.preview-pane > .slide,
.preview-pane > .preview-empty {
  flex: 0 0 auto;
}

.preview-notes {
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  overflow: auto;
}

.preview-notes h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 0.5rem;
  opacity: 0.65;
}

.preview-notes.is-empty {
  opacity: 0.55;
}

.preview-empty {
  color: rgba(242, 238, 230, 0.55);
  padding: 2rem 0;
}

.handout {
  background: #f7f3ea;
  min-height: 100vh;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Source Sans 3", "Segoe UI", sans-serif;
  font-family: var(--font-body);
}

.handout-header {
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}

.handout-header h1 {
  font-family: var(--font-display);
  margin: 0 0 0.5rem;
}

.handout-theme {
  margin: 0.35rem 0 0;
  color: rgba(20, 32, 28, 0.7);
  font-size: 0.95rem;
}

.handout-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.handout-slide {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.handout-slide-label {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: hsl(var(--accent-hue), 45%, 35%);
  margin-bottom: 0.5rem;
}

.handout-notes {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  background: rgba(20, 32, 28, 0.04);
  font-family: Helvetica, "Helvetica Neue", Arial, sans-serif;
}

.handout-notes h3 {
  font-size: 0.85rem;
  margin: 0 0 0.4rem;
  font-family: Helvetica, "Helvetica Neue", Arial, sans-serif;
}

.handout-notes .notes-body {
  font-family: Helvetica, "Helvetica Neue", Arial, sans-serif;
}

body.handout-print .app-top-bar,
body.handout-print .handout-actions,
body.handout-print .user-nav {
  display: none !important;
}

body.handout-print .handout {
  min-height: 0;
}

@media print {
  .app-top-bar,
  .handout-actions,
  .user-nav {
    display: none !important;
  }

  .handout {
    background: #fff;
    min-height: 0;
  }

  .handout-slide {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .handout-notes {
    font-family: Helvetica, "Helvetica Neue", Arial, sans-serif;
  }
}

.error-page {
  min-height: 100vh;
}

@media (max-width: 1100px) {
  .editor-shell.focus-split .editor-grid,
  .editor-shell.focus-write .editor-grid,
  .editor-shell.focus-preview .editor-grid {
    grid-template-columns: 1fr;
  }

  .editor-workspace {
    flex-direction: column;
  }

  .editor-pane {
    flex: 0 0 var(--editor-split, 50%);
    max-width: none;
    min-height: 12rem;
  }

  .editor-splitter {
    flex: 0 0 6px;
    cursor: row-resize;
    border-left: 0;
    border-right: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .editor-shell.focus-write .preview-pane,
  .editor-shell.focus-write .editor-splitter {
    display: none;
  }

  .editor-shell.focus-preview .editor-sidebar,
  .editor-shell.focus-preview .editor-pane,
  .editor-shell.focus-preview .editor-splitter {
    display: none;
  }

  .editor-sidebar,
  .preview-pane {
    border: 0;
  }

  .deck-settings-summary,
  .slide-nav-summary {
    display: block;
  }

  .deck-settings[open] > .deck-settings-body,
  .slide-nav[open] > .slide-nav-body {
    margin-top: 0.75rem;
  }

  .slide-nav {
    flex: 0 0 auto;
  }

  .slide-nav[open] {
    flex: 1 1 auto;
    min-height: 0;
  }
}

@media (max-width: 1100px) {
  .editor-bar {
    flex-wrap: wrap;
    row-gap: 0.35rem;
    padding: 0.35rem 0.55rem;
    align-items: stretch;
  }

  .editor-bar-left {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
  }

  .editor-bar-left .bar-title {
    max-width: min(40vw, 12rem);
  }

  .editor-bar-actions {
    flex: 1 1 100%;
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 0.25rem;
    padding-bottom: 0.1rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .editor-bar-actions > .btn,
  .editor-bar-actions .btn-group > .btn,
  .editor-bar-actions .editor-export > .btn,
  .editor-bar-actions .editor-share > .btn,
  .editor-bar-actions .user-nav-toggle,
  .editor-bar-actions .manual-nav-link {
    --bs-btn-padding-y: 0;
    --bs-btn-padding-x: 0;
    width: 2.5rem;
    min-width: 2.5rem;
    max-width: 2.5rem;
    height: 2.5rem;
    min-height: 2.5rem;
    flex: 0 0 2.5rem;
    gap: 0;
    padding: 0;
    align-items: center;
    justify-content: center;
  }

  .editor-bar-actions .btn-label,
  .editor-bar-actions .user-nav-name {
    display: none;
  }

  .editor-bar-actions .btn i + span,
  .editor-bar-actions .btn span + i {
    margin-inline-start: 0;
  }

  .editor-bar-actions .user-nav-toggle.dropdown-toggle::after {
    display: none;
  }

  .editor-bar-actions .editor-export,
  .editor-bar-actions .editor-share,
  .editor-bar-actions .editor-focus-modes {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
  }

  .editor-bar-actions .editor-focus-modes > .btn {
    width: 2.5rem;
    min-width: 2.5rem;
    max-width: 2.5rem;
  }

  .editor-bar-actions > .user-nav-cluster {
    margin-inline-start: 0.25rem;
    padding-inline-start: 0.4rem;
    align-items: center;
  }

  .save-restore {
    margin-left: auto;
    --bs-btn-padding-y: 0;
    --bs-btn-padding-x: 0.65rem;
    min-height: 2.5rem;
    height: 2.5rem;
  }
}

@media (max-width: 900px) {
  .deck-actions-expanded {
    display: none;
  }

  .deck-more {
    display: block;
  }
}

@media (max-width: 720px) {
  .deck-row {
    grid-template-columns: 7.5rem minmax(0, 1fr);
  }

  .deck-actions {
    grid-column: 1 / -1;
  }

  .home-hero {
    padding: 3rem 0 2.5rem;
  }

  .app-top-bar {
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-bottom: 0.85rem;
  }

  .app-top-bar .brand-logo img {
    height: 2rem;
  }

  .app-top-bar-actions {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .app-top-bar-actions .btn > span:not(.visually-hidden),
  .app-top-bar-actions .user-nav-name,
  .home-top-bar .user-nav-name,
  .handout .user-nav-name,
  .manual-body .user-nav-name,
  .manual-body .manual-pdf-label,
  .admin-page .user-nav-name,
  .auth-page .user-nav-name {
    display: none;
  }

  .app-top-bar-actions .btn {
    min-height: 2.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .user-nav-toggle,
  .manual-nav-link,
  .manual-pdf-link {
    min-height: 2.35rem;
    min-width: 2.35rem;
  }

  .deck-toolbar {
    align-items: stretch;
  }

  .deck-search {
    max-width: none;
  }

  .deck-actions {
    width: 100%;
  }

  .deck-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
    min-height: 2.4rem;
  }

  .handout-actions {
    width: 100%;
  }

  .handout-actions .btn {
    flex: 1 1 calc(50% - 0.5rem);
    justify-content: center;
    min-height: 2.5rem;
  }

  .handout-actions .btn > span {
    display: none;
  }

  .editor-bar-left .sep,
  .editor-bar-left .save-status {
    display: none;
  }

  .editor-bar-left .bar-title {
    max-width: none;
    flex: 1 1 auto;
  }

  .editor-shell {
    height: 100dvh;
    max-height: 100dvh;
  }

  body.editor-body {
    height: 100dvh;
  }
}

.manual-page {
  min-height: 100vh;
}

.manual-content {
  max-width: 48rem;
  margin: 0 auto;
  padding: 0.5rem 0 3rem;
  color: var(--ink);
}

.manual-content > h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 500;
  margin: 0 0 1rem;
}

.manual-content h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
  margin: 2.25rem 0 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--line);
}

.manual-content h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem;
}

.manual-content p,
.manual-content li {
  line-height: 1.55;
}

.manual-content img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 1rem 0 1.25rem;
  border: 1px solid var(--line);
  background: #fff;
}

.manual-content table {
  width: 100%;
  margin: 1rem 0 1.25rem;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.manual-content th,
.manual-content td {
  border: 1px solid var(--line);
  padding: 0.45rem 0.6rem;
  text-align: left;
  vertical-align: top;
}

.manual-content th {
  background: rgba(20, 32, 28, 0.04);
}

.manual-content pre {
  margin: 0.85rem 0 1.15rem;
  padding: 0.85rem 1rem;
  overflow: auto;
  background: #151a17;
  color: #f2eee6;
  font-size: 0.85rem;
  line-height: 1.45;
}

.manual-content code {
  font-size: 0.88em;
}

.manual-content :not(pre) > code {
  padding: 0.1em 0.35em;
  background: rgba(20, 32, 28, 0.06);
}

.manual-content hr {
  margin: 1.75rem 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.manual-content a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

@media print {
  .handout-actions {
    display: none;
  }

  .manual-page .app-top-bar {
    display: none;
  }
}
