/* Custom styles for the application */

body {
  font-family: 'Outfit', sans-serif;
}

/* Suppress transitions during initial sidebar restore */
.no-transition, .no-transition * {
  transition: none !important;
}

/* Instant collapsed sidebar state – only hide text to prevent FOUC.
   JS (_applyCollapsedDOM) handles sizing, logo swap, version badge. */
#sidebar[data-sidebar-collapsed] .sidebar-text,
#sidebar[data-sidebar-collapsed] [data-nav-group-target="arrow"],
#sidebar[data-sidebar-collapsed] [data-nav-group-target="menu"],
#sidebar[data-sidebar-collapsed] .sidebar-version-text {
  display: none;
}

/* Ensure button_to inner buttons always show pointer cursor.
   Rails button_to with a block puts classes on the <form>, not the <button>. */
form > button[type="submit"] {
  cursor: pointer;
}

/* Toast notifications */
.toast {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 280px;
  max-width: 420px;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateX(calc(100% + 1rem));
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.toast-visible {
  transform: translateX(0);
  opacity: 1;
}
.toast-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
.toast-success {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}
.toast-warning {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}
.toast-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}
.toast-message {
  flex: 1;
}
.toast-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.5;
  padding: 0 0.125rem;
  color: inherit;
}
.toast-close:hover {
  opacity: 1;
}
.toast-timer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 0 0 0.5rem 0.5rem;
  overflow: hidden;
}
.toast-timer-bar {
  height: 100%;
  width: 100%;
  transform-origin: right;
  transform: scaleX(1);
}
.toast-timer-running {
  animation: toast-shrink linear forwards;
}
.toast-error .toast-timer-bar {
  background: #ef4444;
}
.toast-success .toast-timer-bar {
  background: #22c55e;
}
.toast-warning .toast-timer-bar {
  background: #f59e0b;
}
@keyframes toast-shrink {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}
.force-dark-disabled {
  .toast-error {
    background: #450a0a;
    color: #fca5a5;
    border-color: #7f1d1d;
  }
  .toast-success {
    background: #052e16;
    color: #86efac;
    border-color: #14532d;
  }
  .toast-warning {
    background: #451a03;
    color: #fcd34d;
    border-color: #78350f;
  }
}

/* ── Achievement Toast ─────────────────────────────────────────────────────── */
.achievement-toast {
  min-width: 300px;
  max-width: 380px;
  background: #1f2937;
  color: #f9fafb;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem 0.5rem;
  box-shadow: 0 10px 25px rgba(0,0,0,0.4);
  opacity: 0;
  transform: translateX(110%);
  transition: opacity 0.3s ease, transform 0.3s ease;
  overflow: hidden;
  position: relative;
}
.achievement-toast-visible {
  opacity: 1;
  transform: translateX(0);
}
.achievement-toast-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.achievement-toast-unlock-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.7;
}
.achievement-toast-close {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
}
.achievement-toast-close:hover { color: #f9fafb; }
.achievement-toast-body {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.achievement-toast-icon {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
}
.achievement-toast-content {
  flex: 1;
  min-width: 0;
}
.achievement-toast-name {
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.achievement-toast-description {
  font-size: 0.8rem;
  opacity: 0.75;
  margin-top: 0.1rem;
}
.achievement-toast-tier {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.5rem;
  border-radius: 9999px;
  flex-shrink: 0;
}
.achievement-toast-timer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255,255,255,0.1);
}
.achievement-toast-timer-bar {
  height: 100%;
  transform-origin: left;
}
.achievement-toast-timer-running {
  animation: toast-shrink linear forwards;
}

/* Tier accent colors */
.achievement-toast-bronze  { border-top: 3px solid #cd7f32; }
.achievement-toast-bronze .achievement-toast-tier  { background: #78350f; color: #fbbf24; }
.achievement-toast-bronze .achievement-toast-timer-bar { background: #cd7f32; }

.achievement-toast-silver  { border-top: 3px solid #9ca3af; }
.achievement-toast-silver .achievement-toast-tier  { background: #374151; color: #e5e7eb; }
.achievement-toast-silver .achievement-toast-timer-bar { background: #9ca3af; }

.achievement-toast-gold    { border-top: 3px solid #d97706; }
.achievement-toast-gold .achievement-toast-tier    { background: #451a03; color: #fcd34d; }
.achievement-toast-gold .achievement-toast-timer-bar { background: #d97706; }

.achievement-toast-platinum { border-top: 3px solid #7c3aed; }
.achievement-toast-platinum .achievement-toast-tier { background: #2e1065; color: #c4b5fd; }
.achievement-toast-platinum .achievement-toast-timer-bar { background: #7c3aed; }

.achievement-toast-black   { border-top: 3px solid #f9fafb; }
.achievement-toast-black .achievement-toast-tier   { background: #111827; color: #f9fafb; border: 1px solid #374151; }
.achievement-toast-black .achievement-toast-timer-bar { background: #f9fafb; }

/* ── Achievement Profile Card ─────────────────────────────────────────────── */
.achievement-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
  padding: 1rem;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  background: #1f2937;
  color: #f9fafb;
  position: relative;
  transition: transform 0.15s ease;
}
.achievement-card:hover { transform: translateY(-2px); }
.achievement-card-locked {
  filter: grayscale(1);
  opacity: 0.4;
}
.achievement-card-icon  { font-size: 2.5rem; line-height: 1; }
.achievement-card-name  { font-weight: 600; font-size: 0.85rem; }
.achievement-card-desc  { font-size: 0.75rem; opacity: 0.65; }
.achievement-card-date  { font-size: 0.7rem; opacity: 0.5; margin-top: 0.25rem; }
.achievement-card-lock  {
  position: absolute; top: 0.5rem; right: 0.5rem;
  font-size: 0.85rem; opacity: 0.5;
}

.achievement-card-bronze   { border-color: #cd7f32; }
.achievement-card-silver   { border-color: #9ca3af; }
.achievement-card-gold     { border-color: #d97706; }
.achievement-card-platinum { border-color: #7c3aed; }
.achievement-card-black    { border-color: #f9fafb; }

.achievement-progress {
  width: 100%;
  height: 4px;
  background: #e5e7eb;
  border-radius: 2px;
  overflow: hidden;
  margin-top: 6px;
}
.achievement-progress-bar {
  height: 100%;
  background: #9ca3af;
  border-radius: 2px;
  transition: width 0.3s ease;
}
.achievement-card-bronze   .achievement-progress-bar { background: #cd7f32; }
.achievement-card-silver   .achievement-progress-bar { background: #9ca3af; }
.achievement-card-gold     .achievement-progress-bar { background: #d97706; }
.achievement-card-platinum .achievement-progress-bar { background: #7c3aed; }
.achievement-card-black    .achievement-progress-bar { background: #6b7280; }
.achievement-progress-label {
  font-size: 0.65rem;
  color: #9ca3af;
  margin-top: 2px;
  display: block;
}

.achievement-unique-hint {
  font-size: 0.65rem;
  color: #6b7280;
  margin-top: 2px;
  display: block;
  font-style: italic;
}

.user-avatar-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

.app-popover-link {
  display: block;
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 0.875rem;
  color: #d1d5db;
  text-decoration: none;
}
.app-popover-link:hover { background: #374151; color: #f9fafb; }

/* Hide scrollbar for year tabs */
.scrollbar-hide {
  -ms-overflow-style: none;  /* Internet Explorer 10+ */
  scrollbar-width: none;  /* Firefox */
}

.scrollbar-hide::-webkit-scrollbar {
  display: none;  /* Safari and Chrome */
}

summary.list-none::-webkit-details-marker {
  display: none;
}

/* FullCalendar vertical event title font size */
.fc-v-event .fc-event-title {
  font-size: 11px;
}

/* Custom event layout for timeGrid views — hide default FC title/time when custom rows present */
.fc-timegrid-event .fc-event-main-frame > .fc-event-time {
  display: none !important;
}
.fc-timegrid-event .fc-event-main-frame > .fc-event-title-container {
  display: none !important;
}
.fc-event-row1 {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.95);
}
.fc-event-logo {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  object-fit: cover;
  flex-shrink: 0;
}
.fc-event-hours {
  flex-shrink: 0;
}
.fc-event-sep {
  opacity: 0.5;
  flex-shrink: 0;
}
.fc-event-project {
  overflow: hidden;
  text-overflow: ellipsis;
}
.fc-event-row2 {
  font-size: 10px;
  font-weight: 400;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.75);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
/* Hide row2 on very short events */
.fc-event-short .fc-event-row2 {
  display: none;
}

/* Service area budget warning borders on events */
.fc-event-budget-warn {
  border-left: 4px solid #eab308 !important;
}
.fc-event-budget-low {
  border-left: 4px solid #f97316 !important;
}
.fc-event-budget-over {
  border-left: 4px solid #ef4444 !important;
}

/* Budget display in tooltip & popup */
.fc-event-tooltip-budget {
  font-size: 11px;
  margin-top: 4px;
  padding: 4px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
}
.fc-event-tooltip-budget-warn {
  background: rgba(234, 179, 8, 0.15);
  color: #fde047;
}
.fc-event-tooltip-budget-low {
  background: rgba(249, 115, 22, 0.15);
  color: #fdba74;
}
.fc-event-tooltip-budget-over {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}

/* FullCalendar event context menu button */
.fc-event-menu-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  border-radius: 3px;
  padding: 0;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 3;
}
.fc-event:hover .fc-event-menu-btn,
.fc-event-menu-btn:focus {
  opacity: 1;
}
.fc-event-menu-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

/* Context menu dropdown */
.fc-context-menu {
  position: fixed;
  z-index: 9999;
  min-width: 160px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 4px 0;
}
.force-dark-disabled {
  .fc-context-menu {
    background: #1f2937;
    border-color: #374151;
  }
}
.fc-context-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 12px;
  font-size: 13px;
  color: #374151;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
}
.force-dark-disabled {
  .fc-context-item { color: #d1d5db; }
}
.fc-context-item:hover {
  background: #f3f4f6;
}
.force-dark-disabled {
  .fc-context-item:hover { background: #374151; }
}
.fc-context-item--danger {
  color: #dc2626;
}
.fc-context-item--danger:hover {
  background: #fef2f2;
}
.force-dark-disabled {
  .fc-context-item--danger { color: #f87171; }
  .fc-context-item--danger:hover { background: rgba(127, 29, 29, 0.2); }
}
.fc-context-kbd {
  margin-left: auto;
  padding: 1px 5px;
  font-size: 10px;
  font-family: inherit;
  color: #9ca3af;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 3px;
  line-height: 1.4;
}
.force-dark-disabled {
  .fc-context-kbd {
    color: #6b7280;
    background: #374151;
    border-color: #4b5563;
  }
}

/* Keyboard shortcuts overlay */
.shortcuts-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
  background: rgba(0, 0, 0, 0.5);
}
.shortcuts-overlay.hidden {
  display: none !important;
}
.shortcuts-panel {
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  padding: 24px 28px;
  max-width: 420px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}
.force-dark-disabled {
  .shortcuts-panel {
    background: #1f2937;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  }
}
.shortcuts-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.shortcuts-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
  margin: 0;
}
.force-dark-disabled {
  .shortcuts-header h3 { color: #f3f4f6; }
}
.shortcuts-section {
  margin-bottom: 16px;
}
.shortcuts-section:last-child { margin-bottom: 0; }
.shortcuts-heading {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9ca3af;
  margin: 0 0 8px 0;
}
.force-dark-disabled {
  .shortcuts-heading { color: #6b7280; }
}
.shortcuts-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
}
.shortcuts-row span {
  font-size: 13px;
  color: #374151;
}
.force-dark-disabled {
  .shortcuts-row span { color: #d1d5db; }
}
.shortcuts-row kbd {
  display: inline-block;
  padding: 2px 7px;
  font-size: 11px;
  font-family: inherit;
  color: #374151;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  min-width: 24px;
  text-align: center;
}
.force-dark-disabled {
  .shortcuts-row kbd {
    color: #d1d5db;
    background: #374151;
    border-color: #4b5563;
  }
}

/* Global search modal (command palette) */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 5vh 0;
  background: rgba(0, 0, 0, 0.5);
}
.search-overlay.hidden {
  display: none !important;
}
.search-panel {
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 90vw;
  width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.force-dark-disabled {
  .search-panel {
    background: #1f2937;
    color: #e5e7eb;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  }
}
.search-input-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid #e5e7eb;
}
.force-dark-disabled {
  .search-input-wrapper { border-color: #374151; }
}
.search-input-icon {
  width: 20px;
  height: 20px;
  color: #9ca3af;
  flex-shrink: 0;
}
.search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 15px;
  color: #111827;
}
.search-input::placeholder { color: #9ca3af; }
.force-dark-disabled {
  .search-input { color: #f3f4f6; }
  .search-input::placeholder { color: #6b7280; }
}
.search-kbd {
  display: inline-block;
  padding: 2px 7px;
  font-size: 11px;
  font-family: inherit;
  color: #9ca3af;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  flex-shrink: 0;
}
.force-dark-disabled {
  .search-kbd { color: #6b7280; background: #374151; border-color: #4b5563; }
}
[data-ctrl-active] .search-kbd {
  color: #3b82f6;
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px #3b82f6;
}
[data-ctrl-active] .fc-event-popup-btn kbd {
  color: #60a5fa;
  border: 1px solid #3b82f6;
  border-radius: 3px;
  padding: 0 3px;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.3);
}
[data-ctrl-active] .app-popover-close kbd {
  color: #60a5fa;
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.3);
}
.search-results {
  overflow-y: auto;
  padding: 8px 0;
}
.search-empty {
  padding: 24px 16px;
  text-align: center;
  font-size: 13px;
  color: #9ca3af;
}
.search-category {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9ca3af;
  padding: 8px 16px 4px;
  margin-top: 4px;
}
.search-category:first-child { margin-top: 0; }
.force-dark-disabled {
  .search-category { color: #6b7280; }
}
.search-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  cursor: pointer;
  transition: background 0.1s;
}
.search-result:hover,
.search-result-selected {
  background: #f3f4f6;
}
.force-dark-disabled {
  .search-result:hover,
  .search-result-selected { background: #374151; }
}
.search-result-label {
  font-size: 14px;
  color: #111827;
}
.force-dark-disabled {
  .search-result-label { color: #f3f4f6; }
}
.search-result-desc {
  font-size: 12px;
  color: #9ca3af;
  margin-left: 8px;
  flex-shrink: 0;
}
.force-dark-disabled {
  .search-result-desc { color: #6b7280; }
}

/* Create-new selector */
.create-new-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 16px;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.1s;
}
.create-new-option:hover {
  background: #f3f4f6;
}
.force-dark-disabled {
  .create-new-option:hover { background: #374151; }
}

/* Finder modal create section & footer */
.search-footer {
  border-top: 1px solid #e5e7eb;
  padding: 8px 16px;
}
.force-dark-disabled {
  .search-footer { border-color: #374151; }
}
.finder-footer-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 8px;
  font-size: 13px;
  color: #6b7280;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.1s;
}
.finder-footer-btn:hover {
  background: #f3f4f6;
  color: #111827;
}
.force-dark-disabled {
  .finder-footer-btn { color: #9ca3af; }
  .finder-footer-btn:hover { background: #374151; color: #f3f4f6; }
}
.search-create-section {
  border-top: 1px solid #e5e7eb;
}
.force-dark-disabled {
  .search-create-section { border-color: #374151; }
}
.finder-select,
.finder-input {
  width: 100%;
  padding: 8px 10px;
  font-size: 13px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: white;
  color: #111827;
  outline: none;
}
.finder-select:focus,
.finder-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}
.force-dark-disabled {
  .finder-select,
  .finder-input {
    background: #374151;
    border-color: #4b5563;
    color: #f3f4f6;
  }
  .finder-select:focus,
  .finder-input:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.2);
  }
}
.finder-btn {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.1s;
}
.finder-btn-primary {
  background: #3b82f6;
  color: white;
}
.finder-btn-primary:hover {
  background: #2563eb;
}
.finder-btn-secondary {
  background: #f3f4f6;
  color: #374151;
}
.finder-btn-secondary:hover {
  background: #e5e7eb;
}
.force-dark-disabled {
  .finder-btn-secondary { background: #374151; color: #d1d5db; }
  .finder-btn-secondary:hover { background: #4b5563; }
}
.finder-error {
  font-size: 12px;
  color: #dc2626;
  padding: 4px 0;
}

/* Kanban cards — prevent text selection so Ctrl+drag works for duplication */
[data-kanban-card] {
  -webkit-user-select: none;
  user-select: none;
}

/* Kanban card avatars */
.kanban-avatars {
  display: flex;
  align-items: center;
  gap: 2px;
}

/* ===== Story Panel: Lexxy editor dark-mode text color ===== */
.force-dark-disabled {
  .story-panel-main lexxy-editor {
    --lexxy-color-ink: #e5e7eb;       /* gray-200 */
    --lexxy-color-canvas: #111827;    /* gray-900 */
    --lexxy-color-ink-lighter: #374151; /* gray-700 */
    --lexxy-color-ink-lightest: #1f2937; /* gray-800 */
  }
}

/* ===== Time Entry Note: compact Trix editor ===== */
.time-entry-note-editor trix-toolbar .trix-button-row {
  flex-wrap: nowrap;
  justify-content: flex-start;
}
.time-entry-note-editor trix-toolbar .trix-button-group {
  margin-bottom: 4px;
  border-radius: 4px;
}
.time-entry-note-editor trix-toolbar .trix-button--icon {
  width: 2em;
  height: 1.4em;
}
.time-entry-note-editor trix-toolbar .trix-button-group:last-child,
.time-entry-note-editor trix-toolbar .trix-button-group--file-tools {
  display: none;
}
.time-entry-note-editor trix-editor {
  min-height: 3em;
  max-height: 10em;
  overflow-y: auto;
  font-size: 0.875rem;
  padding: 0.4em 0.6em;
  border-radius: 0.5rem;
  border: 1px solid #d1d5db;
}
.time-entry-note-editor trix-editor:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--color-primary-500, #99ff00);
}

/* ===== Story Panel: 2-column layout ===== */
.story-panel-content {
  display: flex;
  gap: 1.5rem;
}
.story-panel-main {
  flex: 3;
  min-width: 0;
}
.story-panel-sidebar {
  flex: 2;
  min-width: 0;
  border-left: 1px solid #e5e7eb;
  padding-left: 1.5rem;
}
.force-dark-disabled {
  .story-panel-sidebar { border-color: #374151; }
}
@media (max-width: 640px) {
  .story-panel-content { flex-direction: column; }
  .story-panel-sidebar {
    border-left: none; padding-left: 0;
    border-top: 1px solid #e5e7eb; padding-top: 1rem;
  }
}

/* ===== Week/Day View: hours badge in column header ===== */
.fc .fc-col-header-cell {
  position: relative;
}
.fc-week-day-total {
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  font-weight: 600;
  color: #16a34a;
  background: #f0fdf4;
  border-radius: 4px;
  padding: 0 4px;
  line-height: 1.6;
}
.force-dark-disabled {
  .fc-week-day-total {
    color: #4ade80;
    background: rgba(34, 197, 94, 0.12);
  }
}
.sidebar-calendar .fc-week-day-total {
  font-size: 9px;
  padding: 0 3px;
}

/* ===== Month View Enhancements ===== */

/* Day cell: total hours badge next to date number */
.fc-month-day-total {
  font-size: 11px;
  font-weight: 600;
  color: #16a34a;
  background: #f0fdf4;
  border-radius: 4px;
  padding: 0 5px;
  line-height: 1.6;
}
.force-dark-disabled {
  .fc-month-day-total {
    color: #4ade80;
    background: rgba(34, 197, 94, 0.12);
  }
}

/* Day cell top: flex layout so badge sits on the right */
.fc-daygrid-day-top {
  display: flex;
  align-items: center;
  padding: 4px 6px 2px;
}

/* Compact event bar in month view */
.fc-month-event-inner {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 4px;
  overflow: hidden;
  line-height: 1.5;
}
.fc-month-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.fc-month-event-text {
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* Hide heavy indicators in month view (avatars, progress bar, chain icon) */
.fc-daygrid-event .fc-event-indicators,
.fc-daygrid-event .fc-event-estimate-bar {
  display: none;
}

/* Month view event styling */
.fc-daygrid-event {
  border-radius: 3px;
  border: none !important;
  margin: 1px 2px;
}
.fc-daygrid-dot-event {
  background: transparent;
}
.fc-daygrid-dot-event:hover {
  background: rgba(0, 0, 0, 0.04);
}
.force-dark-disabled {
  .fc-daygrid-dot-event:hover {
    background: rgba(255, 255, 255, 0.06);
  }
}

/* More events link styling */
.fc-daygrid-more-link {
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  padding: 1px 4px;
}
.fc-daygrid-more-link:hover {
  color: #374151;
  background: #f3f4f6;
  border-radius: 3px;
}
.force-dark-disabled {
  .fc-daygrid-more-link { color: #9ca3af; }
  .fc-daygrid-more-link:hover { color: #e5e7eb; background: #374151; }
}

/* Today highlight in month view */
.fc .fc-daygrid-day.fc-day-today {
  background: rgba(34, 197, 94, 0.05);
}
.force-dark-disabled {
  .fc .fc-daygrid-day.fc-day-today {
    background: rgba(34, 197, 94, 0.08);
  }
}

/* Weekend cells slightly dimmed */
.fc .fc-daygrid-day.fc-day-sat,
.fc .fc-daygrid-day.fc-day-sun {
  background: rgba(0, 0, 0, 0.015);
}
.force-dark-disabled {
  .fc .fc-daygrid-day.fc-day-sat,
  .fc .fc-daygrid-day.fc-day-sun {
    background: rgba(255, 255, 255, 0.02);
  }
}

/* Business hours: non-business slots slightly darker */
.fc-non-business {
  background: rgba(0, 0, 0, 0.03) !important;
}
.force-dark-disabled .fc-non-business {
  background: rgba(0, 0, 0, 0.15) !important;
}

/* FullCalendar events — prevent text selection so Ctrl+drag works for duplication */
.fc-event {
  -webkit-user-select: none;
  user-select: none;
}
.fc-event .fc-event-main {
  overflow: hidden;
}
/* Hide indicators on very short events (15min) */
.fc-event-short .fc-event-indicators {
  display: none;
}
.fc-event-short .fc-event-estimate-bar {
  height: 2px;
}

/* Temp event (optimistic, not yet synced) */
.fc-event-temp {
  pointer-events: none;
}
.fc-event-temp-spinner {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: fc-temp-spin 0.6s linear infinite;
}
@keyframes fc-temp-spin {
  to { transform: rotate(360deg); }
}

/* Event bottom-right indicators (user avatar + chain icon) */
.fc-event-indicators {
  position: absolute;
  bottom: 2px;
  right: 2px;
  display: flex;
  align-items: center;
  gap: 3px;
  pointer-events: none;
}
.fc-event-user-avatar {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.5);
}
.fc-event-user-initials {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  color: white;
  font-size: 8px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.fc-event-linked-icon {
  width: 14px;
  height: 14px;
  color: rgba(255, 255, 255, 0.7);
}

/* ===== App Popover (unified dark popover) ===== */
.app-popover {
  position: fixed;
  z-index: 10000;
  min-width: 320px;
  max-width: 420px;
  max-height: 400px;
  background: #1f2937;
  color: #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  font-size: 12px;
  line-height: 1.4;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.app-popover-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid #374151;
  flex-shrink: 0;
}
.app-popover-title {
  flex: 1;
  font-weight: 600;
  font-size: 13px;
  color: #f9fafb;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-popover-close {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 11px;
  flex-shrink: 0;
}
.app-popover-close:hover { color: #f9fafb; background: #374151; }
.app-popover-close kbd {
  font-size: 9px;
  background: #374151;
  color: #9ca3af;
  padding: 1px 4px;
  border-radius: 3px;
  border: 1px solid #4b5563;
}
.app-popover-body {
  overflow-y: auto;
  flex: 1;
}
.app-popover-group {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: #111827;
  border-bottom: 1px solid #374151;
}
.app-popover-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.app-popover-group-name {
  font-size: 11px;
  font-weight: 600;
  color: #d1d5db;
}
.app-popover-group-count {
  font-size: 11px;
  color: #6b7280;
}
.app-popover-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 10px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid #1f2937;
}
.app-popover-item:hover { background: #374151; }
.app-popover-item-icon { flex-shrink: 0; margin-top: 2px; }
.app-popover-item-content { min-width: 0; flex: 1; }
.app-popover-item-meta { display: flex; align-items: center; gap: 6px; }
.app-popover-sha {
  font-size: 11px;
  color: #9ca3af;
  background: #374151;
  padding: 1px 4px;
  border-radius: 3px;
}
.app-popover-time { font-size: 11px; color: #6b7280; }
.app-popover-repo { font-size: 10px; font-weight: 500; }
.app-popover-item-msg { color: #d1d5db; margin-top: 2px; word-break: break-word; }

/* Global simple tooltip (data-tooltip) */
.app-tooltip {
  position: fixed;
  z-index: 10003;
  max-width: 300px;
  padding: 8px 10px;
  background: #1f2937;
  color: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  font-size: 12px;
  line-height: 1.4;
  pointer-events: none;
  white-space: pre-wrap;
}

/* Calendar event hover tooltip */
.fc-event-tooltip {
  position: fixed;
  z-index: 10000;
  max-width: 300px;
  padding: 8px 10px;
  background: #1f2937;
  color: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  font-size: 12px;
  line-height: 1.4;
  pointer-events: none;
}
.fc-event-tooltip-title {
  font-weight: 600;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.fc-event-tooltip-logo {
  width: 18px;
  height: 18px;
  border-radius: 3px;
  object-fit: cover;
  flex-shrink: 0;
}
.fc-event-tooltip-meta {
  font-size: 11px;
}
.fc-event-tooltip-meta span + span::before {
  content: " · ";
}
.fc-event-tooltip-note {
  margin-top: 4px;
  color: #d1d5db;
  font-style: italic;
  font-size: 11px;
}
.fc-event-tooltip-note ol { list-style: decimal; padding-left: 16px; }
.fc-event-tooltip-note ul { list-style: disc; padding-left: 16px; }
.fc-event-tooltip-note p { margin: 2px 0; }

.fc-event-tooltip-notes { margin-top: 4px; padding-top: 4px; border-top: 1px solid #374151; }
.fc-event-tooltip-notes-title { font-size: 10px; font-weight: 600; color: #9ca3af; margin-bottom: 2px; }
.fc-event-tooltip-comment { font-size: 11px; margin-bottom: 3px; }
.fc-event-tooltip-comment-meta { display: block; font-size: 10px; color: #6b7280; }
.fc-event-tooltip-tasks {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid #374151;
}
.fc-event-tooltip-task {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #d1d5db;
}
.fc-event-tooltip-task-done {
  text-decoration: line-through;
  color: #6b7280;
}
.fc-event-tooltip-users {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid #374151;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.fc-event-tooltip-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.3);
}
.fc-event-tooltip-initials {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  font-size: 9px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ===== Event Popup (click-toggled, interactive) ===== */
.fc-event-popup {
  position: fixed;
  z-index: 10000;
  width: 320px;
  max-height: calc(100vh - 16px);
  overflow-y: auto;
  background: #1f2937;
  color: #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  font-size: 12px;
  line-height: 1.4;
}
.fc-event-popup-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid #374151;
}
.fc-event-popup-header-title {
  flex: 1;
  font-weight: 600;
  font-size: 13px;
  color: #f9fafb;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
}
.fc-event-popup-logo {
  width: 20px;
  height: 20px;
  border-radius: 3px;
  object-fit: cover;
  flex-shrink: 0;
}
.fc-event-popup-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px 10px;
  border-bottom: 1px solid #374151;
}
.fc-event-popup-actions-spacer {
  flex: 1;
}
.fc-event-popup-btn--danger {
  color: #f87171;
}
.fc-event-popup-btn--danger:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}
.fc-event-popup-btn {
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 0 5px;
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
}
.fc-event-popup-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #e5e7eb;
}
.fc-event-popup-btn kbd {
  font-family: inherit;
  font-size: 9px;
  line-height: 1;
  pointer-events: none;
}
.fc-event-popup-body {
  padding: 8px 10px;
}
.fc-event-popup-body .fc-event-tooltip-meta {
  margin-bottom: 4px;
}
.fc-event-popup-body .fc-event-tooltip-note ol { list-style: decimal; padding-left: 16px; }
.fc-event-popup-body .fc-event-tooltip-note ul { list-style: disc; padding-left: 16px; }
.fc-event-popup-body .fc-event-tooltip-note p { margin: 2px 0; }
.fc-event-popup-notes { margin-top: 6px; }
.fc-event-popup-comment { font-size: 12px; margin-bottom: 4px; }
.fc-event-popup-comment-meta { display: block; font-size: 10px; color: #9ca3af; }
.fc-event-popup-comment-body { white-space: pre-wrap; }
.fc-event-popup-body .fc-event-tooltip-note {
  margin-bottom: 4px;
  font-size: 11px;
}
.fc-event-popup-tasks {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid #374151;
}
.fc-event-popup-tasks-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.fc-event-popup-task {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  cursor: pointer;
}
.fc-event-popup-task:hover {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 3px;
}
.fc-event-popup-task-checkbox {
  flex-shrink: 0;
  cursor: pointer;
}
.fc-event-popup-task-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fc-event-popup-task-done .fc-event-popup-task-title {
  text-decoration: line-through;
  color: #6b7280;
}
.fc-event-popup-task-delete {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 3px;
  color: #6b7280;
  cursor: pointer;
  opacity: 0;
  flex-shrink: 0;
}
.fc-event-popup-task:hover .fc-event-popup-task-delete {
  opacity: 1;
}
.fc-event-popup-task-delete:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}
.fc-event-popup-add-task {
  margin-top: 4px;
}
.fc-event-popup-add-task input {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid #374151;
  border-radius: 4px;
  color: #e5e7eb;
  font-size: 12px;
  padding: 4px 8px;
  outline: none;
}
.fc-event-popup-add-task input::placeholder {
  color: #6b7280;
}
.fc-event-popup-add-task input:focus {
  border-color: #6b7280;
}
.fc-event-popup-estimate {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  font-size: 11px;
}
.fc-event-popup-estimate-label {
  white-space: nowrap;
}
.fc-event-popup-estimate-input {
  width: 48px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid #374151;
  border-radius: 3px;
  color: #e5e7eb;
  font-size: 11px;
  padding: 1px 4px;
  text-align: center;
  outline: none;
}
.fc-event-popup-estimate-input:focus {
  border-color: #6b7280;
}
.fc-event-popup-status-select {
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 3px;
  color: #e5e7eb;
  font-size: 11px;
  padding: 1px 4px;
  outline: none;
  cursor: pointer;
}
.fc-event-popup-status-select option {
  background: #1f2937;
  color: #e5e7eb;
}
.fc-event-popup-status-select:focus {
  border-color: #6b7280;
}

/* Estimated hours progress bar on calendar events */
.fc-event-estimate-bar {
  height: 4px;
  width: 100%;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 2px;
  margin-bottom: 0;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
}

/* FullCalendar — pagedone-inspired clean design */

/* Remove default FC borders and shadows */
.fc {
  --fc-border-color: var(--color-gray-200);
  --fc-today-bg-color: transparent;
  --fc-neutral-bg-color: var(--color-gray-50);
  --fc-page-bg-color: white;
}

/* Toolbar */
.fc .fc-toolbar {
  margin-bottom: 0.75rem !important;
  padding: 0 !important;
  gap: 0.5rem;
}
.fc .fc-toolbar .fc-button {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid var(--color-gray-200);
  background: white;
  color: var(--color-gray-900);
  border-radius: 0.5rem;
  box-shadow: none;
  transition: all 150ms;
}
.fc .fc-toolbar .fc-button:hover {
  background: var(--color-gray-50);
  border-color: var(--color-gray-300);
}
.fc .fc-toolbar .fc-button:focus {
  box-shadow: none;
  outline: none;
}
.fc .fc-toolbar .fc-button.fc-button-active {
  background: var(--color-gray-900);
  color: white;
  border-color: var(--color-gray-900);
}
.fc .fc-toolbar .fc-button-group {
  border-radius: 0.5rem;
  overflow: hidden;
}
.fc .fc-toolbar .fc-button-group .fc-button {
  border-radius: 0;
}
.fc .fc-toolbar .fc-button-group .fc-button:first-child {
  border-radius: 0.5rem 0 0 0.5rem;
}
.fc .fc-toolbar .fc-button-group .fc-button:last-child {
  border-radius: 0 0.5rem 0.5rem 0;
}
.fc .fc-toolbar-chunk:nth-child(2) {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
}

/* Grid & borders */
.fc .fc-scrollgrid {
  border: 1px solid var(--color-gray-200);
  border-radius: 0.75rem;
  overflow: hidden;
}
.fc td, .fc th {
  border-color: var(--color-gray-200);
}

/* Column headers */
.fc .fc-col-header-cell {
  background: var(--color-gray-50);
  border-color: var(--color-gray-200);
  padding: 0;
}
.fc .fc-col-header-cell-cushion {
  color: var(--color-gray-500);
  font-weight: 500;
  font-size: 0.875rem;
  padding: 0.625rem 0;
  text-decoration: none;
}

/* Time slots */
.fc .fc-timegrid-slot {
  height: 32px;
  position: relative;
}
.fc .fc-timegrid-slot-label-cushion {
  color: var(--color-gray-400);
  font-size: 0.75rem;
  font-weight: 400;
}
/* Business hour labels darker */
.fc .fc-timegrid-slot[data-time="08:00:00"] .fc-timegrid-slot-label-cushion,
.fc .fc-timegrid-slot[data-time="09:00:00"] .fc-timegrid-slot-label-cushion,
.fc .fc-timegrid-slot[data-time="10:00:00"] .fc-timegrid-slot-label-cushion,
.fc .fc-timegrid-slot[data-time="11:00:00"] .fc-timegrid-slot-label-cushion,
.fc .fc-timegrid-slot[data-time="12:00:00"] .fc-timegrid-slot-label-cushion,
.fc .fc-timegrid-slot[data-time="13:00:00"] .fc-timegrid-slot-label-cushion,
.fc .fc-timegrid-slot[data-time="14:00:00"] .fc-timegrid-slot-label-cushion,
.fc .fc-timegrid-slot[data-time="15:00:00"] .fc-timegrid-slot-label-cushion,
.fc .fc-timegrid-slot[data-time="16:00:00"] .fc-timegrid-slot-label-cushion {
  color: var(--color-gray-700);
  font-weight: 500;
}

/* 15-min tick marks */
.fc .fc-timegrid-slot-lane::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-bottom: 1px dashed var(--color-gray-200);
  pointer-events: none;
}

/* 30-min borders (minor slots) — medium */
.fc .fc-timegrid-slot {
  border-color: var(--color-gray-200);
}

/* 1-hour borders (major slots) — darker */
.fc .fc-timegrid-slot-label-frame {
  position: relative;
}
.fc .fc-timegrid-slot[data-time$=":00:00"] {
  border-top-color: var(--color-gray-300);
}

/* Today column highlight — header only */
.fc .fc-day-today {
  background: white !important;
}
.fc .fc-col-header-cell.fc-day-today .fc-col-header-cell-cushion {
  color: var(--color-primary-700);
  font-weight: 600;
}

/* Now indicator */
.fc .fc-timegrid-now-indicator-line {
  border-color: var(--color-red-500);
  border-width: 2px;
}
.fc .fc-timegrid-now-indicator-arrow {
  border-color: var(--color-red-500);
}

/* Sidebar calendar — compact overrides */
.sidebar-calendar .fc {
  font-size: 0.6875rem;
}
.sidebar-calendar .fc .fc-toolbar {
  margin-bottom: 0.25rem;
  padding: 0 0.25rem !important;
  gap: 0.25rem;
}
.sidebar-calendar .fc .fc-toolbar .fc-button {
  padding: 0.25rem 0.5rem;
  font-size: 0.6875rem;
  border-radius: 0.375rem;
}
.sidebar-calendar .fc .fc-toolbar .fc-button-group .fc-button:first-child {
  border-radius: 0.375rem 0 0 0.375rem;
}
.sidebar-calendar .fc .fc-toolbar .fc-button-group .fc-button:last-child {
  border-radius: 0 0.375rem 0.375rem 0;
}
.sidebar-calendar .fc .fc-scrollgrid {
  border-radius: 0.5rem;
}
.sidebar-calendar .fc .fc-timegrid-slot {
  height: 32px;
}
.sidebar-calendar .fc .fc-col-header-cell-cushion {
  font-size: 0.6875rem;
  padding: 0.25rem;
}
.sidebar-calendar .fc .fc-timegrid-slot-label-cushion {
  font-size: 0.625rem;
}
.sidebar-calendar .fc .fc-event {
  font-size: 0.625rem;
  line-height: 1.2;
}
.sidebar-calendar .fc .fc-timegrid-cols {
  overflow: hidden;
}

/* Cross-calendar drag & drop highlight */
.cross-calendar-drop-target {
  outline: 2px dashed #99ff00;
  outline-offset: -2px;
  transition: outline 0.15s;
}

/* Cross-calendar drag preview (snaps to target grid) */
.cross-calendar-preview {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  border-radius: 4px;
  opacity: 0.6;
  color: white;
  font-size: 11px;
  line-height: 1.3;
  padding: 2px 4px;
  overflow: hidden;
  box-sizing: border-box;
}

/* ===== Custom Confirm Dialog ===== */
.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 10002;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
}
.confirm-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
}
.confirm-panel {
  position: relative;
  background: white;
  border-radius: 0.75rem;
  padding: 1.5rem;
  max-width: 24rem;
  width: 90%;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
}
.force-dark-disabled {
  .confirm-panel {
    background: #1f2937;
    color: white;
  }
}
.confirm-message {
  font-size: 0.875rem;
  line-height: 1.5;
  color: #374151;
  margin: 0 0 1.25rem 0;
  white-space: pre-line;
}
.force-dark-disabled {
  .confirm-message { color: #d1d5db; }
}
.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}
.confirm-btn-cancel {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: #e5e7eb;
  color: #374151;
}
.confirm-btn-cancel:hover { background: #d1d5db; }
.confirm-btn-primary {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: var(--color-primary-500, #99ff00);
  color: #4b5563;
}
.confirm-btn-primary:hover { background: var(--color-primary-600, #80d600); }
.confirm-btn-danger {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: #ef4444;
  color: white;
}
.confirm-btn-danger:hover { background: #dc2626; }

/* ===== Popup: Tag pills (colored by tag name) ===== */
.fc-event-popup-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.fc-event-popup-tag {
  display: inline-block;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 600;
  border-radius: 9999px;
  line-height: 1.5;
  background: #374151;
  color: #d1d5db;
}
.fc-event-popup-tag--feature { background: #065f46; color: #6ee7b7; }
.fc-event-popup-tag--bug { background: #7f1d1d; color: #fca5a5; }
.fc-event-popup-tag--chore { background: #3b3b00; color: #fde68a; }
.fc-event-popup-tag--backend { background: #1e3a5f; color: #93c5fd; }
.fc-event-popup-tag--frontend { background: #4c1d95; color: #c4b5fd; }
.fc-event-popup-tag--design { background: #701a75; color: #f0abfc; }
.fc-event-popup-tag--devops { background: #164e63; color: #67e8f9; }

/* ===== Popup: Description ===== */
.fc-event-popup-description {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid #374151;
  font-size: 11px;
  line-height: 1.4;
  color: #e5e7eb;
}
/* Force all children (including Action Text .trix-content) to inherit the light color */
.fc-event-popup-description,
.fc-event-popup-description * {
  color: inherit;
}
.fc-event-popup-description p { margin: 0 0 4px; }
.fc-event-popup-description ul,
.fc-event-popup-description ol { margin: 0 0 4px; padding-left: 16px; }
.fc-event-popup-description li { margin-bottom: 2px; }
.fc-event-popup-description strong { color: #f9fafb; }
.fc-event-popup-description a { color: #60a5fa !important; text-decoration: underline; }
.fc-event-popup-description h1,
.fc-event-popup-description h2,
.fc-event-popup-description h3 {
  font-size: 12px;
  font-weight: 600;
  color: #f9fafb;
  margin: 4px 0 2px;
}
.fc-event-popup-description blockquote {
  border-left-color: #4b5563;
}
.fc-event-popup-description pre {
  background-color: #111827;
  color: #d1d5db;
}
.fc-event-popup-description .attachment--file {
  color: #e5e7eb;
  border-color: #4b5563;
}

/* ===== Popup: File list ===== */
.fc-event-popup-files {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid #374151;
}
.fc-event-popup-file {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  color: #93c5fd;
  text-decoration: none;
  font-size: 11px;
  cursor: pointer;
}
.fc-event-popup-file:hover {
  color: #60a5fa;
}
.fc-event-popup-file svg {
  flex-shrink: 0;
  color: #6b7280;
}
.fc-event-popup-file-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fc-event-popup-file-size {
  flex-shrink: 0;
  color: #6b7280;
  font-size: 10px;
}

/* ===== Tooltip: Tag pills (small, neutral) ===== */
.fc-event-tooltip-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 4px;
}
.fc-event-tooltip-tag {
  display: inline-block;
  padding: 0 5px;
  font-size: 10px;
  font-weight: 500;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.15);
  color: #d1d5db;
  line-height: 1.5;
}

/* ===== Tooltip: Description excerpt (2-line clamped) ===== */
.fc-event-tooltip-desc {
  margin-top: 4px;
  font-size: 11px;
  color: #9ca3af;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

/* @mention prompt — dark theme override for lexxy built-in prompt */
.lexxy-prompt-menu {
  background: #1f2937;
  border-radius: 8px;
  padding: 4px;
  min-inline-size: 220px;
  max-inline-size: 300px;
  max-block-size: 240px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  z-index: 10003;
  color: #e5e7eb;
}

.lexxy-prompt-menu__item {
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  color: #e5e7eb;
  font-size: 13px;
}

.lexxy-prompt-menu__item:hover,
.lexxy-prompt-menu__item[aria-selected] {
  background: rgba(255, 255, 255, 0.1);
}

.lexxy-prompt-menu__item--empty {
  color: #9ca3af;
}
