/* Quick add dialog (.qa-): live token highlight overlay, autocomplete, chips. */
@media (min-width: 861px) { .qa-modal { top: 14vh; width: min(640px, calc(100vw - 32px)); } }
.qa-modal .modal-body { padding: 18px 20px 14px; overflow: visible; }
.qa-modal .modal-foot { justify-content: flex-start; flex-wrap: wrap; align-items: center; }

.qa-parent { display: flex; align-items: center; gap: 6px; min-width: 0; margin-bottom: 10px; padding: 6px 9px; border-radius: var(--r-sm); background: var(--surface-2); color: var(--text-2); font-size: 12.5px; }
.qa-parent .ico { color: var(--text-3); }

/* Overlay technique: transparent input text over a mirrored, highlighted copy. */
.qa-field { position: relative; }
.qa-hl, .qa-input { display: block; width: 100%; margin: 0; padding: 6px 2px; border: 0; font: 500 18px/1.5 var(--font); letter-spacing: 0; white-space: pre; }
.qa-hl { position: absolute; inset: 0; overflow: hidden; color: var(--text); pointer-events: none; }
.qa-input { position: relative; background: transparent; color: transparent; caret-color: var(--text); outline: none; }
.qa-input::placeholder { color: var(--text-3); font-weight: 400; }
.qa-input::selection { background: var(--brand-ring); }
.qa-tok { color: var(--qa-c); background: color-mix(in srgb, var(--qa-c) 14%, transparent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--qa-c) 14%, transparent); border-radius: 3px; }
.qa-tok-tag, .qa-chip-tag { --qa-c: var(--tag-teal); }
.qa-tok-mention, .qa-chip-mention { --qa-c: var(--tag-violet); }
.qa-tok-priority, .qa-chip-priority { --qa-c: var(--p-high); }
.qa-tok-date, .qa-chip-date, .qa-tok-time, .qa-chip-time { --qa-c: var(--brand-text); }
.qa-field.is-shake { animation: qa-shake 320ms var(--ease); }
@keyframes qa-shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }

.qa-suggest { position: absolute; left: 0; top: calc(100% + 4px); z-index: 5; width: 320px; max-width: 100%; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-3); animation: menu-in 120ms var(--ease); }

.qa-desc { display: block; width: 100%; margin-top: 2px; padding: 4px 2px; border: 0; resize: vertical; background: transparent; color: var(--text-2); font-size: 13.5px; line-height: 1.5; outline: none; }
.qa-desc::placeholder { color: var(--text-3); }

.qa-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.qa-chips:empty { display: none; }
.qa-chip { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 3px 0 8px; border-radius: var(--r-pill); font-size: 12.5px; font-weight: 500; color: var(--qa-c); background: color-mix(in srgb, var(--qa-c) 12%, transparent); animation: menu-in 140ms var(--ease); }
.qa-chip .ico { width: 13px; height: 13px; }
.qa-chip em { font-style: normal; opacity: .72; }
.qa-chip button { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: inherit; opacity: .7; }
.qa-chip button:hover { opacity: 1; background: color-mix(in srgb, var(--qa-c) 18%, transparent); }

.qa-hint { margin-top: 12px; font-size: 12px; color: var(--text-3); line-height: 1.7; }
.qa-hint .kbd { height: 18px; min-width: 18px; font-size: 10.5px; }
.qa-error { margin-top: 8px; font-size: 12.5px; color: var(--danger); }

.qa-pick { max-width: 210px; }
.qa-pick .t-ellipsis { max-width: 150px; }
.qa-pick .ico-sm { color: var(--text-3); }
.qa-modal [data-qa="desc"].is-on { color: var(--brand-text); background: var(--brand-soft); }
.qa-more { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; user-select: none; }
.qa-break { display: none; }
@media (max-width: 520px) {
  .qa-hl, .qa-input { font-size: 16px; }
  .qa-break { display: block; flex-basis: 100%; height: 0; }
  .qa-more { margin-left: 0; }
  .qa-modal .modal-foot [data-close] { margin-left: auto; }
}
