/* Quick add — a calm one-line popup on tap, and hold-to-speak on touch screens.
   Loaded after orbit-v30.css. Only styles #captureDialog.quick-capture, #taskFab and #voiceSheet. */

/* ---------- Quick popup ---------- */
body.orbit-v27 #captureDialog.quick-capture {
  /* Centered in the part of the screen the keyboard leaves free. */
  inset: calc((100dvh - var(--keyboard-inset, 0px)) / 2) 0 auto; transform: translateY(-50%);
  max-height: calc(100dvh - var(--keyboard-inset, 0px) - env(safe-area-inset-top, 0px) - 24px); overflow-y: auto;
  width: min(560px, calc(100vw - 32px));
  max-width: 560px;
  padding: 18px 20px 16px;
  border: 1px solid var(--o-line-strong, #333338);
  border-radius: 16px;
  background: var(--o-raise, #121214);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .55);
}
body.orbit-v27 #captureDialog.quick-capture::backdrop { background: rgba(0, 0, 0, .45); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
/* Short and simple for a new task: the note field shows once More options is open (or a draft has a note). */
body.orbit-v27 #captureDialog.quick-capture[data-mode="add"]:not(:has(#captureExtra[open])) #captureNote:placeholder-shown { display: none; }
body.orbit-v27 #captureDialog.quick-capture .dialog-title { margin: 0 0 2px; min-height: 0; }
body.orbit-v27 #captureDialog.quick-capture #captureHeading { margin: 0; font-size: 12px; font-weight: 500; letter-spacing: .02em; color: var(--o-faint, #8a8a93); }
body.orbit-v27 #captureDialog.quick-capture #closeCapture { width: 36px; height: 36px; min-height: 36px; margin: -6px -8px -6px 0; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--o-muted, #a1a1aa); font-size: 22px; line-height: 1; }
body.orbit-v27 #captureDialog.quick-capture #closeCapture:hover { background: var(--o-raise-2, #1a1a1d); color: var(--o-ink, #f4f4f5); }

body.orbit-v27 #captureDialog.quick-capture .capture-title-row { display: flex; align-items: center; gap: 8px; }
body.orbit-v27 #captureDialog.quick-capture #captureTitle {
  flex: 1 1 auto; min-width: 0; min-height: 48px; margin: 0; padding: 6px 0;
  border: 0; border-radius: 0; outline: none; background: transparent; box-shadow: none;
  color: var(--o-ink, #f4f4f5); font-size: 21px; font-weight: 500; line-height: 1.35; letter-spacing: -.015em;
}
body.orbit-v27 #captureDialog.quick-capture #captureTitle::placeholder { color: var(--o-faint, #8a8a93); }
body.orbit-v27 #captureDialog.quick-capture #captureTitle:focus-visible { box-shadow: none; }
body.orbit-v27 #captureDialog.quick-capture .capture-mic {
  flex: none; display: inline-grid; place-items: center; width: 40px; height: 40px; min-height: 40px; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: var(--o-muted, #a1a1aa);
}
body.orbit-v27 #captureDialog.quick-capture .capture-mic svg { width: 21px; height: 21px; }
body.orbit-v27 #captureDialog.quick-capture .capture-mic:hover { background: var(--o-raise-2, #1a1a1d); color: var(--o-ink, #f4f4f5); }
body.orbit-v27 #captureDialog.quick-capture.is-listening .capture-mic { background: var(--o-accent, #3b9eff); color: #071e32; animation: quickMicPulse 1.4s ease-in-out infinite; }
body.orbit-v27 #captureDialog.quick-capture .capture-mic-stop { flex: none; min-height: 34px; padding: 0 12px; border-radius: 999px; font-size: 13px; }

body.orbit-v27 #captureDialog.quick-capture #captureNote {
  display: block; width: 100%; min-height: 0; height: auto; max-height: 180px; margin: 0; padding: 2px 0 6px;
  border: 0; background: transparent; outline: none; resize: none; field-sizing: content;
  color: var(--o-ink-2, #d4d4d8); font-size: 15px; line-height: 1.5;
}
body.orbit-v27 #captureDialog.quick-capture #captureNote::placeholder { color: var(--o-faint, #8a8a93); }

body.orbit-v27 #captureDialog.quick-capture .capture-voice-status { margin: 4px 0 0; font-size: 13px; line-height: 1.45; color: var(--o-muted, #a1a1aa); }
body.orbit-v27 #captureDialog.quick-capture .capture-voice-status:empty { display: none; }
body.orbit-v27 #captureDialog.quick-capture .voice-heard { margin: 8px 0 0; padding: 8px 10px; border: 0; border-radius: 8px; background: var(--o-raise-2, #1a1a1d); }
body.orbit-v27 #captureDialog.quick-capture .voice-heard p { margin: 2px 0 0; color: var(--o-ink-2, #d4d4d8); font-size: 13px; }

/* Chips: the real select / date input sits inside each pill. */
body.orbit-v27 #captureDialog.quick-capture .capture-chips,
body.orbit-v27 .capture-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; grid-template-columns: none; }
body.orbit-v27 .capture-chip,
body.orbit-v27 #captureDialog.quick-capture .capture-chips > label.capture-chip {
  position: relative; display: inline-flex; align-items: center; gap: 6px; flex: 0 1 auto; min-width: 0; max-width: 100%;
  min-height: 36px; margin: 0; padding: 0 12px; border: 1px solid var(--o-line-strong, #333338); border-radius: 999px;
  background: transparent; color: var(--o-ink-2, #d4d4d8); font-size: 14px; line-height: 1; cursor: pointer;
}
body.orbit-v27 .capture-chip:hover { border-color: #4a4a50; background: var(--o-raise-2, #1a1a1d); }
body.orbit-v27 .capture-chip:focus-within { border-color: var(--o-accent, #3b9eff); box-shadow: 0 0 0 3px var(--o-accent-soft, rgba(59, 158, 255, .14)); }
body.orbit-v27 .capture-chip > svg { flex: none; width: 16px; height: 16px; color: var(--o-muted, #a1a1aa); }
body.orbit-v27 .capture-chip .chip-text { min-width: 0; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.2; }
body.orbit-v27 .capture-chip select,
body.orbit-v27 #captureDialog.quick-capture .capture-chips select {
  position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; max-width: none; margin: 0; padding: 0;
  border: 0; border-radius: inherit; opacity: 0; cursor: pointer; -webkit-appearance: none; appearance: none;
  font-size: 16px; color: #f4f4f5; background: transparent;
}
body.orbit-v27 .capture-chip select option,
body.orbit-v27 .capture-chip select optgroup { background: #1a1a1d; color: #f4f4f5; }
body.orbit-v27 .capture-chip .chip-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--o-p3, #6fcf97); }
body.orbit-v27 #captureDialog[data-priority="1"] .chip-dot { background: var(--o-p1, #ff7b7b); }
body.orbit-v27 #captureDialog[data-priority="2"] .chip-dot { background: var(--o-p2, #f2b65a); }
body.orbit-v27 #captureDialog[data-priority="4"] .chip-dot { background: var(--o-p4, #8e8e96); }
body.orbit-v27 .chip-date .chip-date-label { white-space: nowrap; color: var(--o-muted, #a1a1aa); }
body.orbit-v27 #captureDialog[data-due="set"] .chip-date .chip-date-label { color: var(--o-ink-2, #d4d4d8); }
body.orbit-v27 #captureDialog.quick-capture .chip-date input[type="date"] {
  position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; padding: 0; border: 0; opacity: 0; cursor: pointer;
  -webkit-appearance: none; appearance: none; font-size: 16px; color-scheme: dark;
}
body.orbit-v27 #captureDialog.quick-capture .chip-date input[type="date"]::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: auto; height: auto; opacity: 0; cursor: pointer; }

/* Quieter secondary sections */
body.orbit-v27 #captureDialog.quick-capture .capture-secondary,
body.orbit-v27 #captureDialog.quick-capture .capture-source { margin-top: 12px; border-top: 0; }
body.orbit-v27 #captureDialog.quick-capture .capture-secondary > summary,
body.orbit-v27 #captureDialog.quick-capture .capture-source > summary { display: inline-flex; align-items: center; min-height: 32px; padding: 4px 0; font-size: 13px; color: var(--o-faint, #8a8a93); }
body.orbit-v27 #captureDialog.quick-capture .capture-secondary[open] { padding-bottom: 4px; }
body.orbit-v27 #captureDialog.quick-capture .voice-privacy-note { margin: 12px 0 0; font-size: 12px; line-height: 1.5; color: var(--o-faint, #8a8a93); }

body.orbit-v27 #captureDialog.quick-capture .capture-bottom { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin: 14px 0 0; padding: 14px 0 0; border-top: 1px solid var(--o-line, #232326); }
body.orbit-v27 #captureDialog.quick-capture #cancelCapture { display: none; }
body.orbit-v27 #captureDialog.quick-capture .capture-bottom > div { display: flex; gap: 8px; margin-left: auto; }
body.orbit-v27 #captureDialog.quick-capture #saveCaptureAnother { min-height: 40px; padding: 0 14px; border: 0; background: transparent; color: var(--o-muted, #a1a1aa); font-size: 14px; }
body.orbit-v27 #captureDialog.quick-capture #saveCaptureAnother:hover { color: var(--o-ink, #f4f4f5); background: var(--o-raise-2, #1a1a1d); }
body.orbit-v27 #captureDialog.quick-capture #saveCapture { min-height: 40px; padding: 0 18px; border-radius: 10px; font-size: 14px; font-weight: 600; }
body.orbit-v27 #captureDialog.quick-capture[data-mode="edit"] #cancelCapture { display: inline-flex; margin-right: auto; }

/* Phone and foldable: the same centered card, kept above the keyboard. */
@media (max-width: 899px) {
  body.orbit-v27 #captureDialog.quick-capture {
    width: min(560px, calc(100vw - 24px)); max-width: 560px; margin: 0 auto;
    padding: 16px 16px 14px;
    border: 1px solid var(--o-line-strong, #333338); border-radius: 18px;
  }
  body.orbit-v27.keyboard-open #captureDialog.quick-capture { padding-bottom: 12px; }
  body.orbit-v27 #captureDialog.quick-capture #captureTitle { font-size: 19px; }
  body.orbit-v27 #captureDialog.quick-capture #captureNote { font-size: 16px; }
  body.orbit-v27 #captureDialog.quick-capture .capture-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: -16px; padding-right: 16px; }
  body.orbit-v27 #captureDialog.quick-capture .capture-chips::-webkit-scrollbar { display: none; }
  body.orbit-v27 #captureDialog.quick-capture .capture-chips > label.capture-chip { flex: none; }
  body.orbit-v27 .capture-chip .chip-text { max-width: 150px; }
  body.orbit-v27 #captureDialog.quick-capture .capture-bottom { margin-top: 10px; padding-top: 10px; }
}

/* ---------- + button: long-press friendly ---------- */
body.orbit-v27 #taskFab { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
body.orbit-v27.voice-sheet-open #taskFab { transform: scale(1.08); background: #69b6ff; }

/* ---------- Voice sheet ---------- */
.voice-sheet { position: fixed; inset: 0; z-index: 2147483000; display: flex; align-items: flex-end; justify-content: center; background: rgba(0, 0, 0, .62); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.voice-sheet[hidden] { display: none; }
.voice-sheet-card {
  position: relative; width: 100%; max-width: 520px; margin: 0 auto;
  padding: 26px 20px calc(18px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--o-line-strong, #333338); border-radius: 22px 22px 0 0;
  background: var(--o-raise, #121214); color: var(--o-ink, #f4f4f5); text-align: center;
  box-shadow: 0 -18px 60px rgba(0, 0, 0, .5); animation: voiceSheetIn .18s ease-out;
}
@media (min-width: 900px) { .voice-sheet { align-items: center; } .voice-sheet-card { border: 1px solid var(--o-line-strong, #333338); border-radius: 18px; } }
/* While the finger is still on +, the sheet must not steal the touch. */
.voice-sheet[data-state="listening"], .voice-sheet[data-state="starting"] { pointer-events: none; }
.voice-sheet-close { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; min-height: 40px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--o-muted, #a1a1aa); font-size: 24px; line-height: 1; }
.voice-orb { position: relative; display: grid; place-items: center; width: 76px; height: 76px; margin: 4px auto 14px; border-radius: 50%; background: var(--o-raise-2, #1a1a1d); color: var(--o-muted, #a1a1aa); }
.voice-orb svg { position: relative; z-index: 1; width: 32px; height: 32px; }
.voice-orb-ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--o-accent, #3b9eff); opacity: 0; }
.voice-sheet[data-state="listening"] .voice-orb,
.voice-sheet[data-state="listening-tap"] .voice-orb { background: var(--o-accent, #3b9eff); color: #071e32; }
.voice-sheet[data-state="listening"] .voice-orb-ring,
.voice-sheet[data-state="listening-tap"] .voice-orb-ring { animation: voiceRing 1.8s ease-out infinite; }
.voice-sheet[data-state="listening"] .voice-orb-ring + .voice-orb-ring,
.voice-sheet[data-state="listening-tap"] .voice-orb-ring + .voice-orb-ring { animation-delay: .9s; }
.voice-sheet[data-state="starting"] .voice-orb,
.voice-sheet[data-state="finishing"] .voice-orb { color: var(--o-accent-ink, #8cc4ff); }
.voice-sheet[data-state="review"] .voice-orb { display: none; }
.voice-sheet-status { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -.01em; }
.voice-sheet-hint { margin: 6px auto 0; max-width: 34ch; font-size: 14px; line-height: 1.45; color: var(--o-muted, #a1a1aa); }
.voice-sheet-hint:empty { display: none; }
.voice-sheet-transcript { margin: 16px auto 0; max-width: 40ch; min-height: 1.4em; font-size: 18px; line-height: 1.45; color: var(--o-ink-2, #d4d4d8); overflow-wrap: anywhere; }
.voice-sheet-result { margin: 14px 0 0; text-align: left; }
.voice-sheet-result input {
  display: block; width: 100%; min-height: 50px; margin: 0 0 12px; padding: 10px 12px;
  border: 1px solid var(--o-line-strong, #333338); border-radius: 12px; outline: none; background: var(--o-bg, #000);
  color: var(--o-ink, #f4f4f5); font-size: 18px; font-weight: 500;
}
.voice-sheet-result input:focus { border-color: var(--o-accent, #3b9eff); box-shadow: 0 0 0 3px var(--o-accent-soft, rgba(59, 158, 255, .14)); }
.voice-sheet-result .capture-chip { min-height: 42px; font-size: 16px; }
.voice-sheet-result .capture-chip .chip-text { max-width: min(300px, 68vw); }
.voice-sheet-note { margin: 8px 0 0; font-size: 13px; line-height: 1.45; color: var(--o-muted, #a1a1aa); }
.voice-sheet-note:empty { display: none; }
.voice-sheet-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 20px 0 0; }
.voice-sheet-actions button { min-height: 46px; padding: 0 18px; border-radius: 12px; font-size: 15px; }
.voice-sheet[data-state="review"] #voiceSheetAdd { order: -1; flex: 1 1 100%; font-weight: 600; }
.voice-sheet-actions .quiet-action { border: 0; background: transparent; color: var(--o-muted, #a1a1aa); }
.voice-sheet-privacy { margin: 14px 0 0; font-size: 11px; line-height: 1.4; color: var(--o-faint, #8a8a93); }

@keyframes voiceRing { 0% { transform: scale(1); opacity: .65; } 100% { transform: scale(1.7); opacity: 0; } }
@keyframes voiceSheetIn { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes quickMicPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(59, 158, 255, .45); } 50% { box-shadow: 0 0 0 8px rgba(59, 158, 255, 0); } }
@media (prefers-reduced-motion: reduce) {
  .voice-sheet-card, .voice-orb-ring, body.orbit-v27 #captureDialog.quick-capture.is-listening .capture-mic { animation: none !important; }
  .voice-sheet[data-state="listening"] .voice-orb-ring:first-child, .voice-sheet[data-state="listening-tap"] .voice-orb-ring:first-child { opacity: .5; transform: scale(1.2); }
}

/* Edit task: hand it to the agent. */
body.orbit-v27 #captureDialog.quick-capture .capture-ask-agent:not([hidden]) { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 14px; border: 1px solid color-mix(in srgb, var(--o-accent, #3b9eff) 45%, transparent); border-radius: 999px; background: color-mix(in srgb, var(--o-accent, #3b9eff) 14%, transparent); color: var(--o-accent-ink, #6cb4ff); font-size: 14px; font-weight: 600; }
body.orbit-v27 #captureDialog.quick-capture .capture-ask-agent svg { width: 17px; height: 17px; flex: none; }
body.orbit-v27 #captureDialog.quick-capture[data-mode="edit"] #cancelCapture { margin-right: 0; }
body.orbit-v27 #captureDialog.quick-capture[data-mode="edit"] .capture-bottom > div { margin-left: auto; }

/* ---------- Voice add, full screen (Adi, 2026-11-11) ----------
   Long-press + opens a big listening screen. No need to keep holding: it listens through pauses, and the task,
   its date, category and priority fill in live as you talk. Tap Done when finished. */
.voice-sheet { align-items: stretch !important; background: rgba(0, 0, 0, .78); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.voice-sheet-card {
  display: flex; flex-direction: column; align-items: stretch; justify-content: center;
  max-width: 640px; min-height: 100%; margin: 0 auto;
  padding: calc(56px + env(safe-area-inset-top, 0px)) 24px calc(24px + env(safe-area-inset-bottom, 0px));
  border: 0 !important; border-radius: 0 !important; background: transparent; box-shadow: none; animation: voiceScreenIn .22s ease-out;
}
@media (min-width: 900px) { .voice-sheet-card { min-height: 0; margin: auto; padding: 56px 32px 28px; border-radius: 28px !important; background: var(--o-raise, #121214); border: 1px solid var(--o-line-strong, #333338) !important; } }
.voice-sheet-close { top: calc(12px + env(safe-area-inset-top, 0px)); right: 12px; width: 48px; height: 48px; font-size: 26px; }
.voice-orb { width: 132px; height: 132px; margin: 0 auto 22px; }
.voice-orb svg { width: 50px; height: 50px; }
.voice-orb-ring { border-width: 3px; }
.voice-sheet[data-state="listening"] .voice-orb,
.voice-sheet[data-state="listening-tap"] .voice-orb {
  background: radial-gradient(circle at 35% 30%, #7cc4ff, #0a84ff 60%, #0a5fe0); color: #fff;
  box-shadow: 0 0 0 10px rgba(10, 132, 255, .12), 0 0 60px rgba(10, 132, 255, .55); animation: voiceBreathe 2.4s ease-in-out infinite;
}
.voice-sheet[data-state="listening"] .voice-orb-ring,
.voice-sheet[data-state="listening-tap"] .voice-orb-ring { animation-duration: 2.2s; }
/* A live sound wave under the mic while it listens. */
.voice-wave { display: flex; justify-content: center; align-items: center; gap: 6px; height: 34px; margin: 0 auto 14px; opacity: 0; transition: opacity .2s ease; }
.voice-wave i { display: block; width: 5px; height: 100%; border-radius: 3px; background: var(--o-accent, #3b9eff); transform: scaleY(.18); }
.voice-sheet[data-state="listening"] .voice-wave, .voice-sheet[data-state="listening-tap"] .voice-wave { opacity: 1; }
.voice-sheet[data-state="listening"] .voice-wave i, .voice-sheet[data-state="listening-tap"] .voice-wave i { animation: voiceWave 1.1s ease-in-out infinite; }
.voice-wave i:nth-child(2) { animation-delay: -.9s !important; } .voice-wave i:nth-child(3) { animation-delay: -.3s !important; }
.voice-wave i:nth-child(4) { animation-delay: -.6s !important; } .voice-wave i:nth-child(5) { animation-delay: -.15s !important; }
.voice-wave i:nth-child(6) { animation-delay: -.75s !important; } .voice-wave i:nth-child(7) { animation-delay: -.45s !important; }
.voice-sheet[data-state="review"] .voice-wave { display: none; }
.voice-sheet-status { font-size: 24px; }
.voice-sheet-hint { font-size: 15px; max-width: 36ch; }
.voice-sheet-transcript { font-size: 24px; line-height: 1.4; font-weight: 500; max-width: 30ch; color: var(--o-ink, #f4f4f5); }
/* While listening, the live result reads as a preview card: what will be added, updated as you speak. */
.voice-sheet.is-live .voice-sheet-result { margin-top: 22px; padding: 14px; border-radius: 16px; background: var(--o-raise-2, rgba(255, 255, 255, .06)); animation: voiceScreenIn .2s ease-out; }
.voice-sheet.is-live .voice-sheet-result input { font-size: 18px; font-weight: 600; }
.voice-sheet-actions { margin-top: 28px; }
.voice-sheet-actions button { min-height: 52px; padding: 0 22px; font-size: 16px; border-radius: 14px; }
.voice-sheet[data-state="listening-tap"] #voiceSheetDone { order: -1; flex: 1 1 100%; font-weight: 600; }
@keyframes voiceBreathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes voiceWave { 0%, 100% { transform: scaleY(.18); } 50% { transform: scaleY(1); } }
@keyframes voiceScreenIn { from { opacity: 0; transform: scale(.98); } to { opacity: 1; transform: none; } }
html[data-theme="light"] .voice-sheet { background: rgba(255, 255, 255, .86) !important; }
html[data-theme="light"] .voice-sheet-card { background: transparent; box-shadow: none; }
@media (min-width: 900px) { html[data-theme="light"] .voice-sheet-card { background: #fff; } }
@media (prefers-reduced-motion: reduce) {
  .voice-sheet-card, .voice-orb, .voice-wave i, .voice-sheet.is-live .voice-sheet-result { animation: none !important; }
  .voice-wave i { transform: scaleY(.5); }
}
