/* kalender-ai.css — NL bar, response cards, slot suggestions, study plan (deduplicated) */
/* Auto-split from kalender.css + kalender-ai.css — 1365 lines */

/* kalender-ai.css — AI NL input bar & response cards
   Cards-only design — no chat bubbles. Cards rise from the NL bar.
   Palette: accent var(--color-primary), text #384551, borders #e5e7eb
   Font: Nunito Sans (inherited via --font-family) */


/* ════════════════════════════════════════════
   DESIGN TOKENS
   ════════════════════════════════════════════ */

/* Legacy --nl-* tokens removed — now using central design tokens from variables.css */


/* ════════════════════════════════════════════
   KEYFRAMES
   ════════════════════════════════════════════ */

/* Card entrance — slide up + fade in */
@keyframes nl-card-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Card exit — slide down + fade out */
@keyframes nl-card-exit {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(8px);
  }
}


/* Hint tag pop-in */
@keyframes nl-hint-in {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

/* Mic green glow pulse (active recording) */
@keyframes nl-mic-pulse {
  0%, 100% { filter: drop-shadow(0 0 3px rgba(34, 197, 94, 0.4)); }
  50%      { filter: drop-shadow(0 0 6px rgba(34, 197, 94, 0.6)); }
}

/* Mic icon scale pulse */


/* Mic spinner rotation */
@keyframes nl-mic-spin {
  to { transform: rotate(360deg); }
}

/* Loading shimmer — gentle pulsing dot */
@keyframes nl-shimmer-pulse {
  50%      { transform: scale(1.15); opacity: 1; }
}

/* Loading shimmer ring — expanding fade */
@keyframes nl-shimmer-ring {
  0%, 100% { transform: scale(1); opacity: 0.4; }
  50%      { transform: scale(1.3); opacity: 0; }
}

/* Shimmer sweep for skeleton loading */
@keyframes nl-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Listening border pulse — green glow on bar when mic is active */


/* Undo toast entrance */
@keyframes nl-toast-enter {
  from {
    opacity: 0;
    transform: translate(-50%, 12px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* Undo toast exit */
@keyframes nl-toast-exit {
  from {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  to {
    opacity: 0;
    transform: translate(-50%, 12px);
  }
}

/* ════════════════════════════════════════════
   NL INPUT BAR — "Din sekretaer"
   ════════════════════════════════════════════ */

.nl-bar {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  width: min(680px, calc(100% - 48px));
  padding: 0;
}

.nl-bar-label {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-secondary);
  opacity: 0.45;
  margin-top: 5px;
  letter-spacing: 0.3px;
  pointer-events: none;
}


/* ── Input pill ── */

.nl-bar-inner {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  padding: 6px 16px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.10),
    0 2px 8px rgba(0, 0, 0, 0.04);
  transition: border-color 0.2s, box-shadow 0.2s;
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
}

/* Focused state — no border change, clean modern look */
.nl-bar-inner:focus-within {
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.06),
    0 1px 4px rgba(0, 0, 0, 0.04);
}

/* Listening state — removed bar glow, icon-only */

.nl-bar-icon {
  flex-shrink: 0;
  color: rgb(19, 19, 19);
  opacity: 0.5;
  margin-right: 12px;
  width: 20px;
  height: 20px;
  transition: opacity 0.2s, transform 0.2s;
}

.nl-bar-inner:focus-within .nl-bar-icon {
  opacity: 0.85;
  transform: scale(1.06);
}

/* ── Breathing Constellation — 3 async dots, never sync ── */
@keyframes nl-breathe-1 {
  0%, 100% { transform: translate(0, 0) scale(1);            opacity: 0.45; }
  50%      { transform: translate(0.6px, -0.8px) scale(1.35); opacity: 0.9; }
}
@keyframes nl-breathe-2 {
  0%, 100% { transform: translate(0, 0) scale(1);             opacity: 0.35; }
  50%      { transform: translate(-0.7px, 0.5px) scale(1.45); opacity: 0.85; }
}
@keyframes nl-breathe-3 {
  0%, 100% { transform: translate(0, 0) scale(1);            opacity: 0.3; }
  50%      { transform: translate(0.5px, 0.7px) scale(1.5);  opacity: 0.8; }
}
.nl-star {
  will-change: transform, opacity;
}
.nl-star-1 { animation: nl-breathe-1 2.4s ease infinite; }
.nl-star-2 { animation: nl-breathe-2 3.1s ease infinite; }
.nl-star-3 { animation: nl-breathe-3 4.7s ease infinite; }

/* Focus — dots intensify + speed up */
.nl-bar-inner:focus-within .nl-star-1 { animation-duration: 1.2s; }
.nl-bar-inner:focus-within .nl-star-2 { animation-duration: 1.5s; }
.nl-bar-inner:focus-within .nl-star-3 { animation-duration: 1.8s; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .nl-star { animation: none !important; opacity: 0.5; }
}

.nl-bar-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-primary);
  padding: 12px 0;
  outline: none;
  min-width: 0;
  letter-spacing: -0.1px;
}

.nl-bar-input::placeholder {
  color: var(--color-text-secondary);
  opacity: 0.55;
  transition: opacity 0.3s;
}

.nl-bar-input:focus::placeholder {
  opacity: 0.3;
}

.nl-bar-input:focus-visible {
  outline: none;
}


/* ── Inline detected hints ── */

.nl-bar-hints {
  position: absolute;
  left: 0;
  top: 100%;
  margin-top: 6px;
  display: flex;
  gap: 5px;
  pointer-events: none;
}

.nl-hint-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 8px 2px 6px;
  border-radius: 6px;
  border-left: 2px solid transparent;
  white-space: nowrap;
  animation: nl-hint-in 0.2s ease;
  letter-spacing: 0.01em;
}

/* Dot indicator — replaces emoji */
.nl-hint-tag::before {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Date (primary indigo) ── */
.nl-hint-date {
  color: rgb(19, 19, 19);
  background: rgba(0, 0, 0, 0.07);
  border-left-color: rgba(19, 19, 19, 0.4);
}
.nl-hint-date::before { background: rgb(19, 19, 19); }

/* ── Time (teal accent) ── */
.nl-hint-time {
  color: #079aa2;
  background: rgba(7, 154, 162, 0.08);
  border-left-color: rgba(7, 154, 162, 0.4);
}
.nl-hint-time::before { background: #079aa2; }

/* ── Recurrence (purple) ── */
.nl-hint-recurrence {
  color: #7c3aed;
  background: rgba(124, 58, 237, 0.08);
  border-left-color: rgba(124, 58, 237, 0.4);
}
.nl-hint-recurrence::before { background: #7c3aed; }

/* ── Deadline (red urgency) ── */
.nl-hint-deadline {
  color: var(--color-error, #ff3e1d);
  background: rgba(255, 62, 29, 0.08);
  border-left-color: rgba(255, 62, 29, 0.4);
}
.nl-hint-deadline::before { background: var(--color-error, #ff3e1d); }

/* ── Dark mode hints ── */
[data-theme="dark"] .nl-hint-date {
  background: rgba(var(--color-primary-rgb), 0.14);
  border-left-color: rgba(19, 19, 19, 0.5);
}
[data-theme="dark"] .nl-hint-time {
  color: #0db8c1;
  background: rgba(7, 154, 162, 0.14);
  border-left-color: rgba(7, 154, 162, 0.5);
}
[data-theme="dark"] .nl-hint-recurrence {
  color: #a78bfa;
  background: rgba(124, 58, 237, 0.14);
  border-left-color: rgba(124, 58, 237, 0.5);
}
[data-theme="dark"] .nl-hint-deadline {
  color: #ff6b52;
  background: rgba(255, 62, 29, 0.14);
  border-left-color: rgba(255, 62, 29, 0.5);
}


/* ── Submit button ── */

.nl-bar-submit {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 10px;
  background: rgb(19, 19, 19);
  color: #fff;
  cursor: pointer;
  opacity: 0.25;
  transition: opacity 0.2s, transform 0.12s, background 0.2s;
  margin-left: 10px;
}

.nl-bar-submit.active {
  opacity: 1;
}

.nl-bar-submit.active:hover {
  background: rgb(50, 50, 48);
  transform: scale(1.04);
}

.nl-bar-submit:active {
  transform: scale(0.94);
}

.nl-bar-submit:focus-visible {
  outline: 2px solid rgba(31, 31, 30, 0.3);
  outline-offset: 2px;
}


/* ── Mic button ── */

.nl-bar-mic {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: 2px;
  transition: color 0.15s, background 0.15s;
}

.nl-bar-mic:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--color-text-primary);
}

/* Connecting state — spinner overlay */
.nl-bar-mic.nl-mic--connecting {
  pointer-events: none;
  position: relative;
}

.nl-bar-mic.nl-mic--connecting svg {
  opacity: 0.3;
}

.nl-bar-mic.nl-mic--connecting::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  top: 50%;
  left: 50%;
  margin-top: -9px;
  margin-left: -9px;
  border: 2px solid rgba(0, 0, 0, 0.08);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: nl-mic-spin 0.8s linear infinite;
}

/* Listening state — icon-only green glow */
.nl-bar-mic.nl-mic--listening {
  color: var(--color-success);
  background: transparent;
}

.nl-bar-mic.nl-mic--listening svg {
  stroke: #22c55e;
  filter: drop-shadow(0 0 4px rgba(34, 197, 94, 0.5));
  animation: nl-mic-pulse 2s ease infinite;
}

/* Error state — red flash + shake */
.nl-bar-mic.nl-mic--error {
  color: var(--color-error);
  animation: nl-mic-shake 0.3s ease;
}

@keyframes nl-mic-shake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-3px); }
  75%      { transform: translateX(3px); }
}


/* ── Shortcut badge ── */

.nl-bar-shortcut {
  position: absolute;
  right: 56px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--color-text-secondary);
  opacity: 0.4;
  pointer-events: none;
  font-family: monospace;
  background: var(--color-bg);
  padding: 1px 6px;
  border-radius: 6px;
  border: 0.5px solid rgba(0, 0, 0, 0.08);
}

.nl-bar-inner:focus-within .nl-bar-shortcut { display: none; }


/* ════════════════════════════════════════════
   RESPONSE CARDS — rise from the NL bar
   All cards share a base style. Differentiated by left accent color.
   ════════════════════════════════════════════ */

/* ── Shared card base ── */

.nl-result,
.nl-clarify,
.nl-answer,
.nl-query-results,
.nl-modify-confirm,
.nl-delete-confirm,
.nl-slot-suggestions,
.nl-study-plan {
  margin-bottom: 8px;
  background: var(--color-card);
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  border-left: 3px solid rgb(19, 19, 19);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  animation: nl-card-enter 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Generic entrance/exit animation classes (apply via JS) */
.nl-card-enter {
  animation: nl-card-enter 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.nl-card-exit {
  animation: nl-card-exit 0.15s ease both;
  pointer-events: none;
}


/* ════════════════════════════════════════════
   EVENT PREVIEW CARD — .nl-result
   Shows parsed event details with Gem/Annuller actions.
   ════════════════════════════════════════════ */

.nl-result {
  border-left-color: rgb(19, 19, 19);
}

/* Event title — prominent */
.nl-result-title {
  font-size: 15px;
  font-weight: 650;
  color: var(--color-text-primary);
  margin: 0 0 8px;
  line-height: 1.35;
}

/* Metadata rows — date, time, category as subtle info */
.nl-result-body {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin-bottom: 12px;
}

.nl-result-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nl-result-label {
  font-size: 11px;
  font-weight: 650;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nl-result-value {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--color-text-primary);
}

/* Action buttons row */
.nl-result-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nl-result-actions .btn {
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 18px;
  transition: all var(--transition);
  cursor: pointer;
}

/* "Gem" — primary blue accent button */
.nl-result-actions .btn-primary {
  background: rgb(19, 19, 19);
  border: 0.5px solid rgb(19, 19, 19);
  color: #fff;
}

.nl-result-actions .btn-primary:hover {
  background: rgb(50, 50, 48);
  border-color: rgb(50, 50, 48);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.nl-result-actions .btn-primary:active {
  transform: translateY(0) scale(0.98);
  box-shadow: none;
}

/* "Annuller" — ghost button */
.nl-result-actions .btn-ghost,
.nl-result-actions .btn-outline-secondary {
  background: transparent;
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  color: var(--color-text-secondary);
}

.nl-result-actions .btn-ghost:hover,
.nl-result-actions .btn-outline-secondary:hover {
  border-color: var(--color-text-secondary);
  color: var(--color-text-primary);
  background: var(--color-bg);
}

.nl-result-actions .btn-ghost:active,
.nl-result-actions .btn-outline-secondary:active {
  transform: scale(0.98);
}

/* Dismiss x button */
.nl-result-dismiss {
  margin-left: auto;
  background: none;
  border: none;
  font-size: 18px;
  color: var(--color-text-secondary);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  line-height: 1;
  transition: color 0.12s, background 0.12s;
}

.nl-result-dismiss:hover {
  color: var(--color-text-primary);
  background: rgba(0, 0, 0, 0.04);
}

.nl-result-dismiss:focus-visible {
  outline: 2px solid rgba(31, 31, 30, 0.3);
  outline-offset: 1px;
}

/* Priority badges (deadline urgency) */
.nl-priority-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 8px;
}

.nl-priority-badge[data-priority="1"] { color: var(--color-warning); background: var(--color-warning-light); }
.nl-priority-badge[data-priority="2"] { color: var(--color-warning); background: rgba(245, 158, 11, 0.10); }
.nl-priority-badge[data-priority="3"] { color: rgb(19, 19, 19); background: rgba(0, 0, 0, 0.08); }
.nl-priority-badge[data-priority="4"] { color: var(--color-text-secondary); background: rgba(156, 163, 175, 0.10); }

/* ════════════════════════════════════════════
   ANSWER CARD — .nl-answer
   Greeting/query response. Lighter, transient feel.
   Left blue accent border, dismiss button top-right.
   ════════════════════════════════════════════ */

.nl-answer {
  border-left-color: rgb(19, 19, 19);
  position: relative;
  padding-right: 36px; /* room for dismiss button */
}

.nl-answer-text {
  font-size: 14px;
  font-weight: 400;
  color: var(--color-text-primary);
  line-height: 1.6;
  margin: 0;
}

/* Dismiss x — positioned top-right */
.nl-answer-dismiss {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  font-size: 16px;
  color: var(--color-text-secondary);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  line-height: 1;
  opacity: 0.5;
  transition: color 0.12s, opacity 0.12s, background 0.12s;
}

.nl-answer-dismiss:hover {
  color: var(--color-text-primary);
  opacity: 1;
  background: rgba(0, 0, 0, 0.04);
}

.nl-answer-dismiss:focus-visible {
  outline: 2px solid rgba(31, 31, 30, 0.3);
  outline-offset: 1px;
}

/* Auto-fade-out state — applied via JS after timeout */
.nl-answer--dismissing {
  animation: nl-card-exit 0.3s ease both;
  pointer-events: none;
}


/* ════════════════════════════════════════════
   CLARIFICATION CARD — .nl-clarify
   Question text + option chips (pill-shaped, blue outline).
   ════════════════════════════════════════════ */

.nl-clarify {
  border-left-color: rgb(19, 19, 19);
}

.nl-clarify-question {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-primary);
  margin: 0 0 10px;
  line-height: 1.5;
}

/* Chip container */
.nl-clarify-suggestions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

/* Individual option chip — pill-shaped, blue outline */
.nl-clarify-chip {
  background: transparent;
  border: 0.5px solid rgba(0, 0, 0, 0.15);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-family);
  cursor: pointer;
  transition: all 0.12s;
  color: rgb(19, 19, 19);
  user-select: none;
}

.nl-clarify-chip:hover {
  border-color: rgb(19, 19, 19);
  color: #fff;
  background: rgb(19, 19, 19);
}

/* Active/pressed state — feel responsive */
.nl-clarify-chip:active {
  transform: scale(0.95);
  background: rgb(50, 50, 48);
  border-color: rgb(50, 50, 48);
  color: #fff;
}

.nl-clarify-chip:focus-visible {
  outline: 2px solid rgba(31, 31, 30, 0.3);
  outline-offset: 2px;
}

/* Free-text clarification input row */
.nl-clarify-input-row {
  display: flex;
  gap: 8px;
}

.nl-clarify-input {
  flex: 1;
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-family: var(--font-family);
  color: var(--color-text-primary);
  background: var(--color-card);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.nl-clarify-input:focus {
  box-shadow: none;
  outline: none;
}

.nl-clarify-input:focus-visible {
  outline: none;
}

.nl-clarify-input::placeholder {
  color: var(--color-text-secondary);
  opacity: 0.6;
}

.nl-clarify-input-row .nl-bar-submit {
  margin-left: 0;
}


/* ════════════════════════════════════════════
   LOADING STATE — .nl-loading
   Subtle shimmer pulse. Blue-tinted, not aggressive.
   ════════════════════════════════════════════ */

.nl-loading {
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--color-text-secondary);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  border-left: 3px solid transparent;
  position: relative;
  animation: nl-card-enter 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Animated gradient left accent (Apple Intelligence style) */
.nl-loading::before {
  content: '';
  position: absolute;
  left: -3px;
  top: -1px;
  bottom: -1px;
  width: 3px;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.10) 0%,
    rgba(0, 0, 0, 0.15) 50%,
    rgba(0, 0, 0, 0.10) 100%
  );
  background-size: 100% 200%;
  animation: nl-accent-flow 2s ease infinite;
}

@keyframes nl-accent-flow {
  0%, 100% { background-position: 0% 0%; }
  50% { background-position: 0% 100%; }
}

/* Three-dot wave (ChatGPT / iMessage pattern) */
.nl-loading-dots {
  display: flex;
  gap: 3px;
  align-items: center;
  flex-shrink: 0;
}

.nl-loading-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.15);
  animation: nl-dot-wave 1.4s ease infinite;
}
.nl-loading-dots span:nth-child(2) { animation-delay: 0.16s; }
.nl-loading-dots span:nth-child(3) { animation-delay: 0.32s; }

@keyframes nl-dot-wave {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.35; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* Staged message text with crossfade */
.nl-loading-text {
  flex: 1;
  transition: opacity 0.14s ease;
}

/* Elapsed time counter */
.nl-loading-elapsed {
  font-size: 11px;
  color: var(--color-text-tertiary, #9ca3af);
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  opacity: 0;
  animation: nl-card-enter 0.3s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards;
}

@media (prefers-reduced-motion: reduce) {
  .nl-loading-dots span {
    animation: nl-dot-fade 1.4s ease infinite;
  }
  @keyframes nl-dot-fade {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
  }
  .nl-loading::before { animation: none; }
}

/* ── Refinement mode: subtle hint, no colored border ── */
.nl-refine-mode::placeholder {
  color: var(--color-text-tertiary);
  font-style: italic;
}

/* ── Refine icon: gentle breathing pulse ── */
@keyframes refine-breathe {
  0%, 100% { opacity: 0.45; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(1.08); }
}
.nl-icon-refine-pulse {
  animation: refine-breathe 2.4s ease infinite;
}

/* ── Plan card skeleton loading (refinement) ── */
@keyframes skeleton-shimmer {
  0% { background-position: -200px 0; }
  100% { background-position: calc(200px + 100%) 0; }
}

.nl-plan-skeleton-overlay {
  padding: 16px 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nl-skeleton-row {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(0,0,0,0.04) 0%, rgba(0,0,0,0.08) 50%, rgba(0,0,0,0.04) 100%);
  background-size: 200px 100%;
  animation: skeleton-shimmer 1.6s ease infinite;
}

.nl-plan-skeleton-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding-top: 8px;
}

.nl-plan-skeleton-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(0,0,0,0.15);
  animation: nl-dot-wave 1.4s ease infinite;
}
.nl-plan-skeleton-dots span:nth-child(2) { animation-delay: 0.15s; }
.nl-plan-skeleton-dots span:nth-child(3) { animation-delay: 0.3s; }

/* Smooth transition when skeleton appears */
.nl-card-plan--skeleton .nl-plan-header {
  border-bottom-color: rgba(0,0,0,0.04);
}

/* Dark mode skeleton */
[data-theme="dark"] .nl-skeleton-row {
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 100%);
  background-size: 200px 100%;
  animation: skeleton-shimmer 1.6s ease infinite;
}
[data-theme="dark"] .nl-plan-skeleton-dots span {
  background: rgba(255,255,255,0.15);
}

/* ── Dark mode: loading card ── */
[data-theme="dark"] .nl-loading {
  background: var(--sk-bg, #1a1a2e);
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--color-text-tertiary);
}
[data-theme="dark"] .nl-loading-dots span {
  background: rgba(96, 165, 250, 0.5);
}
[data-theme="dark"] .nl-loading::before {
  background: linear-gradient(180deg, rgba(96,165,250,0.1) 0%, rgba(96,165,250,0.5) 50%, rgba(96,165,250,0.1) 100%);
  background-size: 100% 200%;
}
[data-theme="dark"] .nl-loading-elapsed {
  color: var(--color-text-secondary);
}

/* Generic shimmer utility class */
.nl-shimmer {
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.04) 25%,
    rgba(0, 0, 0, 0.07) 50%,
    rgba(0, 0, 0, 0.04) 75%
  );
  background-size: 200% 100%;
  animation: nl-shimmer 1.5s ease infinite;
  border-radius: 6px;
}


/* ════════════════════════════════════════════
   ERROR STATE
   ════════════════════════════════════════════ */

.nl-error {
  margin-bottom: 8px;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--color-error);
  background: var(--color-error-light);
  border-radius: var(--radius-md);
  border: 0.5px solid rgba(185, 28, 28, 0.12);
  border-left: 3px solid var(--color-error);
  animation: nl-card-enter 0.2s ease;
}


/* ════════════════════════════════════════════
   UNDO TOAST — .nl-undo-toast
   Fixed at bottom center, above the NL bar.
   Dark pill with "Fortryd" link in blue.
   ════════════════════════════════════════════ */

/* ── Unified toast — white glassmorphism (matches dokumenter/cal-undo-toast) ── */
.nl-undo-toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px) saturate(1.6);
  -webkit-backdrop-filter: blur(16px) saturate(1.6);
  color: var(--color-text-primary, rgb(19, 19, 19));
  font-size: 13.5px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 100px;
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 12px 24px -4px rgba(0, 0, 0, 0.12);
  animation: nl-toast-enter 0.25s cubic-bezier(0.16, 1, 0.3, 1) both;
  white-space: nowrap;
}

.nl-undo-toast-text {
  line-height: 1.3;
}

.nl-undo-toast-action {
  color: rgb(19, 19, 19);
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  background: transparent;
  border: none;
  font-size: inherit;
  font-family: inherit;
  padding: 4px 12px;
  border-radius: 100px;
  transition: background 0.15s ease;
}

.nl-undo-toast-action:hover {
  background: rgba(128, 128, 128, 0.09);
}

/* Exit animation — applied via JS before removal */
.nl-undo-toast--exiting {
  animation: nl-toast-exit 0.2s ease both;
  pointer-events: none;
}

/* ════════════════════════════════════════════
   SLOT SUGGESTIONS — AI scheduling results
   ════════════════════════════════════════════ */

.nl-slot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.nl-slot-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.nl-slot-dismiss {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--color-text-secondary);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  line-height: 1;
  transition: color 0.12s;
}

.nl-slot-dismiss:hover { color: var(--color-text-primary); }

.nl-slot-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.nl-slot-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 6px;
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  background: var(--color-bg);
  cursor: pointer;
  transition: all 0.12s;
  min-height: 44px;
}

.nl-slot-card:hover {
  border-color: rgba(0, 0, 0, 0.15);
  background: rgba(0, 0, 0, 0.08);
}

.nl-slot-card:active { transform: scale(0.97); }

.nl-slot-card:focus-visible {
  outline: 2px solid rgba(31, 31, 30, 0.3);
  outline-offset: 1px;
}

.nl-slot-day {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-primary);
  text-transform: capitalize;
}

.nl-slot-time {
  font-size: 12px;
  color: var(--color-text-secondary);
}

.nl-slot-score {
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 6px;
}

.nl-slot-score--good { background: var(--color-success-light); color: var(--color-success); }
.nl-slot-score--ok   { background: var(--color-warning-light); color: var(--color-warning); }
.nl-slot-score--low  { background: var(--color-error-light); color: var(--color-error); }

/* ════════════════════════════════════════════
   OVERLAY CARDS — query results, modify/delete confirm
   ════════════════════════════════════════════ */

.nl-overlay-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.nl-overlay-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nl-overlay-count {
  font-size: 11px;
  font-weight: 600;
  color: rgb(19, 19, 19);
  background: rgba(0, 0, 0, 0.08);
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.nl-overlay-dismiss {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--color-text-secondary);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.12s;
}

.nl-overlay-dismiss:hover { color: var(--color-text-primary); }

.nl-overlay-empty {
  font-size: 13px;
  color: var(--color-text-secondary);
  text-align: center;
  padding: 14px 0;
}

.nl-overlay-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: 260px;
  overflow-y: auto;
}

.nl-overlay-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.1s;
}

.nl-overlay-item:hover {
  background: rgba(0, 0, 0, 0.08);
}

.nl-overlay-list--delete .nl-overlay-item { cursor: default; }
.nl-overlay-list--delete .nl-overlay-item:hover {
  background: var(--color-error-light);
}

.nl-overlay-item-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.nl-overlay-item-title {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-primary);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nl-overlay-item-date {
  font-size: 12px;
  color: var(--color-text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}

.nl-overlay-more {
  font-size: 12px;
  color: var(--color-text-secondary);
  text-align: center;
  padding: 6px 0;
}

/* Modify confirm — change rows */
.nl-overlay-changes {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 10px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 6px;
}

.nl-overlay-change-row {
  font-size: 13px;
  color: var(--color-text-primary);
  font-weight: 500;
}

/* Multi-match picker */
.nl-overlay-picker { margin-bottom: 10px; }

.nl-overlay-picker-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 5px;
}

.nl-overlay-picker-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 6px 10px;
  border: 0.5px solid transparent;
  border-radius: 6px;
  background: none;
  font-size: 13px;
  font-family: var(--font-family);
  color: var(--color-text-primary);
  cursor: pointer;
  transition: all 0.1s;
  margin-bottom: 2px;
}

.nl-overlay-picker-btn:hover {
  background: rgba(0, 0, 0, 0.08);
}

.nl-overlay-picker-btn.active {
  border-color: rgba(0, 0, 0, 0.15);
  background: rgba(0, 0, 0, 0.08);
}

/* Actions row */
.nl-overlay-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.nl-overlay-actions .btn {
  min-height: 34px;
  padding: 5px 14px;
  font-size: 13px;
  border-radius: 8px;
}


/* ════════════════════════════════════════════
   QUICK ACTION CHIPS
   ════════════════════════════════════════════ */

.nl-bar-quick-actions {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 6px;
}

.nl-quick-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: rgba(0, 0, 0, 0.08);
  border: 0.5px solid rgba(0, 0, 0, 0.15);
  border-radius: 20px;
  padding: 3px 10px;
  cursor: pointer;
  transition: all 0.12s;
}

.nl-quick-chip:hover {
  background: rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.15);
  color: rgb(19, 19, 19);
}

.nl-quick-chip:active {
  transform: scale(0.96);
}

.nl-quick-chip svg { flex-shrink: 0; }

/* ════════════════════════════════════════════
   MULTI-EVENT CONFIRMATION CARD
   Rendered by nl-input.js for batch event creation.
   ════════════════════════════════════════════ */

@keyframes nlCardSlideUp {
  0%   { opacity: 0; transform: translateY(16px) scale(0.98); }
  60%  { opacity: 1; transform: translateY(-2px) scale(1.005); }
  80%  { transform: translateY(1px) scale(1); }
}

.nl-card-multi {
  background: var(--sk-bg, #fff);
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  padding: 16px;
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.08),
    0 1px 4px rgba(0, 0, 0, 0.04);
  max-width: 420px;
  width: 100%;
  margin-bottom: 12px;
  animation: nlCardSlideUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nl-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  padding-bottom: 12px;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
  font-size: 14px;
  font-weight: 600;
  color: var(--sk-text, #1a1a1a);
}

.nl-card-header svg {
  width: 18px;
  height: 18px;
  color: rgb(19, 19, 19);
  flex-shrink: 0;
}

.nl-card-summary {
  /* Summary text — grows to push handle + close to the right */
  flex: 1;
  min-width: 0;
}

/* ── Drag handle — grip dots between summary and close ── */
.nl-card-drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: var(--color-text-tertiary, #9ca3af);
  cursor: grab;
  flex-shrink: 0;
  transition: background 0.12s, color 0.12s;
  -webkit-user-select: none;
  user-select: none;
}

.nl-card-drag-handle:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--color-text-secondary, #6b7280);
}

.nl-card-drag-handle:active {
  cursor: grabbing;
}

.nl-card-drag-handle svg {
  width: 16px;
  height: 16px;
  color: inherit;
}

/* Card in dragging state */
.nl-card--dragging {
  cursor: grabbing;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.08);
  opacity: 0.95;
  transition: box-shadow 0.15s ease, opacity 0.15s ease;
}

.nl-card--dragging .nl-card-drag-handle {
  cursor: grabbing;
  background: rgba(0, 0, 0, 0.06);
  color: rgb(19, 19, 19);
}

.nl-card-events {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 14px;
  max-height: 240px;
  overflow-y: auto;
}

.nl-card-event-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--sk-bg-subtle, #FAFAF8);
  border-radius: 8px;
  font-size: 13px;
  transition: background 0.15s;
}

.nl-card-event-row + .nl-card-event-row {
  border-top: 0.5px solid rgba(0, 0, 0, 0.04);
  margin-top: 2px;
}

.nl-card-event-row:hover {
  background: rgba(0, 0, 0, 0.04);
}

.nl-card-event-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--cat-personlig, rgb(19, 19, 19));
}

.nl-card-event-title {
  font-weight: 500;
  color: var(--sk-text, #1a1a1a);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nl-card-event-time {
  color: var(--sk-text-secondary, #6b7280);
  font-size: 12px;
  white-space: nowrap;
}

.nl-card-event-duration {
  color: var(--sk-text-tertiary, #9ca3af);
  font-size: 11px;
  white-space: nowrap;
}

.nl-card-actions {
  display: flex;
  gap: 8px;
  padding-top: 12px;
  border-top: 0.5px solid rgba(0, 0, 0, 0.08);
}

.nl-btn {
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
}

.nl-btn:active {
  transform: scale(0.97);
}

.nl-btn-primary {
  background: rgb(19, 19, 19);
  color: #fff;
  flex: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.nl-btn-primary:hover {
  background: rgb(50, 50, 48);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.nl-btn-secondary {
  background: transparent;
  border: 0.5px solid var(--sk-border, #e5e7eb);
  border-radius: 10px;
  color: var(--sk-text-secondary, #6b7280);
}

.nl-btn-secondary:hover {
  background: var(--sk-bg-subtle, #f9fafb);
}

/* Danger button — branded pink for destructive actions (delete) */
.nl-btn-danger {
  background: #e24668;
  color: #fff;
  flex: 1;
  box-shadow: 0 2px 8px rgba(226, 70, 104, 0.25);
}

.nl-btn-danger:hover {
  background: #c93a5a;
  box-shadow: 0 4px 12px rgba(226, 70, 104, 0.35);
}


/* ── Multi-event card: Dark Mode ── */

[data-theme="dark"] .nl-card-multi {
  background: var(--sk-bg, #1a1a2e);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.4),
    0 1px 4px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .nl-card-header {
  color: #e5e7eb;
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .nl-card-header svg {
  color: rgb(19, 19, 19);
}

[data-theme="dark"] .nl-card-drag-handle {
  color: var(--color-text-secondary);
}
[data-theme="dark"] .nl-card-drag-handle:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #e5e7eb;
}
[data-theme="dark"] .nl-card--dragging {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.3);
}
[data-theme="dark"] .nl-card--dragging .nl-card-drag-handle {
  background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .nl-card-event-row {
  background: rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .nl-card-event-row + .nl-card-event-row {
  border-top-color: rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .nl-card-actions {
  border-top-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .nl-card-event-row:hover {
  background: rgba(var(--color-primary-rgb), 0.10);
}

[data-theme="dark"] .nl-card-event-title {
  color: #e5e7eb;
}

[data-theme="dark"] .nl-card-event-time {
  color: var(--color-text-tertiary);
}

[data-theme="dark"] .nl-card-event-duration {
  color: var(--color-text-secondary);
}

[data-theme="dark"] .nl-btn-primary {
  background: var(--color-text-primary);
  color: rgb(19, 19, 19);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .nl-btn-primary:hover {
  background: #d4d3ce;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .nl-btn-secondary {
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--color-text-tertiary);
  background: transparent;
}

[data-theme="dark"] .nl-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #e5e7eb;
}

[data-theme="dark"] .nl-btn-danger {
  background: #e24668;
  box-shadow: 0 2px 8px rgba(226, 70, 104, 0.3);
}

[data-theme="dark"] .nl-btn-danger:hover {
  background: #e95b7a;
  box-shadow: 0 4px 12px rgba(226, 70, 104, 0.4);
}

/* 07-plan-card.css — Grouped plan preview card for AI planner
   Shows categorized events with checkboxes, conflict warnings,
   collapsible groups, and batch create/cancel actions.
   Depends on: kalender-ai.css design tokens + nlCardSlideUp keyframe */


/* ════════════════════════════════════════════
   KEYFRAMES — plan card specific
   ════════════════════════════════════════════ */

/* Event row removal — slide right + fade out */
@keyframes nl-plan-row-remove {
  0%   { opacity: 1; transform: translateX(0); max-height: 60px; }
  60%  { opacity: 0; transform: translateX(40px); max-height: 60px; }
  100% { opacity: 0; transform: translateX(40px); max-height: 0; padding-top: 0; padding-bottom: 0; margin-top: 0; }
}

/* Event row entrance — staggered fade-in from left */
@keyframes nl-plan-row-enter {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Conflict pulse — subtle yellow flash */
@keyframes nl-plan-conflict-pulse {
  0%, 100% { box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.25); }
  50%      { box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.5); }
}


/* ════════════════════════════════════════════
   CARD SHELL — .nl-card-plan
   ════════════════════════════════════════════ */

.nl-card-plan {
  background: var(--sk-bg, #fff);
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  padding: 0;
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.08),
    0 1px 4px rgba(0, 0, 0, 0.04);
  max-width: 460px;
  width: 100%;
  margin-bottom: 12px;
  animation: nlCardSlideUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ═══ DELETE CARD SHELL — .nl-card-delete ═══ */
.nl-card-delete {
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-width: 460px;
}
.nl-card-delete .nl-plan-header {
  background: var(--color-bg);
  border-radius: 12px 12px 0 0;
}
.nl-card-delete .nl-plan-groups {
  padding: 4px 0;
}
.nl-card-delete .nl-plan-event-row {
  padding: 10px 16px;
}
.nl-card-delete .nl-plan-actions {
  padding: 12px 16px 16px;
}
.nl-card-delete.is-dragging {
  z-index: 10000;
  box-shadow: 0 16px 56px rgba(0,0,0,0.15), 0 4px 16px rgba(0,0,0,0.10);
  opacity: 0.95;
}
[data-theme="dark"] .nl-card-delete .nl-plan-header {
  background: var(--sk-bg, #1a1a2e);
}

/* ═══ Delete highlight on existing calendar events ═══ */
.fc-event--pending-delete {
  opacity: 0.55;
  background: rgba(239, 68, 68, 0.15) !important;
  border-color: rgba(239, 68, 68, 0.4);
  transition: opacity 0.3s, background 0.3s;
}
.fc-event--pending-delete .fc-event-title,
.fc-event--pending-delete .fc-event-main {
  text-decoration: line-through;
}
[data-theme="dark"] .fc-event--pending-delete {
  background: rgba(239, 68, 68, 0.2) !important;
  border-color: rgba(239, 68, 68, 0.35);
}


/* ════════════════════════════════════════════
   PLAN HEADER — .nl-plan-header
   Compact: count + dismiss button. No prose, no chips.
   ════════════════════════════════════════════ */

.nl-plan-header {
  background: var(--color-bg);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 12px 10px 14px;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}
.nl-plan-header:active {
  cursor: grabbing;
}

.nl-plan-header-count {
  font-size: 14px;
  font-weight: 650;
  color: var(--sk-text, #1a1a1a);
  letter-spacing: -0.01em;
  flex: 1;
}

.nl-plan-header-dismiss {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  color: var(--sk-text-tertiary, #9ca3af);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  flex-shrink: 0;
}
.nl-plan-header-dismiss:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--sk-text, #1a1a1a);
}

/* ── Drag grip icon (visual hint, not the only click target) ── */
.nl-plan-drag-grip {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  flex-shrink: 0;
  pointer-events: none; /* clicks pass through to header */
}

/* ── Card in dragging state ── */
.nl-card-plan.is-dragging {
  z-index: 10000;
  box-shadow:
    0 16px 56px rgba(0, 0, 0, 0.22),
    0 4px 16px rgba(0, 0, 0, 0.10);
  transition: box-shadow 0.2s ease;
  pointer-events: auto;
  opacity: 0.95;
}
.nl-card-plan.is-dragging .nl-plan-header {
  background: var(--color-bg);
  cursor: grabbing;
}
.nl-card-plan.is-dragging .nl-plan-drag-grip svg {
  opacity: 0.6;
}

/* Legacy: hide old chip markup if any */
.nl-plan-summary, .nl-plan-chips, .nl-plan-chip { display: none; }


/* ════════════════════════════════════════════
   SCROLLABLE GROUPS CONTAINER — .nl-plan-groups
   ════════════════════════════════════════════ */

.nl-plan-groups {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 0;

  /* Default max-height for moderate plans (6-10 events) */
  max-height: 360px;

  /* Smooth inertia scrolling on iOS */
  -webkit-overflow-scrolling: touch;
}

/* Taller container for large plans (11+ events) — toggled via JS class */
.nl-plan-groups--tall {
  max-height: 420px;
}

/* Subtle scroll shadow hints */
.nl-plan-groups::before,
.nl-plan-groups::after {
  content: '';
  display: block;
  height: 0;
  flex-shrink: 0;
}

/* Custom scrollbar — thin, unobtrusive */
.nl-plan-groups::-webkit-scrollbar {
  width: 5px;
}

.nl-plan-groups::-webkit-scrollbar-track {
  background: transparent;
}

.nl-plan-groups::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 10px;
}

.nl-plan-groups::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.2);
}


/* ════════════════════════════════════════════
   CATEGORY GROUP — .nl-plan-group
   ════════════════════════════════════════════ */

.nl-plan-group {
  margin: 0 8px;
  border-radius: 10px;
  overflow: hidden;
  transition: margin 0.2s ease;
}

.nl-plan-group + .nl-plan-group {
  margin-top: 2px;
  border-top: 0.5px solid rgba(0, 0, 0, 0.08);
  padding-top: 2px;
}

/* ── Group header — subtle inline label, no heavy background ── */

.nl-plan-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 4px 16px;
  cursor: pointer;
  user-select: none;
  border-radius: 0;
  transition: background 0.12s;
  position: relative;
  min-height: 36px;
  border-left: none;
  background: transparent;
}

.nl-plan-group-header:hover {
  background: rgba(0, 0, 0, 0.02);
}

.nl-plan-group-header:active {
  background: rgba(0, 0, 0, 0.04);
}

/* Collapse/expand chevron */
.nl-plan-group-chevron {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--sk-text-secondary, #6b7280);
  transition: transform 0.2s ease;
  transform: rotate(0deg);
}

/* Rotated when collapsed */
.nl-plan-group.collapsed .nl-plan-group-chevron {
  transform: rotate(-90deg);
}

/* Group label text — subtle uppercase */
.nl-plan-group-label {
  flex: 1;
  font-size: 11px;
  font-weight: 650;
  color: var(--sk-text-secondary, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Count badge — small, colored */
.nl-plan-group-count {
  font-size: 10px;
  font-weight: 650;
  padding: 1px 7px;
  border-radius: 10px;
  flex-shrink: 0;
  line-height: 1.5;
  /* color + background set inline via JS for category color */
  color: var(--sk-text-secondary, #6b7280);
  background: rgba(0, 0, 0, 0.06);
}

/* ── Group body — smooth collapse transition ── */

.nl-plan-group-body {
  overflow: hidden;
  transition: max-height 0.25s ease, opacity 0.2s ease;
  opacity: 1;
  /* JS sets max-height for animation; fallback for non-JS */
  max-height: 1000px;
}

.nl-plan-group.collapsed .nl-plan-group-body {
  max-height: 0;
  opacity: 0;
}


/* ════════════════════════════════════════════
   EVENT ROW — .nl-plan-event-row
   Dot + title + date/time + ✕ remove. No checkbox.
   ════════════════════════════════════════════ */

.nl-plan-event-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 16px;
  font-size: 13px;
  transition: background 0.12s, opacity 0.25s, transform 0.2s;
  position: relative;
  min-height: 44px;
  animation: nl-plan-row-enter 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.nl-plan-event-row + .nl-plan-event-row {
  border-top: 0.5px solid rgba(0, 0, 0, 0.04);
}

.nl-plan-event-row:hover {
  background: rgba(0, 0, 0, 0.02);
}

/* ── Category dot ── */

.nl-plan-event-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  /* background set inline via JS */
}

/* ── Event title ── */

.nl-plan-event-title {
  flex: 1;
  font-weight: 600;
  font-size: 13px;
  color: var(--sk-text, #1a1a1a);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}

/* ── Date + time (plain text, no pill) ── */

.nl-plan-event-date {
  font-size: 12px;
  color: var(--sk-text-secondary, #6b7280);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Remove button (✕) — replaces checkbox + delete ── */

.nl-plan-event-remove {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--sk-text-tertiary, #9ca3af);
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
  padding: 0;
  margin-left: 4px;
}

/* Show ✕ on row hover (desktop) or always on touch */
.nl-plan-event-row:hover .nl-plan-event-remove {
  opacity: 1;
}

@media (pointer: coarse) {
  .nl-plan-event-remove {
    opacity: 0.5;
    width: 28px;
    height: 28px;
    /* Invisible touch area extends beyond visual bounds */
    position: relative;
  }
  .nl-plan-event-remove::before {
    content: '';
    position: absolute;
    inset: -8px;
  }
  .nl-plan-event-row:hover .nl-plan-event-remove { opacity: 1; }
}

.nl-plan-event-remove:hover {
  color: #e24668;
  background: rgba(226, 70, 104, 0.1);
}

.nl-plan-event-remove:active {
  transform: scale(0.92);
}

.nl-plan-event-remove:focus-visible {
  opacity: 1;
  outline: 2px solid rgba(31, 31, 30, 0.3);
  outline-offset: 1px;
}

/* ── Row state: conflict — yellow warning ── */

.nl-plan-event-row.has-conflict {
  background: var(--color-warning-light);
  animation: nl-plan-conflict-pulse 2s ease 2;
}

.nl-plan-event-row.has-conflict .nl-plan-event-date {
  color: var(--color-warning);
}

/* ── Row removal animation ── */

.nl-plan-event-row.removing {
  animation: nl-plan-row-remove 0.3s ease forwards;
  pointer-events: none;
}

/* Legacy: hide old elements if present */
.nl-plan-checkbox, .nl-plan-date-chip, .nl-plan-event-duration, .nl-plan-event-delete {
  display: none;
}


/* ════════════════════════════════════════════
   CONFLICT BADGE — .nl-plan-conflict-badge
   Small inline warning on conflicting events.
   ════════════════════════════════════════════ */

.nl-plan-conflict-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--color-warning);
  background: var(--color-warning-light);
  padding: 2px 7px;
  border-radius: 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

.nl-plan-conflict-badge svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}


/* ════════════════════════════════════════════
   BOTTOM ACTION BAR — .nl-plan-actions
   Sticky at bottom. Primary "Opret valgte (N)" + "Annuller".
   ════════════════════════════════════════════ */

.nl-plan-actions {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 0.5px solid rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  background: var(--sk-bg, #fff);
  z-index: 2;
}

/* Primary: "Opret valgte (8)" */
.nl-plan-btn-create {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-family);
  cursor: pointer;
  background: rgb(19, 19, 19);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  min-height: 44px;
}

.nl-plan-btn-create:hover {
  background: rgb(50, 50, 48);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.nl-plan-btn-create:active {
  transform: scale(0.97);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.nl-plan-btn-create:focus-visible {
  outline: 2px solid rgba(31, 31, 30, 0.3);
  outline-offset: 2px;
}

/* Disabled state — when 0 checked */
.nl-plan-btn-create:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.nl-plan-btn-create:disabled:hover {
  transform: none;
  background: rgb(19, 19, 19);
}

/* Count badge inside button */
.nl-plan-btn-count {
  font-size: 12px;
  font-weight: 650;
  background: rgba(255, 255, 255, 0.25);
  padding: 1px 7px;
  border-radius: 8px;
  line-height: 1.4;
}

/* Secondary: "Annuller" */
.nl-plan-btn-cancel {
  padding: 10px 18px;
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-family);
  cursor: pointer;
  background: transparent;
  color: var(--sk-text-secondary, #6b7280);
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
  min-height: 44px;
}

.nl-plan-btn-cancel:hover {
  background: var(--color-bg);
  border-color: var(--sk-text-secondary, #6b7280);
  color: var(--sk-text, #1a1a1a);
}

.nl-plan-btn-cancel:active {
  transform: scale(0.97);
}

.nl-plan-btn-cancel:focus-visible {
  outline: 2px solid rgba(31, 31, 30, 0.3);
  outline-offset: 2px;
}


/* ════════════════════════════════════════════
   DARK MODE — [data-theme="dark"]
   ════════════════════════════════════════════ */

/* ── Card shell ── */
[data-theme="dark"] .nl-card-plan {
  background: var(--sk-bg, #1a1a2e);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.4),
    0 1px 4px rgba(0, 0, 0, 0.2);
}

/* ── Summary ── */
/* ── Header ── */
[data-theme="dark"] .nl-plan-header {
  background: var(--sk-bg, #1a1a2e);
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .nl-plan-header-count {
  color: #e5e7eb;
}

[data-theme="dark"] .nl-plan-header-dismiss {
  color: var(--color-text-secondary);
}
[data-theme="dark"] .nl-plan-header-dismiss:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #e5e7eb;
}

[data-theme="dark"] .nl-plan-drag-grip svg {
  opacity: 0.25;
}
[data-theme="dark"] .nl-card-plan.is-dragging {
  box-shadow:
    0 16px 56px rgba(0, 0, 0, 0.6),
    0 4px 16px rgba(0, 0, 0, 0.35);
  opacity: 0.95;
}

/* ── Scrollbar ── */
[data-theme="dark"] .nl-plan-groups::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .nl-plan-groups::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ── Group header ── */
[data-theme="dark"] .nl-plan-group-header:hover {
  filter: brightness(1.08);
}

[data-theme="dark"] .nl-plan-group-header:active {
  filter: brightness(1.12);
}

[data-theme="dark"] .nl-plan-group-chevron {
  color: var(--color-text-tertiary);
}

[data-theme="dark"] .nl-plan-group-label {
  color: #e5e7eb;
}

/* ── Event row ── */
[data-theme="dark"] .nl-plan-event-row + .nl-plan-event-row {
  border-top-color: rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .nl-plan-event-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .nl-plan-event-title {
  color: #e5e7eb;
}

[data-theme="dark"] .nl-plan-event-date {
  color: var(--color-text-tertiary);
}

/* ── Remove button ── */
[data-theme="dark"] .nl-plan-event-remove {
  color: var(--color-text-secondary);
}

[data-theme="dark"] .nl-plan-event-remove:hover {
  color: #f87171;
  background: rgba(185, 28, 28, 0.15);
}

/* ── Conflict state ── */
[data-theme="dark"] .nl-plan-event-row.has-conflict {
  background: rgba(245, 158, 11, 0.08);
}

[data-theme="dark"] .nl-plan-event-row.has-conflict .nl-plan-event-date {
  color: #f59e0b;
}

/* ── Conflict badge ── */
[data-theme="dark"] .nl-plan-conflict-badge {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
}

/* ── Actions bar ── */
[data-theme="dark"] .nl-plan-actions {
  border-top-color: rgba(255, 255, 255, 0.06);
  background: var(--sk-bg, #1a1a2e);
}

[data-theme="dark"] .nl-plan-btn-create {
  background: var(--color-text-primary);
  color: rgb(19, 19, 19);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .nl-plan-btn-create:hover {
  background: #d4d3ce;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .nl-plan-btn-cancel {
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--color-text-tertiary);
  background: transparent;
}

[data-theme="dark"] .nl-plan-btn-cancel:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #e5e7eb;
  border-color: rgba(255, 255, 255, 0.15);
}


/* ════════════════════════════════════════════
   MOBILE RESPONSIVE — max-width: 768px
   ════════════════════════════════════════════ */

@media (max-width: 768px) {

  .nl-card-plan {
    max-width: 100%;
    border-radius: 12px;
  }

  .nl-plan-groups {
    max-height: 50vh;
  }

  .nl-plan-groups--tall {
    max-height: 50vh;
  }

  .nl-plan-summary {
    padding: 14px 14px 10px;
  }

  .nl-plan-chips {
    gap: 5px;
  }

  .nl-plan-chip {
    font-size: 11px;
    padding: 3px 8px;
  }

  .nl-plan-group {
    margin: 0 6px;
  }

  .nl-plan-group-header {
    padding: 8px 10px 8px 10px;
  }

  .nl-plan-event-row {
    padding: 8px 8px 8px 14px;
    gap: 8px;
  }

  /* Always show remove button on touch devices */
  .nl-plan-event-remove {
    opacity: 0.5;
  }

  .nl-plan-event-date {
    font-size: 11px;
  }

  .nl-plan-actions {
    padding: 10px 14px;
  }

  .nl-plan-btn-create,
  .nl-plan-btn-cancel {
    padding: 10px 14px;
    font-size: 13px;
  }
}

/* Extra-small: 375px and below */
@media (max-width: 400px) {

  .nl-plan-header-count {
    font-size: 13px;
  }

  .nl-plan-group-label {
    font-size: 12px;
  }

  .nl-plan-event-title {
    font-size: 12px;
  }

  .nl-plan-event-row {
    gap: 6px;
    padding-left: 10px;
  }

  .nl-plan-event-date {
    font-size: 10.5px;
  }
}


/* ════════════════════════════════════════════
   ACCESSIBILITY — forced colors, reduced motion
   ════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  .nl-card-plan {
    animation: none;
  }

  .nl-plan-event-row {
    animation: none;
  }

  .nl-plan-event-row.removing {
    animation: none;
    opacity: 0;
  }

  .nl-plan-event-row.has-conflict {
    animation: none;
  }

  .nl-plan-group-body {
    transition: none;
  }

  .nl-plan-group-chevron {
    transition: none;
  }
}

@media (forced-colors: active) {
  .nl-plan-checkbox {
    border: 2px solid ButtonText;
  }

  .nl-plan-checkbox:checked {
    background: Highlight;
    border-color: Highlight;
  }

  .nl-plan-date-chip {
    border: 0.5px solid ButtonText;
  }

  .nl-plan-conflict-badge {
    border: 0.5px solid Mark;
  }

  .nl-plan-group-header {
    border-left-color: ButtonText;
  }
}


/* ════════════════════════════════════════════
   GHOST EVENT PREVIEW — semi-transparent calendar events
   ════════════════════════════════════════════ */

.fc-event--ghost {
  opacity: 0.45;
  border-style: dashed !important;
  border-width: 2px !important;
  pointer-events: none;
  cursor: default;
  animation: ghostPulse 2s ease infinite;
  position: relative;
}

.fc-event--ghost::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 4px,
    rgba(255, 255, 255, 0.12) 4px,
    rgba(255, 255, 255, 0.12) 8px
  );
  border-radius: inherit;
  pointer-events: none;
}

@keyframes ghostPulse {
  0%, 100% { opacity: 0.45; }
  50%      { opacity: 0.30; }
}

.fc-timegrid-event.fc-event--ghost {
  border-left-width: 3px !important;
  border-left-style: dashed !important;
}

.fc-daygrid-event.fc-event--ghost {
  border-radius: 6px;
  opacity: 0.55;
}
/* Dot-indicator in month view needs to be visible */
.fc-daygrid-dot-event.fc-event--ghost .fc-daygrid-event-dot {
  border-color: inherit;
  opacity: 0.7;
}

.fc-event--ghost .fc-event-main {
  pointer-events: none;
}

[data-theme="dark"] .fc-event--ghost,
.dark-mode .fc-event--ghost {
  opacity: 0.40;
}

[data-theme="dark"] .fc-event--ghost::after,
.dark-mode .fc-event--ghost::after {
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 4px,
    rgba(255, 255, 255, 0.08) 4px,
    rgba(255, 255, 255, 0.08) 8px
  );
}

.fc-event--ghost .fc-event-title::after {
  content: ' (udkast)';
  font-size: 0.75em;
  opacity: 0.7;
  font-style: italic;
}

@media (prefers-reduced-motion: reduce) {
  .fc-event--ghost {
    animation: none;
  }
}


/* ════════════════════════════════════════════
   DATE CHIP POPOVER — inline date/time picker
   ════════════════════════════════════════════ */

.nl-datechip-popover {
  position: fixed;
  z-index: 9999;
  width: 200px;
  background: var(--sk-bg, #fff);
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  box-shadow:
    0 8px 30px rgba(0, 0, 0, 0.12),
    0 2px 8px rgba(0, 0, 0, 0.06);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  pointer-events: none;
  font-family: var(--font-family, 'Nunito Sans', sans-serif);
}

.nl-datechip-popover.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.nl-datechip-popover::before {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 10px;
  background: var(--sk-bg, #fff);
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  border-right: none;
  border-bottom: none;
}

.nl-datechip-popover.arrow-top::before {
  top: -6px;
  transform: translateX(-50%) rotate(45deg);
}

.nl-datechip-popover.arrow-bottom::before {
  bottom: -6px;
  top: auto;
  transform: translateX(-50%) rotate(225deg);
}

.nl-datechip-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--sk-text-secondary, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin: 0;
  line-height: 1;
}

.nl-datechip-input {
  width: 100%;
  padding: 7px 10px;
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-family, 'Nunito Sans', sans-serif);
  color: var(--sk-text, #1a1a1a);
  background: var(--color-bg, rgba(0, 0, 0, 0.02));
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
  min-height: 36px;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}

.nl-datechip-input:focus {
  border-color: rgba(0, 0, 0, 0.15);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.08);
}

.nl-datechip-input:focus-visible {
  outline: none;
}

.nl-datechip-time-select {
  width: 100%;
  padding: 7px 10px;
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-family, 'Nunito Sans', sans-serif);
  color: var(--sk-text, #1a1a1a);
  background: var(--color-bg, rgba(0, 0, 0, 0.02));
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
  min-height: 36px;
  box-sizing: border-box;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 28px;
}

.nl-datechip-time-select:focus {
  border-color: rgba(0, 0, 0, 0.15);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.08);
}

.nl-datechip-time-select:focus-visible {
  outline: none;
}

.nl-datechip-allday-row {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}

.nl-datechip-allday-checkbox {
  width: 16px;
  height: 16px;
  border-radius: 6px;
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  cursor: pointer;
  accent-color: var(--color-primary);
}

.nl-datechip-allday-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--sk-text-secondary, #6b7280);
  cursor: pointer;
}

.nl-datechip-ok {
  width: 100%;
  padding: 8px 0;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-family, 'Nunito Sans', sans-serif);
  cursor: pointer;
  background: rgb(19, 19, 19);
  color: #fff;
  transition: background 0.12s, transform 0.1s;
  min-height: 36px;
  margin-top: 2px;
}

.nl-datechip-ok:hover {
  background: rgb(50, 50, 48);
}

.nl-datechip-ok:active {
  transform: scale(0.97);
}

.nl-datechip-ok:focus-visible {
  outline: 2px solid rgba(31, 31, 30, 0.3);
  outline-offset: 2px;
}

.nl-plan-date-chip.chip-editing {
  background: rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.15);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.07);
}

/* Dark mode */
[data-theme="dark"] .nl-datechip-popover {
  background: var(--sk-bg, #1e1e2e);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .nl-datechip-popover::before {
  background: var(--sk-bg, #1e1e2e);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .nl-datechip-label { color: var(--color-text-tertiary); }

[data-theme="dark"] .nl-datechip-input {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: #e5e7eb;
}

[data-theme="dark"] .nl-datechip-time-select {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: #e5e7eb;
}

[data-theme="dark"] .nl-datechip-allday-checkbox { border-color: rgba(255, 255, 255, 0.15); }
[data-theme="dark"] .nl-datechip-allday-label { color: var(--color-text-tertiary); }

@media (max-width: 768px) {
  .nl-datechip-popover { width: 190px; padding: 10px; gap: 7px; }
  .nl-datechip-input, .nl-datechip-time-select { font-size: 14px; min-height: 40px; }
  .nl-datechip-ok { min-height: 40px; font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .nl-datechip-popover { transition: none; }
}

/* ════════════════════════════════════════════
   REDUCED MOTION — comprehensive animation kill
   ════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .nl-card-enter, .nl-card-exit, .nl-hint-in, .nl-mic-pulse,
  .nl-mic-spin, .nl-shimmer-pulse, .nl-shimmer-ring, .nl-shimmer,
  .nl-toast-enter, .nl-toast-exit, .nl-mic-shake, .nlCardSlideUp,
  .nl-plan-row-remove, .nl-plan-row-enter, .nl-plan-conflict-pulse,
  .ghostPulse {
    animation: none !important;
  }
}


/* ════════════════════════════════════════════
   WEEKLY REVIEW CARD — Friday briefing summary
   ════════════════════════════════════════════ */
/* Weekly review — compact actionable bar */


/* ── Smart Insights on Events ── */
.cal-briefing { display: none; }

/* Amber left accent on events with insights */
.fc-event--has-insight {
  box-shadow: inset 3px 0 0 #f59e0b !important;
}

/* Small amber dot badge on event card */
.cal-insight-dot {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 8px;
  height: 8px;
  background: #f59e0b;
  border-radius: 50%;
  border: 0.5px solid #fff;
  pointer-events: none;
  z-index: 2;
}

/* Insight row in event popup */
.cal-popup-insight {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 0.5px solid rgba(0, 0, 0, 0.08);
}
.cal-popup-insight-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #78350f;
  line-height: 1.4;
}
.cal-popup-insight-text {
  flex: 1;
}
.cal-popup-insight--done {
  color: #16a34a;
}
.cal-popup-insight-btn {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 7px 14px;
  border-radius: 8px;
  border: 0.5px solid rgba(0, 0, 0, 0.040);
  background: rgba(0, 0, 0, 0.040);
  color: #2563eb;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s, border-color 0.15s;
  font-family: inherit;
}
.cal-popup-insight-btn:hover {
  background: rgba(0, 0, 0, 0.040);
  border-color: rgba(0, 0, 0, 0.040);
}
.cal-popup-insight-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Short events (< 30 min) in week/day time grid — minimum height + compact text */
.fc-timegrid-event.fc-v-event {
  min-height: 22px !important;
}
.fc-timegrid-event .fc-event-main-frame {
  overflow: hidden;
}
.fc-timegrid-event[style*="top"][style*="bottom"] .fc-event-time,
.fc-timegrid-event[style*="top"][style*="bottom"] .fc-event-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 1280px) {
  .nl-bar {
    max-width: 780px;
  }
}

@media (min-width: 1600px) {
  .nl-bar {
    max-width: 880px;
  }
}

@media (min-width: 1920px) {
  .nl-bar {
    max-width: 960px;
  }
}
