/* =========================================================================
   EDITOR — the main word-processor surface
   =========================================================================
   The editor is the core editorial surface — where the student's
   writing lives. It reads as a sheet of premium paper set in
   Newsreader. The surrounding toolbar is a glassmorphic strip that
   "floats above" the sheet (backdrop-filter + 85% opacity), giving
   the student a clear separation between UI chrome and content. */
.editor-shell {
  margin-top: 1.5rem;
}
.editor-toolbar {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
  padding: 0.625rem 1.25rem;
  background: color-mix(in srgb, var(--md-sys-color-surface-container-lowest) 85%, transparent);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border-radius: var(--md-sys-shape-corner-large) var(--md-sys-shape-corner-large) 0 0;
  color: var(--md-sys-color-on-surface-variant);
  font: 600 0.6875rem/1.4 var(--md-sys-typescale-font-label);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.status-dot {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-outline-variant);
  margin-right: 0.4rem;
  transition: background-color var(--md-sys-motion-duration-short)
    var(--md-sys-motion-easing-standard);
}
.status-dot.live {
  background: var(--md-sys-color-tertiary);
}

.editor {
  background: var(--md-sys-color-surface-container-lowest);
  color: var(--md-sys-color-on-surface);
  min-height: 60vh;
  padding: 3.5rem 4rem;
  border-radius: 0 0 var(--md-sys-shape-corner-large) var(--md-sys-shape-corner-large);
  font-family: var(--md-sys-typescale-font-editorial);
  font-size: 1.125rem;
  line-height: 1.75;
  letter-spacing: 0.005em;
  white-space: pre-wrap;
  outline: none;
  transition: background-color var(--md-sys-motion-duration-medium)
    var(--md-sys-motion-easing-standard);
}
/* No box-shadow — the tonal shift from surface to
   surface-container-lowest is the depth cue. On focus, the editor
   warms slightly by pulling a hint of primary into the background. */
.editor:focus {
  background: color-mix(
    in srgb,
    var(--md-sys-color-primary) 1%,
    var(--md-sys-color-surface-container-lowest)
  );
}

/* Empty-state placeholder via data attribute — never part of innerText. */
.editor:empty::before {
  content: attr(data-placeholder);
  color: var(--md-sys-color-on-surface-variant);
  font-style: italic;
  pointer-events: none;
}

/* =========================================================================
   MARKDOWN RENDERED CONTENT — typography for CommonMark HTML output
   ========================================================================= */
.markdown-content {
  font-family: var(--md-sys-typescale-font-editorial);
  font-size: 1.125rem;
  line-height: 1.75;
  color: var(--md-sys-color-on-surface);
}
.markdown-content h1 {
  font: 700 1.75rem/1.25 var(--md-sys-typescale-font-shell);
  margin: 1.5rem 0 0.75rem;
}
.markdown-content h2 {
  font: 700 1.375rem/1.3 var(--md-sys-typescale-font-shell);
  margin: 1.25rem 0 0.625rem;
}
.markdown-content h3 {
  font: 600 1.125rem/1.35 var(--md-sys-typescale-font-shell);
  margin: 1rem 0 0.5rem;
}
.markdown-content p {
  margin: 0 0 1rem;
}
.markdown-content strong {
  font-weight: 600;
}
.markdown-content em {
  font-style: italic;
}
.markdown-content a {
  color: var(--md-sys-color-primary);
  text-underline-offset: 2px;
}
.markdown-content code {
  font: 400 0.9em/1.4 var(--md-sys-typescale-font-mono);
  background: var(--md-sys-color-surface-container-high);
  padding: 0.125em 0.375em;
  border-radius: var(--md-sys-shape-corner-extra-small);
}
.markdown-content pre {
  background: var(--md-sys-color-surface-container);
  padding: 1rem 1.25rem;
  border-radius: var(--md-sys-shape-corner-medium);
  overflow-x: auto;
  margin: 0 0 1rem;
}
.markdown-content pre code {
  background: transparent;
  padding: 0;
}
.markdown-content ul,
.markdown-content ol {
  padding-left: 1.75rem;
  margin: 0 0 1rem;
}
.markdown-content li {
  margin: 0 0 0.375rem;
}
.markdown-content blockquote {
  margin: 0 0 1rem;
  padding: 0.75rem 1.25rem;
  background: var(--md-sys-color-surface-container-low);
  border-radius: var(--md-sys-shape-corner-medium);
  box-shadow: inset 3px 0 0 0 var(--md-sys-color-primary);
  font-style: italic;
}
.markdown-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--md-sys-shape-corner-medium);
  margin: 0.5rem 0;
  transition: max-width 0.2s ease;
}
.markdown-content img.img-size-small  { max-width: 25%; }
.markdown-content img.img-size-medium { max-width: 50%; }
.markdown-content img.img-size-large  { max-width: 75%; }
.markdown-content img.img-size-full   { max-width: 100%; }

/* Image resize toolbar */
.img-resize-toolbar {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.25rem 0.375rem;
  background: var(--md-sys-color-surface-container-highest, #333);
  border-radius: var(--md-sys-shape-corner-small, 4px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  position: absolute;
  left: 0;
  z-index: 40;
}
.img-resize-toolbar.below {
  margin-top: 0.25rem;
}
.img-resize-toolbar.above {
  margin-bottom: 0.25rem;
}
.img-resize-toolbar button {
  border: none;
  background: transparent;
  color: var(--md-sys-color-on-surface, #fff);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: var(--md-sys-shape-corner-extra-small, 3px);
  cursor: pointer;
  line-height: 1;
}
.img-resize-toolbar button:hover {
  background: var(--md-sys-color-surface-container-low, rgba(255,255,255,0.15));
}
.img-resize-toolbar button.active {
  background: var(--md-sys-color-primary, #6750a4);
  color: var(--md-sys-color-on-primary, #fff);
}
.markdown-content hr {
  border: none;
  height: 1px;
  background: var(--md-sys-color-ghost-stroke);
  margin: 1.5rem 0;
}
.markdown-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1rem;
  font-size: 0.9375rem;
}
.markdown-content th,
.markdown-content td {
  padding: 0.5rem 0.75rem;
  text-align: left;
}
.markdown-content th {
  font: 600 0.8125rem/1.4 var(--md-sys-typescale-font-label);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--md-sys-color-on-surface-variant);
}
.markdown-content tbody tr:nth-child(even) {
  background: var(--md-sys-color-surface-container-low);
}

/* ---- Split container: editor + preview side by side ---- */
.editor-split {
  display: flex;
  min-height: calc(100vh - 72px);
  gap: 1px;
}
.editor-split .editor-stage {
  flex: 1;
  min-width: 0;
  max-width: 48rem;
  margin: 0 auto;
  padding-left: 2rem;
  padding-right: 2rem;
  transition:
    max-width 0.3s ease,
    margin 0.3s ease;
}
/* When preview is visible, editor fills its half instead of centering */
.editor-split:has(.editor-preview.is-visible) .editor-stage {
  max-width: none;
  margin: 0;
}
/* Preview pane — slides in/out like the sidebar using flex-basis + overflow */
.editor-preview {
  display: flex;
  flex-direction: column;
  flex: 0 0 0%;
  min-width: 0;
  overflow: hidden;
  background: var(--md-sys-color-surface-container-low);
  border-left: 1px solid color-mix(in srgb, var(--md-sys-color-outline-variant) 12%, transparent);
  transition: flex-basis 0.3s ease;
}
.editor-preview.is-visible {
  flex: 0 0 50%;
}
.editor-preview__header {
  flex-shrink: 0;
  font: 700 0.6875rem/1.4 var(--md-sys-typescale-font-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--md-sys-color-on-surface-variant);
  padding: 4.5rem 2rem 0.75rem;
  border-bottom: 1px solid color-mix(in srgb, var(--md-sys-color-outline-variant) 10%, transparent);
}
.editor-preview__body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 2rem;
}
@media (max-width: 768px) {
  .editor-split {
    flex-direction: column;
  }
  .editor-preview {
    flex-basis: 0;
    transition:
      flex-basis 0.3s ease,
      max-height 0.3s ease;
  }
  .editor-preview.is-visible {
    flex-basis: auto;
    max-height: 50vh;
    border-left: none;
    border-top: 1px solid color-mix(in srgb, var(--md-sys-color-outline-variant) 12%, transparent);
  }
}

/* =========================================================================
   EDITORIAL STAGE — the focused-writing editor layout
   =========================================================================
   Used by `/submissions/:id/edit` only. The layout is a centered narrow
   column (max-width ~48rem = 768px) for comfortable reading, a big
   Manrope title at the top, a tiny all-caps meta row, and the
   contenteditable prose rendered in Newsreader with generous paragraph
   breaks. Sheet chrome is deliberately absent — the prose floats
   directly on the page surface so the writer can focus on words.

   Two floating glass panels frame the stage:
     - `.editor-float-toolbar` fixed below the top app bar, holding
       document actions (snapshot / diff / save & exit). The original
       mockup put rich-text formatting commands here; we don't support
       rich text, so the slot is repurposed for real document actions
       in the same visual position. See the feature doc for why.
     - `.editor-float-statusbar` fixed at the viewport bottom, holding
       the recording-session indicator, autosave state, live word
       count, and the Finish Assignment CTA. */
.editor-stage {
  max-width: 48rem;
  margin: 0 auto;
  /* Top padding clears the top app bar + the floating toolbar beneath
     it. Bottom padding clears the floating status bar. */
  padding: 4.5rem 0 7rem;
  background: var(--md-sys-color-surface-container-lowest);
}
.editor-stage__header {
  margin-bottom: 3rem;
}
.editor-stage__title {
  font: 800 2.5rem/1.1 var(--md-sys-typescale-font-shell);
  letter-spacing: -0.02em;
  color: var(--md-sys-color-primary);
  margin: 0 0 0.75rem;
}
.editor-stage__meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font: 600 0.6875rem/1.4 var(--md-sys-typescale-font-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--md-sys-color-on-surface-variant);
  padding-left: 0.125rem;
}
.editor-stage__meta-dot {
  display: inline-block;
  width: 3px;
  height: 3px;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-outline-variant);
}

/* When the editor sits inside an .editor-stage it switches to the
   prose treatment: transparent background, no padding, Newsreader at
   1.25rem with generous paragraph spacing. Overrides the default
   .editor rules (sheet background, box radius) from earlier. */
.editor-stage .editor {
  background: transparent;
  padding: 0;
  border-radius: 0;
  min-height: 60vh;
  font-family: var(--md-sys-typescale-font-editorial);
  font-size: 1.125rem;
  line-height: 1.75;
  letter-spacing: 0.003em;
  white-space: pre-wrap;
  word-break: break-word;
  outline: none;
}
/* Word wrap toggle — the editor defaults to pre-wrap (soft wrap).
   When .no-wrap is added, text scrolls horizontally instead. Useful
   for students writing code blocks or long URLs. */
.editor-stage .editor.no-wrap {
  white-space: pre;
  overflow-x: auto;
}
.editor-stage .editor:focus {
  background: transparent;
}
.editor-stage .editor p {
  margin: 0 0 1.75rem;
}
.editor-stage .editor p:last-child {
  margin-bottom: 0;
}

/* Floating top toolbar — glassmorphic, anchored below the top app bar.
   Pills of document actions, not formatting commands. z-index sits
   above content but below modal overlays. */
.editor-float-toolbar {
  position: fixed;
  top: 80px; /* 72px app bar + 16px gap */
  left: 0;
  right: 0;
  width: fit-content;
  margin: 0 auto;
  z-index: 40;
  transition: left 0.25s ease;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0.625rem;
  background: var(--md-sys-color-glass);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
  border-radius: var(--md-sys-shape-corner-extra-large);
  box-shadow:
    inset 0 0 0 1px var(--md-sys-color-ghost-stroke),
    var(--md-sys-elevation-2);
}
.editor-float-toolbar__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  height: 34px;
  padding: 0 0.75rem;
  background: transparent;
  color: var(--md-sys-color-on-surface-variant);
  border: none;
  border-radius: var(--md-sys-shape-corner-medium);
  font: 600 0.75rem/1 var(--md-sys-typescale-font-label);
  letter-spacing: 0.02em;
  cursor: pointer;
  text-decoration: none;
  transition:
    background-color var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard),
    color var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
}
.editor-float-toolbar__btn:hover {
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
  text-decoration: none;
}
.editor-float-toolbar__toggle {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--md-sys-color-on-surface-variant);
  user-select: none;
  padding: 0 0.25rem;
}
.editor-float-toolbar__toggle span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.editor-float-toolbar__divider {
  width: 1px;
  height: 18px;
  background: var(--md-sys-color-ghost-stroke);
  margin: 0 0.375rem;
}

/* Floating bottom status bar — full-width glass strip pinned to the
   viewport bottom, live session state on the left and the Finish
   Assignment CTA on the right. */
.editor-float-statusbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 39;
  transition: left 0.25s ease;
  padding: 0.875rem 2rem;
  background: var(--md-sys-color-glass-heavy);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  backdrop-filter: blur(24px) saturate(140%);
  box-shadow: inset 0 1px 0 0 var(--md-sys-color-ghost-stroke);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.editor-float-statusbar__group {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.editor-float-statusbar__recording {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font: 700 0.625rem/1 var(--md-sys-typescale-font-label);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--md-sys-color-on-surface-variant);
}
.editor-float-statusbar__recording .status-dot {
  width: 8px;
  height: 8px;
  margin: 0;
}
/* A stronger, more confident pulse than the general .status-dot.live
   animation in the playful-animations block. */
@media (prefers-reduced-motion: no-preference) {
  .editor-float-statusbar__recording .status-dot.live {
    animation: md-recording-pulse 2s ease-in-out infinite;
  }
  @keyframes md-recording-pulse {
    0%,
    100% {
      box-shadow: 0 0 0 0 color-mix(in srgb, var(--md-sys-color-tertiary) 70%, transparent);
    }
    50% {
      box-shadow: 0 0 0 5px color-mix(in srgb, var(--md-sys-color-tertiary) 0%, transparent);
    }
  }
}
.editor-float-statusbar__stat {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--md-sys-color-on-surface-variant);
  font: 500 0.75rem/1.4 var(--md-sys-typescale-font-label);
  letter-spacing: 0.005em;
}
.editor-float-statusbar__stat .md-icon {
  color: var(--md-sys-color-on-surface-variant);
}

/* ---- Version overlay — drawer that slides over the editor ---- */
.version-overlay {
  position: fixed;
  top: 72px;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  display: flex;
  justify-content: flex-end;
}
.version-overlay[hidden] {
  display: none;
}
.version-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  cursor: pointer;
  animation: version-backdrop-in 0.2s ease;
}
@keyframes version-backdrop-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.version-overlay__drawer {
  position: relative;
  width: 360px;
  max-width: 90vw;
  height: 100%;
  background: var(--md-sys-color-surface-container-lowest);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.08);
  overflow-y: auto;
  padding: 1.25rem 1rem 6rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  animation: version-drawer-in 0.25s ease;
}
@keyframes version-drawer-in {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}
@keyframes version-drawer-out {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(100%);
  }
}
@keyframes version-backdrop-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}
.version-sidebar__title {
  font: 700 0.8125rem/1.4 var(--md-sys-typescale-font-shell);
  color: var(--md-sys-color-on-surface);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
/* ---- Git-branch ladder ---- */
.version-ladder {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.version-ladder__node {
  display: flex;
  align-items: stretch;
  cursor: pointer;
  position: relative;
}
.version-ladder__rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 28px;
  flex-shrink: 0;
  position: relative;
}
/* Vertical line — continuous through all nodes */
.version-ladder__rail::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: var(--md-sys-color-outline-variant);
}
/* Hide line above the first node */
.version-ladder__node--first .version-ladder__rail::before {
  top: 50%;
}
/* Hide line below the last node */
.version-ladder__node:last-child .version-ladder__rail::before {
  bottom: 50%;
}
.version-ladder__dot {
  position: absolute;
  top: 1.05rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--md-sys-color-surface-container-lowest);
  border: 2px solid var(--md-sys-color-outline);
  transition: all var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
}
/* First node gets filled dot */
.version-ladder__node--first .version-ladder__dot {
  background: var(--md-sys-color-primary);
  border-color: var(--md-sys-color-primary);
}
/* Selected state */
.version-ladder__node.is-selected .version-ladder__dot {
  background: var(--md-sys-color-primary);
  border-color: var(--md-sys-color-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--md-sys-color-primary) 25%, transparent);
}
.version-ladder__card {
  flex: 1;
  min-width: 0;
  background: var(--md-sys-color-surface-container-lowest);
  border-radius: var(--md-sys-shape-corner-large);
  padding: 0.75rem 0.875rem;
  margin: 0.25rem 0;
  transition: background-color var(--md-sys-motion-duration-short)
    var(--md-sys-motion-easing-standard);
}
.version-ladder__node:hover .version-ladder__card {
  background: color-mix(
    in srgb,
    var(--md-sys-color-primary) 4%,
    var(--md-sys-color-surface-container-lowest)
  );
}
.version-ladder__node.is-selected .version-ladder__card {
  box-shadow: inset 0 0 0 2px var(--md-sys-color-primary);
}
.version-sidebar__item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.version-sidebar__item-label {
  font: 600 0.8125rem/1.3 var(--md-sys-typescale-font-label);
  color: var(--md-sys-color-on-surface);
}
.version-sidebar__item-time {
  font: 500 0.6875rem/1.3 var(--md-sys-typescale-font-label);
  color: var(--md-sys-color-on-surface-variant);
}
.version-sidebar__diff {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: var(--md-sys-color-surface);
  border-radius: var(--md-sys-shape-corner-medium);
  max-height: 280px;
  overflow-y: auto;
  font: 400 0.75rem/1.55 var(--md-sys-typescale-font-mono);
  white-space: pre-wrap;
  word-break: break-word;
}
.version-sidebar__diff ins {
  background: var(--md-sys-color-tertiary-fixed);
  color: var(--md-sys-color-on-tertiary-fixed);
  text-decoration: none;
  padding: 0 2px;
  border-radius: 2px;
}
.version-sidebar__diff del {
  background: var(--md-sys-color-error-container);
  color: var(--md-sys-color-on-error-container);
  text-decoration: line-through;
  padding: 0 2px;
  border-radius: 2px;
}
.version-sidebar__actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
/* Narrow viewports: tighten toolbar and status bar padding. */
@media (max-width: 720px) {
  .editor-float-toolbar {
    top: 80px;
    padding: 0.375rem 0.5rem;
  }
  .editor-float-toolbar__btn {
    padding: 0 0.5rem;
  }
  .editor-float-statusbar {
    padding: 0.75rem 1rem;
  }
  .editor-float-statusbar__group {
    gap: 0.75rem;
  }
  .editor-stage {
    padding: 4rem 0 8rem;
  }
  .editor-stage__title {
    font-size: 2rem;
  }
}

/* =========================================================================
   EDITOR THEMES — color palette overrides for the writing surface
   =========================================================================
   Applied via a class on <body> alongside .editor-page. The "default"
   theme uses the existing design tokens; the three alternate themes
   override the CSS variables that the editor, preview, toolbar, and
   status bar reference. Since CSS custom properties cascade, setting
   them on <body> is sufficient — no need to duplicate selectors. */

/* ---- Dark: deep charcoal, cool light text ---- */
.editor-theme--dark {
  --md-sys-color-background: #151520;
  --md-sys-color-on-background: #dddce4;
  --md-sys-color-surface: #151520;
  --md-sys-color-surface-container-lowest: #1a1a2e;
  --md-sys-color-surface-container-low: #1f1f35;
  --md-sys-color-surface-container: #24243c;
  --md-sys-color-surface-container-high: #2c2c48;
  --md-sys-color-surface-container-highest: #353554;
  --md-sys-color-on-surface: #dddce4;
  --md-sys-color-on-surface-variant: #9e9caf;
  --md-sys-color-outline: #7a7890;
  --md-sys-color-outline-variant: #3d3b54;
  --md-sys-color-primary: #b8b4ff;
  --md-sys-color-on-primary: #0d0049;
  --md-sys-color-ghost-stroke: rgba(200, 196, 213, 0.08);
  --md-sys-color-glass: rgba(20, 20, 38, 0.88);
  --md-sys-color-glass-heavy: rgba(20, 20, 38, 0.92);
  --md-sys-color-tertiary: #68dba9;
  --md-sys-color-error-container: #93000a;
  --md-sys-color-on-error-container: #ffdad6;
  --md-sys-color-tertiary-fixed: #85f8c4;
  --md-sys-color-on-tertiary-fixed: #002114;
}

/* ---- Sepia: warm parchment, ink-brown text ---- */
.editor-theme--sepia {
  --md-sys-color-background: #f8f1e4;
  --md-sys-color-on-background: #3e3428;
  --md-sys-color-surface: #f8f1e4;
  --md-sys-color-surface-container-lowest: #faf5ea;
  --md-sys-color-surface-container-low: #f2ebdc;
  --md-sys-color-surface-container: #ece5d4;
  --md-sys-color-surface-container-high: #e4dccb;
  --md-sys-color-surface-container-highest: #dcd3c2;
  --md-sys-color-on-surface: #3e3428;
  --md-sys-color-on-surface-variant: #6b5e4f;
  --md-sys-color-outline: #8c7e6e;
  --md-sys-color-outline-variant: #c8bda8;
  --md-sys-color-primary: #5c4a2e;
  --md-sys-color-on-primary: #fff8ee;
  --md-sys-color-ghost-stroke: rgba(92, 74, 46, 0.1);
  --md-sys-color-glass: rgba(248, 241, 228, 0.88);
  --md-sys-color-glass-heavy: rgba(248, 241, 228, 0.92);
  --md-sys-color-tertiary: #3a6b4a;
  --md-sys-color-error-container: #ffdad6;
  --md-sys-color-on-error-container: #410002;
  --md-sys-color-tertiary-fixed: #c2f0d0;
  --md-sys-color-on-tertiary-fixed: #1b3a24;
}

/* ---- Sage: muted forest green, calm study vibes ---- */
.editor-theme--sage {
  --md-sys-color-background: #eaf0ec;
  --md-sys-color-on-background: #1c2e22;
  --md-sys-color-surface: #eaf0ec;
  --md-sys-color-surface-container-lowest: #f0f5f1;
  --md-sys-color-surface-container-low: #e4ebe6;
  --md-sys-color-surface-container: #dce5de;
  --md-sys-color-surface-container-high: #d2ddd6;
  --md-sys-color-surface-container-highest: #c8d5cc;
  --md-sys-color-on-surface: #1c2e22;
  --md-sys-color-on-surface-variant: #4a6052;
  --md-sys-color-outline: #6e8878;
  --md-sys-color-outline-variant: #a8c0ae;
  --md-sys-color-primary: #2d5a3e;
  --md-sys-color-on-primary: #f2faf5;
  --md-sys-color-ghost-stroke: rgba(45, 90, 62, 0.08);
  --md-sys-color-glass: rgba(234, 240, 236, 0.88);
  --md-sys-color-glass-heavy: rgba(234, 240, 236, 0.92);
  --md-sys-color-tertiary: #3a6b4a;
  --md-sys-color-error-container: #ffdad6;
  --md-sys-color-on-error-container: #410002;
  --md-sys-color-tertiary-fixed: #c2f0d0;
  --md-sys-color-on-tertiary-fixed: #1b3a24;
}
