@layer reset;

:root {
  --ease: cubic-bezier(0.25, 0, 0.3, 1);
  --animation__fadeIn: fade-in 0.3s var(--ease);
  --animation__fadeOut: fade-out 0.3s var(--ease);
  /* Major Third */
  --step--1: 0.8rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.5625rem;
  --step-3: 1.9531rem;
  --step-4: 2.4414rem;
  --step-5: 3.0518rem;
  --step-6: 3.8147rem;
  --step-7: 4.7684rem;
  --step-8: 5.9605rem;

  --space-3xs: 0.25rem;
  --space-2xs: 0.5rem;
  --space-xs: 0.75rem;
  --space-s: 1rem;
  --space-m: 1.5rem;
  --space-l: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;

  --shadow: var(--user-theme--semantic-shadows-md), var(--user-theme--semantic-shadows-lg);
  --shadow--lg: 0 10px 15px -3px rgb(0 0 0 / 10%), 0 4px 6px -4px rgb(0 0 0 / 10%);

  --radius: 0.25rem;
  --radius--home-area: 1rem;
  --radius--card: 0.25rem;

  --z__shadow: 10;
  --z__surfaceLayer: 20; /* Just visual surface rects */
  --z__textLayer: 21;
  --z__minorControls: 22;
  --z__title: 23;
  --z__marginaliaLayer: 30;
  --z__controls: 40;
  --z__tray: 50;
  --z__dragOverlay: 55;
  --z__overlay: 58;
  --z__modal: 60;
  --z__confirmation: 70;
  --z__alert: 80;
  --z__toast: 90;
  --z__fileMenu: 100;
}

@layer reset {
  /* https://www.joshwcomeau.com/css/custom-css-reset/ */
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  * {
    margin: 0;
  }

  @media (prefers-reduced-motion: no-preference) {
    html {
      interpolate-size: allow-keywords;
    }
  }

  body {
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
  }

  img,
  picture,
  video,
  canvas,
  svg {
    display: block;
    max-width: 100%;
  }

  input,
  button,
  textarea,
  select {
    font: inherit;
  }

  p,
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    overflow-wrap: break-word;
  }

  p {
    text-wrap: pretty;
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    text-wrap: balance;
  }

  .root--generated {
    isolation: isolate;
  }
}

.root--generated {
  position: fixed;
  inset: 0;
  color: var(--user-theme--semantic-colors-text-primary);
}

/* // .cutout-top {
//   mask-image: radial-gradient(circle at 50% calc(0% - 1px), transparent 8px, black 8px);
// }

// .cutout-bottom {
//   mask-image: radial-gradient(circle at 50% calc(100% + 1px), transparent 8px, black 8px);
// }

// .fadeout-bottom {
//   mask-image: linear-gradient(to top, rgb(0 0 0 / 15%) 0, black 60px);
// }

// .fadeout-bottom-sm {
//   mask-image: linear-gradient(to top, transparent 0, rgb(0 0 0 / 30%) 19px, black 26px);
// } */

@keyframes fade-in {
  to {
    opacity: 1;
  }
}

@keyframes fade-out {
  to {
    opacity: 0;
  }
}

.Loose > .ProseMirror > p {
  /* text-indent: 3ch; */
  margin-bottom: 1.5em;
}

.Loose > .ProseMirror h1 {
  margin-top: 1rem;
  margin-bottom: 1rem;
  font-size: 2.62rem;
}

.Tight > .ProseMirror h1 {
  margin-top: 1rem;
  margin-bottom: 1rem;
  font-size: 2.62rem;
}

section section section .Loose > .ProseMirror h1 {
  margin-top: 1rem;
  margin-bottom: 1rem;
  font-size: 1.62rem;
}

.Tight > .ProseMirror > p {
  text-indent: 3ch;
}

.Tight > .ProseMirror > p:last-of-type {
  margin-bottom: 0;
}

.ProseMirror {
  caret-color: deeppink;

  &:focus {
    outline: none;
  }
}

::marker {
  display: inline-block;
}

#root {
  position: fixed;
  inset: 0;
  background-color: var(--user-theme--app-background-color);
}

body {
  font-family: var(--user-theme--semantic-body-font);
}

/* 
 * This is for experimental Chrome transition API. We only want to transition
 * other items, not the whole page.
 */
/* ::page-transition-container(root),
::page-transition-outgoing-image(root),
::page-transition-incoming-image(root) {
  animation-duration: 0;
} */
/* ============================================================================
 * Button Component Styles
 * Uses data attributes for variant and state styling
 * ============================================================================ */

/* Base button styles — structural only */
.Button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  font-family: inherit;
  cursor: pointer;

  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    color 150ms ease,
    transform 100ms ease,
    opacity 150ms ease;
}

/* Styled variants — sizing, typography, border, custom props */
.Button:not([data-variant="UNSTYLED"]) {
  padding: var(--space-2xs, 0.5rem) var(--space-s, 1rem);
  min-height: 2.5rem;

  font-size: var(--step-0, 1rem);
  font-weight: 500;
  line-height: 1.25;

  border: 1px solid transparent;
  border-radius: var(--radius, 0.25rem);

  /* Custom property defaults - reference theme vars with fallbacks */
  --Button-bg: var(--user-theme--components-button-primary-bg, oklch(45% 0.2 300deg));
  --Button-bg-hover: var(--user-theme--components-button-primary-bg-hover, oklch(40% 0.2 300deg));
  --Button-text: var(--user-theme--components-button-primary-text, #fff);
  --Button-border: var(--user-theme--components-button-primary-border, transparent);
}

.Button:not([data-variant="UNSTYLED"])[data-pressed]:not([data-disabled]) {
  transform: scale(0.98);
}

.Button[data-focus-visible] {
  outline: 2px solid var(--user-theme--components-button-focus-ring, oklch(60% 0.2 300deg));
  outline-offset: 2px;
}

.Button[data-pending] {
  cursor: wait;
}

/* ============================================================================
 * Content Layout
 * ============================================================================ */

.Button__content {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2xs, 0.5rem);

  transition: opacity 150ms ease;
}

.Button__content[data-pending] {
  opacity: 0;
}

.Button__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.Button__icon[data-position="start"] {
  margin-inline-end: 0;
}

.Button__icon[data-position="end"] {
  margin-inline-start: 0;
}

.Button__text {
  white-space: nowrap;
}

/* ============================================================================
 * Loading State
 * ============================================================================ */

.Button__loading-indicator {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.Button__spinner {
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: button-spin 0.8s linear infinite;
}

@keyframes button-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================================================
 * Disabled State
 * ============================================================================ */

.Button[data-disabled] {
  cursor: not-allowed;
  opacity: 0.6;
}

/* ============================================================================
 * Variant: PRIMARY
 * ============================================================================ */

.Button[data-variant="PRIMARY"] {
  background: var(--Button-bg);
  color: var(--Button-text);
  border-color: var(--Button-border);
}

.Button[data-variant="PRIMARY"]:hover:not([data-disabled]) {
  background: var(--Button-bg-hover);
}

/* ============================================================================
 * Variant: SECONDARY
 * ============================================================================ */

.Button[data-variant="SECONDARY"] {
  --Button-bg: var(--user-theme--components-button-secondary-bg, oklch(92% 0 0deg));
  --Button-bg-hover: var(--user-theme--components-button-secondary-bg-hover, oklch(88% 0 0deg));
  --Button-text: var(--user-theme--components-button-secondary-text, oklch(30% 0 0deg));
  --Button-border: var(--user-theme--components-button-secondary-border, oklch(80% 0 0deg));

  background: var(--Button-bg);
  color: var(--Button-text);
  border-color: var(--Button-border);
}

.Button[data-variant="SECONDARY"]:hover:not([data-disabled]) {
  background: var(--Button-bg-hover);
}

/* ============================================================================
 * Variant: BACKGROUND_AREA
 * ============================================================================ */

.Button[data-variant="BACKGROUND_AREA"] {
  --Button-bg: var(--user-theme--components-button-background-area-bg, transparent);
  --Button-bg-hover: var(--user-theme--components-button-background-area-bg-hover);
  --Button-text: var(--user-theme--components-button-background-area-text);
  --Button-border: var(
    --user-theme--components-button-background-area-border,
    oklch(100% 0 0deg / 70%)
  );

  background: var(--Button-bg);
  color: var(--Button-text);
  border: 2px dashed var(--Button-border);
}

.Button[data-variant="BACKGROUND_AREA"]:hover:not([data-disabled]) {
  background: var(--Button-bg-hover);
}

/* ============================================================================
 * Variant: DANGER
 * ============================================================================ */

.Button[data-variant="DANGER"] {
  --Button-bg: var(--user-theme--components-button-danger-bg, oklch(55% 0.2 25deg));
  --Button-bg-hover: var(--user-theme--components-button-danger-bg-hover, oklch(50% 0.2 25deg));
  --Button-text: var(--user-theme--components-button-danger-text, #fff);
  --Button-border: transparent;

  background: var(--Button-bg);
  color: var(--Button-text);
  border-color: var(--Button-border);
}

.Button[data-variant="DANGER"]:hover:not([data-disabled]) {
  background: var(--Button-bg-hover);
}

/* ============================================================================
 * Variant: GHOST
 * ============================================================================ */

.Button[data-variant="GHOST"] {
  --Button-bg: var(--user-theme--components-button-ghost-bg, transparent);
  --Button-bg-hover: var(--user-theme--components-button-ghost-bg-hover, oklch(95% 0 0deg));
  --Button-text: var(--user-theme--components-button-ghost-text, oklch(45% 0.2 300deg));
  --Button-border: transparent;

  background: var(--Button-bg);
  color: var(--Button-text);
  border-color: var(--Button-border);
}

.Button[data-variant="GHOST"]:hover:not([data-disabled]) {
  background: var(--Button-bg-hover);
}

/* ============================================================================
 * Reduced Motion
 * ============================================================================ */

@media (prefers-reduced-motion: reduce) {
  .Button {
    transition: none;
  }

  .Button__content {
    transition: none;
  }

  .Button__spinner {
    animation: none;
  }
}
/* ============================================================================
 * AlertDialog Component Styles
 * Uses react-aria-components data attributes for state styling
 * ============================================================================ */

/* Overlay - Fixed backdrop covering the viewport */
.Alert__overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z__alert);

  display: flex;
  align-items: center;
  justify-content: center;

  background: var(--user-theme--components-modal-overlay-bg, rgb(0 0 0 / 40%));
  backdrop-filter: blur(4px);
}

.Alert__overlay[data-entering] {
  animation: alert-fade-in 200ms ease-out;
}

.Alert__overlay[data-exiting] {
  animation: alert-fade-out 200ms ease-out forwards;
}

/* Container - Centers the dialog card */
.Alert__container {
  display: flex;
  width: 100%;
  height: 100%;
  padding: var(--space-m, 1.5rem);
}

.Alert__overlay[data-entering] .Alert__container {
  animation: alert-slide-in 200ms ease-out;
}

.Alert__overlay[data-exiting] .Alert__container {
  animation: alert-slide-out 200ms ease-out forwards;
}

/* Card - The dialog content area */
.Alert__card {
  display: flex;
  flex-direction: column;
  align-items: stretch;

  margin: auto;
  width: 100%;
  max-width: 32rem;
  max-height: calc(100vh - var(--space-xl, 3rem) * 2);

  overflow: hidden;

  background: var(--user-theme--components-modal-content-bg, #fff);
  border-radius: var(--user-theme--components-modal-border-radius, 0.75rem);
  box-shadow: var(--user-theme--semantic-shadows-overlay, 0 10px 25px rgb(0 0 0 / 15%));

  outline: none;
}

/* Title - Heading styling */
.Alert__title {
  flex-shrink: 0;

  padding-block: var(--space-m, 1.5rem) var(--space-xs, 0.75rem);
  padding-inline: var(--space-m, 1.5rem);

  margin: 0;

  font-size: var(--step-1, 1.25rem);
  font-weight: 600;
  color: var(--user-theme--semantic-colors-text-primary, #1a1a1a);
}

/* Content - Scrollable content area */
.Alert__content {
  flex: 1 1 auto;
  overflow: auto;

  padding-inline: var(--space-m, 1.5rem);
  padding-block-end: var(--space-m, 1.5rem);

  color: var(--user-theme--semantic-colors-text-primary, #333);
}

/* Actions - Footer with buttons */
.Alert__actions {
  flex-shrink: 0;

  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-start;
  gap: var(--space-2xs, 0.5rem);

  padding-block: var(--space-2xs, 0.5rem);
  padding-inline: var(--space-m, 1.5rem);

  background: var(--user-theme--components-modal-action-bar-bg, oklch(97% 0 0deg));
  border-top: 1px solid var(--user-theme--components-modal-action-bar-border, oklch(90% 0 0deg));
}

/* Base button styles */
.Alert__action-button {
  padding: var(--space-2xs, 0.5rem) var(--space-s, 1rem);

  font-size: var(--step-0, 1rem);
  font-weight: 500;

  border: none;
  border-radius: var(--radius, 0.25rem);
  cursor: pointer;

  transition:
    background-color 150ms ease,
    transform 100ms ease;
}

.Alert__action-button:active {
  transform: scale(0.98);
}

.Alert__action-button:focus-visible {
  outline: 2px solid var(--user-theme--components-button-focus-ring, oklch(60% 0.2 300deg));
  outline-offset: 2px;
}

/* Responsive adjustments for small screens */
@media (max-width: 640px) {
  .Alert__container {
    padding: var(--space-s, 1rem);
  }

  .Alert__card {
    max-height: calc(100vh - var(--space-m, 1.5rem) * 2);
    border-radius: 0.5rem;
  }

  .Alert__title {
    padding-inline: var(--space-s, 1rem);
    padding-block: var(--space-s, 1rem) var(--space-2xs, 0.5rem);
    font-size: var(--step-0, 1rem);
  }

  .Alert__content {
    padding-inline: var(--space-s, 1rem);
    padding-block-end: var(--space-s, 1rem);
  }

  .Alert__actions {
    padding-inline: var(--space-s, 1rem);
    flex-wrap: wrap;
  }
}

/* Keyframe animations */
@keyframes alert-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes alert-fade-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes alert-slide-in {
  from {
    transform: translateY(8px);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes alert-slide-out {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(8px);
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .Alert__overlay[data-entering],
  .Alert__overlay[data-exiting],
  .Alert__overlay[data-entering] .Alert__container,
  .Alert__overlay[data-exiting] .Alert__container {
    animation: none;
  }
}
/* ============================================================================
 * ConfirmationDialog Component Styles
 * Uses react-aria-components data attributes for state styling
 * ============================================================================ */

/* Overlay - Fixed backdrop covering the viewport */
.Confirmation__overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z__confirmation);

  display: flex;
  align-items: center;
  justify-content: center;

  background: var(--user-theme--components-modal-overlay-bg, rgb(0 0 0 / 40%));
  backdrop-filter: blur(4px);
}

.Confirmation__overlay[data-entering] {
  animation: confirmation-fade-in 200ms ease-out;
}

.Confirmation__overlay[data-exiting] {
  animation: confirmation-fade-out 200ms ease-out forwards;
}

/* Container - Centers the dialog card */
.Confirmation__container {
  display: flex;
  width: 100%;
  height: 100%;
  padding: var(--space-m, 1.5rem);
}

.Confirmation__overlay[data-entering] .Confirmation__container {
  animation: confirmation-slide-in 200ms ease-out;
}

.Confirmation__overlay[data-exiting] .Confirmation__container {
  animation: confirmation-slide-out 200ms ease-out forwards;
}

/* Card - The dialog content area */
.Confirmation__card {
  display: flex;
  flex-direction: column;
  align-items: stretch;

  margin: auto;
  width: 100%;
  max-width: 32rem;
  max-height: calc(100vh - var(--space-xl, 3rem) * 2);

  overflow: hidden;

  background: var(--user-theme--components-modal-content-bg, #fff);
  border-radius: var(--user-theme--components-modal-border-radius, 0.75rem);
  box-shadow: var(--user-theme--semantic-shadows-overlay, 0 10px 25px rgb(0 0 0 / 15%));

  outline: none;
}

/* Title - Heading styling */
.Confirmation__title {
  flex-shrink: 0;

  padding-block: var(--space-m, 1.5rem) var(--space-xs, 0.75rem);
  padding-inline: var(--space-m, 1.5rem);

  margin: 0;

  font-size: var(--step-1, 1.25rem);
  font-weight: 600;
  color: var(--user-theme--semantic-colors-text-primary, #1a1a1a);
}

/* Content - Scrollable content area */
.Confirmation__content {
  flex: 1 1 auto;
  overflow: auto;

  padding-inline: var(--space-m, 1.5rem);
  padding-block-end: var(--space-m, 1.5rem);

  color: var(--user-theme--semantic-colors-text-primary, #333);
}

/* Actions - Footer with buttons */
.Confirmation__actions {
  flex-shrink: 0;

  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-start;
  gap: var(--space-2xs, 0.5rem);

  padding-block: var(--space-2xs, 0.5rem);
  padding-inline: var(--space-m, 1.5rem);

  background: var(--user-theme--components-modal-action-bar-bg, oklch(97% 0 0deg));
  border-top: 1px solid var(--user-theme--components-modal-action-bar-border, oklch(90% 0 0deg));
}

/* Base button styles */
.Confirmation__action-button {
  padding: var(--space-2xs, 0.5rem) var(--space-s, 1rem);

  font-size: var(--step-0, 1rem);
  font-weight: 500;

  border: none;
  border-radius: var(--radius, 0.25rem);
  cursor: pointer;

  transition:
    background-color 150ms ease,
    transform 100ms ease;
}

.Confirmation__action-button:active {
  transform: scale(0.98);
}

.Confirmation__action-button:focus-visible {
  outline: 2px solid var(--user-theme--components-button-focus-ring, oklch(60% 0.2 300deg));
  outline-offset: 2px;
}

/* Responsive adjustments for small screens */
@media (max-width: 640px) {
  .Confirmation__container {
    padding: var(--space-s, 1rem);
  }

  .Confirmation__card {
    max-height: calc(100vh - var(--space-m, 1.5rem) * 2);
    border-radius: 0.5rem;
  }

  .Confirmation__title {
    padding-inline: var(--space-s, 1rem);
    padding-block: var(--space-s, 1rem) var(--space-2xs, 0.5rem);
    font-size: var(--step-0, 1rem);
  }

  .Confirmation__content {
    padding-inline: var(--space-s, 1rem);
    padding-block-end: var(--space-s, 1rem);
  }

  .Confirmation__actions {
    padding-inline: var(--space-s, 1rem);
    flex-wrap: wrap;
  }
}

/* Keyframe animations */
@keyframes confirmation-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes confirmation-fade-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes confirmation-slide-in {
  from {
    transform: translateY(8px);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes confirmation-slide-out {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(8px);
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .Confirmation__overlay[data-entering],
  .Confirmation__overlay[data-exiting],
  .Confirmation__overlay[data-entering] .Confirmation__container,
  .Confirmation__overlay[data-exiting] .Confirmation__container {
    animation: none;
  }
}
.DropIndicator {
  z-index: var(--z__dragOverlay);
  position: fixed;
  pointer-events: none;
}

.DropIndicator--line {
  background: deeppink;
}

.DropIndicator--area {
  border: 3px solid deeppink;
}
.ElementInFlightGhost {
  z-index: var(--z__dragOverlay);
  position: fixed;
  top: 0;
  left: 0;
  max-width: 16rem;
  margin: 1rem;
  padding: 0.5rem 1rem;
  pointer-events: none;
  white-space: nowrap;
  opacity: 0.5;
  color: white;
  border-radius: 0.25rem;
  background-color: rgb(107 114 128 / 50%);
}
/* ============================================================================
 * Modal Component Styles
 * Uses react-aria-components data attributes for state styling
 * ============================================================================ */

/* Overlay - Fixed backdrop covering the viewport */
.Modal__overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z__modal);

  display: flex;
  align-items: center;
  justify-content: center;

  padding: var(--space-m, 1.5rem);

  background: var(--user-theme--components-modal-overlay-bg, rgb(0 0 0 / 40%));
  backdrop-filter: blur(4px);
}

.Modal__overlay[data-entering] {
  animation: modal-fade-in 200ms ease-out;
}

.Modal__overlay[data-exiting] {
  animation: modal-fade-out 200ms ease-out forwards;
}

/* Container - Wraps the modal card (must not cover the overlay for isDismissable) */
.Modal__container {
  display: flex;
  max-width: 100%;
  max-height: 100%;
}

.Modal__overlay[data-entering] .Modal__container {
  animation: modal-slide-in 200ms ease-out;
}

.Modal__overlay[data-exiting] .Modal__container {
  animation: modal-slide-out 200ms ease-out forwards;
}

/* Card - The dialog content area */
.Modal__card {
  display: flex;
  flex-direction: column;
  align-items: stretch;

  width: 100%;
  max-width: 46rem;

  overflow: hidden;

  background: var(--user-theme--components-modal-content-bg, #fff);
  border-radius: var(--user-theme--components-modal-border-radius, 0.75rem);
  box-shadow: var(--user-theme--semantic-shadows-overlay, 0 10px 25px rgb(0 0 0 / 15%));

  /* Remove default dialog outline */
  outline: none;
}

/* Title - Heading styling */
.Modal__title {
  flex-shrink: 0;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding-block: var(--space-m, 1.5rem) var(--space-xs, 0.75rem);
  padding-inline: var(--space-m, 1.5rem);

  margin: 0;

  font-size: var(--step-1, 1.25rem);
  font-weight: 600;
  color: var(--user-theme--semantic-colors-text-primary, #1a1a1a);
}

/* Close button */
.Modal__close-button {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 1.75rem;
  height: 1.75rem;
  padding: 0;

  border: none;
  border-radius: var(--radius, 0.25rem);
  background: transparent;
  color: var(--user-theme--semantic-colors-text-secondary, oklch(50% 0 0deg));
  cursor: pointer;
  flex-shrink: 0;
}

.Modal__close-button:hover {
  background: var(--user-theme--semantic-colors-surface-secondary, oklch(95% 0 0deg));
  color: var(--user-theme--semantic-colors-text-primary, oklch(20% 0 0deg));
}

.Modal__close-button svg {
  width: 1rem;
  height: 1rem;
}

/* Content - Scrollable content area */
.Modal__content {
  flex: 1 1 auto;
  overflow: auto;

  padding-inline: var(--space-m, 1.5rem);
  padding-block-end: var(--space-m, 1.5rem);

  color: var(--user-theme--semantic-colors-text-primary, #333);
}

/* Actions - Footer with buttons */
.Modal__actions {
  flex-shrink: 0;

  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-start;
  gap: var(--space-2xs, 0.5rem);

  padding-block: var(--space-2xs, 0.5rem);
  padding-inline: var(--space-m, 1.5rem);

  background: var(--user-theme--components-modal-action-bar-bg, oklch(97% 0 0deg));
  border-top: 1px solid var(--user-theme--components-modal-action-bar-border, oklch(90% 0 0deg));
}

/* Base button styles */
.Modal__action-button {
  padding: var(--space-2xs, 0.5rem) var(--space-s, 1rem);

  font-size: var(--step-0, 1rem);
  font-weight: 500;

  border: none;
  border-radius: var(--radius, 0.25rem);
  cursor: pointer;

  transition:
    background-color 150ms ease,
    transform 100ms ease;
}

.Modal__action-button:active {
  transform: scale(0.98);
}

.Modal__action-button:focus-visible {
  outline: 2px solid var(--user-theme--components-button-focus-ring, oklch(60% 0.2 300deg));
  outline-offset: 2px;
}

/* Primary button - emphasized action */
.Modal__action-button[data-variant="primary"] {
  background: var(--user-theme--components-button-primary-bg, oklch(45% 0.2 300deg));
  color: var(--user-theme--components-button-primary-text, #fff);
}

.Modal__action-button[data-variant="primary"]:hover {
  background: var(--user-theme--components-button-primary-bg-hover, oklch(40% 0.2 300deg));
}

/* Secondary button - less prominent */
.Modal__action-button[data-variant="secondary"] {
  background: var(--user-theme--components-button-secondary-bg, oklch(92% 0 0deg));
  color: var(--user-theme--components-button-secondary-text, oklch(30% 0 0deg));
}

.Modal__action-button[data-variant="secondary"]:hover {
  background: var(--user-theme--components-button-secondary-bg-hover, oklch(88% 0 0deg));
}

/* Responsive adjustments for small screens */
@media (max-width: 640px) {
  .Modal__overlay {
    padding: var(--space-s, 1rem);
  }

  .Modal__card {
    border-radius: 0.5rem;
  }

  .Modal__title {
    padding-inline: var(--space-s, 1rem);
    padding-block: var(--space-s, 1rem) var(--space-2xs, 0.5rem);
    font-size: var(--step-0, 1rem);
  }

  .Modal__content {
    padding-inline: var(--space-s, 1rem);
    padding-block-end: var(--space-s, 1rem);
  }

  .Modal__actions {
    padding-inline: var(--space-s, 1rem);
    flex-wrap: wrap;
  }
}

/* Keyframe animations */
@keyframes modal-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modal-fade-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes modal-slide-in {
  from {
    transform: translateY(8px);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes modal-slide-out {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(8px);
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .Modal__overlay[data-entering],
  .Modal__overlay[data-exiting],
  .Modal__overlay[data-entering] .Modal__container,
  .Modal__overlay[data-exiting] .Modal__container {
    animation: none;
  }
}
.OverlayTabs {
  position: fixed;
  bottom: 0;
  right: var(--space-s);
  z-index: var(--z__overlay);
  display: flex;
  gap: var(--space-xs);
  pointer-events: none;
}

.OverlayTab {
  display: flex;
  align-items: center;
  max-width: 16rem;
  border: 1px solid var(--user-theme--border-color);
  border-bottom: none;
  border-radius: var(--radius-m) var(--radius-m) 0 0;
  background: var(--user-theme--components-writing-surface-bg);
  color: var(--user-theme--semantic-colors-text-primary);
  pointer-events: auto;
}

.OverlayTab:hover {
  background: color-mix(
    in oklch,
    var(--user-theme--components-writing-surface-bg) 80%,
    transparent
  );
}

.OverlayTab__maximize {
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: var(--space-xs) var(--space-xs) var(--space-xs) var(--space-s);
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
}

.OverlayTab__title {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: var(--step--1);
}

.OverlayTab__close {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  padding: var(--space-xs);
  border: none;
  border-radius: var(--radius-s);
  background: none;
  color: inherit;
  cursor: pointer;
  opacity: 0.5;
}

.OverlayTab__close:hover {
  opacity: 1;
  background: var(--user-theme--hover-bg);
}

.OverlayTab__closeIcon {
  width: 12px;
  height: 12px;
}
/* ============================================================================
 * Overlay Component Styles
 * Full-screen overlay with blurred backdrop, using react-aria-components
 * data attributes for enter/exit animations.
 * ============================================================================ */

.Overlay__backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z__overlay);

  display: flex;
  align-items: center;
  justify-content: center;

  background: color-mix(
    in oklch,
    var(--user-theme--components-writing-surface-bg) 50%,
    transparent
  );
  backdrop-filter: blur(2px);
}

.Overlay__backdrop[data-entering] {
  animation: overlay-fade-in 200ms ease-out;
}

.Overlay__backdrop[data-exiting] {
  animation: overlay-fade-out 200ms ease-out forwards;
}

.Overlay__modal {
  display: flex;
  width: 100%;
  height: 100%;
  outline: none;
}

.Overlay__backdrop[data-entering] .Overlay__modal {
  animation: overlay-scale-in 200ms ease-out;
}

.Overlay__backdrop[data-exiting] .Overlay__modal {
  animation: overlay-scale-out 200ms ease-out forwards;
}

.Overlay__dialog {
  display: flex;
  width: 100%;
  height: 100%;
  outline: none;
}

/* Keyframe animations */
@keyframes overlay-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes overlay-fade-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes overlay-scale-in {
  from {
    transform: scale(0.97);
  }
  to {
    transform: scale(1);
  }
}

@keyframes overlay-scale-out {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(0.97);
  }
}

@media (prefers-reduced-motion: reduce) {
  .Overlay__backdrop[data-entering],
  .Overlay__backdrop[data-exiting],
  .Overlay__backdrop[data-entering] .Overlay__modal,
  .Overlay__backdrop[data-exiting] .Overlay__modal {
    animation: none;
  }
}
/* ============================================================================
 * PrimaryAction Component Styles
 * Route-aware primary navigation action
 * ============================================================================ */

/* ROOT_MENU variant - hamburger + logo on home route */
.PrimaryAction[data-variant="ROOT_MENU"] {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1em;

  margin-top: var(--Frame--top-gap);
  padding: 0.4375em;

  border-radius: var(--radius--home-area, 1rem);
  background-color: oklch(1 0 0 / 0.15);
}

.PrimaryAction__button {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 1.5em;
  height: 1.5em;

  color: #fff;
  cursor: pointer;
}

.PrimaryAction__button svg {
  width: 100%;
  height: 100%;
}

.PrimaryAction__logo {
  width: 1.125em;
  height: auto;

  color: #fff;
}

/* Workspace dots */
.PrimaryAction__workspaces {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375em;
}

.PrimaryAction__dot {
  width: 0.375em;
  height: 0.375em;
  min-width: unset;

  padding: 0;
  border: none;
  border-radius: 50%;
  appearance: none;

  background-color: #fff;
  opacity: 0.35;
  cursor: pointer;
  transition: opacity 150ms ease;
}

.PrimaryAction__dot[data-active="true"] {
  opacity: 1;
}

.PrimaryAction__tooltip {
  padding: 0.25rem 0.5rem;

  font-size: 0.75rem;
  white-space: nowrap;
  color: #fff;
  background-color: oklch(0 0 0 / 0.8);
  border-radius: 0.375rem;
}

/* BACK variant - circular back button on non-home routes */
.PrimaryAction[data-variant="BACK"] {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 2.5rem;
  height: 2.5rem;
  margin-top: var(--top-gap, 1.5rem);
  margin-left: 0.5rem;

  background-color: oklch(1 0 0 / 0.3);
  border: none;
  border-radius: 50%;
  cursor: pointer;

  color: var(--color-pink-700, oklch(55% 0.2 0));

  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  transition: background-color 150ms ease;
}

.PrimaryAction[data-variant="BACK"]:hover {
  background-color: oklch(1 0 0 / 0.9);
}

.PrimaryAction__icon {
  width: 1.25rem;
  height: 1.25rem;
}
/* ============================================================================
 * ScrollArea Component Styles
 * Uses CSS custom properties for padding and visual overflow
 * ============================================================================ */

.ScrollArea {
  overflow: auto;

  /* Visual overflow: negative margins extend scroll bounds,
   * padding compensates so content stays in correct position.
   * This allows content to visually extend under overlays (menu, tray). */
  margin-left: calc(var(--SA-vol, 0px) * -1);
  padding-left: calc(var(--SA-pl, 0px) + var(--SA-vol, 0px));

  margin-right: calc(var(--SA-vor, 0px) * -1);
  padding-right: calc(var(--SA-pr, 0px) + var(--SA-vor, 0px));

  margin-top: calc(var(--SA-vot, 0px) * -1);
  padding-top: calc(var(--SA-pt, 0px) + var(--SA-vot, 0px));

  /* Note: negative bottom margin can trigger unwanted vertical scroll on parent */
  margin-bottom: calc(var(--SA-vob, 0px) * -1);
  padding-bottom: calc(var(--SA-pb, 0px) + var(--SA-vob, 0px));
}

/* ============================================================================
 * Hidden Scrollbar
 * ============================================================================ */

.ScrollArea::-webkit-scrollbar {
  display: none;
}

/* Firefox */
.ScrollArea {
  scrollbar-width: none;
}

/* IE/Edge */
.ScrollArea {
  -ms-overflow-style: none;
}
/* ============================================================================
 * TextInput Component Styles
 * Uses data attributes for variant and state styling
 * ============================================================================ */

/* Base styles */
.TextInput {
  display: flex;
  flex-direction: column;
  gap: var(--space-3xs, 0.25rem);

  /* Custom property defaults */
  --TextInput-bg: oklch(100% 0 0deg);
  --TextInput-bg-focus: oklch(100% 0 0deg);
  --TextInput-border: oklch(80% 0 0deg);
  --TextInput-border-focus: oklch(55% 0.15 250deg);
  --TextInput-text: oklch(20% 0 0deg);
  --TextInput-placeholder: oklch(60% 0 0deg);
}

/* ============================================================================
 * Label
 * ============================================================================ */

.TextInput__label {
  font-size: var(--step--1, 0.875rem);
  font-weight: 500;
  color: oklch(40% 0 0deg);
}

/* ============================================================================
 * Input
 * ============================================================================ */

.TextInput__input {
  width: 100%;
  padding: var(--space-2xs, 0.5rem) var(--space-xs, 0.75rem);
  min-height: 2.75rem;

  font-family: inherit;
  font-size: var(--step-0, 1rem);
  line-height: 1.5;
  color: var(--TextInput-text);

  background: var(--TextInput-bg);
  border: 1px solid var(--TextInput-border);
  border-radius: var(--radius, 0.375rem);

  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.TextInput__input::placeholder {
  color: var(--TextInput-placeholder);
}

.TextInput__input:focus {
  outline: none;
  background: var(--TextInput-bg-focus);
  border-color: var(--TextInput-border-focus);
  box-shadow: 0 0 0 3px oklch(55% 0.15 250deg / 0.15);
}

/* ============================================================================
 * States
 * ============================================================================ */

/* Focused state (via data attribute for parent styling) */
.TextInput[data-focused] {
  /* Can be used for container-level styling if needed */
}

/* Invalid/Error state */
.TextInput[data-invalid] .TextInput__input {
  --TextInput-border: oklch(55% 0.2 25deg);
  --TextInput-border-focus: oklch(55% 0.2 25deg);
}

.TextInput[data-invalid] .TextInput__input:focus {
  box-shadow: 0 0 0 3px oklch(55% 0.2 25deg / 0.15);
}

/* Disabled state */
.TextInput[data-disabled] .TextInput__input {
  cursor: not-allowed;
  opacity: 0.6;
  background: oklch(96% 0 0deg);
}

.TextInput[data-disabled] .TextInput__label {
  opacity: 0.6;
}

/* ============================================================================
 * Variant: SUBTLE
 * ============================================================================ */

.TextInput[data-variant="SUBTLE"] {
  --TextInput-bg: oklch(98% 0 0deg);
  --TextInput-border: transparent;
}

.TextInput[data-variant="SUBTLE"] .TextInput__input:hover:not(:focus) {
  background: oklch(96% 0 0deg);
}

/* ============================================================================
 * Reduced Motion
 * ============================================================================ */

@media (prefers-reduced-motion: reduce) {
  .TextInput__input {
    transition: none;
  }
}
.Draggable[data-state="dragging"] {
  opacity: 0.5;
}

.Draggable__handle {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  opacity: 0;
  touch-action: none;
  transition: opacity 0.15s;
}

.Draggable:hover .Draggable__handle {
  opacity: 0.5;
}

.Draggable .Draggable__handle:hover {
  opacity: 1;
}

.Draggable__handleIcon {
  width: 10px;
  height: 16px;
}
.TrayNoteCard {
  display: flex;
  flex-direction: column;
  gap: var(--space-3xs, 0.25rem);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  background-color: oklch(0.73 0.16 203 / 0.08);
  border: 1px solid oklch(0.73 0.16 203 / 0.2);
  transition:
    background-color 0.1s ease,
    border-color 0.1s ease;
}

.TrayNoteCard:hover {
  background-color: oklch(0.73 0.16 203 / 0.15);
  border-color: oklch(0.73 0.16 203 / 0.35);
}

.TrayNoteCard:active {
  background-color: oklch(0.73 0.16 203 / 0.2);
}

.TrayNoteCard__title {
  font-size: var(--step--2, 0.75rem);
  color: oklch(30% 0 0deg);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.TrayNoteCard__summary {
  font-size: var(--step--2, 0.75rem);
  color: oklch(45% 0 0deg);
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
/* ============================================================================
 * TraySearchResultCard Component Styles
 * Search result card with expandable multi-snippet disclosure
 * ============================================================================ */

.TraySearchResultCard {
  display: flex;
  flex-direction: column;
  gap: var(--space-3xs, 0.25rem);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  background-color: oklch(96% 0 0deg);
  border: 1px solid oklch(88% 0 0deg);
  text-align: left;
  width: 100%;
  font: inherit;
  color: inherit;
  transition:
    background-color 0.1s ease,
    border-color 0.1s ease;
}

.TraySearchResultCard:hover {
  background-color: oklch(94% 0 0deg);
  border-color: oklch(82% 0 0deg);
}

.TraySearchResultCard:active {
  background-color: oklch(92% 0 0deg);
}

/* Expandable variant (Disclosure wrapper, not a button) */

.TraySearchResultCard--expandable {
  cursor: default;
}

.TraySearchResultCard__header {
  display: flex;
  align-items: center;
  gap: var(--space-2xs, 0.5rem);
}

.TraySearchResultCard__titleRow {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  padding: 0;
  background: none;
  border: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.TraySearchResultCard__title {
  font-size: var(--step--2, 0.75rem);
  color: oklch(30% 0 0deg);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.1s ease;
}

.TraySearchResultCard__titleRow:hover .TraySearchResultCard__title {
  color: oklch(15% 0 0deg);
}

.TraySearchResultCard__snippet {
  font-size: var(--step--2, 0.75rem);
  color: oklch(45% 0 0deg);
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.TraySearchResultCard__snippet mark {
  background: oklch(90% 0.12 90deg);
  color: oklch(30% 0.05 90deg);
  border-radius: 2px;
  padding: 0 1px;
}

.TraySearchResultCard__badge {
  flex-shrink: 0;
  padding: 1px 6px;
  font-family: inherit;
  font-size: var(--step--3, 0.65rem);
  font-weight: 500;
  color: oklch(45% 0 0deg);
  background: oklch(92% 0 0deg);
  border: 1px solid oklch(85% 0 0deg);
  border-radius: 4px;
  cursor: pointer;
  transition:
    background-color 0.1s ease,
    color 0.1s ease;
}

.TraySearchResultCard__badge:hover {
  background: oklch(88% 0 0deg);
  color: oklch(30% 0 0deg);
}

.TraySearchResultCard__panel {
  display: grid;
  grid-template-rows: 1fr;
  overflow: hidden;
  transition: grid-template-rows 200ms ease-out;
}

.TraySearchResultCard--expandable:not([data-expanded]) .TraySearchResultCard__panel {
  grid-template-rows: 0fr;
}

.TraySearchResultCard__extraSnippets {
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: var(--space-3xs, 0.25rem);
  padding-top: var(--space-3xs, 0.25rem);
  border-top: 1px solid oklch(90% 0 0deg);
  margin-top: var(--space-3xs, 0.25rem);
}

/* ============================================================================
 * Reduced Motion
 * ============================================================================ */

@media (prefers-reduced-motion: reduce) {
  .TraySearchResultCard__panel {
    transition: none;
  }
}
/* ============================================================================
 * TrayNotes Component Styles
 * ============================================================================ */

.TrayNotes {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.TrayNotes__empty {
  color: oklch(55% 0 0deg);
  font-size: var(--step--2, 0.75rem);
  padding: var(--space-2xs, 0.5rem) var(--space-xs, 0.75rem);
}
/* ============================================================================
 * TrayOutline Component Styles
 * Document heading hierarchy in the Tray
 * ============================================================================ */

.TrayOutline {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.TrayOutline__node {
  display: flex;
  flex-direction: column;
  gap: var(--space-3xs, 0.25rem);
  padding: var(--space-3xs, 0.25rem) var(--space-xs, 0.75rem);
  padding-left: calc(0.75rem + var(--outline-depth) * 1rem);
  border-radius: var(--radius, 0.25rem);
  cursor: pointer;
  width: 100%;
  transition: background-color 0.1s ease;
}

.TrayOutline__node:hover {
  background: oklch(94% 0 0deg);
}

.TrayOutline__node:active {
  background: oklch(90% 0 0deg);
}

.TrayOutline__node[data-heading] {
  font-weight: 600;
  font-size: var(--step--1, 0.875rem);
}

.TrayOutline__nodeLabel {
  font-size: var(--step--2, 0.75rem);
  color: oklch(30% 0 0deg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.TrayOutline__nodeLabel[data-empty] {
  opacity: 0.4;
}

.TrayOutline__node[data-heading] .TrayOutline__nodeLabel {
  font-size: var(--step--1, 0.875rem);
}

.TrayOutline__snippet {
  font-size: var(--step--2, 0.75rem);
  color: oklch(45% 0 0deg);
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.TrayOutline__snippet mark {
  background: oklch(90% 0.12 90deg);
  color: oklch(30% 0.05 90deg);
  border-radius: 2px;
  padding: 0 1px;
}

.TrayOutline__empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;

  color: oklch(55% 0 0deg);
  font-size: var(--step--1, 0.875rem);
}
.TrayProjectCard {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  background-color: oklch(0.81 0.22 121 / 0.08);
  border: 1px solid oklch(0.81 0.22 121 / 0.2);
  transition:
    background-color 0.1s ease,
    border-color 0.1s ease;
}

.TrayProjectCard:hover {
  background-color: oklch(0.81 0.22 121 / 0.15);
  border-color: oklch(0.81 0.22 121 / 0.35);
}

.TrayProjectCard:active {
  background-color: oklch(0.81 0.22 121 / 0.2);
}

.TrayProjectCard__title {
  font-size: var(--step--2, 0.75rem);
  color: oklch(30% 0 0deg);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* ============================================================================
 * TrayProjects Component Styles
 * ============================================================================ */

.TrayProjects {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.TrayProjects__empty {
  color: oklch(55% 0 0deg);
  font-size: var(--step--2, 0.75rem);
  padding: var(--space-2xs, 0.5rem) var(--space-xs, 0.75rem);
}
/* ============================================================================
 * TraySection Component Styles
 * Collapsible section wrapper with animated disclosure
 * ============================================================================ */

.TraySection {
  display: flex;
  flex-direction: column;
}

.TraySection__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: var(--space-3xs, 0.25rem) var(--space-xs, 0.75rem);

  font-family: inherit;
  font-size: var(--step--2, 0.75rem);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;

  background: transparent;
  color: oklch(55% 0 0deg);
  border: none;
  border-radius: var(--radius, 0.25rem);
  cursor: pointer;

  transition: color 150ms ease;
}

.TraySection__trigger:hover {
  color: oklch(40% 0 0deg);
}

.TraySection__trigger:focus-visible {
  outline: 2px solid oklch(60% 0.2 300deg);
  outline-offset: 2px;
}

.TraySection__chevron {
  display: inline-block;
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 5px solid currentColor;

  transition: transform 200ms ease-out;
}

.TraySection[data-expanded] .TraySection__chevron {
  transform: rotate(90deg);
}

.TraySection__label {
  user-select: none;
}

.TraySection__panel {
  display: grid;
  grid-template-rows: 1fr;
  overflow: hidden;
  transition: grid-template-rows 200ms ease-out;
}

.TraySection:not([data-expanded]) .TraySection__panel {
  grid-template-rows: 0fr;
}

.TraySection__content {
  min-height: 0;
  overflow: hidden;
}

/* ============================================================================
 * Reduced Motion
 * ============================================================================ */

@media (prefers-reduced-motion: reduce) {
  .TraySection__chevron,
  .TraySection__panel {
    transition: none;
  }
}
/* ============================================================================
 * Tray Component Styles
 * Side panel for secondary content
 * ============================================================================ */

.Tray {
  position: relative;
  width: 384px;
  flex-shrink: 0;

  background: var(--user-theme--components-tray-bg, oklch(98% 0 0deg));
  border-left: 1px solid var(--user-theme--components-tray-border, oklch(90% 0 0deg));
}

.Tray__content {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: var(--space-m, 1rem);
}

.Tray__header {
  display: flex;
  align-items: center;
  gap: var(--space-2xs, 0.5rem);
}

.Tray__header .TextInput {
  flex: 1;
}

.Tray__closeButton {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: oklch(50% 0 0deg);
  cursor: pointer;
}

.Tray__closeButton:hover {
  background: oklch(90% 0 0deg);
  color: oklch(30% 0 0deg);
}

.Tray__closeButton svg {
  width: 20px;
  height: 20px;
}

.Tray__sections {
  display: flex;
  flex-direction: column;
  padding: var(--space-m, 1rem);
  padding-top: 0;
  gap: var(--space-l, 0.75rem);
  min-height: 0;
  flex: 1;
}

.Tray__placeholder {
  color: var(--user-theme--components-tray-placeholder-text, oklch(60% 0 0deg));
  font-size: var(--step--1, 0.875rem);
  padding: var(--space-2xs, 0.5rem) var(--space-xs, 0.75rem);
}
/* ============================================================================
 * Frame Layout Styles
 * Main application layout structure
 * ============================================================================ */

/* ============================================================================
 * Frame Container
 * ============================================================================ */

.Frame {
  --Frame--top-gap: 1em;
  display: flex;
  flex: 1;
  width: 100%;
  min-height: 0;
  overflow: hidden;

  background: var(--user-theme--components-app-bg, oklch(98% 0 0deg));
  background-size: cover;
}

/* ============================================================================
 * Menu (Left Sidebar)
 * ============================================================================ */

.Frame__primaryAction {
  z-index: var(--z__controls);
  isolation: isolate;
  margin-inline: 0.75em;
  margin-top: var(--Frame--top-gap, 0);
}

/* ============================================================================
 * Viewport (Main Content Area)
 * ============================================================================ */

.Frame__viewport {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
}

.Frame__viewport_scroll {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: stretch;
}

.Frame__viewport_scroll > * {
  flex-grow: 1;
}

/* ============================================================================
 * Control Bar Layout (Floating overlay in viewport)
 * ============================================================================ */

.Frame__controlBarLayout {
  z-index: var(--z__controls);
  position: absolute;
  top: 2rem;
  left: 50%;
  display: flex;
  justify-content: center;
  width: 0;
}

/* ============================================================================
 * Tray (Right Side Panel)
 * ============================================================================ */

.Frame__tray {
  z-index: var(--z__tray);
}
/* ============================================================================
 * ErrorDetails Component Styles
 * Collapsible error details disclosure (reusable in alerts and error boundaries)
 * ============================================================================ */

.ErrorDetails {
  width: 100%;
}

.ErrorDetails__trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3xs, 0.25rem);

  padding: var(--space-3xs, 0.25rem) var(--space-xs, 0.75rem);
  margin-bottom: var(--space-xs, 0.75rem);

  font-family: inherit;
  font-size: var(--step--1, 0.875rem);
  font-weight: 500;
  line-height: 1.25;

  background: transparent;
  color: var(--user-theme--text-secondary, oklch(45% 0 0deg));
  border: 1px solid var(--user-theme--border, oklch(80% 0 0deg));
  border-radius: var(--radius, 0.25rem);
  cursor: pointer;

  transition:
    background-color 150ms ease,
    border-color 150ms ease;
}

.ErrorDetails__trigger:hover {
  background: oklch(95% 0 0deg);
  border-color: oklch(70% 0 0deg);
}

.ErrorDetails__trigger:focus-visible {
  outline: 2px solid var(--user-theme--components-button-focus-ring, oklch(60% 0.2 300deg));
  outline-offset: 2px;
}

.ErrorDetails__panel {
  display: grid;
  grid-template-rows: 1fr;
  overflow: hidden;
  transition: grid-template-rows 200ms ease-out;
}

.ErrorDetails:not([data-expanded]) .ErrorDetails__panel {
  grid-template-rows: 0fr;
}

.ErrorDetails__pre {
  overflow: auto;
  max-width: 100%;
  max-height: 50vh;
  padding: var(--space-s, 1rem);
  margin: 0;

  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: var(--step--1, 0.875rem);
  line-height: 1.5;
  text-align: left;
  white-space: pre-wrap;
  word-break: break-word;

  background: oklch(95% 0 0deg);
  border-radius: var(--radius, 0.25rem);
  color: oklch(35% 0 0deg);
}

/* Grid animation requires min-height: 0 on the child */
.ErrorDetails__panel > .ErrorDetails__pre {
  min-height: 0;
}

/* ============================================================================
 * Dark Mode Support
 * ============================================================================ */

@media (prefers-color-scheme: dark) {
  .ErrorDetails__trigger {
    color: var(--user-theme--text-secondary, oklch(70% 0 0deg));
    border-color: oklch(35% 0 0deg);
  }

  .ErrorDetails__trigger:hover {
    background: oklch(25% 0 0deg);
    border-color: oklch(45% 0 0deg);
  }

  .ErrorDetails__pre {
    background: oklch(20% 0 0deg);
    color: oklch(80% 0 0deg);
  }
}

/* ============================================================================
 * Reduced Motion
 * ============================================================================ */

@media (prefers-reduced-motion: reduce) {
  .ErrorDetails__trigger,
  .ErrorDetails__panel {
    transition: none;
  }
}
/* ============================================================================
 * ErrorDisclosure Component Styles
 * A reusable error display component
 * ============================================================================ */

.ErrorDisclosure {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  inset: 0;
  overflow: auto;
  padding: var(--space-m, 1.5rem);
  background: var(oklch(98% 0 0deg));
}

.ErrorDisclosure__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 100%;
  width: 32rem;
  text-align: center;
}

.ErrorDisclosure__icon {
  color: oklch(55% 0.15 25deg);
  margin-bottom: var(--space-s, 1rem);
}

.ErrorDisclosure__icon-svg {
  width: 48px;
  height: 48px;
}

.ErrorDisclosure__title {
  margin: 0;
  margin-bottom: var(--space-2xs, 0.5rem);
  font-size: var(--step-2, 1.5rem);
  font-weight: 600;
  color: var(--user-theme--text-primary, oklch(20% 0 0deg));
}

.ErrorDisclosure__subtitle {
  margin: 0;
  margin-bottom: var(--space-m, 1.5rem);
  font-size: var(--step-0, 1rem);
  color: var(--user-theme--text-secondary, oklch(35% 0 0deg));
}

.ErrorDisclosure__actions {
  margin-bottom: var(--space-m, 1.5rem);
}

.ErrorDisclosure__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: var(--space-2xs, 0.5rem) var(--space-s, 1rem);
  min-height: 2.5rem;

  font-family: inherit;
  font-size: var(--step-0, 1rem);
  font-weight: 500;
  line-height: 1.25;

  background: var(--user-theme--components-button-primary-bg, oklch(45% 0.2 300deg));
  color: var(--user-theme--components-button-primary-text, #fff);
  border: 1px solid transparent;
  border-radius: var(--radius, 0.25rem);
  cursor: pointer;

  transition:
    background-color 150ms ease,
    transform 100ms ease;
}

.ErrorDisclosure__button:hover {
  background: var(--user-theme--components-button-primary-bg-hover, oklch(40% 0.2 300deg));
}

.ErrorDisclosure__button:active {
  transform: scale(0.98);
}

.ErrorDisclosure__button:focus-visible {
  outline: 2px solid var(--user-theme--components-button-focus-ring, oklch(60% 0.2 300deg));
  outline-offset: 2px;
}

/* ============================================================================
 * Reduced Motion
 * ============================================================================ */

@media (prefers-reduced-motion: reduce) {
  .ErrorDisclosure,
  .ErrorDisclosure__button {
    transition: none;
  }
}
.ProseMirror {
  position: relative;
}

.ProseMirror {
  word-wrap: break-word;
  white-space: pre-wrap;
  white-space: break-spaces;
  -webkit-font-variant-ligatures: none;
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
}

.ProseMirror pre {
  white-space: pre-wrap;
}

.ProseMirror li {
  position: relative;
}

.ProseMirror-hideselection *::selection { background: transparent; }
.ProseMirror-hideselection *::-moz-selection { background: transparent; }
.ProseMirror-hideselection { caret-color: transparent; }

/* See https://code.haverbeke.berlin/prosemirror/prosemirror/issues/1421#issuecomment-1759320191 */
.ProseMirror [draggable][contenteditable=false] { user-select: text }

.ProseMirror-selectednode {
  outline: 2px solid #8cf;
}

/* Make sure li selections wrap around markers */

li.ProseMirror-selectednode {
  outline: none;
}

li.ProseMirror-selectednode:after {
  content: "";
  position: absolute;
  left: -32px;
  right: -2px; top: -2px; bottom: -2px;
  border: 2px solid #8cf;
  pointer-events: none;
}

/* Protect against generic img rules */

img.ProseMirror-separator {
  display: inline !important;
  border: none !important;
  margin: 0 !important;
}
:where(.TextEditor) {
  --TextEditor__proseRhythm: var(--Block__proseRhythm, var(--user-theme--semantic-prose-rhythm));
  --TextEditor__halfRhythm: calc(var(--TextEditor__proseRhythm) / 2);
  --TextEditor__startRhythm: var(--TextEditor__halfRhythm);
  --TextEditor__endRhythm: var(--TextEditor__halfRhythm);
}

.TextEditor {
  display: flex;
  flex-direction: column;
}

.TextEditor--heading {
  font-weight: bold;
  line-height: calc(1em + 0.5rem);
}

/* Compose view (no data-heading-level attr) keeps uniform sizing */
.TextEditor--heading:not([data-heading-level]) {
  font-size: var(--step-1);
}

/* Page view heading levels */
.TextEditor--heading[data-heading-level="1"] {
  font-size: var(--step-3);
  margin-block-start: var(--space-l);
  margin-block-end: var(--space-2xs);
}

.TextEditor--heading[data-heading-level="2"] {
  font-size: var(--step-2);
  margin-block-start: var(--space-m);
  margin-block-end: var(--space-2xs);
}

.TextEditor--heading[data-heading-level="3"] {
  font-size: var(--step-1);
  margin-block-start: var(--space-s);
  margin-block-end: var(--space-3xs);
}

.TextEditor--heading[data-heading-level="4"],
.TextEditor--heading[data-heading-level="5"],
.TextEditor--heading[data-heading-level="6"] {
  font-size: var(--step-0);
  margin-block-start: var(--space-xs);
  margin-block-end: var(--space-3xs);
}

.TextEditor > :is(p, [data-display-as="paragraph"]) {
  z-index: var(--z__textLayer);
  display: block;
  padding-block: var(--TextEditor__halfRhythm);
  padding-inline: var(
    --Page--inline-margin,
    var(--Block__hPadding, var(--user-theme--components-outline-block-h-padding))
  );
}

.TextEditor > :is(p, [data-display-as="paragraph"]):first-of-type {
  padding-top: var(--TextEditor__startRhythm, var(--TextEditor__halfRhythm));
}

.TextEditor > :is(p, [data-display-as="paragraph"]):last-of-type {
  --TextEditor__isLastParagraph: 1;
  flex-grow: 1;
  padding-bottom: var(--TextEditor__endRhythm, var(--TextEditor__halfRhythm));
}

.TextEditor .ProseMirror {
  outline: none;
}

/* Placeholder styles for empty editors/nodes */
.TextEditor .is-editor-empty::before {
  content: attr(data-placeholder);
  float: left;
  height: 0;
  pointer-events: none;
  opacity: 0.5;
}

/* Summary mode overrides */
.TextEditor[data-summary] {
  opacity: 0.5;
}

.TextEditor[data-summary]:focus-within {
  opacity: 0.8;
}
/**
 * Styles for the marginalia button plugin.
 */

.marginalia-button-widget {
  position: absolute;
  right: 2em;
  display: flex;
  height: 0;
  overflow: hidden;
  align-items: center;
  z-index: var(--z__minorControls, 10);
  pointer-events: auto;
}

.marginalia-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 2px solid var(--color-border, #d1d5db);
  border-radius: 9999px;
  background: var(--color-background, #ffffff);
  color: var(--color-text-secondary, #9ca3af);
  cursor: pointer;
  box-shadow: 0 1px 3px rgb(0 0 0 / 10%);
  transition: all 0.1s ease-in-out;
}

.marginalia-button:hover {
  background: var(--color-background-hover, #f3f4f6);
  color: var(--color-text-primary, #374151);
}

.marginalia-button__icon {
  width: 14px;
  height: 14px;
}
/* Presence cursor decorations */

.presence-cursor {
  position: relative;
  border-left: 2px solid var(--presence-color);
  margin-left: -1px;
  margin-right: -1px;
  pointer-events: none;
  display: inline;
}

.presence-cursor__label {
  position: absolute;
  bottom: 100%;
  left: -1px;
  white-space: nowrap;
  font-size: 11px;
  line-height: 1;
  padding: 1px 4px 2px;
  border-radius: 3px 3px 3px 0;
  color: white;
  background-color: var(--presence-color);
  user-select: none;
  pointer-events: none;
  opacity: 0;
  animation: presence-cursor-fade-in 150ms ease-out forwards;
}

@keyframes presence-cursor-fade-in {
  to {
    opacity: 1;
  }
}

.presence-selection {
  /* background-color set via inline style (per-user color with alpha) */
}
/* Search match highlight in editors */

.search-highlight {
  background: oklch(90% 0.12 90deg);
  color: oklch(30% 0.05 90deg);
  border-radius: 2px;
}
/* Cross-editor selection highlight */

.cross-selection {
  background-color: Highlight;
  color: HighlightText;
}
.slash-command-anchor {
  anchor-name: --slash-menu-anchor;
}

.slash-command-highlight {
  background-color: var(--color-surface-highlight, rgba(128, 128, 255, 0.12));
  border-radius: 2px;
}
/**
 * Styles for the slicing plugin contextual buttons.
 */

.slicing-interstitial-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 0;
  position: relative;
  z-index: var(--z__minorControls);
  opacity: 0;
  transition: opacity 0.15s ease-in-out;
  pointer-events: auto;
}

.slicing-interstitial-controls:hover,
.slicing-interstitial-controls[data-position="upper"],
.slicing-interstitial-controls[data-position="lower"] {
  opacity: 1;
}

/* Dashed cut line — visible only between blocks */
.slicing-interstitial-controls::before {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 50ch;
  height: 2px;
  background-image: repeating-linear-gradient(
    to right,
    oklch(0.9 0 0),
    oklch(0.9 0 0) 12px,
    transparent 12px,
    transparent 18px
  );
  pointer-events: none;
}

.slicing-interstitial-controls:first-child::before,
.slicing-interstitial-controls:last-child::before {
  content: none;
}

.slicing-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--color-border, #e0e0e0);
  border-radius: 4px;
  background: var(--color-background, #ffffff);
  color: var(--color-text-secondary, #666666);
  cursor: pointer;
  transition: all 0.1s ease-in-out;
}

.slicing-button:hover {
  background: var(--color-background-hover, #f5f5f5);
  border-color: var(--color-border-hover, #ccc);
  color: var(--color-text-primary, #333333);
}

.slicing-button:active {
  background: var(--color-background-active, #ebebeb);
}

.slicing-button__icon {
  width: 14px;
  height: 14px;
}

/* Add button: hidden by default, shown only at document boundaries */
.slicing-add-button {
  display: none;
}

.slicing-interstitial-controls:first-child .slicing-add-button,
.slicing-interstitial-controls:last-child .slicing-add-button {
  display: flex;
}

/* Slice button: hidden at document boundaries */
.slicing-interstitial-controls:first-child .slicing-slice-button,
.slicing-interstitial-controls:last-child .slicing-slice-button {
  display: none;
}

/* Old divider — superseded by the cut line pseudo-element */
.slicing-divider {
  display: none;
}
.Kbd {
  font-family: inherit;
  font-size: 0.75rem;
  color: oklch(0% 0 0 / 0.4);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}
/* ============================================================================
 * SlashCommandMenu — Floating slash command menu
 * Styling matches ActionsMenu glass-morphism appearance.
 * ============================================================================ */

/* Shared base */
.SlashCommandMenu {
  position: fixed;
  z-index: var(--z__controls);
  background: oklch(100% 0 0 / 0.65);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  backdrop-filter: blur(20px) saturate(1.8);
  border: 0.5px solid oklch(100% 0 0 / 0.5);
  border-radius: 0.625rem;
  padding: 0.3125rem;
  box-shadow:
    0 0 0 0.5px oklch(0% 0 0 / 0.06),
    0 8px 40px -4px oklch(0% 0 0 / 0.16),
    0 2px 8px -2px oklch(0% 0 0 / 0.08);
  outline: none;
  min-width: 200px;
  max-height: 320px;
  display: flex;
  flex-direction: column;
}

.SlashCommandMenu__scroll {
  overflow-y: auto;
  overscroll-behavior: contain;
  flex: 1;
  min-height: 0;
}

/* CSS anchor positioning path */
.SlashCommandMenu--anchored {
  position-anchor: --slash-menu-anchor;
  position-area: bottom right;
  margin-top: 4px;
  /* Offset left so menu item text aligns with editor text at cursor */
  margin-left: calc(-0.3125rem - 0.5rem);
}

/* JS fallback path */
.SlashCommandMenu--fallback {
  /* top/left set via inline style */
}

/* ============================================================================
 * Group
 * ============================================================================ */

.SlashCommandMenu__group + .SlashCommandMenu__group {
  margin-top: 0.25rem;
}

.SlashCommandMenu__groupLabel {
  padding: 0.25rem 0.5rem 0.125rem;
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: oklch(0% 0 0 / 0.4);
  user-select: none;
}

/* ============================================================================
 * Item
 * ============================================================================ */

.SlashCommandMenu__item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.3125rem;
  font-size: 0.8125rem;
  cursor: pointer;
  outline: none;
  transition:
    background-color 60ms ease,
    color 60ms ease;
}

.SlashCommandMenu__item:hover {
  background: oklch(0% 0 0 / 0.05);
}

.SlashCommandMenu__item[data-selected] {
  background: oklch(0.55 0.2 260);
  color: oklch(1 0 0);
}

.SlashCommandMenu__itemLabel {
  flex: 1;
}

.SlashCommandMenu__itemKbd {
  margin-left: auto;
}

/* ============================================================================
 * Separator + Close
 * ============================================================================ */

.SlashCommandMenu__separator {
  height: 0.5px;
  margin: 0.25rem 0;
  background: oklch(0% 0 0 / 0.08);
}

.SlashCommandMenu__close {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.3125rem;
  font-size: 0.8125rem;
  cursor: pointer;
  outline: none;
  color: oklch(0% 0 0 / 0.4);
  transition:
    background-color 60ms ease,
    color 60ms ease;
}

.SlashCommandMenu__close:hover {
  background: oklch(0% 0 0 / 0.05);
  color: oklch(0% 0 0 / 0.6);
}
.TextSummary {
  padding-block-start: var(--TextEditor__startRhythm, var(--TextEditor__halfRhythm));
  padding-block-end: var(--TextEditor__endRhythm, var(--TextEditor__halfRhythm));
  padding-inline: var(--Block__hPadding, var(--user-theme--components-outline-block-h-padding));
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  opacity: 0.5;
  user-select: none;
}

.TextSummary--heading {
  font-size: var(--step-1);
  font-weight: bold;
}
.ComboButton {
  --ComboButton__iconRotation: 90deg;

  display: grid;
  place-items: center;
  border-right: 1px solid oklch(0 0 0 / 0.1);
  background-color: oklch(0 0 0 / 0.01);
  cursor: pointer;

  &[data-collapsed="true"] {
    --ComboButton__iconRotation: 0deg;
  }

  &:hover {
    background-color: oklch(0 0 0 / 0.07);
    background-origin: center center;
    background-image: repeating-linear-gradient(
      -45deg,
      oklch(0 0 0 / 0),
      oklch(0 0 0 / 0) 3px,
      oklch(1 0 0) 3px,
      oklch(1 0 0) 5px
    );
  }
}

.ComboButton__icon {
  fill: oklch(0.75 0 0);
  width: 0.45rem;
  aspect-ratio: 1;
  transform: rotate(var(--ComboButton__iconRotation));
  transition: transform 0.3s;
}
.ActionsMenu {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
  border: none;
  border-radius: var(--radius, 0.25rem);
  background: transparent;
  color: currentColor;
  cursor: pointer;
  transition: background-color 150ms ease;
}

.ActionsMenu:hover {
  background: oklch(0% 0 0 / 0.08);
}

.ActionsMenu[data-pressed] {
  background: oklch(0% 0 0 / 0.12);
}

.ActionsMenu[data-focus-visible] {
  outline: 2px solid var(--user-theme--components-button-focus-ring, oklch(60% 0.2 300deg));
  outline-offset: 2px;
}

.ActionsMenu__icon {
  width: 1rem;
  height: 1rem;
}

.ActionsMenu__menu {
  background: oklch(100% 0 0 / 0.65);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  backdrop-filter: blur(20px) saturate(1.8);
  border: 0.5px solid oklch(100% 0 0 / 0.5);
  border-radius: 0.625rem;
  padding: 0.3125rem;
  box-shadow:
    0 0 0 0.5px oklch(0% 0 0 / 0.06),
    0 8px 40px -4px oklch(0% 0 0 / 0.16),
    0 2px 8px -2px oklch(0% 0 0 / 0.08);
  outline: none;
  min-width: 176px;
}

.ActionsMenu__item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.075rem 0.5rem;
  border-radius: 0.3125rem;
  font-size: 0.8125rem;
  cursor: pointer;
  outline: none;
  transition:
    background-color 60ms ease,
    color 60ms ease;
}

.ActionsMenu__itemLabel {
  flex: 1;
}

.ActionsMenu__itemKbd {
  margin-left: auto;
}

.ActionsMenu__item[data-hovered] {
  background: oklch(0.55 0.2 260);
  color: oklch(1 0 0);
}

.ActionsMenu__item[data-focused] {
  background: oklch(0.55 0.2 260);
  color: oklch(1 0 0);
}

.ActionsMenu__separator {
  height: 0.5px;
  margin: 0.25rem 0.5rem;
  background: oklch(0% 0 0 / 0.08);
}
.Block {
  --Block__background: var(--user-theme--components-outline-block-bg);
  --Block__hPadding: var(--user-theme--components-outline-block-h-padding);
  --Block__proseRhythm: var(--user-theme--semantic-prose-rhythm);
  --Block__radius: 1px;
  --Block__vPadding: var(--user-theme--components-outline-block-v-padding);

  position: relative;
  display: flex;
  flex-direction: column;
  margin-bottom: 1px;
}

.Block:hover {
  --Block__isHovered: 1;
}

.Block[data-block-type="HEADING"] {
  --Block__background: var(--user-theme--components-outline-heading-bg);
}

.Block[data-first-visual-block="true"],
.Block[data-title="true"] {
  --Block__startMargin: calc(3 * var(--Block__vPadding));
}

.Block[data-last-block="true"] {
  --Block__endMargin: calc(3 * var(--Block__vPadding));
}

.Block__surface {
  z-index: var(--z__surfaceLayer);
  flex-grow: 1;
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  cursor: text;
  background-color: var(--Block__background);
  border-radius: var(--Block__radius);
}

.Block[data-block-selected="true"] .Block__surface {
  outline: 2px solid var(--user-theme--accent, oklch(0.6 0.18 250));
  outline-offset: -2px;
}

@keyframes block-highlight-flash {
  0% {
    box-shadow: inset 0 0 0 2px var(--user-theme--accent, oklch(0.6 0.18 250));
    background-color: oklch(from var(--user-theme--accent, oklch(0.6 0.18 250)) l c h / 0.08);
  }
  100% {
    box-shadow: inset 0 0 0 2px transparent;
    background-color: transparent;
  }
}

.Block[data-block-highlight="true"] .Block__surface::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  animation: block-highlight-flash 1s ease-out forwards;
}

@media (prefers-reduced-motion: reduce) {
  .Block[data-block-highlight="true"] .Block__surface::after {
    animation: none;
  }
}

.Block__shadow {
  z-index: var(--z__shadow);
  position: absolute;
  inset: 0;
  border-radius: var(--Block__radius);
  transform: scale(0.98);
  transform-origin: center;
  filter: drop-shadow(-6px 10px 10px rgba(0, 0, 0, 0.15));
  background-color: deeppink;
}

.Block[data-row-area="Marginalia"] {
  --Block__background: var(--user-theme--components-outline-marginalia-bg, oklch(0.95 0 0));
  --Block__hPadding: var(--user-theme--components-outline-marginalia-h-padding, 0.75rem);
  --Block__proseRhythm: var(
    --user-theme--components-outline-marginalia-rhythm,
    var(--Block__proseRhythm)
  );
  --Block__radius: var(--user-theme--components-outline-marginalia-radius, 4px);
  --Block__vPadding: var(--user-theme--components-outline-marginalia-v-padding, 0.375rem);

  font-size: 0.875rem;
}

.Block__text {
  --TextEditor__startRhythm: var(--Block__startMargin);
  --TextEditor__endRhythm: var(--Block__endMargin);
  z-index: var(--z__textLayer);
  flex-grow: 1;
  cursor: text;
}

.Block__actions {
  z-index: var(--z__minorControls);
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  opacity: 0;
  transition: opacity 0.15s;
}

.Block:hover .Block__actions,
.Block__actions[aria-expanded="true"] {
  opacity: 1;
}

.Block[data-collapsed="true"] {
  --Block__isCollapsed: 1;
  --Block__vPadding: 0.75rem;
}

.Block__comboButton {
  z-index: var(--z__minorControls);
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 1.4rem;
  border-radius: var(--Block__radius) 0 0 var(--Block__radius);
  opacity: 0;
  transition: opacity 0.15s;
}

.Block:hover .Block__comboButton,
.Block[data-collapsed="true"] .Block__comboButton {
  opacity: 1;
}

/* Title overlay — invisible by default, visible on hover/focus/has-content */
.Block__title {
  z-index: var(--z__title);
  pointer-events: none;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
}

.Block__title_input {
  pointer-events: auto;
  /* background-color: oklch(90% 0 0deg); */
  background-color: oklch(0.73 0.16 203 / 0.08);
  border-bottom: 1px solid oklch(0.73 0.16 203 / 0.2);
  border-right: 1px solid oklch(0.73 0.16 203 / 0.2);
  border-radius: 0 0 9999px 0;
  opacity: 0;
  transition: opacity 0.3s;

  &[data-empty="false"],
  &:hover,
  &:has(input:focus) {
    opacity: 1;
  }
}

.Block__title_sizingAnchor {
  position: relative;
  padding-inline: 1em 1.5em;
}

.Block__title_phantomText {
  opacity: 0;
  white-space: pre;
  min-height: 1lh;
}

.Block__title_inputElement {
  position: absolute;
  inset: 0;
  padding: inherit;
  font: inherit;
  background-color: transparent;
  border: none;
  outline: none;

  &::placeholder {
    font-style: italic;
    color: inherit;
    opacity: 0.6;
  }
}
.ColumnRow {
  --ColumnRow__indent: var(--user-theme--components-outline-indent);
  --ColumnRow__marginaliaLeadIn: 2rem;
  --ColumnRow__blockWidth: 768px;
  --ColumnRow__groupAreaBackground: var(--user-theme--components-writing-surface-bg);
  --ColumnRow__groupAreaRadius: 0;

  flex-shrink: 0;
  position: relative;
  display: grid;
  grid-template-columns: var(--ColumnRow__blockWidth) max-content;
  grid-column: 1 / -1;
}

.ColumnRow[data-node="true"] {
  & > .ColumnRow {
    margin-left: var(--ColumnRow__indent);
  }

  &::before {
    content: "";
    grid-area: 1 / 1 / 3 / 2;
    position: absolute;
    inset: 0;
    top: -1px;
    left: 1px;
    bottom: -1px;
    border: 2px solid
      color-mix(in oklch, var(--ColumnRow__groupAreaBackground), transparent calc(100% - 20%));
    border-radius: var(--ColumnRow__groupAreaRadius);
    border-block: none;
    background-color: color-mix(
      in oklch,
      var(--ColumnRow__groupAreaBackground),
      transparent calc(100% - 30%)
    );
    backdrop-filter: blur(2px);
  }
}

.ColumnRow[data-row-area="Marginalia"] {
  --ColumnRow__marginaliaLeadIn: 0;
  --ColumnRow__groupAreaBackground: oklch(0.88 0 0);
  --ColumnRow__groupAreaRadius: var(--user-theme--components-outline-marginalia-radius);
  --ColumnRow__indent: var(
    --user-theme--components-outline-marginalia-indent,
    var(--user-theme--components-outline-indent)
  );
}

.ColumnRow__marginalia {
  margin-inline-start: -1rem;
  margin-block-start: var(--ColumnRow__marginaliaLeadIn);
}

.ColumnRow__children {
  position: relative;
  padding-left: var(--ColumnRow__indent);
  grid-column: 1 / -1;
}

.ColumnRow__childrenPlaceholder {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: var(--ColumnRow__indent);
  border: 2px solid
    color-mix(in oklch, var(--ColumnRow__groupAreaBackground), transparent calc(100% - 20%));
  border-block: none;
  background-color: color-mix(
    in oklch,
    var(--ColumnRow__groupAreaBackground),
    transparent calc(100% - 30%)
  );
}

.Button.ColumnRow__addBlockButton {
  width: 9rem;
  align-self: center;
  margin-block: 0.5rem;
  font-size: var(--font-size--xs);
  background: transparent;
  border: 2px dashed oklch(1 0 0 / 0.3);
}

.Button.ColumnRow__addBlockButton:hover {
  background: oklch(1 0 0 / 0.2);
}

.Marginalia {
  position: relative;
  z-index: var(--z__marginaliaLayer);
}
.OutlineColumn {
  position: relative;
  display: grid;
  grid-auto-rows: min-content;
}
/* ============================================================================
 * OutlineControlBar
 * Floating gradient bar at top of viewport with title, actions, tray toggle
 * ============================================================================ */

.OutlineControlBar {
  --control-bar--inline-padding: 1em;
  display: flex;
  align-items: center;
  min-width: 768px;
  border-radius: var(--radius--card);
  background-image: linear-gradient(to right, oklch(0.3 0.3 300) 0%, oklch(0.7 0.3 300) 100%);
  background-color: var(--user-theme--components-control-bar-bg);
  box-shadow: var(--shadow--lg);
}

/* ============================================================================
 * Title Input
 * ============================================================================ */

.OutlineControlBar__title {
  flex: 1;
  padding: 0.6em var(--control-bar--inline-padding);
  border: none;
  background: transparent;
  color: var(--user-theme--components-control-bar-text, white);
  font-size: 1rem;
  font-weight: 500;
  outline: none;
}

.OutlineControlBar__title::placeholder {
  color: var(--user-theme--components-control-bar-text, white);
  opacity: 0.6;
}

/* ============================================================================
 * Actions Menu (override trigger button style for control bar context)
 * ============================================================================ */

.OutlineControlBar__actions {
  color: var(--user-theme--components-control-bar-text, white);
  opacity: 0.8;
}

.OutlineControlBar__actions:hover,
.OutlineControlBar__actions[data-pressed] {
  opacity: 1;
}

/* ============================================================================
 * Tray Toggle
 * ============================================================================ */

.OutlineControlBar__trayToggle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5em;
  margin-right: 0.4em;
  border: none;
  border-radius: var(--radius--card);
  background: transparent;
  color: var(--user-theme--components-control-bar-text, white);
  cursor: pointer;
  opacity: 0.8;
}

.OutlineControlBar__trayToggle svg {
  width: 1.2em;
  height: 1.2em;
}

.OutlineControlBar__trayToggle:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.15);
}
.ZoomIndicator {
  position: absolute;
  bottom: 2rem;
  right: 2rem;
  z-index: var(--z__controls);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.625rem;
  background: oklch(0.2 0 0 / 0.7);
  backdrop-filter: blur(8px);
  border-radius: 6px;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: oklch(0.85 0 0);
}
.Outline {
  flex-shrink: 0;
  display: flex;
  align-items: stretch;
  position: relative;
  padding-top: 7rem; /* sufficient to clear the control and leave some breathing room */
}

.Outline__content {
  flex-grow: 1;
  flex-shrink: 0;
  display: flex;
  align-items: stretch;
}

.Outline__centeringMargin {
  flex-grow: 1;
  flex-basis: 0;
  display: grid;
}

.Outline__column {
  flex-shrink: 0;
}

.Outline__column + .Outline__column {
  margin-left: 4rem;
}

.Outline__addColumn {
  display: grid;
  padding: 4rem;
}
/* ============================================================================
 * DocumentOverlay — layout for the overlay content frame and action buttons
 * ============================================================================ */

.DocumentOverlay {
  display: flex;
  width: 100%;
  height: 100%;
  padding: var(--space-l);
  gap: var(--space-s);
}

/* Content area — holds the Compose view */
.DocumentOverlay__content {
  flex: 1 1 auto;
  min-width: 0;
  position: relative;

  overflow: hidden auto;

  border-radius: 0.75rem;

  box-shadow:
    0 1px 2px rgb(0 0 0 / 8%),
    0 4px 8px rgb(0 0 0 / 8%),
    0 12px 24px rgb(0 0 0 / 12%),
    0 24px 48px rgb(0 0 0 / 16%);
}

.DocumentOverlay__content::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--user-theme--components-app-bg);
  /* background-color: deeppink; */
  background-size: cover;
  opacity: 0.9;
  z-index: -1;
}

/* Action button panel — column of circular icon buttons */
.DocumentOverlay__actions {
  flex: 0 0 auto;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);

  padding-block-start: var(--space-xs);
}

.DocumentOverlay__actionButton {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 2.5rem;
  height: 2.5rem;

  padding: 0;

  color: rgb(255 255 255 / 80%);
  /* background: rgb(255 255 255 / 10%); */
  background: oklch(0.76 0.15 6.17);
  border: none;
  border-radius: 50%;
  cursor: pointer;

  transition:
    background-color 150ms ease,
    color 150ms ease;
}

.DocumentOverlay__actionButton:hover {
  color: #fff;
  background: rgb(255 255 255 / 20%);
}

.DocumentOverlay__actionButton:active {
  transform: scale(0.95);
}

.DocumentOverlay__actionButton:focus-visible {
  outline: 2px solid rgb(255 255 255 / 50%);
  outline-offset: 2px;
}

.DocumentOverlay__actionIcon {
  width: 1.25rem;
  height: 1.25rem;
}
/* ============================================================================
 * AuthCard Component Styles
 * Centered card with glassmorphism and animated mesh gradient background
 * ============================================================================ */

/* ============================================================================
 * Container - Fullscreen centered
 * ============================================================================ */

.AuthCard__container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--space-m, 1.5rem);

  /* Subtle base background */
  background: oklch(98% 0.01 250deg);
  overflow: hidden;
}

/* ============================================================================
 * Animated Mesh Gradient Background
 * ============================================================================ */

.AuthCard__background {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.AuthCard__gradient {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
}

.AuthCard__gradient--1 {
  width: 60vmax;
  height: 60vmax;
  top: -20%;
  left: -10%;
  background: oklch(75% 0.15 280deg);
  animation: auth-gradient-float 18s ease-in-out infinite;
}

.AuthCard__gradient--2 {
  width: 50vmax;
  height: 50vmax;
  bottom: -30%;
  right: -15%;
  background: oklch(75% 0.12 200deg);
  animation: auth-gradient-float 22s ease-in-out infinite reverse;
}

.AuthCard__gradient--3 {
  width: 40vmax;
  height: 40vmax;
  top: 40%;
  left: 50%;
  transform: translateX(-50%);
  background: oklch(80% 0.08 320deg);
  animation: auth-gradient-float 15s ease-in-out infinite 3s;
}

@keyframes auth-gradient-float {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(5%, -8%) scale(1.05);
  }
  66% {
    transform: translate(-3%, 5%) scale(0.95);
  }
}

/* ============================================================================
 * Card - Glassmorphism
 * ============================================================================ */

.AuthCard {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: var(--space-l, 2rem);

  /* Glassmorphism */
  background: oklch(100% 0 0deg / 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid oklch(100% 0 0deg / 0.5);
  border-radius: var(--radius-lg, 0.75rem);
  box-shadow:
    0 4px 6px -1px oklch(0% 0 0deg / 0.05),
    0 10px 15px -3px oklch(0% 0 0deg / 0.08),
    0 20px 25px -5px oklch(0% 0 0deg / 0.05);

  /* Entry animation */
  animation: auth-card-enter 400ms ease-out;

  /* Custom property defaults */
  --AuthCard-bg: oklch(100% 0 0deg / 0.75);
  --AuthCard-border: oklch(100% 0 0deg / 0.5);
}

@keyframes auth-card-enter {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ============================================================================
 * Header
 * ============================================================================ */

.AuthCard__header {
  text-align: center;
  margin-bottom: var(--space-l, 2rem);
}

.AuthCard__title {
  margin: 0;
  font-size: var(--step-3, 1.75rem);
  font-weight: 700;
  color: oklch(20% 0 0deg);
  line-height: 1.2;
}

.AuthCard__subtitle {
  margin: var(--space-2xs, 0.5rem) 0 0;
  font-size: var(--step-0, 1rem);
  color: oklch(45% 0 0deg);
  line-height: 1.5;
}

/* ============================================================================
 * Content
 * ============================================================================ */

.AuthCard__content {
  display: flex;
  flex-direction: column;
  gap: var(--space-m, 1.5rem);
}

/* ============================================================================
 * Actions
 * ============================================================================ */

.AuthCard__actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-s, 1rem);
  margin-top: var(--space-m, 1.5rem);
}

/* Make buttons full width in actions */
.AuthCard__actions .Button {
  width: 100%;
}

/* ============================================================================
 * Footer
 * ============================================================================ */

.AuthCard__footer {
  text-align: center;
  margin-top: var(--space-l, 2rem);
  padding-top: var(--space-m, 1.5rem);
  border-top: 1px solid oklch(90% 0 0deg);
}

.AuthCard__footer a,
.AuthCard__footer button {
  color: oklch(45% 0.15 250deg);
  font-size: var(--step--1, 0.875rem);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.AuthCard__footer a:hover,
.AuthCard__footer button:hover {
  text-decoration: underline;
}

/* ============================================================================
 * Responsive
 * ============================================================================ */

@media (max-width: 480px) {
  .AuthCard__container {
    padding: var(--space-s, 1rem);
    align-items: flex-start;
    padding-top: var(--space-xl, 3rem);
  }

  .AuthCard {
    padding: var(--space-m, 1.5rem);
  }

  .AuthCard__title {
    font-size: var(--step-2, 1.5rem);
  }
}

/* ============================================================================
 * Reduced Motion
 * ============================================================================ */

@media (prefers-reduced-motion: reduce) {
  .AuthCard {
    animation: none;
  }

  .AuthCard__gradient {
    animation: none;
  }
}

/* ============================================================================
 * Dark mode considerations - subtle adjustments
 * ============================================================================ */

@media (prefers-color-scheme: dark) {
  .AuthCard__container {
    background: oklch(15% 0.02 250deg);
  }

  .AuthCard {
    background: oklch(20% 0.02 250deg / 0.8);
    border-color: oklch(30% 0 0deg / 0.5);
  }

  .AuthCard__title {
    color: oklch(95% 0 0deg);
  }

  .AuthCard__subtitle {
    color: oklch(70% 0 0deg);
  }

  .AuthCard__gradient {
    opacity: 0.2;
  }

  .AuthCard__footer {
    border-top-color: oklch(30% 0 0deg);
  }
}
/* ============================================================================
 * CodeInput Component Styles
 * 6 individual character boxes for sign-in code
 * ============================================================================ */

.CodeInput {
  display: flex;
  gap: var(--space-2xs, 0.5rem);
  justify-content: center;

  /* Custom property defaults */
  --CodeInput-bg: oklch(100% 0 0deg);
  --CodeInput-border: oklch(80% 0 0deg);
  --CodeInput-border-focus: oklch(55% 0.15 250deg);
  --CodeInput-text: oklch(20% 0 0deg);
}

/* ============================================================================
 * Individual Box
 * ============================================================================ */

.CodeInput__box {
  width: 3rem;
  height: 3.5rem;

  font-family: inherit;
  font-size: var(--step-2, 1.5rem);
  font-weight: 600;
  text-align: center;
  text-transform: uppercase;
  color: var(--CodeInput-text);

  background: var(--CodeInput-bg);
  border: 2px solid var(--CodeInput-border);
  border-radius: var(--radius, 0.375rem);

  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    transform 150ms ease;
}

.CodeInput__box::placeholder {
  color: oklch(70% 0 0deg);
}

/* Selection styling */
.CodeInput__box::selection {
  background: oklch(55% 0.15 250deg / 0.2);
}

/* Focus state */
.CodeInput__box:focus {
  outline: none;
  border-color: var(--CodeInput-border-focus);
  box-shadow: 0 0 0 3px oklch(55% 0.15 250deg / 0.15);
}

/* ============================================================================
 * Data Attribute States
 * ============================================================================ */

/* Filled state - subtle scale up */
.CodeInput__box[data-filled] {
  transform: scale(1.02);
  border-color: oklch(70% 0.05 250deg);
}

/* Active state styling handled by :focus */

/* ============================================================================
 * Error State
 * ============================================================================ */

.CodeInput[data-error] .CodeInput__box {
  --CodeInput-border: oklch(55% 0.2 25deg);
  --CodeInput-border-focus: oklch(55% 0.2 25deg);
  animation: codeinput-shake 300ms ease-out;
}

.CodeInput[data-error] .CodeInput__box:focus {
  box-shadow: 0 0 0 3px oklch(55% 0.2 25deg / 0.15);
}

@keyframes codeinput-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-4px);
  }
  40% {
    transform: translateX(4px);
  }
  60% {
    transform: translateX(-3px);
  }
  80% {
    transform: translateX(3px);
  }
}

/* ============================================================================
 * Disabled State
 * ============================================================================ */

.CodeInput[data-disabled] .CodeInput__box {
  cursor: not-allowed;
  opacity: 0.6;
  background: oklch(96% 0 0deg);
}

/* ============================================================================
 * Responsive - Smaller boxes on mobile
 * ============================================================================ */

@media (max-width: 400px) {
  .CodeInput__box {
    width: 2.5rem;
    height: 3rem;
    font-size: var(--step-1, 1.25rem);
  }
}

/* ============================================================================
 * Reduced Motion
 * ============================================================================ */

@media (prefers-reduced-motion: reduce) {
  .CodeInput__box {
    transition: none;
  }

  .CodeInput[data-error] .CodeInput__box {
    animation: none;
  }
}
/* ============================================================================
 * FormField Component Styles
 * Wrapper with label above input, error message below
 * ============================================================================ */

.FormField {
  display: flex;
  flex-direction: column;
  gap: var(--space-3xs, 0.25rem);

  /* Custom property defaults */
  --FormField-error-color: oklch(55% 0.2 25deg);
}

/* ============================================================================
 * Error Message
 * ============================================================================ */

.FormField__error {
  font-size: var(--step--1, 0.875rem);
  color: var(--FormField-error-color);

  /* Entry animation */
  animation: formfield-error-enter 200ms ease-out;
}

@keyframes formfield-error-enter {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================================================
 * Input shake animation on error
 * ============================================================================ */

.FormField[data-error] .FormField__input {
  animation: formfield-shake 300ms ease-out;
}

@keyframes formfield-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-4px);
  }
  40% {
    transform: translateX(4px);
  }
  60% {
    transform: translateX(-3px);
  }
  80% {
    transform: translateX(3px);
  }
}

/* ============================================================================
 * Reduced Motion
 * ============================================================================ */

@media (prefers-reduced-motion: reduce) {
  .FormField__error {
    animation: none;
  }

  .FormField[data-error] .FormField__input {
    animation: none;
  }
}
/* ============================================================================
 * Auth Component Styles
 * Additional styles for auth flow components
 * ============================================================================ */

/* ============================================================================
 * Code Entry Wrapper
 * ============================================================================ */

.Auth__code-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-s, 1rem);
}

/* ============================================================================
 * Error Message
 * ============================================================================ */

.Auth__error {
  margin: 0;
  font-size: var(--step--1, 0.875rem);
  color: oklch(55% 0.2 25deg);
  text-align: center;
  max-width: 280px;

  /* Entry animation */
  animation: auth-error-enter 200ms ease-out;
}

@keyframes auth-error-enter {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================================================
 * Reduced Motion
 * ============================================================================ */

@media (prefers-reduced-motion: reduce) {
  .Auth__error {
    animation: none;
  }
}
/* ============================================================================
 * ResyncingScreen Component Styles
 * Full-screen loading state shown during data resync
 * ============================================================================ */

@keyframes ResyncingScreen-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.ResyncingScreen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.ResyncingScreen__content {
  text-align: center;
}

.ResyncingScreen__spinner {
  width: 3rem;
  height: 3rem;
  margin: 0 auto var(--space-s, 1rem);

  border: 2px solid transparent;
  border-bottom-color: oklch(20% 0 0deg);
  border-radius: 50%;

  animation: ResyncingScreen-spin 1s linear infinite;
}

.ResyncingScreen__message {
  font-size: var(--step-0, 1rem);
  color: oklch(45% 0 0deg);
}

/* ============================================================================
 * Dark Mode
 * ============================================================================ */

@media (prefers-color-scheme: dark) {
  .ResyncingScreen__spinner {
    border-bottom-color: oklch(90% 0 0deg);
  }

  .ResyncingScreen__message {
    color: oklch(70% 0 0deg);
  }
}

/* ============================================================================
 * Reduced Motion
 * ============================================================================ */

@media (prefers-reduced-motion: reduce) {
  .ResyncingScreen__spinner {
    animation-duration: 3s;
  }
}
/* ============================================================================
 * Preflight Component Styles
 * Styles for the choose mode screen
 * ============================================================================ */

/* ============================================================================
 * Options Grid
 * ============================================================================ */

.Preflight__options {
  display: flex;
  flex-direction: column;
  gap: var(--space-s, 1rem);
}

/* ============================================================================
 * Option Button
 * ============================================================================ */

.Preflight__option {
  display: flex;
  align-items: center;
  gap: var(--space-m, 1.5rem);
  width: 100%;
  padding: var(--space-m, 1.5rem);

  background: oklch(100% 0 0deg);
  border: 2px solid oklch(90% 0 0deg);
  border-radius: var(--radius, 0.5rem);
  cursor: pointer;

  text-align: left;
  font-family: inherit;

  transition:
    border-color 150ms ease,
    background-color 150ms ease,
    transform 100ms ease;
}

.Preflight__option:hover {
  border-color: oklch(55% 0.15 250deg);
  background: oklch(98% 0.01 250deg);
}

.Preflight__option:active {
  transform: scale(0.98);
}

.Preflight__option:focus-visible {
  outline: 2px solid oklch(55% 0.15 250deg);
  outline-offset: 2px;
}

/* ============================================================================
 * Option Icon
 * ============================================================================ */

.Preflight__option-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;

  width: 3rem;
  height: 3rem;

  background: oklch(95% 0.03 250deg);
  border-radius: var(--radius, 0.375rem);
  color: oklch(45% 0.15 250deg);
}

/* ============================================================================
 * Option Content
 * ============================================================================ */

.Preflight__option-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-3xs, 0.25rem);
}

.Preflight__option-title {
  font-size: var(--step-1, 1.125rem);
  font-weight: 600;
  color: oklch(20% 0 0deg);
}

.Preflight__option-description {
  font-size: var(--step--1, 0.875rem);
  color: oklch(45% 0 0deg);
}

/* ============================================================================
 * Dark Mode
 * ============================================================================ */

@media (prefers-color-scheme: dark) {
  .Preflight__option {
    background: oklch(25% 0.02 250deg);
    border-color: oklch(35% 0 0deg);
  }

  .Preflight__option:hover {
    border-color: oklch(55% 0.15 250deg);
    background: oklch(28% 0.03 250deg);
  }

  .Preflight__option-icon {
    background: oklch(30% 0.05 250deg);
    color: oklch(70% 0.12 250deg);
  }

  .Preflight__option-title {
    color: oklch(95% 0 0deg);
  }

  .Preflight__option-description {
    color: oklch(70% 0 0deg);
  }
}

/* ============================================================================
 * Responsive
 * ============================================================================ */

@media (max-width: 400px) {
  .Preflight__option {
    padding: var(--space-s, 1rem);
    gap: var(--space-s, 1rem);
  }

  .Preflight__option-icon {
    width: 2.5rem;
    height: 2.5rem;
  }

  .Preflight__option-title {
    font-size: var(--step-0, 1rem);
  }
}

/* ============================================================================
 * Reduced Motion
 * ============================================================================ */

@media (prefers-reduced-motion: reduce) {
  .Preflight__option {
    transition: none;
  }
}
.PageView {
  flex-shrink: 0;
  align-self: flex-start; /* Frame stretches content to fill */
  display: grid;
  justify-items: center;
  align-content: start;
  position: relative;
  padding-top: 7rem;
  /* TODO: pull from page style settings */
  --Page--inline-margin: 6rem;
}

.PageView__surface {
  position: relative;
  width: min(860px, 100%);
  min-width: min(768px, 100%);
  min-height: 75vh;
  padding: 5rem 0 4rem;
  background: var(--user-theme--components-writing-surface-bg);
  box-shadow:
    0 1px 3px oklch(0 0 0 / 0.12),
    0 1px 2px oklch(0 0 0 / 0.08);
  border-radius: 4px;
}

.PageView__surface > .TextEditor--heading:first-child {
  margin-block-start: 0;
}
.Home {
  display: flex;
  align-items: stretch;
  flex: 1;
}

.Home__container {
  flex-grow: 1;
  display: flex;
  align-items: stretch;
  margin-top: var(--Frame--top-gap, 0);
  margin-right: var(--space-md, 1.5rem);
  padding-inline: 2rem;
  gap: 3rem;
  border-radius: var(--radius--xl, 1rem) var(--radius--xl, 1rem) 0 0;
  background-color: oklch(1 0 0 / 0.15);
}

.Home__column {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding-block: 1.5rem;
  gap: 1.5rem;
}

.Home__column[data-type="notes"] {
  flex-grow: 1;
}

.Home__headingButton {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  margin: -0.75rem -0.75rem -1.25rem -0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 5px;
  color: white;
  text-shadow: 1px 1px 1px oklch(0 0 0 / 0.06);
  font-weight: 500;
  background: transparent;
  border: none;
  cursor: pointer;
}

.Home__headingButton:hover {
  background-color: oklch(0.81 0.22 121);
}

.Home__headingButton[data-type="notes"]:hover {
  background-color: oklch(0.73 0.16 203);
}

.Home__items {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 22rem;
}
.HomeNoteCard {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--home--masonry-item-width);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background-color: oklch(0.73 0.16 203 / 0.15);
  border: 1px solid oklch(0.73 0.16 203 / 0.3);
  cursor: pointer;
  text-align: left;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease;
}

.MasonryContainer[data-masonry-initialized] .HomeNoteCard {
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    translate 200ms ease;
}

.HomeNoteCard:hover {
  background-color: oklch(0.73 0.16 203 / 0.25);
  border-color: oklch(0.73 0.16 203 / 0.5);
}

.HomeNoteCard__title {
  color: white;
  font-size: 0.875rem;
  font-weight: 500;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

.HomeNoteCard__actions {
  z-index: var(--z__minorControls);
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  opacity: 0;
  transition: opacity 0.15s;
}

.HomeNoteCard:hover .HomeNoteCard__actions,
.HomeNoteCard__actions[aria-expanded="true"] {
  opacity: 1;
}

.HomeNoteCard__summary {
  color: white;
  font-size: 0.75rem;
  opacity: 0.6;
  margin-top: 0.375rem;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 6;
  line-clamp: 6;
  overflow: hidden;
}
.HomeProjectCard {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background-color: oklch(0.81 0.22 121 / 0.15);
  border: 1px solid oklch(0.81 0.22 121 / 0.3);
  cursor: pointer;
  text-align: left;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease;
}

.HomeProjectCard:hover {
  background-color: oklch(0.81 0.22 121 / 0.25);
  border-color: oklch(0.81 0.22 121 / 0.5);
}

.HomeProjectCard__title {
  color: white;
  font-size: 0.875rem;
  font-weight: 500;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

.HomeProjectCard__actions {
  z-index: var(--z__minorControls);
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  opacity: 0;
  transition: opacity 0.15s;
}

.HomeProjectCard:hover .HomeProjectCard__actions,
.HomeProjectCard__actions[aria-expanded="true"] {
  opacity: 1;
}

.HomeProjectCard__summary {
  color: white;
  font-size: 0.75rem;
  opacity: 0.6;
  margin-top: 0.375rem;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 6;
  line-clamp: 6;
  overflow: hidden;
}
.MasonryContainer {
  position: relative;
  flex-shrink: 0;
}
/* ============================================================================
 * ThemeEditor Component Styles
 * ============================================================================ */

.ThemeEditor {
  display: flex;
  flex-direction: column;
  gap: var(--space-m);
  padding: var(--space-l);
  max-width: 600px;
  margin: 0 auto;
  color: var(--user-theme--semantic-text-primary, oklch(20% 0 0));
}

.ThemeEditor__header {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
}

.ThemeEditor__title {
  font-size: var(--step-3);
  font-weight: 600;
  margin: 0;
}

.ThemeEditor__subtitle {
  font-size: var(--step--1);
  color: var(--user-theme--semantic-text-muted, oklch(50% 0 0));
  margin: 0;
}

/* ============================================================================
 * Mode Selector
 * ============================================================================ */

.ThemeEditor__modeSelector {
  display: flex;
  gap: var(--space-2xs);
  padding: var(--space-3xs);
  background: var(--user-theme--semantic-bg-surface, oklch(97% 0 0));
  border-radius: var(--radius);
  width: fit-content;
}

.ThemeEditor__modeButton {
  padding: var(--space-2xs) var(--space-s);
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--user-theme--semantic-text-secondary, oklch(40% 0 0));
  font-size: var(--step--1);
  font-weight: 500;
  cursor: pointer;
  transition:
    background-color 150ms ease,
    color 150ms ease;
}

.ThemeEditor__modeButton:hover {
  background: var(--user-theme--semantic-bg-surface-raised, oklch(94% 0 0));
}

.ThemeEditor__modeButton[data-selected="true"] {
  background: var(--user-theme--semantic-bg-page, #fff);
  color: var(--user-theme--semantic-text-primary, oklch(20% 0 0));
  box-shadow: 0 1px 3px rgb(0 0 0 / 8%);
}

.ThemeEditor__modeButton:focus-visible {
  outline: 2px solid var(--user-theme--components-button-focus-ring, oklch(60% 0.2 300deg));
  outline-offset: 2px;
}

/* ============================================================================
 * Sections
 * ============================================================================ */

.ThemeEditor__section {
  display: flex;
  flex-direction: column;
  gap: var(--space-s);
  padding: var(--space-m);
  background: var(--user-theme--semantic-bg-surface, oklch(97% 0 0));
  border-radius: var(--radius);
  border: 1px solid var(--user-theme--semantic-border-default, oklch(90% 0 0));
}

.ThemeEditor__sectionHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-s);
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  width: 100%;
  color: inherit;
}

.ThemeEditor__sectionHeader:focus-visible {
  outline: 2px solid var(--user-theme--components-button-focus-ring, oklch(60% 0.2 300deg));
  outline-offset: 2px;
  border-radius: var(--radius);
}

.ThemeEditor__sectionTitle {
  font-size: var(--step-0);
  font-weight: 600;
  margin: 0;
}

.ThemeEditor__sectionArrow {
  font-size: var(--step--1);
  color: var(--user-theme--semantic-text-muted, oklch(50% 0 0));
  transition: transform 150ms ease;
}

.ThemeEditor__sectionArrow[data-expanded="true"] {
  transform: rotate(90deg);
}

.ThemeEditor__sectionContent {
  display: flex;
  flex-direction: column;
  gap: var(--space-m);
  padding-top: var(--space-s);
  border-top: 1px solid var(--user-theme--semantic-border-default, oklch(90% 0 0));
}

/* ============================================================================
 * Token Groups
 * ============================================================================ */

.ThemeEditor__tokenGroup {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.ThemeEditor__tokenGroupTitle {
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--user-theme--semantic-text-secondary, oklch(40% 0 0));
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
}

.ThemeEditor__tokenList {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
}

/* ============================================================================
 * Token Row
 * ============================================================================ */

.ThemeEditor__tokenRow {
  display: flex;
  align-items: center;
  gap: var(--space-s);
  padding: var(--space-2xs);
  border-radius: var(--radius);
  transition: background-color 150ms ease;
}

.ThemeEditor__tokenRow:hover {
  background: var(--user-theme--semantic-bg-surface-raised, oklch(94% 0 0));
}

.ThemeEditor__tokenLabel {
  flex: 1;
  font-size: var(--step--1);
  display: flex;
  align-items: center;
  gap: var(--space-3xs);
}

.ThemeEditor__tokenModified {
  color: var(--user-theme--semantic-text-accent, oklch(55% 0.2 300deg));
  font-weight: 600;
}

.ThemeEditor__tokenControls {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
}

/* ============================================================================
 * Color Picker Trigger (react-aria-components)
 * ============================================================================ */

.ThemeEditor__colorTrigger {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  padding: var(--space-3xs);
  border: 1px solid var(--user-theme--semantic-border-default, oklch(85% 0 0));
  border-radius: var(--radius);
  background: var(--user-theme--semantic-bg-page, #fff);
  cursor: pointer;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.ThemeEditor__colorTrigger:hover {
  border-color: var(--user-theme--semantic-border-accent, oklch(70% 0.1 300deg));
}

.ThemeEditor__colorTrigger[data-focus-visible] {
  outline: 2px solid var(--user-theme--components-button-focus-ring, oklch(60% 0.2 300deg));
  outline-offset: 2px;
}

/* ============================================================================
 * Color Swatch (react-aria-components)
 * ============================================================================ */

.ThemeEditor__colorSwatch {
  width: 24px;
  height: 24px;
  border-radius: calc(var(--radius) / 2);
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 10%);
  flex-shrink: 0;
}

/* ============================================================================
 * Color Picker Popover
 * ============================================================================ */

.ThemeEditor__colorPopover {
  background: var(--user-theme--semantic-bg-page, #fff);
  border: 1px solid var(--user-theme--semantic-border-default, oklch(90% 0 0));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--space-s);
  display: flex;
  flex-direction: column;
  gap: var(--space-s);
  z-index: var(--z__modal);

  /* Entry animation */
  animation: popoverFadeIn 150ms ease;
}

.ThemeEditor__colorPopover[data-entering] {
  animation: popoverFadeIn 150ms ease;
}

.ThemeEditor__colorPopover[data-exiting] {
  animation: popoverFadeOut 150ms ease;
}

@keyframes popoverFadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes popoverFadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-4px);
  }
}

.ThemeEditor__colorDialog {
  outline: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-s);
}

/* ============================================================================
 * Color Area (react-aria-components)
 * ============================================================================ */

.ThemeEditor__colorArea {
  width: 180px;
  height: 180px;
  border-radius: var(--radius);
  flex-shrink: 0;
}

/* ============================================================================
 * Color Thumb (shared between ColorArea and ColorSlider)
 * ============================================================================ */

.ThemeEditor__colorThumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow:
    0 0 0 1px rgb(0 0 0 / 20%),
    0 2px 4px rgb(0 0 0 / 20%);
  box-sizing: border-box;
  transition:
    width 100ms ease,
    height 100ms ease;
}

.ThemeEditor__colorThumb[data-focus-visible] {
  width: 22px;
  height: 22px;
}

.ThemeEditor__colorThumb[data-dragging] {
  cursor: grabbing;
}

/* ============================================================================
 * Color Slider (react-aria-components)
 * ============================================================================ */

.ThemeEditor__colorSlider {
  display: flex;
  flex-direction: column;
  gap: var(--space-3xs);
  width: 100%;
}

.ThemeEditor__colorSlider[data-orientation="horizontal"] .ThemeEditor__sliderTrack {
  height: 18px;
  width: 100%;
  border-radius: 9px;
}

/* ============================================================================
 * Color Field (hex input)
 * ============================================================================ */

.ThemeEditor__colorFieldContainer {
  display: flex;
  flex-direction: column;
  gap: var(--space-3xs);
}

.ThemeEditor__colorFieldLabel {
  font-size: var(--step--1);
  color: var(--user-theme--semantic-text-muted, oklch(50% 0 0));
}

.ThemeEditor__colorField {
  padding: var(--space-2xs) var(--space-xs);
  border: 1px solid var(--user-theme--semantic-border-default, oklch(85% 0 0));
  border-radius: var(--radius);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: var(--step--1);
  width: 100%;
  background: var(--user-theme--semantic-bg-page, #fff);
  color: var(--user-theme--semantic-text-primary, oklch(20% 0 0));
  transition: border-color 150ms ease;
}

.ThemeEditor__colorField:hover {
  border-color: var(--user-theme--semantic-border-accent, oklch(70% 0.1 300deg));
}

.ThemeEditor__colorField:focus {
  outline: 2px solid var(--user-theme--components-button-focus-ring, oklch(60% 0.2 300deg));
  outline-offset: 2px;
  border-color: transparent;
}

/* ============================================================================
 * Reset Button
 * ============================================================================ */

.ThemeEditor__resetTokenButton {
  padding: var(--space-3xs) var(--space-2xs);
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--user-theme--semantic-text-muted, oklch(50% 0 0));
  font-size: var(--step--1);
  cursor: pointer;
  transition:
    background-color 150ms ease,
    color 150ms ease;
}

.ThemeEditor__resetTokenButton:hover {
  background: var(--user-theme--semantic-bg-surface-raised, oklch(94% 0 0));
  color: var(--user-theme--semantic-text-primary, oklch(20% 0 0));
}

.ThemeEditor__resetTokenButton:focus-visible {
  outline: 2px solid var(--user-theme--components-button-focus-ring, oklch(60% 0.2 300deg));
  outline-offset: 2px;
}

/* ============================================================================
 * Reset All Section
 * ============================================================================ */

.ThemeEditor__resetSection {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
  padding: var(--space-m);
  background: var(--user-theme--semantic-bg-surface, oklch(97% 0 0));
  border-radius: var(--radius);
  border: 1px solid var(--user-theme--semantic-border-default, oklch(90% 0 0));
}

.ThemeEditor__resetAllButton {
  padding: var(--space-2xs) var(--space-s);
  border: 1px solid var(--user-theme--components-button-danger-bg, oklch(55% 0.2 25deg));
  border-radius: var(--radius);
  background: transparent;
  color: var(--user-theme--components-button-danger-bg, oklch(55% 0.2 25deg));
  font-size: var(--step--1);
  font-weight: 500;
  cursor: pointer;
  transition:
    background-color 150ms ease,
    color 150ms ease;
}

.ThemeEditor__resetAllButton:hover {
  background: var(--user-theme--components-button-danger-bg, oklch(55% 0.2 25deg));
  color: var(--user-theme--components-button-danger-text, #fff);
}

.ThemeEditor__resetAllButton:focus-visible {
  outline: 2px solid var(--user-theme--components-button-focus-ring, oklch(60% 0.2 300deg));
  outline-offset: 2px;
}

.ThemeEditor__resetHint {
  font-size: var(--step--1);
  color: var(--user-theme--semantic-text-muted, oklch(50% 0 0));
  margin: 0;
}

/* ============================================================================
 * Reduced Motion
 * ============================================================================ */

@media (prefers-reduced-motion: reduce) {
  .ThemeEditor__colorPopover,
  .ThemeEditor__colorPopover[data-entering],
  .ThemeEditor__colorPopover[data-exiting] {
    animation: none;
  }

  .ThemeEditor__sectionArrow {
    transition: none;
  }

  .ThemeEditor__colorThumb {
    transition: none;
  }
}
.Vitals {
  display: flex;
  align-items: stretch;
  flex: 1;
}

.Vitals__container {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  margin-top: var(--Frame--top-gap, 0);
  padding: 2rem;
  gap: 1.5rem;
  border-radius: var(--radius--xl, 1rem) var(--radius--xl, 1rem) 0 0;
  background-color: oklch(1 0 0 / 0.15);
  overflow-y: auto;
}

.Vitals__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.Vitals__headerLeft {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.Vitals__title {
  font-size: 0.875rem;
  font-weight: 500;
  color: white;
  text-shadow: 1px 1px 1px oklch(0 0 0 / 0.06);
}

.Vitals__syncMode {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: oklch(1 0 0 / 0.6);
  letter-spacing: 0.05em;
}

.Vitals__docCount {
  font-size: 0.75rem;
  color: oklch(1 0 0 / 0.5);
}

.Vitals__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(22rem, 1fr));
  gap: 1rem;
  align-items: start;
}

.Vitals__card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 0.5rem;
  background-color: oklch(1 0 0 / 0.08);
}

.Vitals__cardTitle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: oklch(1 0 0 / 0.7);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.Vitals__badge {
  font-size: 0.625rem;
  font-weight: 700;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  background-color: oklch(1 0 0 / 0.1);
  color: oklch(1 0 0 / 0.5);
}

.Vitals__badge[data-error="true"] {
  background-color: oklch(0.65 0.2 25 / 0.3);
  color: oklch(0.85 0.15 25);
}

.Vitals__rows {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.Vitals__row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: oklch(1 0 0 / 0.6);
}

/* 3-state status dot */
.Vitals__dot {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  flex-shrink: 0;
  background-color: oklch(0.55 0.05 0);
}

.Vitals__dot[data-status="inactive"] {
  background-color: oklch(0.55 0 0);
}

.Vitals__dot[data-status="ok"] {
  background-color: oklch(0.75 0.2 145);
}

.Vitals__dot[data-status="error"] {
  background-color: oklch(0.65 0.25 25);
}

.Vitals__empty {
  font-size: 0.75rem;
  color: oklch(1 0 0 / 0.35);
}

.Vitals__table {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.Vitals__tableHeader {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 0.5rem;
  font-size: 0.625rem;
  font-weight: 600;
  color: oklch(1 0 0 / 0.4);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid oklch(1 0 0 / 0.08);
}

.Vitals__tableRow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 0.5rem;
  font-size: 0.75rem;
  color: oklch(1 0 0 / 0.6);
}

.Vitals__mono {
  font-family: monospace;
  font-size: 0.6875rem;
}

.Vitals__errorMessage {
  color: oklch(0.85 0.15 25);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.Vitals__moreRows {
  font-size: 0.6875rem;
  color: oklch(1 0 0 / 0.35);
  padding-top: 0.25rem;
}
/* ============================================================================
 * VitalsPill — hover-expand status indicator for the FileMenu bar
 * ============================================================================ */

.VitalsPill {
  display: inline-flex;
  align-items: center;
  gap: 0;
  height: 20px;
  padding: 0 6px;
  border: none;
  border-radius: 0.25rem;
  background: transparent;
  cursor: pointer;
  transition:
    gap 150ms ease,
    background-color 100ms ease;
  outline: none;
  flex-shrink: 0;
  overflow: hidden;
}

.VitalsPill:hover {
  gap: 0.3rem;
  background: oklch(0% 0 0 / 0.08);
}

/* Status dot */
.VitalsPill__dot {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  flex-shrink: 0;
  background-color: oklch(0.55 0.05 0);
}

.VitalsPill__dot[data-status="inactive"] {
  background-color: oklch(0.55 0 0);
}

.VitalsPill__dot[data-status="ok"] {
  background-color: oklch(0.75 0.2 145);
}

.VitalsPill__dot[data-status="error"] {
  background-color: oklch(0.65 0.25 25);
}

/* Label — hidden by default, revealed on hover */
.VitalsPill__label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: oklch(0% 0 0 / 0.55);
  white-space: nowrap;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  transition:
    max-width 150ms ease,
    opacity 150ms ease;
}

.VitalsPill:hover .VitalsPill__label {
  max-width: 4rem;
  opacity: 1;
}
.WorkspaceNameForm {
  display: flex;
  flex-direction: column;
  gap: var(--space-s, 1rem);
}

.WorkspaceNameForm__actions {
  display: flex;
  justify-content: flex-end;
}
/* ============================================================================
 * FileMenu — hover-reveal menu bar
 * ============================================================================ */

.FileMenu {
  --FileMenu--bar-height: 28px;
  --FileMenu--hit-area: 6px;

  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z__fileMenu);
  height: var(--FileMenu--hit-area);
  transition:
    height 150ms ease,
    opacity 150ms ease;
  opacity: 0;
  pointer-events: auto;
}

/* Expand on hover, when pinned, or when a dropdown is open */
.FileMenu:hover,
.FileMenu[data-pinned],
.FileMenu:has(button[aria-expanded="true"]) {
  height: var(--FileMenu--bar-height);
  opacity: 1;
}

/* Always visible when pinned */
.FileMenu[data-pinned] {
  position: relative;
}

/* ============================================================================
 * Bar layout
 * ============================================================================ */

.FileMenu__bar {
  display: flex;
  align-items: center;
  height: var(--FileMenu--bar-height);
  padding-inline: 0.5rem;
  padding-block: 0.1875rem;
  background: var(--user-theme--components-writing-surface-bg, oklch(98% 0 0deg));
  border-bottom: 1px solid oklch(0% 0 0 / 0.06);
  font-size: 0.8125rem;
}

.FileMenu__menus {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1;
}

/* ============================================================================
 * Menu triggers (top-level buttons)
 * ============================================================================ */

.FileMenu__trigger {
  display: inline-flex;
  align-items: center;
  padding: 0.1875rem 0.5rem;
  border: none;
  border-radius: 0.25rem;
  background: transparent;
  color: oklch(0% 0 0 / 0.65);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: background-color 100ms ease;
  line-height: 1;
  outline: none;
}

.FileMenu__trigger[data-menu-id="anozumi"] {
  font-weight: bold;
}

.FileMenu__trigger:hover,
.FileMenu__trigger[data-pressed] {
  background: oklch(0% 0 0 / 0.08);
  color: oklch(0% 0 0 / 0.85);
}

.FileMenu__trigger[data-focus-visible] {
  outline: 2px solid var(--user-theme--components-button-focus-ring, oklch(60% 0.2 300deg));
  outline-offset: 1px;
}

/* ============================================================================
 * Dropdown menu
 * ============================================================================ */

.FileMenu__triggerWrap {
  position: relative;
}

.FileMenu__dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1;
  margin-top: 0.375rem;
  background: oklch(100% 0 0 / 0.65);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  backdrop-filter: blur(20px) saturate(1.8);
  border: 0.5px solid oklch(100% 0 0 / 0.5);
  border-radius: 0.625rem;
  padding: 0.3125rem;
  box-shadow:
    0 0 0 0.5px oklch(0% 0 0 / 0.06),
    0 8px 32px -4px oklch(0% 0 0 / 0.12),
    0 4px 12px -2px oklch(0% 0 0 / 0.08);
  outline: none;
  min-width: 176px;
}

/* ============================================================================
 * Menu items
 * ============================================================================ */

.FileMenu__item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.075rem 0.5rem;
  border-radius: 0.3125rem;
  font-size: 0.8125rem;
  cursor: pointer;
  outline: none;
  transition:
    background-color 60ms ease,
    color 60ms ease;
}

.FileMenu__item[data-hovered],
.FileMenu__item[data-focused] {
  background: oklch(0.55 0.2 260);
  color: oklch(1 0 0);
}

.FileMenu__item[data-hovered] .Kbd,
.FileMenu__item[data-focused] .Kbd {
  color: oklch(1 0 0 / 0.7);
}

.FileMenu__item[data-disabled] {
  opacity: 0.4;
  cursor: default;
}

.FileMenu__itemCheck {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  flex-shrink: 0;
}

.FileMenu__itemLabel {
  flex: 1;
}

.FileMenu__separator {
  height: 0.5px;
  margin: 0.25rem 0.5rem;
  background: oklch(0% 0 0 / 0.08);
}

/* ============================================================================
 * Submenu
 * ============================================================================ */

.FileMenu__submenu {
  position: relative;
}

.FileMenu__submenuTrigger {
  justify-content: space-between;
}

.FileMenu__submenuArrow {
  font-size: 0.875rem;
  line-height: 1;
  opacity: 0.6;
}

.FileMenu__submenuDropdown {
  display: none;
  position: absolute;
  top: -0.3125rem;
  left: 100%;
  margin-left: 0.125rem;
  background: oklch(100% 0 0 / 0.65);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  backdrop-filter: blur(20px) saturate(1.8);
  border: 0.5px solid oklch(100% 0 0 / 0.5);
  border-radius: 0.625rem;
  padding: 0.3125rem;
  box-shadow:
    0 0 0 0.5px oklch(0% 0 0 / 0.06),
    0 8px 32px -4px oklch(0% 0 0 / 0.12),
    0 4px 12px -2px oklch(0% 0 0 / 0.08);
  outline: none;
  min-width: 120px;
  z-index: 1;
}

.FileMenu__submenu:hover > .FileMenu__submenuDropdown {
  display: block;
}

/* ============================================================================
 * Pin button
 * ============================================================================ */

.FileMenu__pin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 0.25rem;
  background: transparent;
  color: oklch(0% 0 0 / 0.4);
  cursor: pointer;
  transition: background-color 100ms ease;
  flex-shrink: 0;
  outline: none;
}

.FileMenu__pin:hover {
  background: oklch(0% 0 0 / 0.08);
  color: oklch(0% 0 0 / 0.7);
}

.FileMenu__pin[data-pinned] {
  color: oklch(0% 0 0 / 0.7);
}
.RouteLoadingBar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  z-index: 101;
  overflow: hidden;
  pointer-events: none;
}

.RouteLoadingBar::after {
  content: "";
  display: block;
  height: 100%;
  background: var(--user-theme--components-button-primary-bg, oklch(45% 0.2 300deg));
  animation: route-loading-bar 2s var(--ease) infinite;
}

@keyframes route-loading-bar {
  0% {
    width: 0%;
    margin-left: 0%;
  }
  50% {
    width: 40%;
    margin-left: 30%;
  }
  100% {
    width: 0%;
    margin-left: 100%;
  }
}
.AreaDragOverlay {
  z-index: var(--z__dragOverlay);
  position: fixed;
  pointer-events: none;
  border: 1px solid var(--user-theme--accent, oklch(0.6 0.18 250));
  background: oklch(0.6 0.18 250 / 0.08);
}
/* ============================================================================
 * Toast Component Styles
 * ============================================================================ */

/* Container - Fixed position at top-right of viewport */
.ToastContainer {
  position: fixed;
  top: var(--space-m, 1.5rem);
  right: var(--space-m, 1.5rem);
  z-index: var(--z__toast);

  display: flex;
  flex-direction: column;
  gap: var(--space-2xs, 0.5rem);

  pointer-events: none;
}

/* Individual toast */
.Toast {
  display: flex;
  align-items: center;
  gap: var(--space-xs, 0.75rem);

  min-width: 16rem;
  max-width: 24rem;
  padding: var(--space-xs, 0.75rem) var(--space-s, 1rem);

  border-radius: var(--radius--card, 0.25rem);
  box-shadow: var(--user-theme--semantic-shadows-overlay, 0 10px 25px rgb(0 0 0 / 15%));

  pointer-events: auto;

  animation: toast-slide-in 200ms ease-out;
}

.Toast[data-exiting] {
  animation: toast-slide-out 200ms ease-out forwards;
}

/* Variant styles */
.Toast[data-variant="SUCCESS"] {
  background: oklch(95% 0.05 145deg);
  color: oklch(30% 0.1 145deg);
  border: 1px solid oklch(85% 0.08 145deg);
}

.Toast[data-variant="ERROR"] {
  background: oklch(95% 0.04 25deg);
  color: oklch(30% 0.1 25deg);
  border: 1px solid oklch(85% 0.06 25deg);
}

.Toast[data-variant="INFO"] {
  background: var(--user-theme--components-modal-content-bg, #fff);
  color: var(--user-theme--semantic-colors-text-primary, #333);
  border: 1px solid oklch(90% 0 0deg);
}

/* Message */
.Toast__message {
  flex: 1 1 auto;
  font-size: var(--step-0, 1rem);
  line-height: 1.4;
}

/* Dismiss button */
.Toast__dismiss {
  flex-shrink: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  width: 1.5rem;
  height: 1.5rem;
  padding: 0;

  background: none;
  border: none;
  border-radius: var(--radius, 0.25rem);
  cursor: pointer;

  color: inherit;
  opacity: 0.6;
  transition: opacity 150ms ease;
}

.Toast__dismiss:hover {
  opacity: 1;
}

.Toast__dismiss:focus-visible {
  outline: 2px solid var(--user-theme--components-button-focus-ring, oklch(60% 0.2 300deg));
  outline-offset: 2px;
}

.Toast__dismiss-icon {
  width: 1rem;
  height: 1rem;
}

/* Responsive adjustments for small screens */
@media (max-width: 640px) {
  .ToastContainer {
    top: var(--space-s, 1rem);
    right: var(--space-s, 1rem);
    left: var(--space-s, 1rem);
  }

  .Toast {
    max-width: none;
  }
}

/* Keyframe animations */
@keyframes toast-slide-in {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toast-slide-out {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .Toast,
  .Toast[data-exiting] {
    animation: none;
  }
}
/* ============================================================================
 * VitalsOverlay — dialog-style layout for vitals in overlay
 * ============================================================================ */

.VitalsOverlay {
  display: flex;
  width: 100%;
  height: 100%;
  padding: var(--space-l);
  gap: var(--space-s);
}

.VitalsOverlay__content {
  flex: 1 1 auto;
  min-width: 0;
  position: relative;
  overflow: hidden auto;
  border-radius: 0.75rem;
  box-shadow:
    0 1px 2px rgb(0 0 0 / 8%),
    0 4px 8px rgb(0 0 0 / 8%),
    0 12px 24px rgb(0 0 0 / 12%),
    0 24px 48px rgb(0 0 0 / 16%);
}

.VitalsOverlay__content::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--user-theme--components-app-bg);
  background-size: cover;
  opacity: 0.9;
  z-index: -1;
}

/* Action button panel */
.VitalsOverlay__actions {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  padding-block-start: var(--space-xs);
}

.VitalsOverlay__actionButton {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  color: rgb(255 255 255 / 80%);
  background: oklch(0.76 0.15 6.17);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition:
    background-color 150ms ease,
    color 150ms ease;
}

.VitalsOverlay__actionButton:hover {
  color: #fff;
  background: rgb(255 255 255 / 20%);
}

.VitalsOverlay__actionButton:active {
  transform: scale(0.95);
}

.VitalsOverlay__actionButton:focus-visible {
  outline: 2px solid rgb(255 255 255 / 50%);
  outline-offset: 2px;
}

.VitalsOverlay__actionIcon {
  width: 1.25rem;
  height: 1.25rem;
}
.CollaboratorsModal {
  display: flex;
  flex-direction: column;
  gap: var(--space-s, 1rem);
  min-width: 24rem;
}

/* Add form */
.CollaboratorsModal__add {
  display: flex;
  align-items: flex-end;
  gap: var(--space-2xs, 0.5rem);
}

.CollaboratorsModal__field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-3xs, 0.25rem);
}

.CollaboratorsModal__label {
  font-size: var(--step--1, 0.875rem);
  color: var(--user-theme--semantic-colors-text-secondary, oklch(50% 0 0deg));
}

.CollaboratorsModal__input {
  padding: var(--space-3xs, 0.25rem) var(--space-2xs, 0.5rem);
  font-size: var(--step-0, 1rem);
  border: 1px solid var(--user-theme--semantic-colors-border, oklch(80% 0 0deg));
  border-radius: var(--radius, 0.25rem);
  background: transparent;
  color: var(--user-theme--semantic-colors-text-primary, oklch(20% 0 0deg));
  outline: none;
}

.CollaboratorsModal__input:focus {
  border-color: var(--user-theme--components-button-focus-ring, oklch(60% 0.2 300deg));
}

.CollaboratorsModal__input::placeholder {
  color: var(--user-theme--semantic-colors-text-secondary, oklch(60% 0 0deg));
}

.CollaboratorsModal__add-button {
  flex-shrink: 0;
}

/* Error */
.CollaboratorsModal__error {
  font-size: var(--step--1, 0.875rem);
  color: oklch(55% 0.2 25deg);
}

/* Member list */
.CollaboratorsModal__list {
  display: flex;
  flex-direction: column;
}

.CollaboratorsModal__member {
  display: flex;
  align-items: center;
  gap: var(--space-2xs, 0.5rem);
  padding: var(--space-2xs, 0.5rem) 0;
  border-bottom: 1px solid var(--user-theme--semantic-colors-border, oklch(90% 0 0deg));
}

.CollaboratorsModal__member:last-child {
  border-bottom: none;
}

.CollaboratorsModal__email {
  flex: 1;
  font-size: var(--step-0, 1rem);
  color: var(--user-theme--semantic-colors-text-primary, oklch(20% 0 0deg));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.CollaboratorsModal__role {
  font-size: var(--step--1, 0.875rem);
  padding: 0.125rem 0.5rem;
  border-radius: 1rem;
  background: var(--user-theme--semantic-colors-surface-secondary, oklch(95% 0 0deg));
  color: var(--user-theme--semantic-colors-text-secondary, oklch(45% 0 0deg));
  text-transform: capitalize;
  flex-shrink: 0;
}

.CollaboratorsModal__remove-button {
  flex-shrink: 0;
  font-size: var(--step--1, 0.875rem);
  padding: 0.125rem 0.5rem;
  border: none;
  border-radius: var(--radius, 0.25rem);
  background: transparent;
  color: var(--user-theme--semantic-colors-text-secondary, oklch(50% 0 0deg));
  cursor: pointer;
}

.CollaboratorsModal__remove-button:hover {
  background: var(--user-theme--semantic-colors-surface-secondary, oklch(95% 0 0deg));
  color: oklch(55% 0.2 25deg);
}

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

/* States */
.CollaboratorsModal__loading {
  padding: var(--space-m, 1.5rem) 0;
  text-align: center;
  color: var(--user-theme--semantic-colors-text-secondary, oklch(50% 0 0deg));
}

.CollaboratorsModal__empty {
  padding: var(--space-s, 1rem) 0;
  text-align: center;
  color: var(--user-theme--semantic-colors-text-secondary, oklch(50% 0 0deg));
  font-size: var(--step--1, 0.875rem);
}
