/* Kanban drag and drop styles */
.dragging {
  @apply shadow-lg transform rotate-2 opacity-90;
}

.sortable-ghost {
  @apply bg-base-200 opacity-50;
}

.drop-zone-active {
  @apply ring-2 ring-primary/30 bg-primary/10;
}

/* Semantic button extensions for DaisyUI */
.btn-info {
  @apply btn bg-info text-info-content border-info;
}

.badge-info {
  @apply badge bg-info text-info-content;
}

/* Status indicator semantic classes */
.status-recording {
  @apply bg-error/20 text-error;
}

.status-processing {
  @apply bg-warning/20 text-warning;
}

.status-completed {
  @apply bg-success/20 text-success;
}

.status-analyzing {
  @apply bg-secondary/20 text-secondary;
}

/* Custom animations */
.animate-fade-in {
  animation: fadeIn 0.2s ease-in-out;
}

.animate-fade-out {
  animation: fadeOut 0.2s ease-in-out;
}

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

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

/* Flash message slide animations */
.animate-slide-in {
  animation: slideIn 0.2s ease-out;
}

.animate-slide-out {
  animation: slideOut 0.2s ease-in forwards;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

/* Atlas FAB coin-flip — 3D flip transition for the dual-face button */
.atlas-fab-coin {
  transition: transform 0.6s ease-in-out;
}

/* Atlas FAB glow — subtle amber pulse when unread high-confidence insights exist */
.atlas-fab-glow {
  box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.6);
  animation: atlas-fab-pulse 2s ease-in-out infinite;
}

@keyframes atlas-fab-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.5); }
  50% { box-shadow: 0 0 12px 4px rgba(245, 158, 11, 0.3); }
}

/* Flatpickr calendar z-index fix — must render above native <dialog> (default z-index 2147483647) */
.flatpickr-calendar {
  z-index: 2147483648 !important;
}

/* Inline flatpickr in defer forms — remove shadow/border since it's embedded */
[data-controller="defer-picker"] .flatpickr-calendar.inline {
  box-shadow: none;
  border: 1px solid oklch(var(--b3));
  border-radius: 0.25rem;
}

/* ========================================================================
   Meeting-specific styles (formerly meetings.css, was pulled in via the
   Sprockets `*= require meetings` directive under the old pipeline).
   ======================================================================== */

.transcript-container {
  position: relative;
}

.transcript-text {
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.5;
  max-height: calc(1.5em * 5);
}

.transcript-container.expanded .transcript-text {
  display: block;
  -webkit-line-clamp: unset;
  -webkit-box-orient: unset;
  overflow-y: auto;
  max-height: 200px;
  text-overflow: unset;
}

.transcript-toggle {
  margin-top: 8px;
  font-size: 0.875rem;
  color: #6B7280;
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
}

.transcript-toggle:hover {
  color: #374151;
}

/* Prose content styling — scoped to .prose class */
.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.prose h1 { font-size: 1.5rem; }
.prose h2 { font-size: 1.25rem; }
.prose h3 { font-size: 1.125rem; }

.prose p {
  margin-bottom: 1rem;
}

.prose ul, .prose ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.prose li {
  margin-bottom: 0.25rem;
}

.prose code {
  background-color: rgba(0, 0, 0, 0.1);
  padding: 0.125rem 0.25rem;
  border-radius: 0.25rem;
  font-family: ui-monospace, SFMono-Regular, 'Cascadia Code', 'Roboto Mono', monospace;
}

.prose pre {
  background-color: rgba(0, 0, 0, 0.05);
  padding: 1rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin-bottom: 1rem;
}

.prose pre code {
  background-color: transparent;
  padding: 0;
}

.prose blockquote {
  border-left: 4px solid #D1D5DB;
  padding-left: 1rem;
  margin: 1rem 0;
  font-style: italic;
}

.prose strong {
  font-weight: 600;
}

.prose em {
  font-style: italic;
}

/* Manual transcript UI */
.manual-transcript-container {
  background: linear-gradient(135deg, #e0f2fe 0%, #f3e5f5 100%);
  border: 1px solid #b3e5fc;
}

.manual-transcript-textarea {
  resize: vertical;
  min-height: 200px;
  font-family: ui-monospace, SFMono-Regular, 'Cascadia Code', 'Roboto Mono', monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  border: 2px solid #e3f2fd;
  border-radius: 8px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.manual-transcript-textarea:focus {
  outline: none;
  border-color: #2196f3;
  box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.manual-transcript-textarea::placeholder {
  color: #9e9e9e;
  font-style: italic;
}

.character-counter {
  font-size: 0.75rem;
  color: #666;
  transition: color 0.3s ease;
}

.character-counter.warning {
  color: #ff9800;
  font-weight: 500;
}

.character-counter.error {
  color: #f44336;
  font-weight: 600;
}

.or-divider {
  position: relative;
}

.or-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: #e0e0e0;
}

.or-divider span {
  background: white;
  padding: 0 1rem;
  color: #757575;
  font-size: 0.875rem;
  position: relative;
  z-index: 1;
}

/* Custom button effects */
.btn-manual-transcript {
  transition: all 0.3s ease;
  transform: translateY(0);
}

.btn-manual-transcript:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.btn-analyze {
  background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
  transition: all 0.3s ease;
}

.btn-analyze:hover {
  background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
  transform: translateY(-1px);
}

/* Status messages */
.error-message {
  background: #ffebee;
  border: 1px solid #ffcdd2;
  color: #c62828;
  padding: 0.75rem;
  border-radius: 6px;
  font-size: 0.875rem;
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
}

.error-message svg {
  width: 1rem;
  height: 1rem;
  margin-right: 0.5rem;
  flex-shrink: 0;
}

.success-message {
  background: #e8f5e8;
  border: 1px solid #c8e6c9;
  color: #2e7d32;
  padding: 0.75rem;
  border-radius: 6px;
  font-size: 0.875rem;
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
}

.success-message svg {
  width: 1rem;
  height: 1rem;
  margin-right: 0.5rem;
  flex-shrink: 0;
}

/* Mermaid diagram container styling (rendered diagram wrapper) */
.mermaid {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 1rem 0;
  padding: 1rem;
  background-color: #fafafa;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow-x: auto;
}

.mermaid-rendered {
  background-color: transparent;
}

.mermaid-rendered svg {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.mermaid-error {
  font-family: ui-monospace, SFMono-Regular, 'Cascadia Code', 'Roboto Mono', monospace;
}

.mermaid-error details {
  margin-top: 0.5rem;
}

.mermaid-error summary {
  outline: none;
  user-select: none;
}

.mermaid-error summary:hover {
  text-decoration: underline;
}

.mermaid-error pre {
  font-size: 0.75rem;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ========================================================================
   Mermaid clickable viewer (formerly components/mermaid_viewer.css, was
   pulled in via a broken `@import` in application.tailwind.css that
   Tailwind CLI v3 does not resolve without postcss-import).
   ======================================================================== */

.mermaid-clickable {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border-radius: 0.125rem;
  padding: 1rem;
  position: relative;
}

.mermaid-clickable:hover {
  transform: scale(1.02);
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

.mermaid-clickable:focus-visible {
  outline: 2px solid oklch(var(--p));
  outline-offset: 2px;
}

.mermaid-clickable::after {
  content: "Click to expand";
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: oklch(var(--b1) / 0.9);
  border: 1px solid oklch(var(--bc) / 0.1);
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  color: oklch(var(--bc) / 0.6);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.mermaid-clickable:hover::after {
  opacity: 1;
}

/* DaisyUI 4 theme variables are oklch components. This block read them through hsl(), which is
   invalid against them, so the box computed as transparent and the enlarged diagram floated over the page. */
#mermaid-viewer-modal .modal-box {
  background-color: oklch(var(--b1));
}

#mermaid-viewer-modal svg {
  max-width: 100%;
  max-height: 100%;
  height: auto;
  width: auto;
  display: block;
  margin: 0 auto;
}

#mermaid-viewer-modal {
  z-index: 9999;
}

.focus-visible:focus-visible {
  outline: 2px solid oklch(var(--p));
  outline-offset: 2px;
}

/* ===== Notes editor (Tiptap) — docs/plans/active/knowledgebase.md =====
   Scoped to .note-content (the editable body) and the two floating pieces it creates:
   .note-popup (the `/` menu) and .note-bubble (the selection bar). Colours read DaisyUI 4's
   oklch variables so both themes work. `prose` here is custom CSS, not the typography plugin,
   so the editor carries its own type scale. */
.note-content {
  outline: none;
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--fallback-bc, oklch(var(--bc) / 1));
  min-height: 12rem;
}
.note-content > * + * { margin-top: 0.75em; }
.note-content h1 { font-size: 1.875rem; line-height: 1.25; font-weight: 700; margin-top: 1.25em; }
.note-content h2 { font-size: 1.375rem; line-height: 1.3; font-weight: 650; margin-top: 1.4em; }
.note-content h3 { font-size: 1.125rem; line-height: 1.4; font-weight: 650; margin-top: 1.2em; }
.note-content > :first-child { margin-top: 0; }
.note-content ul { list-style: disc; padding-left: 1.5rem; }
.note-content ol { list-style: decimal; padding-left: 1.5rem; }
.note-content li > p { margin: 0; }
.note-content ul[data-type="taskList"] { list-style: none; padding-left: 0.25rem; }
.note-content ul[data-type="taskList"] li { display: flex; gap: 0.6rem; align-items: flex-start; }
.note-content ul[data-type="taskList"] li > label { margin-top: 0.3rem; user-select: none; }
.note-content ul[data-type="taskList"] li > label input { width: 1rem; height: 1rem; accent-color: var(--fallback-p, oklch(var(--p) / 1)); }
.note-content ul[data-type="taskList"] li > div { flex: 1; min-width: 0; }
.note-content ul[data-type="taskList"] li[data-checked="true"] > div { text-decoration: line-through; opacity: 0.6; }
.note-content blockquote { border-left: 3px solid var(--fallback-b3, oklch(var(--b3) / 1)); padding-left: 1rem; opacity: 0.85; }
.note-content code { font-family: ui-monospace, SFMono-Regular, monospace; font-size: 0.875em; background: var(--fallback-b2, oklch(var(--b2) / 1)); padding: 0.1em 0.35em; border-radius: 0.2rem; }
.note-content pre { background: var(--fallback-n, oklch(var(--n) / 1)); color: var(--fallback-nc, oklch(var(--nc) / 1)); padding: 0.85rem 1rem; border-radius: 0.25rem; overflow-x: auto; }
.note-content pre code { background: none; padding: 0; color: inherit; }
.note-content hr { border: 0; border-top: 1px solid var(--fallback-b3, oklch(var(--b3) / 1)); margin: 1.5em 0; }
.note-content a { color: var(--fallback-p, oklch(var(--p) / 1)); text-decoration: underline; text-underline-offset: 3px; filter: brightness(0.75); }
.note-content .note-link, .note-content a[data-note-link] {
  display: inline-block;
  padding: 0 0.35em;
  border-radius: 0.2rem;
  background: oklch(var(--p) / 0.12);
  color: inherit;
  text-decoration: none;
  filter: none;
  font-size: 0.95em;
}
.note-content a[data-note-link].ProseMirror-selectednode { outline: 2px solid var(--fallback-p, oklch(var(--p) / 1)); }
/* A [[link]]'s target icon (Stage 6.4): the note's icon tinted by its lead tag, or the target's kind.
   :where() keeps the neutral colours at zero specificity so a .tag-cN on the span wins. */
:where(.note-link-icon) { --tag-bg: oklch(var(--bc) / 0.08); --tag-fg: oklch(var(--bc) / 0.7); }
.note-link-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.05em; height: 1.05em; margin-right: 0.3em; vertical-align: -0.12em;
  border-radius: 2px; background-color: var(--tag-bg); color: var(--tag-fg);
}
.note-link-icon svg { width: 0.75em; height: 0.75em; }
.note-content mark { background: oklch(var(--wa) / 0.35); color: inherit; padding: 0 0.1em; border-radius: 0.15rem; }
.note-content img { display: block; max-width: 100%; height: auto; border-radius: 0.25rem; border: 1px solid var(--fallback-b3, oklch(var(--b3) / 1)); }
.note-content img.ProseMirror-selectednode { outline: 2px solid var(--fallback-p, oklch(var(--p) / 1)); outline-offset: 2px; }
.note-content img[data-uploading] { opacity: 0.55; }
.note-content .note-callout { background: oklch(var(--wa) / 0.15); border-radius: 0.25rem; padding: 0.75rem 1rem; }
.note-content p.is-editor-empty:first-child::before,
.note-content .is-empty::before {
  content: attr(data-placeholder);
  float: left;
  height: 0;
  pointer-events: none;
  color: var(--fallback-bc, oklch(var(--bc) / 0.45));
}

/* Save state (notes/_save_status): a faint icon in the surface's header row. Only an error
   shows words. Icons swap on data-state; the text is the tooltip and the screen-reader label. */
.note-status {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-width: 0.875rem;
  min-height: 1.5rem;
  font-size: 0.75rem;
  line-height: 1;
  vertical-align: middle;
  color: var(--fallback-bc, oklch(var(--bc) / 0.35));
}
.note-status-icon { width: 0.875rem; height: 0.875rem; display: none; }
.note-status[data-state="saved"] .note-status-saved { display: block; }
.note-status[data-state="unsaved"] .note-status-pending { display: block; width: 0.625rem; height: 0.625rem; }
.note-status[data-state="saving"] .note-status-pending { display: block; width: 0.625rem; height: 0.625rem; animation: note-status-pulse 1.2s ease-in-out infinite; }
.note-status[data-state="error"], .note-status[data-state="retrying"] { color: var(--fallback-wa, oklch(var(--wa) / 1)); max-width: 18rem; }
.note-status[data-state="error"] .note-status-error, .note-status[data-state="retrying"] .note-status-error { display: block; flex-shrink: 0; }
/* A save that kept less than was sent (Stage 6b): saved, with one sentence saying so. */
.note-status[data-state="notice"] { max-width: 22rem; }
.note-status[data-state="notice"] .note-status-saved { display: block; flex-shrink: 0; }
/* Visually hidden except where words are the point; always read by screen readers. */
.note-status:not([data-state="error"]):not([data-state="retrying"]):not([data-state="notice"]) .note-status-text {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
@keyframes note-status-pulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .note-status[data-state="saving"] .note-status-pending { animation: none; } }

.note-popup {
  position: absolute;
  z-index: 60;
  width: 18rem;
  max-height: 20rem;
  overflow-y: auto;
  background: var(--fallback-b1, oklch(var(--b1) / 1));
  border: 1px solid var(--fallback-b3, oklch(var(--b3) / 1));
  border-radius: 0.25rem;
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.12);
  padding: 0.25rem;
}
.note-popup-option { display: flex; width: 100%; justify-content: space-between; gap: 0.75rem; text-align: left; padding: 0.45rem 0.6rem; border-radius: 0.2rem; font-size: 0.875rem; }
.note-popup-option[aria-selected="true"], .note-popup-option:hover { background: oklch(var(--p) / 0.15); }
.note-popup-hint { font-family: ui-monospace, monospace; font-size: 0.75rem; opacity: 0.6; }

/* position/width set up front: floating-ui measures the bar before Tiptap applies
   width: max-content, and a full-width block measured first lands at the viewport edge. */
.note-bubble {
  position: fixed;
  top: 0;
  left: 0;
  width: max-content;
  display: flex;
  align-items: center;
  gap: 0.125rem;
  background: var(--fallback-n, oklch(var(--n) / 1));
  color: var(--fallback-nc, oklch(var(--nc) / 1));
  border-radius: 0.25rem;
  padding: 0.25rem;
  box-shadow: 0 6px 18px rgb(0 0 0 / 0.2);
  z-index: 60;
}
.note-bubble-button { min-width: 2rem; height: 2rem; padding: 0 0.5rem; border-radius: 0.2rem; font-size: 0.8125rem; font-weight: 600; }
.note-bubble-button:hover, .note-bubble-button[aria-pressed="true"] { background: rgb(255 255 255 / 0.15); }
.note-bubble-italic { font-style: italic; font-family: Georgia, serif; }
.note-bubble-strike { text-decoration: line-through; }
.note-bubble-input { height: 2rem; width: 16rem; padding: 0 0.5rem; border-radius: 0.2rem; background: rgb(255 255 255 / 0.1); color: inherit; font-size: 0.8125rem; outline: none; }

/* ===== Tag pills — docs/plans/active/knowledgebase.md, Stage 5 =====
   A tag's colour is .tag-c0…9, picked by TagPalette (Ruby) / helpers/tag_palette.js from its slug.
   ⚠️ Categorical, not semantic: DaisyUI's error/success colours mean something, and #acme must
   never look like an error. Each hue sets four variables; .tag-pill reads them. Light values are
   Tailwind's 100/200/800 shades, dark ones its 500 at low alpha with a 300 text; the selected
   ("solid") state is the 700 shade with white text. All pairs pass WCAG AA at 12px. */
.tag-c0 { --tag-bg: #e0f2fe; --tag-bd: #bae6fd; --tag-fg: #075985; --tag-solid: #0369a1; } /* sky */
.tag-c1 { --tag-bg: #ccfbf1; --tag-bd: #99f6e4; --tag-fg: #115e59; --tag-solid: #0f766e; } /* teal */
.tag-c2 { --tag-bg: #d1fae5; --tag-bd: #a7f3d0; --tag-fg: #065f46; --tag-solid: #047857; } /* emerald */
.tag-c3 { --tag-bg: #ecfccb; --tag-bd: #d9f99d; --tag-fg: #3f6212; --tag-solid: #4d7c0f; } /* lime */
.tag-c4 { --tag-bg: #fef3c7; --tag-bd: #fde68a; --tag-fg: #92400e; --tag-solid: #b45309; } /* amber */
.tag-c5 { --tag-bg: #ffedd5; --tag-bd: #fed7aa; --tag-fg: #9a3412; --tag-solid: #c2410c; } /* orange */
.tag-c6 { --tag-bg: #ffe4e6; --tag-bd: #fecdd3; --tag-fg: #9f1239; --tag-solid: #be123c; } /* rose */
.tag-c7 { --tag-bg: #fae8ff; --tag-bd: #f5d0fe; --tag-fg: #86198f; --tag-solid: #a21caf; } /* fuchsia */
.tag-c8 { --tag-bg: #ede9fe; --tag-bd: #ddd6fe; --tag-fg: #5b21b6; --tag-solid: #6d28d9; } /* violet */
.tag-c9 { --tag-bg: #e0e7ff; --tag-bd: #c7d2fe; --tag-fg: #3730a3; --tag-solid: #4338ca; } /* indigo */

[data-theme="business"] .tag-c0 { --tag-bg: rgb(14 165 233 / .18); --tag-bd: rgb(14 165 233 / .35); --tag-fg: #7dd3fc; }
[data-theme="business"] .tag-c1 { --tag-bg: rgb(20 184 166 / .18); --tag-bd: rgb(20 184 166 / .35); --tag-fg: #5eead4; }
[data-theme="business"] .tag-c2 { --tag-bg: rgb(16 185 129 / .18); --tag-bd: rgb(16 185 129 / .35); --tag-fg: #6ee7b7; }
[data-theme="business"] .tag-c3 { --tag-bg: rgb(132 204 22 / .18); --tag-bd: rgb(132 204 22 / .35); --tag-fg: #bef264; }
[data-theme="business"] .tag-c4 { --tag-bg: rgb(245 158 11 / .18); --tag-bd: rgb(245 158 11 / .35); --tag-fg: #fcd34d; }
[data-theme="business"] .tag-c5 { --tag-bg: rgb(249 115 22 / .18); --tag-bd: rgb(249 115 22 / .35); --tag-fg: #fdba74; }
[data-theme="business"] .tag-c6 { --tag-bg: rgb(244 63 94 / .18);  --tag-bd: rgb(244 63 94 / .35);  --tag-fg: #fda4af; }
[data-theme="business"] .tag-c7 { --tag-bg: rgb(217 70 239 / .18); --tag-bd: rgb(217 70 239 / .35); --tag-fg: #f0abfc; }
[data-theme="business"] .tag-c8 { --tag-bg: rgb(139 92 246 / .18); --tag-bd: rgb(139 92 246 / .35); --tag-fg: #c4b5fd; }
[data-theme="business"] .tag-c9 { --tag-bg: rgb(99 102 241 / .18); --tag-bd: rgb(99 102 241 / .35); --tag-fg: #a5b4fc; }

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.0625rem 0.4375rem;
  border: 1px solid var(--tag-bd);
  border-radius: 2px;
  background-color: var(--tag-bg);
  color: var(--tag-fg);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.35;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color 120ms ease, color 120ms ease, opacity 120ms ease;
}
a.tag-pill:hover { border-color: var(--tag-fg); }
a.tag-pill:focus-visible { outline: 2px solid var(--tag-solid); outline-offset: 1px; }
.tag-pill-sm { font-size: 0.75rem; padding: 0 0.375rem; }
.tag-pill-count { opacity: 0.7; font-variant-numeric: tabular-nums; }

/* The selected tag in a filter bar is solid; the others step back. */
.tag-pill[aria-current="true"] { background-color: var(--tag-solid); border-color: var(--tag-solid); color: #fff; }
.tag-bar[data-filtered="true"] .tag-pill:not([aria-current="true"]) { opacity: 0.55; }
.tag-bar[data-filtered="true"] .tag-pill:not([aria-current="true"]):hover { opacity: 1; }

/* Inside the editor a pill is a decoration over plain text (helpers/note_editor/tag_pill.js), so
   it must not change the text's metrics: no border width, no horizontal padding that shifts the caret. */
.note-content .tag-pill {
  display: inline;
  padding: 0.0625rem 0.1875rem;
  margin: 0 -0.0625rem;
  border: 0;
  box-shadow: inset 0 0 0 1px var(--tag-bd);
  font-size: 0.92em;
}
.note-content .tag-pill-typing { background-color: oklch(var(--bc) / 0.06); border-radius: 2px; }

/* A #tag's colour behind a plain-text field (a journal task's title): a mirror of the text sits
   under the transparent textarea, its own text invisible, and each tag's mark adds only a
   background and an inset ring — no padding or border width, so it never moves the field's text. */
.tag-mark-mirror { color: transparent; white-space: pre-wrap; overflow-wrap: break-word; pointer-events: none; }
.tag-mark { color: transparent; background-color: var(--tag-bg); box-shadow: 0 0 0 1px var(--tag-bd); border-radius: 2px; }

/* The journal task row in a list with no manual order (the topic hub): no drag handle. */
.task-rows-unordered .task-row-handle { display: none; }
.task-rows-unordered > li:hover { background-color: oklch(var(--p) / 0.07); }
[data-theme="business"] .task-rows-unordered > li:hover { background-color: oklch(var(--p) / 0.12); }

/* A coloured accent strip — pinned cards, collection cards, a filtered page's heading. */
.tag-accent { border-top: 3px solid var(--tag-solid); }

/* A surface raised off the page, as on the knowledgebase mockups: the light theme's base-100 IS the
   page colour, so a bg-base-100 card disappears into it. White in light; a touch lighter in dark. */
.surface-raised { background-color: #fff; }
[data-theme="business"] .surface-raised { background-color: color-mix(in oklch, oklch(var(--b1)) 94%, white); }
/* A row on a raised surface lights up with a faint primary tint; a base-200 hover would sink it back
   to the page colour. */
.surface-row:hover, .surface-row:focus-within { background-color: oklch(var(--p) / 0.07); }
[data-theme="business"] .surface-row:hover, [data-theme="business"] .surface-row:focus-within { background-color: oklch(var(--p) / 0.12); }

/* A tag's topic page (Stage 6.1): the header takes the tag's colour; its section counts and the
   title pill sit on the page background so they read against the tint in both themes. */
.topic-hub-header { background-color: var(--tag-bg); border: 1px solid var(--tag-bd); border-top: 4px solid var(--tag-solid); }
.topic-hub-title { font-size: 1.5rem; font-weight: 600; padding: 0.125rem 0.75rem; background-color: oklch(var(--b1)); }
.topic-hub-count { font-size: 0.8125rem; padding: 0.125rem 0.625rem; border-radius: 2px; border: 1px solid var(--tag-bd); background-color: oklch(var(--b1)); color: var(--tag-fg); text-decoration: none; }
.topic-hub-count:hover { border-color: var(--tag-fg); }
.topic-hub-count:focus-visible { outline: 2px solid var(--tag-solid); outline-offset: 1px; }
.topic-link-band { background-color: var(--tag-bg); border: 1px solid var(--tag-bd); }
/* A topic promoted into the journal (organise_by_topics.md, decision O): a slim header ruled in the
   tag's colour, so the page note starts high. And a tag's colour as a small square (Notes sidebar). */
.topic-page-rule { border-bottom: 3px solid var(--tag-solid); }

/* Sidebars — one type scale for the Meetings (global), Notes and Journal sidebars (owner, 2026-10-11).
   The Journal's sizes are the reference: section headings in small caps, items at text-sm, counts
   and meta at text-xs. Text WRAPS — nothing truncates, and nothing pushes a sidebar sideways. */
.sidebar-heading { font-size: 0.75rem; line-height: 1rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: oklch(var(--bc) / 0.6); }
.sidebar-item { display: flex; align-items: center; gap: 0.5rem; padding: 0.25rem 0.5rem; border-radius: 2px; font-size: 0.875rem; line-height: 1.25rem; color: oklch(var(--bc) / 0.75); text-decoration: none; overflow-wrap: anywhere; }
.sidebar-item:hover { background-color: oklch(var(--b2) / 0.6); }
.sidebar-text { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.sidebar-count { flex-shrink: 0; font-size: 0.75rem; line-height: 1.25rem; color: oklch(var(--bc) / 0.45); font-variant-numeric: tabular-nums; }
.sidebar-meta { font-size: 0.75rem; line-height: 1rem; color: oklch(var(--bc) / 0.55); }
/* Tag pills in a sidebar wrap their text rather than run past the edge. */
.sidebar-pills .tag-pill { white-space: normal; overflow-wrap: anywhere; max-width: 100%; }
.tag-swatch { background-color: var(--tag-solid); }
.topic-link-band-link { color: var(--tag-fg); }
.topic-link-band-link:hover { text-decoration: underline; }

/* ===== Note icons — Stage 5b =====
   A note's icon (NoteIcon) on a square tinted by its first tag: the tile also carries that tag's
   .tag-cN class, whose variables it reads. :where() keeps the neutral defaults at zero specificity
   so a .tag-cN on the same element always wins, whichever rule comes later in this file. */
:where(.note-icon) {
  --tag-bg: oklch(var(--bc) / 0.06);
  --tag-bd: oklch(var(--bc) / 0.12);
  --tag-fg: oklch(var(--bc) / 0.6);
}
.note-icon {
  position: relative;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background-color: var(--tag-bg);
  color: var(--tag-fg);
  box-shadow: inset 0 0 0 1px var(--tag-bd);
}
.note-icon-sm { width: 1.25rem; height: 1.25rem; border-radius: 3px; }
.note-icon-md { width: 2.25rem; height: 2.25rem; }
.note-icon-lg { width: 2.5rem; height: 2.5rem; }
.note-icon-xl { width: 4rem; height: 4rem; border-radius: 6px; }
/* The meeting badge: brand teal, which no tag colour uses. */
.note-icon-badge {
  position: absolute;
  right: -5px;
  bottom: -5px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #1b6475;
  color: #fff;
  box-shadow: 0 0 0 2px oklch(var(--b1));
}
.note-meeting-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0 0.4375rem;
  border: 1px solid #bfe4ee;
  border-radius: 2px;
  background: #e2f3f7;
  color: #1b6475;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}
[data-theme="business"] .note-meeting-chip { background: rgb(101 195 218 / .15); border-color: rgb(101 195 218 / .35); color: #9adcec; }
[data-theme="business"] .note-icon-badge { background: #65c3da; color: #10343d; }
