/* ============================================================
   v0.4.18: task compose bar - centered. AI prompt input + attached
   sparkle button form one unit; the manual "hand" button is separate.
   ============================================================ */
.compose-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.compose-group {
  display: flex;
  align-items: stretch;
  width: min(560px, 100%);
  background: var(--chronos-card-bg);
  border: 1px solid var(--chronos-outline);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.compose-group:focus-within {
  border-color: var(--chronos-violet);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.15);
}
.compose-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  outline: none;
  padding: 12px 18px;
  font-size: 14px;
  color: var(--chronos-fg-primary);
  font-family: inherit;
}
/* v0.4.64: voice-to-task mic, a leading button inside the pill (Plus/Pro only). Transparent
   so it reads as part of the field; turns into a pulsing red "stop" control while recording. */
.compose-mic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  padding: 0 6px 0 14px;
  color: var(--chronos-violet);
  cursor: pointer;
  transition: color 0.15s, transform 0.12s;
}
.compose-mic:hover:not(:disabled) { transform: scale(1.08); }
.compose-mic:disabled { opacity: 0.5; cursor: not-allowed; }
.compose-mic .material-icons { font-size: 20px; }
.compose-mic.is-recording {
  color: #ef4444;
  animation: mic-pulse 1.3s ease-in-out infinite;
}
@keyframes mic-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.18); opacity: 0.65; }
}
@media (prefers-reduced-motion: reduce) {
  .compose-mic.is-recording { animation-duration: 2.4s; }
}

/* ============================================================
   v0.4.66: voice-note dialog (record -> listen -> send). Opened by the
   compose-bar mic; the JS module (chronos-voice.js) draws the live
   equalizer into #voice-eq-slot and mounts the native playback player
   into #voice-player-slot so the note can be heard BEFORE the paid send.
   ============================================================ */
.voice-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 8, 20, 0.55);
  backdrop-filter: blur(4px);
}
.voice-card {
  width: min(440px, calc(100vw - 32px));
  padding: 18px 20px 20px;
  border-radius: 16px;
  background: var(--chronos-card-bg);
  border: 1px solid var(--chronos-outline);
  /* The requested shadow: the dialog visibly floats above the board. */
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.45),
    0 6px 18px rgba(0, 0, 0, 0.30),
    0 0 0 1px rgba(124, 58, 237, 0.20);
}
.voice-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.voice-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 15px;
}
.voice-title .material-icons { font-size: 20px; color: var(--chronos-violet); }
.voice-close {
  border: none;
  background: transparent;
  color: var(--chronos-fg-secondary);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
}
.voice-close:hover { background: var(--chronos-hover-bg); color: var(--chronos-fg-primary); }

.voice-rec-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px;
}
.voice-rec-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ef4444;
  animation: voice-rec-pulse 1.3s ease-in-out infinite;
}
@keyframes voice-rec-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.25); opacity: 0.55; }
}
.voice-rec-time {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  color: var(--chronos-fg-secondary);
}

.voice-eq-slot {
  display: flex;
  justify-content: center;
  padding: 8px 0 4px;
  min-height: 72px;
}
.voice-eq-slot canvas { display: block; }

.voice-preview-hint {
  font-size: 13px;
  color: var(--chronos-fg-secondary);
  margin-bottom: 10px;
}
.voice-player-slot { margin-bottom: 12px; min-height: 44px; }
.voice-player-slot audio { width: 100%; display: block; }

.voice-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}
.voice-btn {
  flex: 1;
  padding: 10px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--chronos-outline);
  /* A surface distinct from the card (which is --chronos-card-bg) so the secondary
     button reads as a button on its own, not just a hairline border. */
  background: var(--chronos-hover-bg);
  color: var(--chronos-fg-primary);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s, filter 0.15s;
}
/* Violet outline + label on hover: clearly visible on both the white and dark card,
   instead of a near-invisible card-coloured wash that merged with the dialog. */
.voice-btn:hover:not(:disabled) {
  border-color: var(--chronos-violet);
  color: var(--chronos-violet);
}
.voice-btn.primary {
  border: none;
  background: linear-gradient(135deg, var(--chronos-violet), var(--chronos-lavender));
  color: #fff;
}
.voice-btn.primary:hover:not(:disabled) { filter: brightness(1.1); color: #fff; }
.voice-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.voice-btn.primary.is-loading::after { border-color: #fff; border-top-color: transparent; }

.voice-token-note {
  margin-top: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--chronos-violet);
}
.voice-error {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #f87171;
}
@media (prefers-reduced-motion: reduce) {
  .voice-rec-dot { animation-duration: 2.6s; }
}

.compose-ai {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  padding: 0 20px;
  background: linear-gradient(135deg, var(--chronos-violet), var(--chronos-lavender));
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.04em;
  transition: filter 0.15s;
}
.compose-ai:hover:not(:disabled) { filter: brightness(1.08); }
.compose-ai:disabled { opacity: 0.55; cursor: not-allowed; }
.compose-ai .material-icons { font-size: 20px; }
.compose-ai-label { font-size: 13px; }

/* USE AI TOKEN - opt-in premium-model button. Pulses (FOMO) when the user has AI tokens;
   greys out with NO pulse when they have none (a click then opens the upsell modal). */
.compose-token {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  border-radius: var(--radius-pill);
  padding: 9px 16px;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
}
.compose-token .material-icons { font-size: 18px; }
.compose-token-count {
  background: rgba(0, 0, 0, 0.28);
  border-radius: var(--radius-pill);
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 700;
}
.compose-token.has-tokens {
  background: var(--chronos-violet);
  animation: upgrade-pulse 2.4s ease-in-out infinite, upgrade-halo 2.4s ease-in-out infinite;
}
.compose-token.no-tokens {
  background: var(--chronos-card-bg);
  border: 1px solid var(--chronos-outline);
  color: var(--chronos-fg-primary);
  opacity: 0.7;
}
.compose-token.no-tokens:hover { opacity: 0.95; }
.compose-token:disabled { opacity: 0.5; cursor: not-allowed; animation: none; }

.compose-hand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  background: var(--chronos-card-bg);
  border: 1px solid var(--chronos-outline);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-card);
  color: var(--chronos-fg-primary);
  font-weight: 600;
  font-size: 14px;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}
.compose-hand:hover:not(:disabled) {
  background: var(--chronos-hover-bg);
  border-color: var(--chronos-violet);
  transform: translateY(-1px);
}
.compose-hand:disabled { opacity: 0.55; cursor: not-allowed; }
.compose-hand .material-icons { font-size: 20px; color: var(--chronos-violet); }

@media (max-width: 480px) {
  .compose-bar {
    flex-direction: column;
    gap: 8px;
  }
  .compose-group {
    width: 100%;
  }
  .compose-token {
    width: 100%;
    justify-content: center;
  }
  .compose-hand {
    width: 100%;
    justify-content: center;
  }
}

