/* ==========================================================================
   "Use AI" picker and AI capture pop-ups (capture-expenses.js)
   --------------------------------------------------------------------------
   Everything is scoped to .aiu inside the pop-up. Lively but calm: one soft
   violet hero, coloured icon tiles, true-black text, greys no lighter than
   #475569, no coloured card borders.
   ========================================================================== */

.aiu { display: flex; flex-direction: column; gap: 12px; color: #000; }
.aiu p { margin: 0; }
.aiu-note { font-size: .86rem; color: #334155; line-height: 1.5; }

/* ---- Use AI: hero + options --------------------------------------------- */
.aiu-hero {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 14px; border-radius: 16px;
    background: linear-gradient(135deg, #f5f3ff 0%, #fdf4ff 100%);
    border: 1px solid #ede9fe;
}
.aiu-hero-ic {
    flex: 0 0 40px; width: 40px; height: 40px; border-radius: 12px;
    display: grid; place-items: center; color: #fff; font-size: 1.1rem;
    background: linear-gradient(135deg, #7c3aed, #c026d3);
    box-shadow: 0 8px 16px -10px rgba(124, 58, 237, .8);
}
.aiu-hero > div > b { display: block; font-size: .98rem; font-weight: 800; color: #000; }
.aiu-hero > div > span { display: block; margin-top: 3px; font-size: .82rem; line-height: 1.5; color: #334155; }

.aiu-label {
    margin: 4px 0 -4px; font-size: .7rem; font-weight: 800; letter-spacing: .06em;
    text-transform: uppercase; color: #475569;
}
.aiu-opts { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 560px) { .aiu-opts { grid-template-columns: 1fr 1fr; } .aiu-opts.aiu-opts-one { grid-template-columns: 1fr; } }
.aiu-opt {
    display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px;
    padding: 10px 12px; border-radius: 14px; cursor: pointer; text-align: left;
    font: inherit; color: #000; background: #fff; border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    transition: border-color .15s ease, box-shadow .15s ease, transform .12s ease;
}
.aiu-opt:hover { border-color: #c4b5fd; box-shadow: 0 10px 22px -16px rgba(91, 33, 182, .45); }
.aiu-opt:active { transform: scale(.985); }
.aiu-opt:focus-visible { outline: 2px solid #7c3aed; outline-offset: 2px; }
.aiu-opt-ic {
    flex: 0 0 42px; width: 42px; height: 42px; border-radius: 13px;
    display: grid; place-items: center; color: #fff; font-size: 1.15rem;
    box-shadow: 0 6px 12px -8px rgba(15, 23, 42, .4);
}
.aiu-opt-copy { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.aiu-opt-copy b { font-size: .92rem; font-weight: 800; color: #000; }
.aiu-opt-copy small { font-size: .76rem; line-height: 1.35; color: #475569; }
.aiu-opt-go { flex-shrink: 0; color: #64748b; font-size: .8rem; }

/* ---- Capture: header, method tiles, limits --------------------------------- */
.aiu-head { display: flex; flex-direction: column; gap: 8px; }
.aiu-head p { font-size: .86rem; line-height: 1.5; color: #334155; }
.aiu-ctx {
    align-self: flex-start; display: inline-flex; align-items: center; gap: 6px;
    height: 26px; padding: 0 10px; border-radius: 999px;
    font-size: .74rem; font-weight: 800; color: var(--t, #334155);
    background: color-mix(in srgb, var(--t, #334155) 10%, #fff);
}
.aiu-methods { grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 8px; }
.aiu-method {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
    min-height: 82px; padding: 10px 4px; border-radius: 14px; cursor: pointer;
    font: inherit; color: #000; background: #fff; border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    transition: border-color .15s ease, background .15s ease, transform .12s ease;
}
.aiu-method:hover { border-color: color-mix(in srgb, var(--t, #059669) 45%, #fff); background: color-mix(in srgb, var(--t, #059669) 4%, #fff); }
.aiu-method:active { transform: scale(.97); }
.aiu-method:focus-visible { outline: 2px solid var(--t, #059669); outline-offset: 2px; }
.aiu-method-ic {
    width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
    font-size: 1.3rem; color: var(--t, #059669);
    background: color-mix(in srgb, var(--t, #059669) 12%, #fff);
}
.aiu-method-lbl { font-size: .8rem; font-weight: 750; color: #000; }
.aiu-method.is-recording { border-color: #dc2626; background: #fef2f2; }
.aiu-method.is-recording .aiu-method-ic { color: #fff; background: #dc2626; }
.aiu-method.is-recording .aiu-method-lbl { color: #b91c1c; }

.aiu-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.aiu-chips span {
    display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px;
    border-radius: 999px; background: #f1f5f9; color: #334155; font-size: .72rem; font-weight: 650;
}
.aiu-chips i { font-size: .78rem; color: #475569; }

/* recording + text input */
.aiu-rec {
    align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px;
    background: #fef2f2; border: 1px solid #fecaca;
}
.aiu-rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #dc2626; flex-shrink: 0; animation: aiu-pulse 1.1s ease-in-out infinite; }
.aiu-rec-lbl { font-size: .86rem; font-weight: 700; color: #b91c1c; }
.aiu-rec-time { margin-left: auto; font-size: .86rem; font-weight: 800; color: #b91c1c; font-variant-numeric: tabular-nums; }
@keyframes aiu-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(1.35); } }
.aiu-text { padding: 12px; border-radius: 14px; background: #f8fafc; border: 1px solid #e2e8f0; }
.aiu-text .input-group { margin-bottom: 10px; }
.aiu-text-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.aiu-text-head label { margin: 0; font-weight: 750; color: #000; }
.aiu-text-head span { font-size: .74rem; color: #475569; font-variant-numeric: tabular-nums; }

/* working, error, preview, actions */
.aiu-working {
    position: relative; overflow: hidden; text-align: center; padding: 26px 18px 22px;
    border-radius: 16px; background: linear-gradient(180deg, #faf5ff 0%, #fff 70%); border: 1px solid #ede9fe;
}
.aiu-working-orb {
    width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 16px;
    display: grid; place-items: center; color: #fff; font-size: 1.35rem;
    background: linear-gradient(135deg, #7c3aed, #c026d3);
    box-shadow: 0 12px 24px -12px rgba(124, 58, 237, .8);
    animation: aiu-breathe 1.6s ease-in-out infinite;
}
@keyframes aiu-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }
.aiu-working-msg { font-weight: 800; color: #000; font-size: .95rem; }
.aiu-working-sub { margin-top: 5px; font-size: .78rem; color: #475569; line-height: 1.45; }
.aiu-working-bar { display: block; height: 4px; margin: 16px auto 0; max-width: 220px; border-radius: 999px; background: #ede9fe; overflow: hidden; }
.aiu-working-bar i { display: block; width: 40%; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #7c3aed, #c026d3); animation: aiu-slide 1.3s ease-in-out infinite; }
@keyframes aiu-slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }

.aiu-error {
    display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px;
    background: #fef2f2; border: 1px solid #fecaca; color: #7f1d1d; font-size: .86rem; line-height: 1.5;
}
.aiu-error i { color: #dc2626; font-size: 1.05rem; flex-shrink: 0; margin-top: 1px; }
.aiu-preview { padding: 10px; border-radius: 16px; background: #f8fafc; border: 1px solid #e2e8f0; }
.aiu-preview img { border-radius: 10px; }
.aiu-addmore .btn { width: 100%; }
.aiu-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.aiu-actions .btn { min-height: 44px; }
.aiu-actions .btn-primary { flex: 1 1 160px; }

@media (prefers-reduced-motion: reduce) {
    .aiu-opt, .aiu-method { transition: none; }
    .aiu-rec-dot, .aiu-working-orb, .aiu-working-bar i { animation: none; }
}
