/* Paper theme decorators — Realtime Collaboration Workspace */
@layer decorators {

/* Minimal card — warm border, rounded, no shadow */
.paper-card {
  background: var(--d-surface);
  border: 1px solid var(--d-border);
  border-radius: 6px;
}

.paper-card-raised {
  background: var(--d-surface);
  border: 1px solid var(--d-border);
  border-radius: 8px;
  box-shadow: var(--d-shadow-sm);
}

/* Entrance fade — opacity only, 180ms */
.paper-fade {
  animation: paper-fade-in 180ms ease both;
}
.entrance-fade {
  animation: paper-fade-in 180ms ease both;
}

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

/* Warm input — gray border, teal focus ring */
.paper-input {
  border: 1px solid var(--d-border);
  border-radius: var(--d-radius);
  background: var(--d-surface);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  width: 100%;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.paper-input:focus {
  outline: none;
  border-color: var(--d-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--d-primary) 15%, transparent);
}

/* Reading-optimized prose */
.paper-prose {
  font-size: 1rem;
  line-height: 1.75;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  max-width: 720px;
  color: var(--d-text);
}

.paper-prose h1 { font-size: 2rem; font-weight: 600; margin-top: 1rem; margin-bottom: 1rem; line-height: 1.3; }
.paper-prose h2 { font-size: 1.5rem; font-weight: 600; margin-top: 2rem; margin-bottom: 0.75rem; line-height: 1.35; }
.paper-prose h3 { font-size: 1.25rem; font-weight: 600; margin-top: 1.5rem; margin-bottom: 0.5rem; }
.paper-prose p { margin-bottom: 1rem; }
.paper-prose ul, .paper-prose ol { margin-bottom: 1rem; padding-left: 1.5rem; }
.paper-prose li { margin-bottom: 0.375rem; }
.paper-prose blockquote {
  border-left: 3px solid var(--d-primary);
  padding-left: 1rem;
  margin: 1rem 0;
  color: var(--d-text-muted);
  font-style: italic;
}
.paper-prose code {
  font-family: ui-monospace, 'SF Mono', monospace;
  font-size: 0.875em;
  background: var(--d-surface-raised);
  padding: 0.125rem 0.375rem;
  border-radius: var(--d-radius-sm);
  border: 1px solid var(--d-border);
}

/* Warm cream canvas */
.paper-canvas {
  background: var(--d-bg);
}

/* Hairline separator */
.paper-divider {
  border: none;
  border-top: 1px solid var(--d-border);
  margin: 1rem 0;
}

/* Clean panel surface for sidebars */
.paper-surface {
  background: var(--d-surface);
}

/* Presence avatar — circular with colored dot */
.presence-avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #fff;
  border: 2px solid var(--d-bg);
  flex-shrink: 0;
}

.presence-avatar-sm {
  width: 22px;
  height: 22px;
  font-size: 0.625rem;
}

.presence-avatar-lg {
  width: 40px;
  height: 40px;
  font-size: 0.875rem;
}

.presence-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid var(--d-bg);
  background: var(--d-text-muted);
}
.presence-dot.active { background: var(--d-success); }
.presence-dot.idle { background: var(--d-warning); }
.presence-dot.offline { background: var(--d-text-muted); opacity: 0.5; }

.presence-stack {
  display: inline-flex;
  align-items: center;
}
.presence-stack > .presence-avatar {
  margin-left: -8px;
}
.presence-stack > .presence-avatar:first-child {
  margin-left: 0;
}

/* Remote cursor — colored line with name flag */
.remote-cursor {
  position: absolute;
  width: 2px;
  height: 1.4em;
  pointer-events: none;
}
.remote-cursor::before {
  content: attr(data-name);
  position: absolute;
  top: -1.25em;
  left: -1px;
  font-size: 0.6875rem;
  font-weight: 500;
  color: #fff;
  padding: 0.0625rem 0.375rem;
  border-radius: 3px 3px 3px 0;
  white-space: nowrap;
  background: inherit;
}

/* Block toolbar — floats beside active block */
.block-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 0.125rem;
  background: var(--d-surface);
  border: 1px solid var(--d-border);
  border-radius: var(--d-radius);
  padding: 0.25rem;
  box-shadow: var(--d-shadow-md);
}
.block-toolbar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  border-radius: var(--d-radius-sm);
  color: var(--d-text-muted);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}
.block-toolbar button:hover {
  background: var(--d-surface-raised);
  color: var(--d-text);
}

/* Editable block — shows hover handle */
.doc-block {
  position: relative;
  padding: 0.125rem 0;
}
.doc-block-handle {
  position: absolute;
  left: -1.75rem;
  top: 0.375rem;
  width: 1.25rem;
  height: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  color: var(--d-text-muted);
  cursor: grab;
  border-radius: var(--d-radius-sm);
  transition: opacity 120ms ease;
}
.doc-block:hover .doc-block-handle {
  opacity: 1;
}
.doc-block-handle:hover {
  background: var(--d-surface-raised);
  color: var(--d-text);
}

/* Inline comment annotation — margin marker */
.comment-annotation {
  background: color-mix(in srgb, var(--d-warning) 20%, transparent);
  border-bottom: 2px solid var(--d-warning);
  padding: 0.0625rem 0.125rem;
  border-radius: 2px;
  cursor: pointer;
}

/* Kanban card — draggable surface */
.kanban-column {
  background: var(--d-surface-raised);
  border-radius: var(--d-radius);
  padding: 0.75rem;
  min-width: 260px;
  width: 260px;
  flex-shrink: 0;
}
.kanban-card {
  background: var(--d-surface);
  border: 1px solid var(--d-border);
  border-radius: var(--d-radius-sm);
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  cursor: grab;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.kanban-card:hover {
  border-color: var(--d-primary);
  box-shadow: var(--d-shadow-sm);
}

/* Label chip */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.0625rem 0.5rem;
  border-radius: var(--d-radius-full);
  font-size: 0.6875rem;
  font-weight: 500;
  background: var(--d-surface-raised);
  color: var(--d-text-muted);
  border: 1px solid var(--d-border);
}
.chip-accent {
  background: color-mix(in srgb, var(--d-accent) 15%, transparent);
  color: var(--d-accent);
  border-color: color-mix(in srgb, var(--d-accent) 30%, transparent);
}
.chip-primary {
  background: color-mix(in srgb, var(--d-primary) 12%, transparent);
  color: var(--d-primary);
  border-color: color-mix(in srgb, var(--d-primary) 25%, transparent);
}

/* Slash command menu hint */
.slash-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--d-text-muted);
  padding: 0.125rem 0.375rem;
  background: var(--d-surface-raised);
  border-radius: var(--d-radius-sm);
  border: 1px solid var(--d-border);
}
.kbd {
  display: inline-block;
  font-family: ui-monospace, 'SF Mono', monospace;
  font-size: 0.6875rem;
  padding: 0.0625rem 0.375rem;
  background: var(--d-surface);
  border: 1px solid var(--d-border);
  border-bottom-width: 2px;
  border-radius: 3px;
  color: var(--d-text-muted);
}

} /* end @layer decorators */

@media (prefers-reduced-motion: reduce) {
  .paper-fade, .entrance-fade { animation: none !important; }
}
