/* Speak instead of type, and voice notes (public/js/dictate.js, voicenote.js). */

/* The microphone follows the cursor, so it is fixed to the window and placed by
   script at the corner of the box. Above modals and the command bar (9000). */
.dict-mic {
  position: fixed; z-index: 9500;
  width: 32px; height: 32px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 50%;
  background: var(--card); color: var(--muted);
  box-shadow: var(--shadow); cursor: pointer;
}
.dict-mic[hidden] { display: none; }
.dict-mic svg { width: 16px; height: 16px; }
.dict-mic:hover { color: var(--blue); border-color: var(--blue); }
.dict-mic.on { background: var(--red); border-color: var(--red); color: #fff; animation: dict-pulse 1.2s ease-in-out infinite; }
.dict-mic.busy { background: var(--blue); border-color: var(--blue); color: #fff; opacity: .8; }
@keyframes dict-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .45); } 50% { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); } }

.dict-tip {
  position: fixed; z-index: 9500; max-width: min(420px, calc(100vw - 16px));
  padding: 5px 10px; border-radius: 8px;
  background: var(--navy); color: #fff; font-size: 12px; line-height: 1.35;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
}
.dict-tip[hidden] { display: none; }

/* A voice note on a text, before it is sent. */
.vn-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0; }
.vn-bar .vn-time { font-variant-numeric: tabular-nums; color: var(--red); font-weight: 600; }
.vn-bar audio { height: 32px; max-width: 100%; }
.attach-chip audio { display: block; height: 28px; max-width: 220px; margin-top: 4px; }

/* Phone: targets big enough for a thumb. */
@media (max-width: 860px) {
  .dict-mic { width: 40px; height: 40px; }
  .dict-mic svg { width: 20px; height: 20px; }
  .vn-bar .btn { min-height: 36px; }
}

/* The labelled Dictate button on the Note, Email and Call tabs. */
.dict-btn svg { width: 14px; height: 14px; vertical-align: -2px; }
.dict-btn.on { background: var(--red); border-color: var(--red); color: #fff; }
@media (max-width: 860px) { .dict-btn { min-height: 36px; } }
