.notes-library {
  max-width: 1440px;
  margin-inline: auto;
}
.notes-workspace { max-width: none; min-width: 0; }
.notes-hero,
.workspace-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 28px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  background:
    radial-gradient(
      circle at 90% 0,
      var(--bg-hover),
      transparent 42%),
    linear-gradient(
      145deg,
      var(--bg-card),
      var(--bg-panel));
  box-shadow: var(--button-inset), var(--shadow-soft);
}
.notes-hero h2,
.workspace-top h2 {
  margin: 4px 0;
  font-size: clamp(2rem, 4vw, 3.25rem);
}
.notes-hero p {
  margin: 0;
  color: var(--text-secondary);
}
.notes-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.notes-library > #notesApp {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 20px;
  margin-top: 20px;
}
.notes-folder-panel,
.notes-main,
.workspace-pages,
.workspace-stage,
.workspace-beto {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  background: var(--bg-card);
  box-shadow: var(--button-inset);
}
.notes-folder-panel {
  padding: 12px;
}
.notes-folder-panel > div {
  display: grid;
}
.notes-folder {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text-secondary);
  text-align: start;
  font: inherit;
  cursor: pointer;
}
.notes-folder:hover,
.notes-folder.active {
  border-color: var(--border-active);
  background: var(--bg-hover);
  color: var(--text-primary);
}
.notes-main {
  padding: 20px;
}
.notes-filterbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 10px;
  margin-bottom: 18px;
}
.notes-filterbar input,
.notes-filterbar select {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control);
  background: var(--bg-panel);
  color: var(--text-primary);
}
.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}
.note-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  padding: 17px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-button);
  background:
    linear-gradient(
      145deg,
      var(--bg-panel),
      var(--bg-sidebar));
  transition: transform 180ms, border-color 180ms;
}
.note-card:hover {
  transform: translateY(-1px);
  border-color: var(--border-active);
}
.note-card-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 56px;
  border: 1px solid var(--border-active);
  border-radius: 10px;
  background: var(--bg-hover);
  color: var(--betooth-light);
  font-size: .78rem;
  font-weight: 850;
}
.note-card-copy h3,
.note-card-copy p {
  margin: 0;
}
.note-card-copy h3 {
  margin-block: 4px;
  font-size: 1rem;
}
.note-card-copy p,
.note-kind {
  color: var(--text-secondary);
  font-size: .76rem;
}
.note-card > a {
  grid-column: 1/-1;
}
.notes-empty {
  grid-column: 1/-1;
  display: grid;
  place-items: center;
  min-height: 280px;
  padding: 30px;
  text-align: center;
  color: var(--text-secondary);
}
.notes-empty h3,
.notes-empty p {
  margin: 4px;
}
.workspace-top {
  justify-content: flex-start;
  gap: 12px;
  padding: 6px 10px 12px;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}
.workspace-top h2 { font-size: clamp(1.1rem, 1.8vw, 1.5rem); line-height: 1.2; }
.workspace-top .eyebrow { font-size: .7rem; }
.workspace-top > button {
  margin-inline-start: auto;
}
.workspace-shell {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr) 200px;
  gap: 8px;
  margin-top: 4px;
  height: max(640px, calc(100dvh - var(--topbar-height) - 92px));
  min-height: 0;
  overflow: hidden;
}
.workspace-shell[hidden],
.workspace-toolbar[hidden] { display: none; }
@media (min-width: 951px) {
  .workspace-shell:not(.pages-open) { grid-template-columns: minmax(0, 1fr) 200px; }
  .workspace-shell:not(.pages-open) .workspace-pages { display: none; }
  .workspace-shell:not(.beto-open) { grid-template-columns: 148px minmax(0, 1fr); }
  .workspace-shell:not(.beto-open) .workspace-beto { display: none; }
  .workspace-shell:not(.pages-open):not(.beto-open) { grid-template-columns: minmax(0, 1fr); }
}
.workspace-pages,
.workspace-beto {
  padding: 10px;
  min-width: 0;
  overflow: auto;
}
.workspace-pages { display: flex; flex-direction: column; }
.workspace-pages h3,
.workspace-beto h3 {
  margin: 0 0 12px;
}
.workspace-pages-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.workspace-pages #workspacePageList {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-bottom: 10px;
  padding: 2px;
  align-content: start;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}
.pdf-workspace .workspace-pages #workspacePageList {
  grid-template-columns: 1fr;
  overscroll-behavior: contain;
}
.workspace-page {
  display: grid;
  place-items: center;
  aspect-ratio: .72;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control);
  background: var(--bg-panel);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition-fast),border-color var(--transition-fast),color var(--transition-fast);
}
@media (hover: hover) {
  .workspace-page:hover { border-color: var(--betooth-muted); background: var(--bg-card); }
}
.workspace-page:focus-visible {
  outline: 2px solid var(--betooth-orange);
  outline-offset: 2px;
}
.workspace-page.active {
  border-color: var(--betooth-muted);
  background: var(--bg-hover);
  color: var(--text-primary);
  box-shadow: inset 3px 0 0 var(--betooth-orange);
}
[dir="rtl"] .workspace-page.active {
  box-shadow: inset -3px 0 0 var(--betooth-orange);
}
.workspace-add-page {
  position: relative;
}
.workspace-add-page > #workspaceAddPage {
  width: 100%;
}
.workspace-page-template-menu {
  position: absolute;
  inset-inline: 0;
  bottom: calc(100% + 8px);
  z-index: 12;
  display: grid;
  gap: 4px;
  padding: 6px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control);
  background: var(--bg-panel);
  box-shadow: var(--shadow-md);
}
.workspace-page-template-menu[hidden] {
  display: none;
}
.workspace-page-template-menu button {
  width: 100%;
  min-height: 44px;
  justify-content: flex-start;
  text-align: start;
}
.workspace-stage {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 0;
}
.workspace-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 4px 8px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: .78rem;
}
.pdf-viewer-toolbar {
  justify-content: space-between;
  flex-wrap: nowrap;
  overflow-x: auto;
}
.pdf-toolbar-group {
  display: flex;
  align-items: center;
  gap: 6px;
}
.pdf-viewer-toolbar button {
  min-width: 40px;
  min-height: 40px;
  padding: 6px 8px;
}
.pdf-viewer-toolbar button[aria-pressed="true"] {
  border-color: var(--border-active);
  background: var(--bg-hover);
  color: var(--text-primary);
}
.pdf-page-control {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-secondary);
}
.pdf-page-control input {
  width: 54px;
  height: 38px;
  padding: 5px 6px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-panel);
  color: var(--text-primary);
  text-align: center;
}
.pdf-page-control input:focus-visible {
  border-color: var(--border-active);
  outline: 2px solid var(--betooth-light);
  outline-offset: 2px;
}
.pdf-zoom-controls output {
  min-width: 48px;
  text-align: center;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.pdf-thumb-toggle {
  display: inline-flex;
}
.workspace-toolbar button {
  min-width: 40px;
  min-height: 40px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-panel);
  color: var(--text-secondary);
}
.annotation-toolbar {
  min-height: 48px;
  justify-content: flex-start;
  flex-wrap: nowrap;
  background: var(--bg-panel);
  overflow-x: auto;
  scrollbar-width: thin;
}
.annotation-settings { position: relative; flex: 0 0 auto; }
.annotation-settings summary {
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-panel);
  color: var(--text-primary);
  font-size: 1.25rem;
  cursor: pointer;
  list-style: none;
}
.annotation-settings summary::-webkit-details-marker { display: none; }
.annotation-settings[open] summary { border-color: var(--border-active); }
.annotation-settings > .annotation-tool-group { padding: 4px 8px; }
.annotation-settings summary:focus-visible,
.workspace-toolbar button:focus-visible { outline: 2px solid var(--betooth-light); outline-offset: 2px; }
.annotation-tool-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding-inline-end: 8px;
  border-inline-end: 1px solid var(--border-subtle);
}
.annotation-tool-group:last-of-type {
  border-inline-end: 0;
}
.annotation-toolbar button[aria-pressed="true"] {
  border-color: var(--border-active);
  background: var(--bg-hover);
  color: var(--text-primary);
  box-shadow: inset 0 -2px 0 var(--betooth-orange);
}
.annotation-toolbar button { min-width: 44px; min-height: 44px; }
.annotation-toolbar button:active:not(:disabled) { background: var(--bg-hover); }
@media (hover: hover) {
  .annotation-toolbar button:hover:not(:disabled),
  .annotation-settings summary:hover { border-color: var(--betooth-muted); color: var(--text-primary); }
}
.workspace-panel-controls button[aria-expanded="true"],
.workspace-focus-toggle[aria-pressed="true"] {
  border-color: var(--border-active);
  color: var(--text-primary);
  background: var(--bg-hover);
}
.annotation-toolbar button:disabled,
.annotation-toolbar input:disabled {
  cursor: not-allowed;
  opacity: .42;
}
.annotation-color {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
}
.annotation-color input {
  width: 36px;
  height: 36px;
  padding: 2px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-card);
  cursor: pointer;
}
.annotation-width {
  display: inline-flex;
  align-items: center;
}
.annotation-width input {
  width: 96px;
  accent-color: var(--betooth-muted);
}
.annotation-status {
  min-width: 48px;
  margin-inline-start: auto;
  color: var(--text-secondary);
  font-size: .72rem;
}
.workspace-host {
  display: grid;
  place-items: stretch;
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  padding: 8px;
  background: var(--bg-sidebar);
}
.workspace-host.is-notebook-scroll {
  overflow: auto;
  overscroll-behavior: contain;
}
.pdf-page-scroll {
  width: 100%;
  height: 100%;
  border-radius: 10px;
  overflow: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  scroll-padding-block: 18px;
}
.pdf-page-scroll.is-finger-panning,
.workspace-host.is-finger-panning {
  scroll-behavior: auto;
}
.pdf-page-shell {
  position: relative;
  display: grid;
  place-items: center;
  width: max-content;
  min-width: 0;
  min-height: 0;
  margin: 0 auto 12px;
  background: var(--neutral-white);
  box-shadow: var(--shadow-md);
}
.note-annotation-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  pointer-events: none;
}
.note-annotation-layer.is-interactive {
  pointer-events: auto;
  touch-action: none;
}
.note-annotation-layer[data-tool="pen"],
.note-annotation-layer[data-tool="highlighter"],
.note-annotation-layer[data-tool="shapes"] {
  cursor: crosshair;
}
.note-annotation-layer[data-tool="eraser"] {
  cursor: cell;
}
.pdf-page-shell canvas:not(.note-annotation-layer) {
  display: block;
  max-width: none;
  background: var(--neutral-white);
}
.pdf-note-page-shell {
  width: 760px;
  height: 720px;
}
.pdf-note-page-shell .workspace-paper {
  width: 100%;
  height: 100%;
  min-height: 0;
}
.pdf-page-loading,
.pdf-page-error {
  align-self: center;
  padding: 24px;
  color: var(--betooth-muted);
  text-align: center;
}
.pdf-thumbnail {
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 3px;
  min-height: 96px;
  padding: 6px;
}
.pdf-thumbnail canvas {
  display: block;
  max-width: 100%;
  max-height: 72px;
  margin: auto;
  background: var(--neutral-white);
}
.pdf-blank-thumbnail {
  width: min(100%, 56px);
  height: 72px;
  margin: auto;
  border: 1px solid color-mix(in srgb, var(--betooth-light) 34%, transparent);
  background: var(--betooth-paper);
}
.pdf-blank-thumbnail[data-template=ruled] {
  background: repeating-linear-gradient(var(--betooth-paper) 0 9px, color-mix(in srgb, var(--betooth-light) 34%, var(--betooth-paper)) 10px);
}
.pdf-blank-thumbnail[data-template=grid] {
  background-color: var(--betooth-paper);
  background-image: linear-gradient(color-mix(in srgb, var(--betooth-light) 28%, transparent) 1px, transparent 1px),linear-gradient(90deg,color-mix(in srgb, var(--betooth-light) 28%, transparent) 1px,transparent 1px);
  background-size: 9px 9px;
}
.pdf-blank-thumbnail[data-template=dot] {
  background-color: var(--betooth-paper);
  background-image: radial-gradient(circle, color-mix(in srgb, var(--betooth-light) 42%, transparent) 1px, transparent 1.25px);
  background-size: 9px 9px;
}
.pdf-thumbnail span {
  font-size: .6875rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.pdf-thumbnail.active span { color: var(--text-primary); }
.pdf-thumbnail-error canvas {
  opacity: .35;
}
.workspace-paper {
  justify-self: center;
  width: min(92%, 760px);
  height: 100%;
  padding: var(--paper-padding, 36px);
  border-radius: 2px;
  background: var(--betooth-paper);
  color: var(--betooth-muted);
  box-shadow: var(--shadow-md);
}
.workspace-paper[data-template=ruled] {
  background: repeating-linear-gradient(var(--betooth-paper) 0 var(--paper-rule-line, 31px), color-mix(in srgb, var(--betooth-light) 42%, var(--betooth-paper)) var(--paper-rule-step, 32px));
}
.workspace-paper[data-template=grid] {
  background-color: var(--betooth-paper);
  background-image:
    linear-gradient(color-mix(in srgb, var(--betooth-light) 35%, transparent) 1px, transparent 1px),
    linear-gradient(
      90deg,
      color-mix(in srgb, var(--betooth-light) 35%, transparent) 1px,
      transparent 1px);
  background-size: var(--paper-grid-step, 24px) var(--paper-grid-step, 24px);
}
.workspace-paper[data-template=dot] {
  background-color: var(--betooth-paper);
  background-image: radial-gradient(circle, color-mix(in srgb, var(--betooth-light) 42%, transparent) 1px, transparent 1.35px);
  background-size: var(--paper-grid-step, 24px) var(--paper-grid-step, 24px);
}
.workspace-beto {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.workspace-beto p {
  color: var(--text-secondary);
  font-size: .84rem;
}
.workspace-bookmark {
  display: inline-flex;
  color: var(--accent-orange);
}
@media (max-width: 950px) {
  .notes-library > #notesApp {
    grid-template-columns: 1fr;
  }
  .notes-folder-panel {
    display: flex;
    overflow-x: auto;
  }
  .notes-folder {
    width: auto;
    white-space: nowrap;
  }
  .workspace-shell {
    grid-template-columns: minmax(0, 1fr);
    position: relative;
    height: max(540px, calc(100dvh - 140px));
  }
  .workspace-pages {
    position: absolute;
    inset-block: 0;
    inset-inline-start: 0;
    z-index: 5;
    width: min(280px, 82vw);
    transform: translateX(calc(-100% - 18px));
    transition: transform 180ms ease;
  }
  [dir="rtl"] .workspace-pages {
    transform: translateX(calc(100% + 18px));
  }
  .workspace-pages.open {
    transform: translateX(0);
  }
  .workspace-beto {
    position: absolute;
    inset-block: 0;
    inset-inline-end: 0;
    z-index: 5;
    width: min(280px, 82vw);
    transform: translateX(calc(100% + 18px));
    transition: transform 180ms ease;
  }
  [dir="rtl"] .workspace-beto { transform: translateX(calc(-100% - 18px)); }
  .workspace-beto.open { transform: translateX(0); }
}
@media (max-width: 600px) {
  .notes-hero {
    align-items: stretch;
    flex-direction: column;
    padding: 20px 16px;
  }
  .notes-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .notes-actions .primary {
    grid-column: 1/-1;
  }
  .notes-main {
    padding: 14px;
  }
  .notes-filterbar {
    grid-template-columns: 1fr;
  }
  .notes-grid {
    grid-template-columns: 1fr;
  }
  .workspace-top {
    padding: 14px;
  }
  .workspace-shell {
    grid-template-columns: 1fr;
    min-height: 0;
    height: max(480px, calc(100dvh - 175px));
  }
  .workspace-pages #workspacePageList {
    grid-template-columns: repeat(2, 1fr);
  }
  .workspace-page {
    width: auto;
    height: auto;
  }
  .workspace-pages > .secondary {
    white-space: nowrap;
  }
  .workspace-page-template-menu {
    position: static;
    margin-block: 8px;
  }
  .workspace-host {
    height: auto;
    padding: 4px;
  }
  .pdf-viewer-toolbar {
    gap: 8px;
    padding: 8px;
  }
  .pdf-toolbar-group {
    flex: 1 1 auto;
    justify-content: center;
  }
  .pdf-zoom-controls {
    order: 3;
    flex-basis: 100%;
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: 2px;
  }
  .pdf-viewer-toolbar button {
    min-width: 44px;
    min-height: 44px;
    white-space: nowrap;
  }
  .annotation-toolbar {
    flex-wrap: nowrap;
    overflow-x: auto;
  }
  .annotation-tool-group {
    flex: 0 0 auto;
  }
  .annotation-status {
    flex: 0 0 auto;
  }
  .pdf-page-control input {
    height: 44px;
  }
  .pdf-page-shell { margin-bottom: 10px; }
}
html.notes-focus-mode .app { grid-template-columns: minmax(0, 1fr); }
html.notes-focus-mode .sidebar,
html.notes-focus-mode .topbar { display: none; }
html.notes-focus-mode #pageMount { padding: 0; min-height: 100dvh; }
html.notes-focus-mode .notes-workspace,
.notes-workspace:fullscreen { width: 100%; max-width: none; min-height: 100dvh; background: var(--bg-page); }
html.notes-focus-mode .notes-workspace .workspace-top { display: none; }
html.notes-focus-mode .notes-workspace .workspace-shell { height: 100dvh; margin: 0; grid-template-columns: minmax(0, 1fr); gap: 0; }
html.notes-focus-mode .notes-workspace .workspace-stage { border: 0; border-radius: 0; }
html.notes-focus-mode .notes-workspace .workspace-pages,
html.notes-focus-mode .notes-workspace .workspace-beto {
  position: absolute;
  inset-block: 0;
  z-index: 5;
  display: block;
  width: min(280px, 82vw);
  transition: transform 180ms ease;
}
html.notes-focus-mode .notes-workspace .workspace-pages { inset-inline-start: 0; transform: translateX(calc(-100% - 18px)); }
html.notes-focus-mode .notes-workspace .workspace-beto { inset-inline-end: 0; transform: translateX(calc(100% + 18px)); }
html[dir="rtl"].notes-focus-mode .notes-workspace .workspace-pages { transform: translateX(calc(100% + 18px)); }
html[dir="rtl"].notes-focus-mode .notes-workspace .workspace-beto { transform: translateX(calc(-100% - 18px)); }
html.notes-focus-mode .notes-workspace .workspace-pages.open,
html.notes-focus-mode .notes-workspace .workspace-beto.open { transform: translateX(0); }
html.notes-focus-mode .notes-workspace .workspace-host { padding: 4px; }
@media (prefers-reduced-motion: reduce) {
  .notes-workspace .workspace-pages,
  .notes-workspace .workspace-beto { transition: none; }
}

/* Phase 13.2.2: a writing-first Notes workspace. Page geometry and annotation layers stay unchanged. */
.notes-workspace {
  --workspace-canvas-bg: color-mix(in srgb, var(--betooth-paper) 17%, var(--betooth-deep));
  --workspace-rail-bg: color-mix(in srgb, var(--betooth-deep) 78%, var(--betooth-muted));
  padding: 0;
  overflow: clip;
}
.notes-workspace .workspace-top {
  display: flex;
  gap: 10px;
  min-height: 54px;
  padding: 5px 10px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-subtle);  
  position: relative;
  z-index: 25;
  overflow: visible;
}
.notes-workspace .workspace-study-page-menu,
.notes-workspace .workspace-more-panel {
  z-index: 110;
  max-height: min(70dvh, 480px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.notes-workspace .workspace-title-block { min-width: 0; flex: 1 1 auto; }
.notes-workspace .workspace-type { display: block; color: var(--betooth-light); font-size: .66rem; line-height: 1.15; }
.notes-workspace .workspace-top h2 { margin: 1px 0 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: .98rem; line-height: 1.3; font-weight: 750; }
.notes-workspace .workspace-header-page { flex: 0 0 auto; color: var(--text-secondary); font-size: .78rem; font-variant-numeric: tabular-nums; }
.notes-workspace .workspace-header-actions { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.notes-workspace .workspace-icon { width: 20px; height: 20px; flex: none; }
.notes-workspace .workspace-icon-button,
.notes-workspace .workspace-tool,
.notes-workspace .annotation-settings summary {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text-secondary);
  box-shadow: none;
  cursor: pointer;
  text-decoration: none;
  font: inherit;
  line-height: 1;
}
.notes-workspace :is(.workspace-icon-button,.workspace-tool,.annotation-settings summary):focus-visible,
.notes-workspace :is(.workspace-more-action,.workspace-menu-action,.annotation-preset):focus-visible { outline: 2px solid var(--betooth-orange); outline-offset: 2px; }
.notes-workspace :is(.workspace-icon-button,.workspace-tool,.annotation-settings summary):hover { background: var(--bg-hover); color: var(--text-primary); }
.notes-workspace .workspace-more,
.notes-workspace .workspace-study,
.notes-workspace .pdf-zoom-menu { position: relative; }
.notes-workspace .workspace-more summary,
.notes-workspace .pdf-zoom-menu summary,
.notes-workspace .annotation-settings summary { list-style: none; }
.notes-workspace summary::-webkit-details-marker { display: none; }
.notes-workspace .workspace-more-panel,
.notes-workspace .pdf-zoom-menu-panel,
.notes-workspace .annotation-settings-panel {
  position: absolute;
  z-index: 30;
  display: grid;
  gap: 3px;
  min-width: 174px;
  padding: 6px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control);
  background: var(--bg-panel);
  box-shadow: var(--shadow-md);
}
.notes-workspace :is(.workspace-more,.pdf-zoom-menu,.annotation-settings):not([open]) > :is(.workspace-more-panel,.pdf-zoom-menu-panel,.annotation-settings-panel) { display: none; }
.notes-workspace .workspace-more-panel { inset-block-start: calc(100% + 5px); inset-inline-end: 0; }
.notes-workspace .workspace-study-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid color-mix(in srgb,var(--betooth-muted) 70%,transparent);
  border-radius: var(--radius-control);
  background: color-mix(in srgb,var(--betooth-muted) 18%,transparent);
  color: var(--text-primary);
  font: inherit;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
}
.notes-workspace .workspace-study-trigger .workspace-icon { width: 14px; height: 14px; }
.notes-workspace .workspace-study-trigger:hover,
.notes-workspace .workspace-study-trigger[aria-expanded="true"] { border-color: var(--betooth-light); background: color-mix(in srgb,var(--betooth-muted) 34%,var(--betooth-deep)); }
.notes-workspace .workspace-study-trigger:focus-visible { outline: 2px solid var(--betooth-orange); outline-offset: 2px; }
.notes-workspace .workspace-study-page-menu { position: absolute; z-index: 40; inset-block-start: calc(100% + 6px); inset-inline-end: 0; width: min(250px,calc(100vw - 16px)); }
.notes-workspace .workspace-study-page-menu { max-height: calc(100dvh - 80px); overflow-y: auto; }
.notes-workspace .workspace-study-page-menu [data-study-level][hidden] { display: none !important; }
.app #pageMount .notes-workspace #workspaceStudyPageMenu button { min-height: 44px; width: 100%; text-align: start; }
.notes-workspace .workspace-study-page-menu [data-study-open],
.notes-workspace .workspace-study-page-menu [data-study-back] { display: flex; align-items: center; gap: 10px; }
.notes-workspace .workspace-study-page-menu [data-study-open] small { display: block; font-size: .75rem; color: var(--text-secondary); margin-top: 4px; line-height: 1.4; }
.notes-workspace .workspace-study-page-menu .workspace-icon { width: 20px; height: 20px; flex-shrink: 0; }
.notes-workspace .workspace-study-scope-title { margin: 6px 8px; font-size: .8rem; color: var(--betooth-light); }
.notes-workspace .workspace-more-action,
.notes-workspace .workspace-menu-action { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 40px; padding: 7px 9px; border: 0; border-radius: 6px; background: transparent; color: var(--text-primary); text-align: start; font: inherit; font-size: .78rem; cursor: pointer; }
.notes-workspace :is(.workspace-more-action,.workspace-menu-action):hover { background: var(--bg-hover); }
.notes-workspace #workspaceStar[aria-pressed="true"] { color: var(--betooth-orange); }
.notes-workspace #workspaceStar[aria-pressed="true"] .workspace-icon { fill: color-mix(in srgb, var(--betooth-orange) 25%, transparent); }
.notes-workspace .workspace-shell {
  position: relative;
  display: grid;
  grid-template-columns: 166px minmax(0, 1fr);
  gap: 0;
  height: max(480px, calc(100dvh - var(--topbar-height) - 70px));
  min-height: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: var(--workspace-canvas-bg);
}
.notes-workspace .workspace-shell[hidden] { display: none; }
.notes-workspace .workspace-shell:not(.pages-open),
.notes-workspace .workspace-shell:not(.beto-open),
.notes-workspace .workspace-shell:not(.pages-open):not(.beto-open) { grid-template-columns: minmax(0, 1fr); }
.notes-workspace .workspace-shell.pages-open,
.notes-workspace .workspace-shell.pages-open:not(.beto-open) { grid-template-columns: 166px minmax(0, 1fr); }
.notes-workspace .workspace-pages {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 8px;
  border: 0;
  border-inline-end: 1px solid var(--border-subtle);
  border-radius: 0;
  background: var(--workspace-rail-bg);
  box-shadow: none;
}
.notes-workspace .workspace-shell:not(.pages-open) .workspace-pages { display: none; }
.notes-workspace .workspace-pages-heading { padding-inline: 4px; min-height: 30px; }
.notes-workspace .workspace-pages h3 { margin: 0; font-size: .78rem; font-weight: 750; }
.notes-workspace .workspace-pages #workspacePageList,
.notes-workspace .pdf-workspace .workspace-pages #workspacePageList { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 2px 4px; margin: 0; }
.notes-workspace .workspace-page,
.notes-workspace .pdf-thumbnail { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 4px; width: 100%; height: 122px; min-height: 0; aspect-ratio: auto; padding: 6px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--text-secondary); box-shadow: none; }
.notes-workspace .workspace-page:hover,
.notes-workspace .pdf-thumbnail:hover { border-color: var(--border-subtle); background: var(--bg-hover); }
.notes-workspace .workspace-page.active,
.notes-workspace .pdf-thumbnail.active { border-color: var(--betooth-muted); background: var(--bg-hover); box-shadow: inset 0 0 0 1px var(--betooth-muted); }
.notes-workspace .workspace-page-number,
.notes-workspace .pdf-thumbnail span { color: var(--text-secondary); font-size: .69rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.notes-workspace .workspace-page.active .workspace-page-number,
.notes-workspace .pdf-thumbnail.active span { color: var(--text-primary); }
.notes-workspace .workspace-mini-sheet,
.notes-workspace .pdf-blank-thumbnail { display: block; width: min(76px, 90%); height: 90px; margin: auto; border: 1px solid color-mix(in srgb, var(--betooth-light) 35%, transparent); border-radius: 2px; background: var(--betooth-paper); box-shadow: 0 2px 7px color-mix(in srgb, var(--betooth-deep) 30%, transparent); }
.notes-workspace .workspace-mini-sheet[data-template=ruled] { background: repeating-linear-gradient(var(--betooth-paper) 0 11px, color-mix(in srgb, var(--betooth-light) 40%, var(--betooth-paper)) 12px); }
.notes-workspace .workspace-mini-sheet[data-template=grid] { background-color: var(--betooth-paper); background-image: linear-gradient(color-mix(in srgb, var(--betooth-light) 35%, transparent) 1px, transparent 1px),linear-gradient(90deg,color-mix(in srgb, var(--betooth-light) 35%, transparent) 1px,transparent 1px); background-size: 11px 11px; }
.notes-workspace .workspace-mini-sheet[data-template=dot] { background-color: var(--betooth-paper); background-image: radial-gradient(circle,color-mix(in srgb,var(--betooth-light) 48%,transparent) 1px,transparent 1.25px); background-size: 11px 11px; }
.notes-workspace .workspace-pages #workspaceAddPage { min-height: 40px; font-size: .76rem; }
.notes-workspace .workspace-stage { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; padding: 0; border: 0; border-radius: 0; background: var(--workspace-canvas-bg); box-shadow: none; }
.notes-workspace .annotation-toolbar {
  position: relative;
  align-self: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: 3px;
  width: max-content;
  max-width: calc(100% - 16px);
  min-height: 50px;
  margin: 6px auto 4px;
  padding: 3px 6px;
  overflow: visible;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--bg-panel);
  box-shadow: var(--shadow-soft);
}
.notes-workspace .annotation-shapes { position: absolute; z-index: 12; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); width: min(380px,calc(100vw - 20px)); max-height: min(64dvh,530px); overflow: auto; padding: 10px; border: 1px solid var(--border-subtle); border-radius: 12px; background: var(--bg-panel); box-shadow: var(--shadow-md); }
.notes-workspace .annotation-shapes[hidden] { display: none; }
.notes-workspace .annotation-shape-style { display: flex; gap: 12px; padding: 6px; border-bottom: 1px solid var(--border-subtle); }
.notes-workspace .annotation-shape-style label { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--text-secondary); font-size: .72rem; }
.notes-workspace .annotation-shape-style input[type="color"] { width: 36px; height: 30px; }
.notes-workspace .annotation-shape-style input[type="range"] { width: min(90px,22vw); }
.notes-workspace .annotation-shapes-heading { padding: 7px 6px 5px; color: var(--text-secondary); font-size: .69rem; font-weight: 700; letter-spacing: .04em; }
.notes-workspace .annotation-shapes-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 4px; }
.notes-workspace .annotation-shapes-grid button { display: flex; align-items: center; gap: 7px; min-width: 0; min-height: 48px; padding: 6px 8px; border: 1px solid transparent; border-radius: 8px; background: var(--bg-elevated); color: var(--text-primary); font: inherit; font-size: .7rem; line-height: 1.2; text-align: start; cursor: pointer; }
.notes-workspace .annotation-shapes-grid .workspace-icon { flex: 0 0 20px; width: 20px; height: 20px; color: var(--betooth-light); }
.notes-workspace .annotation-shapes-grid button:hover { border-color: var(--betooth-muted); background: var(--bg-hover); }
.notes-workspace .annotation-shapes-grid button[aria-pressed="true"] { border-color: var(--betooth-muted); background: var(--bg-hover); box-shadow: inset 0 -2px 0 var(--betooth-orange); }
.notes-workspace .annotation-shapes-grid button:focus-visible { outline: 2px solid var(--betooth-light); outline-offset: 2px; }
.notes-workspace .annotation-shapes-brand button { grid-column: span 1; }
.notes-workspace .annotation-tool-group { flex: 0 0 auto; gap: 2px; padding-inline-end: 5px; margin-inline-end: 2px; border-inline-end: 1px solid var(--border-subtle); }
.notes-workspace .annotation-history { border-inline-end: 0; padding-inline-end: 0; }
.notes-workspace .annotation-toolbar button[aria-pressed="true"],
.notes-workspace .annotation-settings[open] summary,
.notes-workspace .workspace-focus-toggle[aria-pressed="true"] { border-color: var(--betooth-muted); background: var(--betooth-muted); color: var(--betooth-paper); box-shadow: inset 0 -2px 0 var(--betooth-orange); }
.notes-workspace .annotation-settings[hidden] { display: none; }
.notes-workspace .annotation-settings-panel { inset-block-start: calc(100% + 8px); inset-inline-start: 50%; transform: translateX(-50%); width: min(320px,calc(100vw - 20px)); }
.notes-workspace .annotation-preset-row { display: flex; flex-wrap: wrap; gap: 7px; padding: 5px; }
.notes-workspace .annotation-preset { display: block; width: 30px; height: 30px; min-width: 30px; min-height: 30px; border: 2px solid transparent; border-radius: 50%; background: var(--preset-color); cursor: pointer; }
.notes-workspace .annotation-preset[aria-pressed="true"] { outline: 2px solid var(--betooth-orange); outline-offset: 2px; }
.notes-workspace .annotation-settings-panel :is(.annotation-color,.annotation-width) { display: flex; justify-content: space-between; gap: 10px; width: 100%; min-height: 40px; padding: 4px 6px; color: var(--text-secondary); font-size: .75rem; }
.notes-workspace .annotation-color input { width: 40px; height: 32px; }
.notes-workspace .annotation-setting-row,.notes-workspace .annotation-favorite-row { display: grid; gap: 7px; padding: 6px; color: var(--text-secondary); font-size: .75rem; }
.notes-workspace .annotation-setting-row.hidden { display: none; }
.notes-workspace .annotation-segments { display: grid; grid-template-columns: repeat(3,1fr); gap: 4px; }
.notes-workspace .annotation-segments button,.notes-workspace .annotation-favorite-save { min-height: 32px; padding: 5px 7px; border: 1px solid var(--border-subtle); border-radius: 8px; background: var(--bg-elevated); color: var(--text-secondary); font: inherit; cursor: pointer; }
.notes-workspace .annotation-segments button[aria-pressed="true"] { border-color: var(--betooth-muted); background: color-mix(in srgb,var(--betooth-muted) 24%,var(--bg-elevated)); color: var(--text-primary); }
.notes-workspace .annotation-highlighter-styles { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 5px; }
.notes-workspace .annotation-highlighter-styles button { display: grid; place-items: center; min-height: 40px; border: 1px solid var(--border-subtle); border-radius: 8px; background: var(--bg-elevated); color: var(--text-secondary); font-size: 1.35rem; cursor: pointer; }
.notes-workspace .annotation-highlighter-styles button[aria-pressed="true"] { border-color: var(--betooth-muted); background: color-mix(in srgb,var(--betooth-muted) 24%,var(--bg-elevated)); color: var(--text-primary); }
.notes-workspace .annotation-highlighter-styles button:focus-visible { outline: 2px solid var(--betooth-light); outline-offset: 2px; }
.notes-workspace .annotation-highlighter-styles :is(.highlight-style-block,.highlight-style-rounded-block,.highlight-style-rounded-strip) { display: block; width: 25px; height: 11px; background: currentColor; }
.notes-workspace .annotation-highlighter-styles .highlight-style-rounded-block { border-radius: 4px; }
.notes-workspace .annotation-highlighter-styles .highlight-style-rounded-strip { border-radius: 999px; height: 8px; }
.notes-workspace .annotation-selection-actions { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; padding: 6px 10px; border-bottom: 1px solid var(--betooth-muted); background: color-mix(in srgb,var(--betooth-deep) 88%,var(--betooth-muted)); color: var(--betooth-paper); }
.notes-workspace .annotation-selection-actions[hidden] { display: none; }
.notes-workspace .annotation-selection-actions button { min-height: 40px; padding: 5px 9px; border: 1px solid color-mix(in srgb,var(--betooth-light) 52%,var(--betooth-deep)); border-radius: 8px; background: color-mix(in srgb,var(--betooth-deep) 74%,var(--betooth-muted)); color: var(--betooth-paper); cursor: pointer; }
.notes-workspace .annotation-selection-actions button:hover { border-color: var(--betooth-light); background: color-mix(in srgb,var(--betooth-muted) 74%,var(--betooth-deep)); }
.notes-workspace .annotation-selection-actions button:focus-visible { outline: 2px solid var(--betooth-orange); outline-offset: 2px; }
.notes-workspace .annotation-selection-actions button[data-selection-action="delete"] { border-color: color-mix(in srgb,var(--betooth-orange) 65%,var(--betooth-deep)); color: var(--betooth-orange); }
.notes-workspace .annotation-selection-actions input[type="color"] { width: 38px; height: 38px; padding: 2px; border: 1px solid var(--betooth-light); border-radius: 8px; background: var(--betooth-deep); }
.notes-workspace .annotation-selection-actions input[type="range"] { width: 86px; }
.notes-workspace .annotation-selection-actions [hidden] { display: none; }
.notes-workspace .annotation-selection-actions button:disabled { opacity: .42; cursor: not-allowed; }
.notes-workspace .annotation-empty-context-menu { position: fixed; z-index: 24; display: grid; min-width: 142px; padding: 5px; border: 1px solid var(--betooth-muted); border-radius: 10px; background: color-mix(in srgb,var(--betooth-deep) 92%,var(--betooth-muted)); color: var(--betooth-paper); box-shadow: 0 14px 34px color-mix(in srgb,var(--betooth-deep) 62%,transparent),0 0 0 1px color-mix(in srgb,var(--betooth-light) 14%,transparent); }
.notes-workspace .annotation-empty-context-menu[hidden] { display: none; }
.notes-workspace .annotation-empty-context-menu button { min-height: 42px; padding: 7px 12px; border: 0; border-radius: 7px; background: transparent; color: var(--betooth-paper); text-align: start; cursor: pointer; }
.notes-workspace .annotation-empty-context-menu button:hover { background: color-mix(in srgb,var(--betooth-muted) 52%,var(--betooth-deep)); }
.notes-workspace .annotation-empty-context-menu button:focus-visible { outline: 2px solid var(--betooth-orange); outline-offset: -2px; background: color-mix(in srgb,var(--betooth-muted) 62%,var(--betooth-deep)); }
.notes-workspace .annotation-empty-context-menu button[hidden] { display: none; }
.notes-workspace .annotation-study-menu { position: relative; }
.notes-workspace .annotation-study-menu > summary { min-height: 36px; display: inline-flex; align-items: center; padding: 6px 10px; border: 1px solid color-mix(in srgb,var(--betooth-muted) 70%,transparent); border-radius: 8px; color: var(--betooth-paper); cursor: pointer; list-style: none; }
.notes-workspace .annotation-study-menu > summary::-webkit-details-marker { display: none; }
.notes-workspace .annotation-study-menu[open] > summary { border-color: var(--betooth-light); background: color-mix(in srgb,var(--betooth-muted) 48%,var(--betooth-deep)); }
.notes-workspace .notes-study-menu { display: grid; min-width: 190px; padding: 5px; border: 1px solid var(--betooth-muted); border-radius: 10px; background: color-mix(in srgb,var(--betooth-deep) 94%,var(--betooth-muted)); box-shadow: 0 14px 34px color-mix(in srgb,var(--betooth-deep) 62%,transparent); }
.notes-workspace .notes-study-menu[hidden] { display: none; }
.notes-workspace .annotation-study-menu .notes-study-menu { position: absolute; z-index: 25; inset-block-start: calc(100% + 7px); inset-inline-start: 0; }
.notes-workspace .notes-study-menu button { min-height: 42px; padding: 8px 11px; border: 0; border-radius: 7px; background: transparent; color: var(--betooth-paper); text-align: start; cursor: pointer; }
.notes-workspace .notes-study-menu button:hover { background: color-mix(in srgb,var(--betooth-muted) 52%,var(--betooth-deep)); }
.notes-workspace .notes-study-menu button:focus-visible { outline: 2px solid var(--betooth-orange); outline-offset: -2px; }
.notes-workspace .notes-study-result { width: min(680px,calc(100vw - 28px)); max-height: min(76vh,720px); padding: 0; border: 1px solid var(--betooth-muted); border-radius: 16px; background: color-mix(in srgb,var(--betooth-deep) 96%,var(--betooth-muted)); color: var(--betooth-paper); box-shadow: 0 24px 70px color-mix(in srgb,var(--betooth-deep) 78%,transparent); }
.notes-workspace .notes-study-result::backdrop { background: color-mix(in srgb,var(--betooth-deep) 72%,transparent); }
.notes-workspace .notes-study-result header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 20px 14px; border-bottom: 1px solid color-mix(in srgb,var(--betooth-muted) 45%,transparent); }
.notes-workspace .notes-study-result header span,.notes-workspace .notes-study-result-source { color: var(--betooth-light); }
.notes-workspace .notes-study-result h2 { margin: 3px 0 0; font-size: 1.18rem; }
.notes-workspace .notes-study-result-source { margin: 0; padding: 12px 20px 0; font-size: .84rem; }
.notes-workspace .notes-study-result-body { min-height: 110px; padding: 16px 20px 22px; overflow: auto; white-space: pre-wrap; line-height: 1.65; }
.notes-workspace .notes-study-result-body.error { color: var(--betooth-paper); }
@media (max-width:700px){.notes-workspace .notes-study-result{width:calc(100vw - 18px);max-height:82vh;border-radius:13px}.notes-workspace .annotation-study-menu .notes-study-menu{inset-inline-start:auto;inset-inline-end:0}}

/* Phase 13.4.1 — temporary, provider-backed Study Result drawer. */
.notes-workspace .notes-study-result {
  position: fixed;
  z-index: 40;
  inset-block: calc(var(--topbar-height, 72px) + 12px) 14px;
  inset-inline-end: 14px;
  display: flex;
  flex-direction: column;
  width: min(430px, calc(100vw - 28px));
  max-height: none;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--betooth-muted);
  border-radius: 16px;
  background: color-mix(in srgb, var(--betooth-deep) 96%, var(--betooth-muted));
  color: var(--betooth-paper);
  box-shadow: 0 24px 70px color-mix(in srgb, var(--betooth-deep) 78%, transparent);
}
.notes-workspace .notes-study-result[hidden] { display: none; }
.notes-workspace .notes-study-heading { display: flex; align-items: center; gap: 10px; }
.notes-workspace .notes-study-action-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: color-mix(in srgb,var(--betooth-muted) 54%,var(--betooth-deep)); color: var(--betooth-orange); }
.notes-workspace .notes-study-source { margin: 10px 16px 0; padding: 11px 12px; border: 1px solid color-mix(in srgb,var(--betooth-light) 28%,transparent); border-radius: 10px; background: color-mix(in srgb,var(--betooth-muted) 14%,var(--betooth-deep)); }
.notes-workspace .notes-study-source strong { font-size: .75rem; color: var(--betooth-light); }
.notes-workspace .notes-study-source p { margin: 5px 0 0; max-height: 4.2em; overflow: hidden; color: var(--betooth-paper); font-size: .8rem; line-height: 1.4; }
.notes-workspace .notes-study-question-input { display: grid; gap: 6px; margin: 12px 16px 0; color: var(--betooth-light); font-size: .78rem; }
.notes-workspace .notes-study-question-input[hidden] { display: none; }
.notes-workspace .notes-study-question-input textarea { width: 100%; resize: vertical; min-height: 72px; padding: 10px 11px; border: 1px solid var(--betooth-muted); border-radius: 9px; background: color-mix(in srgb,var(--betooth-deep) 88%,var(--betooth-muted)); color: var(--betooth-paper); font: inherit; }
.notes-workspace .notes-study-question-input textarea:focus-visible { outline: 2px solid var(--betooth-orange); outline-offset: 2px; }
.notes-workspace .notes-study-result-body { flex: 1 1 auto; min-height: 110px; padding: 16px; overflow: auto; color: var(--betooth-paper); }
.notes-workspace .notes-study-result-body[hidden] { display: none; }
.notes-workspace .notes-study-result footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid color-mix(in srgb,var(--betooth-muted) 40%,transparent); }
.notes-workspace .notes-study-result footer button { min-height: 42px; }
.notes-workspace .notes-study-result footer #notesStudyCopy { margin-inline-end: auto; }
.notes-workspace .notes-study-loading { color: var(--betooth-light); }
.notes-workspace .notes-study-loading::before { content: '●'; display: inline-block; margin-inline-end: 8px; color: var(--betooth-orange); animation: notes-study-pulse 1.25s ease-in-out infinite; }
@keyframes notes-study-pulse { 50% { opacity: .35; transform: scale(.78); } }
.notes-workspace .notes-study-section h3,.notes-workspace .notes-study-question { margin: 14px 0 7px; color: var(--betooth-light); font-size: .92rem; }
.notes-workspace .notes-study-section ul { margin: 0; padding-inline-start: 20px; }
.notes-workspace .notes-study-section li { margin-block: 6px; }
.notes-workspace .notes-study-terms { display: grid; grid-template-columns: minmax(90px,auto) 1fr; gap: 7px 12px; }
.notes-workspace .notes-study-terms dt { color: var(--betooth-light); font-weight: 700; }
.notes-workspace .notes-study-terms dd { margin: 0; }
.notes-workspace .notes-study-options { display: grid; gap: 8px; }
.notes-workspace .notes-study-options button,.notes-workspace .notes-study-navigation button { min-height: 42px; padding: 8px 10px; border: 1px solid var(--betooth-muted); border-radius: 9px; background: color-mix(in srgb,var(--betooth-deep) 86%,var(--betooth-muted)); color: var(--betooth-paper); text-align: start; }
.notes-workspace .notes-study-options button[aria-pressed="true"] { border-color: var(--betooth-orange); box-shadow: inset 3px 0 0 var(--betooth-orange); }
.notes-workspace .notes-study-progress { color: var(--betooth-light); font-size: .78rem; font-variant-numeric: tabular-nums; }
.notes-workspace .notes-study-navigation { display: flex; justify-content: space-between; gap: 8px; margin-top: 14px; }
.notes-workspace .notes-study-flashcard { width: 100%; min-height: 210px; margin-top: 10px; padding: 24px; border: 1px solid var(--betooth-muted); border-radius: 14px; background: color-mix(in srgb,var(--betooth-muted) 22%,var(--betooth-deep)); color: var(--betooth-paper); font: inherit; font-size: 1rem; line-height: 1.6; }
@media (orientation: portrait), (max-width: 699px) {
  .notes-workspace .notes-study-result { inset: auto 6px 6px; width: auto; max-height: min(76dvh,720px); border-radius: 16px 16px 10px 10px; }
}
html.notes-focus-mode .notes-workspace .notes-study-result,.notes-workspace.is-focus-mode .notes-study-result { inset-block-start: 12px; }
@media (prefers-reduced-motion: reduce) { .notes-workspace .notes-study-loading::before { animation: none; } }
.notes-workspace .annotation-settings { position: static; width: 0; height: 0; flex: 0 0 0; }
.notes-workspace .annotation-settings > summary[hidden] { display: none; }
.notes-workspace .annotation-settings-panel,
.notes-workspace .annotation-shapes { position: fixed; z-index: 30; inset: auto; transform: none; max-width: calc(100vw - 16px); max-height: min(65dvh, 530px); overflow-y: auto; }
.notes-workspace .annotation-settings-panel .hidden,
.notes-workspace .annotation-setting-row.hidden,
.notes-workspace .annotation-preset-row.hidden,
.notes-workspace .annotation-color.hidden,
.notes-workspace .annotation-width.hidden,
.notes-workspace .annotation-favorite-row.hidden { display: none; }
.notes-workspace .annotation-selection-actions { position: fixed; z-index: 46; top: 64px; left: 50%; transform: translateX(-50%); justify-content: center; flex-wrap: wrap; width: min(440px,calc(100vw - 16px)); max-width: calc(100vw - 16px); overflow: visible; border: 1px solid var(--betooth-muted); border-radius: 10px; box-shadow: 0 12px 30px color-mix(in srgb,var(--betooth-deep) 55%,transparent),0 0 0 1px color-mix(in srgb,var(--betooth-light) 16%,transparent); }
.notes-workspace .annotation-selection-actions > * { flex: 0 0 auto; }
.notes-workspace .annotation-eraser-row .annotation-segments { grid-template-columns: repeat(2,minmax(0,1fr)); }
.notes-workspace .annotation-text-row input[type="range"] { width: 100%; }
.notes-workspace .annotation-text-row input[type="color"] { width: 42px; height: 34px; }
.notes-workspace .note-annotation-layer[data-tool="eraser"] { cursor: crosshair; }
.notes-workspace .annotation-eraser-preview { position: absolute; z-index: 7; pointer-events: none; border: 1px solid var(--betooth-muted); border-radius: 50%; background: color-mix(in srgb,var(--betooth-light) 14%,transparent); }
.notes-workspace .annotation-eraser-preview[hidden] { display: none; }
.notes-workspace .annotation-text-editor { position: absolute; z-index: 8; box-sizing: border-box; min-width: 120px; min-height: 54px; padding: 6px; border: 2px solid var(--betooth-muted); border-radius: 6px; outline: 2px solid var(--betooth-light); background: var(--betooth-paper); color: var(--betooth-deep); resize: both; overflow: auto; font: 20px/1.3 system-ui, sans-serif; }
.notes-workspace .annotation-crop-dialog { width: min(360px, calc(100vw - 24px)); padding: 20px; border: 1px solid var(--betooth-muted); border-radius: 12px; background: var(--bg-card); color: var(--text-primary); box-shadow: var(--shadow-md); }
.notes-workspace .annotation-crop-dialog::backdrop { background: color-mix(in srgb, var(--betooth-deep) 75%, transparent); }
.notes-workspace .annotation-crop-dialog h3 { margin: 0 0 14px; font-size: 1rem; }
.notes-workspace .annotation-crop-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.notes-workspace .annotation-crop-fields label { display: grid; gap: 4px; font-size: .8rem; }
.notes-workspace .annotation-crop-fields input { width: 100%; min-height: 40px; }
.notes-workspace .annotation-crop-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.notes-workspace .annotation-favorite-row { grid-template-columns: 1fr auto; align-items: center; }
.notes-workspace .annotation-favorites { display: flex; gap: 6px; min-height: 28px; }
.notes-workspace .annotation-favorite { position: relative; width: 28px; height: 28px; min-width: 28px; min-height: 28px; padding: 0; border: 2px solid var(--surface-strong); border-radius: 50%; background: var(--preset-color); box-shadow: 0 0 0 1px var(--border-subtle); }
.notes-workspace .annotation-favorite::after { content: attr(data-tool); position: absolute; inset-inline-end: -2px; inset-block-end: -3px; width: 12px; height: 12px; overflow: hidden; border-radius: 50%; background: var(--betooth-orange); color: transparent; }
.notes-workspace .annotation-width input { width: 100px; }
.notes-workspace .annotation-status { min-width: 0; max-width: 120px; margin-inline-start: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notes-workspace .workspace-host { flex: 1 1 auto; min-height: 0; padding: 6px; background: var(--workspace-canvas-bg); }
.notes-workspace .pdf-page-scroll { border-radius: 0; }
.notes-workspace .pdf-page-shell { margin-bottom: 10px; box-shadow: 0 3px 15px color-mix(in srgb, var(--betooth-deep) 28%, transparent); }
.notes-workspace .pdf-viewer-toolbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  flex: 0 0 auto;
  width: 100%;
  min-height: 48px;
  padding: 2px 10px;
  overflow: visible;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 0;
  background: var(--bg-panel);
}
.notes-workspace .pdf-viewer-toolbar[hidden] { display: none; }
.notes-workspace .pdf-page-navigation { grid-column: 2; justify-self: center; }
.notes-workspace .pdf-zoom-controls { grid-column: 3; justify-self: end; order: initial; flex-basis: auto; padding: 0; overflow: visible; }
.notes-workspace .pdf-viewer-toolbar button { min-width: 38px; min-height: 38px; }
.notes-workspace .pdf-page-control input { width: 48px; height: 34px; padding: 3px; background: var(--bg-card); }
.notes-workspace .pdf-zoom-controls output { min-width: 42px; }
.notes-workspace .pdf-zoom-menu-panel { inset-block-end: calc(100% + 6px); inset-inline-end: 0; }
.notes-workspace .workspace-beto { position: absolute; z-index: 8; inset-block: 0; inset-inline-end: 0; width: min(248px, 82vw); padding: 14px; border: 0; border-inline-start: 1px solid var(--border-subtle); border-radius: 0; background: var(--workspace-rail-bg); box-shadow: var(--shadow-md); transform: none; }
.notes-workspace .workspace-shell:not(.beto-open) .workspace-beto { display: none; }
.notes-workspace .workspace-beto h3 { font-size: .85rem; }
.notes-workspace .workspace-beto p { font-size: .75rem; }
html.notes-focus-mode .notes-workspace .workspace-shell,
.notes-workspace.is-focus-mode .workspace-shell { height: 100dvh; margin: 0; grid-template-columns: minmax(0, 1fr); }
html.notes-focus-mode .notes-workspace .workspace-top,
.notes-workspace.is-focus-mode .workspace-top { position: fixed; z-index: 55; inset-block-start: 6px; inset-inline-end: 6px; display: flex; width: auto; min-height: 0; padding: 0; border: 0; background: transparent; pointer-events: none; }
html.notes-focus-mode .notes-workspace .workspace-top > :not(.workspace-header-actions),
.notes-workspace.is-focus-mode .workspace-top > :not(.workspace-header-actions),
html.notes-focus-mode .notes-workspace .workspace-header-actions > :not(.workspace-study),
.notes-workspace.is-focus-mode .workspace-header-actions > :not(.workspace-study) { display: none; }
html.notes-focus-mode .notes-workspace .workspace-study,
.notes-workspace.is-focus-mode .workspace-study { pointer-events: auto; }
html.notes-focus-mode .notes-workspace .workspace-stage { border: 0; }
@media (max-width: 1100px) {
  .notes-workspace .workspace-shell,
  .notes-workspace .workspace-shell.pages-open,
  .notes-workspace .workspace-shell.pages-open:not(.beto-open) { grid-template-columns: minmax(0, 1fr); }
  .notes-workspace .workspace-pages { position: absolute; z-index: 9; inset-block: 0; inset-inline-start: 0; width: min(180px, 72vw); border-inline-end: 1px solid var(--border-subtle); box-shadow: var(--shadow-md); transform: translateX(calc(-100% - 18px)); transition: transform 160ms ease; }
  [dir="rtl"] .notes-workspace .workspace-pages { transform: translateX(calc(100% + 18px)); }
  .notes-workspace .workspace-shell.pages-open .workspace-pages,
  .notes-workspace .workspace-pages.open { display: flex; transform: translateX(0); }
}
@media (max-width: 600px) {
  .notes-workspace .workspace-top { min-height: 50px; padding: 3px 6px; gap: 4px; }
  .notes-workspace .workspace-header-page { display: none; }
  .notes-workspace .workspace-top h2 { font-size: .85rem; }
  .notes-workspace .workspace-type { font-size: .6rem; }
  .notes-workspace .workspace-icon-button,
  .notes-workspace .workspace-tool,
  .notes-workspace .annotation-settings summary { width: 38px; height: 40px; min-width: 38px; min-height: 40px; }
  .notes-workspace .workspace-study-trigger { min-height: 40px; padding-inline: 9px; }
  .notes-workspace .workspace-study-page-menu { position: fixed; inset-block-start: 56px; inset-inline: 8px; width: auto; }
  .notes-workspace .workspace-shell { height: max(420px, calc(100dvh - 112px)); }
  .notes-workspace .annotation-toolbar { max-width: calc(100% - 8px); min-height: 44px; margin: 3px auto; padding: 1px 3px; gap: 1px; flex-wrap: wrap; }
  .notes-workspace .annotation-shapes { width: min(330px,calc(100vw - 12px)); max-height: 58dvh; padding: 7px; }
  .notes-workspace .annotation-shapes-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .notes-workspace .annotation-tool-group { gap: 0; padding-inline-end: 2px; margin-inline-end: 1px; max-width: 100%; min-width: 0; flex-shrink: 1; flex-wrap: wrap; justify-content: center; }
  .notes-workspace .annotation-status { display: block; flex-basis: 100%; max-width: 100%; margin: 2px 0; white-space: normal; overflow-wrap: anywhere; text-align: center; }
  .notes-workspace .annotation-status:empty,
  .notes-workspace .annotation-status[hidden] { display: none; }
  .notes-workspace .annotation-settings-panel { inset-inline: auto; transform: none; }
  .notes-workspace .workspace-host { padding: 3px; }
  .notes-workspace .pdf-viewer-toolbar { grid-template-columns: auto auto; justify-content: space-between; gap: 2px; min-height: 44px; padding: 2px 4px; }
  .notes-workspace .pdf-toolbar-spacer { display: none; }
  .notes-workspace .pdf-page-navigation { grid-column: 1; }
  .notes-workspace .pdf-zoom-controls { grid-column: 2; gap: 1px; }
  .notes-workspace .pdf-zoom-controls output { min-width: 35px; font-size: .72rem; }
  .notes-workspace .pdf-page-control { gap: 1px; font-size: .72rem; }
  .notes-workspace .pdf-page-control input { width: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .notes-workspace .workspace-pages { transition: none; }
}
.notes-workspace .lecture-study-hub { position:fixed; inset:16px; z-index:1200; width:min(880px,calc(100vw - 32px)); margin-inline:auto; padding:24px; overflow:auto; overscroll-behavior:contain; color:var(--betooth-paper); background:var(--bg-panel,var(--betooth-deep)); border:2px solid var(--betooth-muted); border-radius:2px; box-shadow:var(--pixel-edge),8px 8px var(--bg-page); }
.notes-workspace .lecture-study-hub[hidden] { display:none; }
.lecture-study-heading,.lecture-study-tabs,.lecture-study-navigation { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.lecture-study-heading { justify-content:space-between; position:sticky; inset-block-start:-24px; z-index:2; padding-block:12px; background:var(--bg-panel); border-block-end:1px solid var(--border-subtle); }
.lecture-study-source { color:var(--betooth-light); overflow-wrap:anywhere; }
.lecture-study-tabs { margin-block:20px; border-block-end:2px solid var(--betooth-muted); padding-block-end:12px; }
.lecture-study-modes { display:flex; flex-wrap:wrap; gap:8px; margin-block:0 20px; padding:8px; border:1px solid var(--border-subtle); background:var(--bg-sidebar); }
.lecture-study-modes button { flex:1; }
.lecture-study-advisory { color:var(--betooth-light); font-size:.875rem; line-height:1.5; max-width:70ch; }
.lecture-study-status,.lecture-study-ready { margin-block:16px; padding:12px 16px; border-inline-start:3px solid var(--betooth-muted); background:var(--bg-sidebar); }
.lecture-study-ready { color:var(--betooth-light); font-size:.875rem; }
.lecture-study-test-setup { display:grid; grid-template-columns:minmax(0,1fr) minmax(100px,160px) auto; gap:12px; align-items:center; margin-block:20px; }
.lecture-study-test-setup label { min-width:0; }
.lecture-study-question-count { color:var(--betooth-light); font-variant-numeric:tabular-nums; margin-block:16px 8px; }
.lecture-study-feedback { margin-block:24px; padding:20px; border:1px solid var(--betooth-muted); background:var(--bg-sidebar); }
.lecture-study-rubric { margin-block:16px; padding-inline-start:16px; border-inline-start:2px solid var(--betooth-muted); }
.lecture-study-rubric[data-feedback=missing],.lecture-study-rubric[data-feedback=incorrectClaims],.lecture-study-rubric[data-feedback=incorrect] { border-inline-start-color:var(--betooth-orange); }
.lecture-study-concept { display:flex; justify-content:space-between; align-items:baseline; gap:16px; padding-block:12px; margin:0; border-block-end:1px solid var(--border-subtle); }
.lecture-study-concept-state { color:var(--betooth-light); text-align:end; flex-shrink:0; }
.lecture-study-concept-state[data-state=weak] { color:var(--betooth-orange); }
/* Override chrome fonts only for academic reading/answer content, never input routing. */
.app .notes-workspace .lecture-study-content { font:400 1rem/1.7 Arial,Helvetica,sans-serif; }
.app .notes-workspace .lecture-study-content :is(.lecture-study-question,.lecture-study-option,textarea) { font-family:Arial,Helvetica,sans-serif; line-height:1.6; }
.app .notes-workspace .lecture-study-score { font-size:2rem; color:var(--betooth-orange); }
@media(max-width:600px) { .lecture-study-test-setup { grid-template-columns:minmax(0,1fr) minmax(90px,120px); } .lecture-study-test-setup button { grid-column:1/-1; } .lecture-study-tabs button { flex:1; padding-inline:8px; } .lecture-study-concept { flex-wrap:wrap; gap:4px 12px; } .lecture-study-concept-state { text-align:start; flex-shrink:1; } .lecture-study-feedback { padding:12px; } }
.lecture-study-hub button,.lecture-study-hub select,.lecture-study-hub textarea { border-radius:2px; border:2px solid var(--betooth-muted); box-shadow:var(--pixel-edge); font:inherit; min-height:44px; padding:8px 12px; color:var(--betooth-paper); background:var(--betooth-deep); }
.lecture-study-hub :is(button,textarea,select):focus-visible { outline:2px solid var(--betooth-light); outline-offset:3px; }
.lecture-study-hub :is([aria-selected=true],[aria-pressed=true]) { border-color:var(--betooth-orange); background:color-mix(in srgb,var(--betooth-muted) 32%,var(--betooth-deep)); }
.lecture-study-hub button:disabled { opacity:.55; cursor:not-allowed; }
.lecture-study-content { line-height:1.7; overflow-wrap:anywhere; }
.lecture-study-content h3,.lecture-study-content h4 { margin-block:20px 12px; }
.lecture-study-content fieldset { display:grid; gap:12px; padding:16px; border:1px solid var(--betooth-muted); }
.lecture-study-content textarea { display:block; width:100%; min-height:180px; resize:vertical; margin-block:12px; }
.lecture-study-option { text-align:start; width:100%; }
.lecture-study-navigation { justify-content:space-between; margin-block:20px; }
.lecture-study-flashcard { display:block; min-height:220px!important; width:100%; font-size:1.125rem!important; white-space:pre-wrap; }
.lecture-study-mastery { margin-block-start:24px; border-block-start:2px solid var(--betooth-muted); }
.lecture-study-hub progress { width:100%; accent-color:var(--betooth-orange); }
@media(max-width:600px) { .notes-workspace .lecture-study-hub { inset:8px; width:calc(100vw - 16px); padding:16px; } .lecture-study-heading { inset-block-start:-16px; } .lecture-study-tabs { gap:8px; } }

/* ==========================================================================
   MODERN POLISH FOR NOTES (Library, Cards, Workspace)
   ========================================================================== */
.notes-library {
  max-width: 1240px;
  margin-inline: auto;
}

.notes-hero {
  border-radius: 12px;
  background: linear-gradient(135deg, #10242D 0%, #163643 55%, #0D1B21 100%);
  border: 1px solid rgba(143, 174, 184, 0.2);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.32);
  padding: 28px 32px;
}

.notes-hero .eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  margin-bottom: 6px;
  border-radius: 6px;
  background: rgba(94, 234, 212, 0.12);
  border: 1px solid rgba(94, 234, 212, 0.25);
  color: #2DD4BF;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.notes-hero h2 {
  font-size: clamp(24px, 2.5vw, 36px);
  font-weight: 800;
  color: #FFFFFF;
  margin: 6px 0 8px;
}

.notes-hero p {
  color: #CBD5E1;
  font-size: 15px;
  max-width: 65ch;
}

.notes-actions button.primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 22px;
  border-radius: 8px;
  background: linear-gradient(135deg, #FF9E44 0%, #F57C00 100%) !important;
  color: #FFFFFF !important;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  box-shadow: 0 4px 14px rgba(245, 124, 0, 0.35);
  cursor: pointer;
  transition: transform 0.16s ease, filter 0.16s ease;
}

.notes-actions button.primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.notes-actions button.secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 8px;
  background: #172D36;
  color: #F1F5F9;
  border: 1px solid rgba(143, 174, 184, 0.25);
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.notes-actions button.secondary:hover {
  border-color: #2DD4BF;
  background: #1C3642;
  color: #FFFFFF;
  transform: translateY(-2px);
}

.notes-folder-panel {
  border-radius: 12px;
  border: 1px solid rgba(143, 174, 184, 0.16);
  background: linear-gradient(160deg, #172D36 0%, #0F1F26 100%);
  padding: 16px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
}

.notes-folder {
  border-radius: 8px;
  padding: 10px 14px;
  color: #CBD5E1;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.16s ease;
}

.notes-folder:hover {
  background: rgba(94, 234, 212, 0.08);
  color: #FFFFFF;
}

.notes-folder.active {
  background: rgba(94, 234, 212, 0.12);
  color: #2DD4BF;
  border-inline-start: 3px solid #2DD4BF;
}

.notes-main {
  border-radius: 12px;
  border: 1px solid rgba(143, 174, 184, 0.16);
  background: linear-gradient(160deg, #172D36 0%, #0F1F26 100%);
  padding: 24px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
}

.notes-filterbar input,
.notes-filterbar select {
  border-radius: 8px;
  border: 1px solid rgba(143, 174, 184, 0.2);
  background: #112229;
  color: #FFFFFF;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.notes-filterbar input:focus,
.notes-filterbar select:focus {
  border-color: #2DD4BF;
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.2);
  outline: none;
}

.note-card {
  border-radius: 12px;
  border: 1px solid rgba(143, 174, 184, 0.16);
  background: linear-gradient(160deg, #1A313C 0%, #112229 100%);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.note-card:hover {
  transform: translateY(-3px);
  border-color: rgba(94, 234, 212, 0.4);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.38), 0 0 16px rgba(94, 234, 212, 0.1);
}

.note-card-icon {
  border-radius: 8px;
  background: #112229;
  border: 1px solid rgba(143, 174, 184, 0.25);
  color: #2DD4BF;
}

.note-card-copy h3 {
  color: #FFFFFF;
  font-weight: 700;
}

.note-card-copy p {
  color: #94A3B8;
  font-size: 13px;
}

/* Card kind tags */
.note-kind {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 6px;
  width: fit-content;
}

.note-card[data-workspace-type="academic_pdf"] .note-kind {
  background: rgba(45, 212, 191, 0.12);
  color: #2DD4BF;
  border: 1px solid rgba(45, 212, 191, 0.25);
}

.note-card[data-workspace-type="notebook"] .note-kind {
  background: rgba(255, 158, 68, 0.12);
  color: #FF9E44;
  border: 1px solid rgba(255, 158, 68, 0.25);
}

.note-card[data-workspace-type="personal_pdf"] .note-kind {
  background: rgba(96, 165, 250, 0.12);
  color: #60A5FA;
  border: 1px solid rgba(96, 165, 250, 0.25);
}

/* Card menu */
.note-card-more {
  border-radius: 6px;
  background: rgba(143, 174, 184, 0.08);
  color: #94A3B8;
  padding: 4px 10px;
  font-size: 16px;
  cursor: pointer;
  list-style: none;
  transition: all 0.14s ease;
}

.note-card-more:hover {
  background: rgba(94, 234, 212, 0.15);
  color: #2DD4BF;
}

.note-card-menu-panel {
  position: absolute;
  top: 100%;
  inset-inline-end: 0;
  margin-top: 6px;
  background: #112229;
  border: 1px solid rgba(143, 174, 184, 0.25);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  padding: 6px;
  z-index: 20;
  min-width: 140px;
}

.note-card-menu-panel a {
  display: block;
  padding: 8px 12px;
  color: #E2E8F0;
  font-size: 13px;
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.14s ease;
}

.note-card-menu-panel a:hover {
  background: rgba(45, 212, 191, 0.12);
  color: #2DD4BF;
}

/* Empty state */
.notes-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px;
  background: linear-gradient(160deg, #172D36 0%, #0F1F26 100%);
  border: 1px dashed rgba(143, 174, 184, 0.22);
  border-radius: 12px;
}

.notes-empty-icon {
  width: 48px;
  height: 48px;
  color: #2DD4BF;
  opacity: 0.85;
  margin-bottom: 16px;
}

.notes-empty h3 {
  font-size: 18px;
  font-weight: 700;
  color: #FFFFFF;
  margin: 0 0 8px;
}

.notes-empty p {
  color: #94A3B8;
  font-size: 14px;
  max-width: 40ch;
  margin: 0 0 20px;
  line-height: 1.55;
}


/* Read-only conflict comparison; never an editing canvas. */
.notes-conflict-dialog{box-sizing:border-box;max-inline-size:calc(100% - 24px)}
.notes-conflict-dialog fieldset{min-inline-size:0;max-inline-size:100%;margin-inline:0}
.notes-conflict-dialog select{inline-size:100%;min-inline-size:0;max-inline-size:100%}
.notes-conflict-dialog p,.notes-conflict-dialog legend{overflow-wrap:anywhere}
.notes-conflict-comparison{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;min-width:0}
.notes-conflict-preview{min-width:0;margin:0;overflow-wrap:anywhere}
.notes-conflict-preview figcaption{font-weight:700;margin-block:8px}
.notes-conflict-preview canvas{display:block;width:100%;height:auto;border:1px solid var(--border-color,#4c7e8a);background:#fff;pointer-events:none}
.workspace-action-status{overflow-wrap:anywhere;line-height:1.55}
@media(max-width:520px){.notes-conflict-comparison{grid-template-columns:minmax(0,1fr)}}
