/* AI features — same soft language as app.css (cards, hairlines, one blue). */
.ai-entry { margin-left: auto; flex: none; color: var(--brand-text); }
.ai-entry svg, .lp-ai svg, .ai-draft-btn svg, .ai-h svg, .sheet-h h2 svg { width: 16px; height: 16px; vertical-align: -2px; }
.lp-ai { flex: none; color: var(--brand-text); padding: 0 12px; }
.ai-note { padding: 10px 12px; border-radius: 12px; background: var(--line); color: var(--ink-2); font-size: 14px; }
.ai-note.warn { background: color-mix(in srgb, var(--warning) 12%, var(--surface)); color: color-mix(in srgb, var(--warning) 60%, var(--ink)); }
.ai-note.err { background: color-mix(in srgb, var(--danger) 9%, var(--surface)); color: color-mix(in srgb, var(--danger) 70%, var(--ink)); }

.ai-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; min-height: 168px; padding: 20px;
  border: 1.5px dashed var(--line-2); border-radius: var(--r-lg); background: var(--surface-alt); cursor: pointer; transition: border-color .15s, background .15s; }
.ai-drop:hover, .ai-drop.over { border-color: var(--brand); background: var(--brand-soft); }
.ai-drop b { overflow-wrap: anywhere; }
.ai-drop-ic { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-text); }
.ai-drop-ic svg { width: 22px; height: 22px; }

.ai-wait { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; min-height: 30vh; color: var(--ink-2); text-align: center; }
.ai-wait.sm { flex-direction: row; min-height: 0; justify-content: flex-start; gap: 10px; font-size: 14px; }
.ai-spin { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--brand-soft); border-top-color: var(--brand); animation: ai-spin .8s linear infinite; flex: none; }
.btn .ai-spin { width: 14px; height: 14px; border-width: 2px; border-color: rgba(255, 255, 255, .35); border-top-color: #fff; }
@keyframes ai-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ai-spin { animation-duration: 2.4s; } }

.ai-group { display: flex; flex-direction: column; gap: 8px; }
.ai-group > h3 { display: flex; align-items: center; gap: 8px; }
.ai-group.g-new > h3 { color: color-mix(in srgb, var(--success) 70%, var(--ink)); }
.ai-group.g-unsure > h3 { color: color-mix(in srgb, var(--warning) 70%, var(--ink)); }
.ai-group.g-exists > h3 { color: var(--ink-3); }
.ai-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.ai-row.b-unsure { border-color: color-mix(in srgb, var(--warning) 35%, transparent); }
.ai-row.b-exists { opacity: .66; }
.ai-cb { width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--brand); }
.ai-cb.off { display: inline-block; border-radius: 6px; background: var(--line); }
.ai-m { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ai-n { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ai-n b { overflow-wrap: anywhere; }
.ai-sub, .ai-notes { overflow-wrap: anywhere; }
.ai-notes { color: var(--ink-2); }
.ai-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-tags:empty { display: none; }
.pill.ai-r { background: color-mix(in srgb, var(--warning) 12%, transparent); color: color-mix(in srgb, var(--warning) 70%, var(--ink)); }
.b-exists .pill.ai-r { background: var(--line); color: var(--ink-2); }
.ai-geo { font-size: 12px; color: var(--ink-3); align-self: center; }
.ai-geo.g-ok, .ai-geo.g-approx { color: color-mix(in srgb, var(--success) 70%, var(--ink)); }
.ai-geo.g-mismatch { color: color-mix(in srgb, var(--danger) 70%, var(--ink)); }
.ai-edit summary { cursor: pointer; color: var(--brand-text); font-size: 13px; font-weight: 600; width: max-content; }
.ai-edit .grid2 { margin-top: 10px; }

.ai-sum:empty { display: none; }
.ai-sum > h3 { gap: 8px; }
.ai-h { display: inline-flex; align-items: center; gap: 6px; }
.ai-sum-t { margin: 0; line-height: 1.5; }
.ai-sum-b { display: flex; flex-direction: column; gap: 10px; }
.ai-sum-b[hidden] { display: none; }
.ai-list ul { margin: 4px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 3px; }
.ai-list li { line-height: 1.45; overflow-wrap: anywhere; }

.ai-draft { border: 1px solid var(--line); border-radius: 14px; padding: 8px; background: var(--surface-alt); }
.ai-draft.open { padding: 12px; }
.ai-draft-btn { color: var(--brand-text); }
.ai-draft-b { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.ai-check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; min-height: 32px; }
.ai-check input { width: 18px; height: 18px; accent-color: var(--brand); }
.ai-src { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.ai-src a { color: var(--brand-text); font-size: 13px; overflow-wrap: anywhere; }

@media (max-width: 560px) {
  .ai-edit .grid2 { grid-template-columns: 1fr; }
}

/* Conflicts, per-row actions, bulk tools */
.ai-bar { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.chip.sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.chip:disabled { opacity: .45; cursor: default; }
.ai-bulk summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.ai-bulk .grid2 { margin-top: 10px; }
.ai-bulk .row-actions { margin-top: 10px; }
.ai-group.g-conflict > h3 { color: color-mix(in srgb, var(--danger) 70%, var(--ink)); }
.ai-row.b-conflict { border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.ai-row.sel { box-shadow: 0 0 0 2px var(--brand-soft); }
.ai-cf { margin-top: 6px; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--danger) 6%, var(--surface)); border: 1px solid color-mix(in srgb, var(--danger) 22%, transparent); display: flex; flex-direction: column; gap: 8px; }
.ai-cf-h { font-weight: 700; font-size: 13px; color: color-mix(in srgb, var(--danger) 75%, var(--ink)); }
.ai-cf-i { display: flex; flex-direction: column; gap: 2px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.ai-cf-i:last-of-type { border-bottom: 0; padding-bottom: 0; }
.ai-cf-n { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ai-cf-n b { overflow-wrap: anywhere; }
.ai-open { color: var(--brand-text); font-size: 13px; font-weight: 600; text-decoration: none; width: max-content; }
.ai-acts { gap: 6px; }
.ai-assign { color: var(--brand-text); font-weight: 600; }
.duplist .row .main > .sub { display: block; }
.ai-manual { margin-left: auto; flex: none; }
.sheet-h h2 + .ai-manual { max-width: 50%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Place lookup (name-only rows → maps) */
.ai-look { display: inline-flex; align-items: center; gap: 6px; }
.ai-look.l-found { color: color-mix(in srgb, var(--success) 70%, var(--ink)); }
.ai-look.l-pick { color: var(--brand-text); font-weight: 600; }
.ai-look.l-none, .ai-look.l-err, .ai-look.l-skipped { color: color-mix(in srgb, var(--warning, #c98a00) 75%, var(--ink)); }
.ai-spin.sm { width: 12px; height: 12px; border-width: 2px; }
.ai-tags .ai-open { align-self: center; font-size: 12px; }
.ai-pick { margin-top: 6px; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--brand) 6%, var(--surface)); border: 1px solid color-mix(in srgb, var(--brand) 20%, transparent); display: flex; flex-direction: column; gap: 6px; }
.ai-pick .ai-cf-h { color: var(--brand-text); }
.ai-pick-i { all: unset; box-sizing: border-box; display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); cursor: pointer; transition: border-color .15s, background .15s; }
.ai-pick-i:hover { border-color: color-mix(in srgb, var(--brand) 45%, transparent); }
.ai-pick-i:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.ai-pick-n { display: flex; align-items: center; gap: 6px; }
.ai-pick-n b, .ai-pick-i .small { overflow-wrap: anywhere; }
