/* ---- Cards ---- */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.card__head {
    display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
    padding: var(--sp-4) var(--sp-5);
    border-bottom: 1px solid var(--color-line);
}
.card__title { font-size: var(--fs-md); font-weight: 650; }
.card__body { padding: var(--sp-5); }
.card__body--flush { padding: 0; }

/* ---- Stat cards ---- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--sp-4); }
.stats[hidden] { display: none; }
.stat { padding: var(--sp-5); border-top: 4px solid var(--color-line-2); }
.stat__label { color: var(--color-ink-2); font-size: var(--fs-sm); font-weight: 600; }
.stat__value { font-size: var(--fs-2xl); font-weight: 700; margin-top: var(--sp-1); }
.stat__value--accent { color: var(--color-accent); }
.stat__value--danger { color: var(--color-danger); }
.stat__value--success { color: var(--color-success); }
/* Colour-key each tile's top edge (and a soft wash) to its value, so the
   stat row reads at a glance. Progressive enhancement: browsers without
   :has() just keep the neutral top edge. */
.stat:has(.stat__value--accent)  { border-top-color: var(--color-accent);  background: linear-gradient(180deg, var(--color-accent-soft) 0%, var(--color-surface) 70%); }
.stat:has(.stat__value--danger)  { border-top-color: var(--color-danger);  background: linear-gradient(180deg, var(--color-danger-soft) 0%, var(--color-surface) 70%); }
.stat:has(.stat__value--success) { border-top-color: var(--color-success); background: linear-gradient(180deg, var(--color-success-soft) 0%, var(--color-surface) 70%); }
/* Stat tiles double as links on the dashboard, and as quick filters on the
   compliances list (.stat--clickable). */
a.stat { display: block; text-decoration: none; color: inherit; transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition); }
a.stat:hover { border-color: var(--color-accent); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.stat--clickable { cursor: pointer; transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition); }
.stat--clickable:hover { border-color: var(--color-accent); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.stat--clickable:focus-visible { outline: 2px solid var(--color-accent-ring); outline-offset: 2px; }

/* ---- "Viewing as" banner (Switch profile) ---- */
.acting-banner {
    display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
    flex-wrap: wrap;
    background: var(--color-accent-pale, #eef2ff); border: 1px solid var(--color-accent);
    color: var(--color-ink); border-radius: var(--radius);
    padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-4);
}

/* ---- Dashboard insights ---- */
.dash-grid { display: grid; grid-template-columns: 2fr 1fr; gap: var(--sp-4); align-items: start; }
@media (max-width: 860px) { .dash-grid { grid-template-columns: 1fr; } }
.cat-bars { display: flex; flex-direction: column; gap: var(--sp-3); }
.cat-bar__top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: var(--sp-1); }
.cat-bar__name { font-size: var(--fs-sm); color: var(--color-ink-2); }
.cat-bar__cnt { font-weight: 700; font-size: var(--fs-sm); }
.cat-bar__track { height: 8px; background: var(--color-bg-2); border-radius: 999px; overflow: hidden; }
.cat-bar__fill { display: block; height: 100%; background: var(--gradient-accent); border-radius: 999px; }

/* ---- Buttons ---- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
    padding: var(--sp-2) var(--sp-4);
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-size: var(--fs-base); font-weight: 600;
    cursor: pointer; white-space: nowrap;
    transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn--primary { background: var(--gradient-accent); color: #fff; }
.btn--primary:hover {
    background: linear-gradient(135deg, #0b4585 0%, #1272c4 100%);
    color: #fff;
    box-shadow: var(--shadow-accent);
    transform: translateY(-1px);
}
.btn--ghost { background: var(--color-surface); border-color: var(--color-line-2); color: var(--color-ink-2); }
.btn--ghost:hover { background: var(--color-bg-2); }
.btn--danger { background: var(--color-danger); color: #fff; }
.btn--danger:hover { background: #b91c1c; color: #fff; }
.btn--sm { padding: var(--sp-1) var(--sp-3); font-size: var(--fs-sm); }
/* Active (pressed) state — stats toggle while stats show, and the Switch
   profile button while viewing as another user. */
[data-stats-toggle][aria-pressed="true"],
[data-switch-profile][aria-pressed="true"] { background: var(--color-accent); border-color: var(--color-accent); color: #fff; }
[data-stats-toggle][aria-pressed="true"]:hover,
[data-switch-profile][aria-pressed="true"]:hover { background: var(--color-accent-hover); border-color: var(--color-accent-hover); color: #fff; }
/* A person's name linked to WhatsApp (or email fallback). The whole name is
   clickable; the name text keeps its normal colour and only the trailing icon
   carries WhatsApp's brand green. */
.name-link {
    display: inline-flex; align-items: center; gap: 4px;
    color: inherit; text-decoration: none;
}
.name-link:hover .name-link__text { text-decoration: underline; }
.name-link__ico {
    display: inline-flex; align-items: center; justify-content: center;
    flex: none; color: #075e54; /* WhatsApp dark teal-green */
}
.name-link--mail .name-link__ico { color: #128c7e; }
.name-link:hover .name-link__ico { color: #128c7e; }
.btn--icon { padding: var(--sp-2); }
.btn--block { width: 100%; }
.btn.is-active { background: var(--color-accent); color: #fff; border-color: var(--color-accent); }

/* Segmented filter control (tabs / quick filters) */
.segmented { display: inline-flex; border: 1px solid var(--color-line-2); border-radius: var(--radius-sm); overflow: hidden; }
.segmented__btn {
    padding: var(--sp-1) var(--sp-3); font-size: var(--fs-sm); font-weight: 600;
    background: var(--color-surface); color: var(--color-ink-2);
    border: 0; border-left: 1px solid var(--color-line-2); cursor: pointer;
    transition: background var(--transition), color var(--transition);
}
.segmented__btn:first-child { border-left: 0; }
.segmented__btn:hover { background: var(--color-bg-2); }
.segmented__btn.is-active { background: var(--color-accent); color: #fff; }

/* ---- Forms ---- */
.field { margin-bottom: var(--sp-4); }
.field__label { display: block; font-weight: 600; font-size: var(--fs-sm); margin-bottom: var(--sp-2); }
.field__label .req { color: var(--color-danger); }
.input, .select, .textarea {
    width: 100%;
    padding: var(--sp-3);
    border: 1px solid var(--color-line-2);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px var(--color-accent-ring);
}
.field--error .input, .field--error .select { border-color: var(--color-danger); }
.field__error { color: var(--color-danger); font-size: var(--fs-sm); margin-top: var(--sp-1); }
.field__hint { color: var(--color-muted); font-size: var(--fs-sm); margin-top: var(--sp-1); }
.checkbox { display: inline-flex; align-items: center; gap: var(--sp-2); cursor: pointer; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--color-accent); }

/* ---- Watchers picker (searchable, touch-friendly checkbox list) ---- */
.watch-picker {
    border: 1px solid var(--color-line-2);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    overflow: hidden;
}
.watch-picker__bar {
    position: relative;
    display: flex; align-items: center;
    border-bottom: 1px solid var(--color-line);
    background: var(--color-bg-2);
}
.watch-picker__bar .ico {
    position: absolute; left: var(--sp-3); top: 50%; transform: translateY(-50%);
    color: var(--color-faint); pointer-events: none;
}
.watch-picker__search.input {
    flex: 1; width: auto; min-width: 0;
    border: 0; background: transparent; border-radius: 0;
    padding-left: 2.25rem;
}
.watch-picker__search.input:focus { box-shadow: none; border: 0; }
.watch-picker__count { flex: none; padding: 0 var(--sp-3); white-space: nowrap; }
.watch-picker__list {
    max-height: 240px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.watch-opt {
    display: flex; align-items: center; gap: var(--sp-3);
    padding: var(--sp-3) var(--sp-4);
    min-height: 44px;
    border-bottom: 1px solid var(--color-line);
    cursor: pointer;
}
.watch-opt:last-of-type { border-bottom: 0; }
.watch-opt:hover { background: var(--color-bg-2); }
/* A flex display would otherwise override the [hidden] attribute the search uses. */
.watch-opt[hidden] { display: none; }
.watch-opt input[type="checkbox"] {
    width: 20px; height: 20px; flex: none;
    accent-color: var(--color-accent);
}
.watch-opt__body { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.watch-opt__name { font-weight: 500; }
.watch-opt__email {
    color: var(--color-muted); font-size: var(--fs-sm);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.watch-picker__empty { padding: var(--sp-4); margin: 0; }

/* Watcher propagation scope (shown on a recurring instance when the set changes) */
.watch-scope {
    margin-top: var(--sp-3);
    padding: var(--sp-3) var(--sp-4);
    border: 1px dashed var(--color-line-2);
    border-radius: var(--radius-sm);
    background: var(--color-bg-2);
}
.watch-scope .radio {
    display: flex; align-items: flex-start; gap: var(--sp-2);
    padding: var(--sp-2) 0; cursor: pointer;
}
.watch-scope .radio input {
    margin-top: 3px; width: 16px; height: 16px; flex: none;
    accent-color: var(--color-accent);
}

/* ---- Toolbar (search/filter row) ---- */
.toolbar {
    display: flex; gap: var(--sp-3); align-items: center; flex-wrap: wrap;
    padding: var(--sp-4) var(--sp-5);
    border-bottom: 1px solid var(--color-line);
}
.toolbar .search { position: relative; flex: 1; min-width: 200px; }
.toolbar .search .input { padding-left: 2.25rem; }
.toolbar .search .ico {
    position: absolute; left: var(--sp-3); top: 50%; transform: translateY(-50%);
    color: var(--color-faint);
}

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-base); }
.table th, .table td { padding: var(--sp-3) var(--sp-5); text-align: left; }
.table thead th {
    font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.04em;
    color: var(--color-accent-hover);
    background: linear-gradient(180deg, var(--color-accent-soft) 0%, var(--color-bg-2) 100%);
    border-bottom: 1px solid #bfdbfe; white-space: nowrap;
}
.table tbody tr { border-bottom: 1px solid var(--color-line); }
.table tbody tr:last-child { border-bottom: 0; }
.table tbody tr:hover { background: var(--color-bg-2); }
.table .actions { display: flex; gap: var(--sp-2); justify-content: flex-end; }
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable .arrow { opacity: 0.4; }
.table th.sortable[aria-sort="ascending"] .arrow,
.table th.sortable[aria-sort="descending"] .arrow { opacity: 1; color: var(--color-accent); }

/* ---- Badges ---- */
.badge {
    display: inline-flex; align-items: center; gap: var(--sp-1);
    padding: 2px var(--sp-2); border-radius: var(--radius-pill);
    font-size: var(--fs-xs); font-weight: 600;
}
.badge--success { background: var(--color-success-soft); color: var(--color-success); }
.badge--muted   { background: var(--color-bg); color: var(--color-muted); }
.badge--accent  { background: var(--color-accent-soft); color: var(--color-accent); }
.badge--warning { background: var(--color-warning-soft); color: var(--color-warning); }

/* ---- Empty state ---- */
.empty { text-align: center; padding: var(--sp-7) var(--sp-5); color: var(--color-muted); }
.empty__icon { font-size: 2rem; opacity: 0.5; margin-bottom: var(--sp-2); }

/* ---- Pagination ---- */
.pagination { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
    padding: var(--sp-3) var(--sp-5); flex-wrap: wrap; }
.pagination__pages { display: flex; gap: var(--sp-1); }
.pagination__pages a, .pagination__pages span {
    min-width: 32px; height: 32px; padding: 0 var(--sp-2);
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--color-line-2); border-radius: var(--radius-sm);
    color: var(--color-ink-2); font-size: var(--fs-sm);
}
.pagination__pages a:hover { background: var(--color-bg-2); text-decoration: none; }
.pagination__pages .is-current { background: var(--gradient-accent); border-color: transparent; color: #fff; box-shadow: 0 2px 8px rgba(13,79,158,0.3); }
.pagination__pages .is-disabled { opacity: 0.4; pointer-events: none; }

/* ---- Flash / alerts ---- */
.alerts { position: fixed; top: var(--sp-4); right: var(--sp-4); z-index: 80;
    display: flex; flex-direction: column; gap: var(--sp-2); max-width: 360px; }
.alert {
    padding: var(--sp-3) var(--sp-4); border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg); display: flex; gap: var(--sp-2); align-items: flex-start;
    background: var(--color-surface); border-left: 4px solid var(--color-muted);
    animation: slide-in var(--transition);
}
.alert--success { border-left-color: var(--color-success); }
.alert--error   { border-left-color: var(--color-danger); }
/* `display:flex` above otherwise defeats the `hidden` attribute on empty alerts. */
.alert[hidden] { display: none; }
.alert__close { margin-left: auto; background: none; border: none; cursor: pointer; color: var(--color-faint); }
@keyframes slide-in { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }

/* ---- Modal ---- */
.modal-backdrop {
    position: fixed; inset: 0; background: rgba(15,23,42,0.5);
    display: grid; place-items: center; z-index: 70; padding: var(--sp-4);
    animation: fade-in var(--transition);
}
.modal {
    background: var(--color-surface); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg); width: 100%; max-width: 480px;
    max-height: 90vh; overflow-y: auto;
    animation: pop var(--transition);
}
.modal__head { display: flex; align-items: center; justify-content: space-between;
    padding: var(--sp-5); border-bottom: 1px solid var(--color-line); }
.modal__body { padding: var(--sp-5); }
.modal__foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--sp-2);
    padding: var(--sp-4) var(--sp-5); border-top: 1px solid var(--color-line); }
.modal__close { background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--color-faint); line-height: 1; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: none; } }

/* ---- Auth screen ---- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: var(--sp-5);
    background: var(--gradient-hero);
    background-size: 200% 200%;
    animation: gradient-drift 16s ease infinite;
    position: relative; overflow: hidden; }
/* Decorative glow orbs */
.auth::before, .auth::after {
    content: ''; position: absolute; border-radius: 50%; pointer-events: none;
}
.auth::before {
    width: 420px; height: 420px; top: -140px; left: -120px;
    background: radial-gradient(circle, rgba(14,165,233,0.35) 0%, transparent 70%);
}
.auth::after {
    width: 520px; height: 520px; bottom: -200px; right: -140px;
    background: radial-gradient(circle, rgba(96,165,250,0.35) 0%, transparent 70%);
}
@keyframes gradient-drift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
.auth__card { width: 100%; max-width: 400px; position: relative; z-index: 1; }
/* The sign-in card itself sits inside .auth__card as a .card */
.auth__card .card { box-shadow: 0 20px 60px rgba(15,23,42,0.35); border: none; border-radius: var(--radius-lg); }
.auth__brand { display: flex; align-items: center; gap: var(--sp-2); justify-content: center;
    margin-bottom: var(--sp-5); font-weight: 700; font-size: var(--fs-xl); color: #fff; }
.auth__brand .dot { width: 16px; height: 16px; border-radius: 5px; background: var(--gradient-accent);
    box-shadow: 0 0 0 3px rgba(255,255,255,0.25); }
.spinner {
    width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff; border-radius: 50%; animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Responsive: tables collapse into stacked cards ---- */
/* Leftmost actions column: delete, view (eye), then the complete checkbox. */
.table th.col-check, .table td.col-check { width: 104px; text-align: left; }
/* Leftmost icon-action column for the master/users lists (shrink to fit). */
.table th.col-actions, .table td.col-actions { width: 1%; white-space: nowrap; text-align: left; }
.table .task-check { width: 18px; height: 18px; cursor: pointer; accent-color: var(--color-success); vertical-align: middle; }
.table .task-check:disabled { cursor: default; opacity: 0.9; }
.check-cell { display: inline-flex; align-items: center; gap: var(--sp-1); }

/* Small icon-only action buttons (eye view, trash delete). */
.icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; padding: 0;
    border: 1px solid transparent; border-radius: var(--radius-sm);
    background: transparent; color: var(--color-muted); cursor: pointer;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.icon-btn:hover { background: var(--color-bg-2); color: var(--color-accent); border-color: var(--color-line-2); text-decoration: none; }
.icon-btn--danger:hover { background: var(--color-danger-soft); color: var(--color-danger); border-color: var(--color-danger); }
.icon-btn svg { display: block; }

/* Completing: flash light green, then fade the row out before the list reloads
   and the (now-completed) row drops from the Pending view. */
@keyframes rowCompleteFlash {
    0%   { background-color: #86efac; opacity: 1; }
    55%  { background-color: #86efac; opacity: 1; }
    100% { background-color: #86efac; opacity: 0; }
}
.table tbody tr.row-completing > td { animation: rowCompleteFlash 0.5s ease forwards; }

/* Deleting: sweep white → dark red over 2s, then the row is gone. */
@keyframes rowDeleteFade { 0% { background-color: #ffffff; } 100% { background-color: #b91c1c; } }
.table tbody tr.row-deleting > td { animation: rowDeleteFade 2s ease forwards; color: #fff; transition: color 1.5s ease; }
.table tbody tr.row-deleting > td a, .table tbody tr.row-deleting > td .badge, .table tbody tr.row-deleting > td .icon-btn {
    color: #fff !important; transition: color 1.5s ease;
}
/* Keep the due date and its Overdue badge on one line (incl. the mobile card,
   where each cell value is otherwise stacked). */
.due-val { display: inline-flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2); }

@media (max-width: 720px) {
    /* Each row becomes a self-contained card with label/value rows. */
    .table thead { display: none; }
    .table, .table tbody { display: block; width: 100%; }
    .table tbody tr {
        display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--sp-2);
        border: 1px solid var(--color-line-2);
        border-radius: var(--radius);
        background: var(--color-surface);
        box-shadow: var(--shadow-sm);
        padding: var(--sp-3) var(--sp-4);
        margin-bottom: var(--sp-3);
        max-width: 100%;
    }
    .table tbody tr > td {
        flex: 0 0 100%;
        min-width: 0;                                  /* allow the cell to shrink */
        display: grid;
        grid-template-columns: 84px minmax(0, 1fr);    /* value track may shrink below its content */
        align-items: start;
        gap: var(--sp-3);
        padding: var(--sp-1) 0;
        border: 0;
        overflow-wrap: anywhere;                       /* break long words / emails */
    }
    /* Keep every value (incl. multi-element cells like Due) in the value column
       and let it shrink instead of widening the card. */
    .table tbody tr > td > * { grid-column: 2; min-width: 0; max-width: 100%; justify-self: start; }
    /* Date cells must wrap inside a card even though they're nowrap in the table. */
    .table tbody tr > td.nowrap { white-space: normal; }
    /* Cells with no data-label (e.g. the dashboard "Needs attention" table) render
       as plain stacked blocks rather than reserving an empty label column. */
    .table tbody tr > td:not([data-label]) { display: block; }
    .table tbody tr > td:not([data-label])::before { content: none; }
    .table td::before {
        content: attr(data-label);
        font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.04em;
        color: var(--color-muted); font-weight: 700; padding-top: 3px;
    }
    /* Primary cell = card title header (full width, no label) — unless the row
       leads with a checkbox column, in which case checkbox + title share line 1. */
    .table tbody tr > td:first-child:not(.col-check):not(.col-actions) {
        display: block; flex-basis: 100%;
        margin-bottom: var(--sp-2); padding-bottom: var(--sp-2);
        border-bottom: 1px solid var(--color-line);
    }
    .table tbody tr > td:first-child:not(.col-check):not(.col-actions)::before { content: none; }
    .table tbody tr > td.col-check,
    .table tbody tr > td.col-actions { flex: 0 0 auto; display: block; width: auto; padding: 0; text-align: left; }
    .table tbody tr > td.col-check::before,
    .table tbody tr > td.col-actions::before { content: none; }
    .table tbody tr > td.col-title { flex: 1; min-width: 0; display: block; width: auto; padding: var(--sp-1) 0; }
    .table tbody tr > td.col-title::before { content: none; }
    /* Action buttons (e.g. Users: Edit / Suspend / Reset / Delete) wrap instead
       of forcing the card wider than the screen. */
    .table .actions { justify-content: flex-start; flex-wrap: wrap; }

    /* Tighten the filter row and let the segmented tabs scroll rather than
       push the page wider than the screen. */
    .toolbar { padding: var(--sp-3) var(--sp-4); }
    .toolbar .search { min-width: 140px; }
    .segmented { max-width: 100%; overflow-x: auto; }
    .segmented__btn { white-space: nowrap; }
}

/* ---- Detail page: meta sidebar card ---- */
.task-meta { width: 280px; flex-shrink: 0; }
@media (max-width: 720px) {
    /* Becomes a full-width block under the main content on phones. */
    .task-meta { width: 100%; }
}

/* ---- Forms: side-by-side field rows stack on phones ---- */
@media (max-width: 560px) {
    .flex > .field { flex: 1 1 100%; }
}

/* ---- Compliance filter section: toggle, date range, AI search ---- */
/* Collapsed state is set on <html> pre-paint (no flash) by boot-filters.js and
   kept in sync by the topbar toggle handler in app.js. One class suffices since
   only one list (and its [data-filter-section]) is on the page at a time. */
html.ct-filters-collapsed [data-filter-section] { display: none; }

.ai-search {
    padding: var(--sp-4) var(--sp-5);
    border-top: 1px dashed var(--color-line-2);
}
.ai-search__row { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.ai-search__spark { font-size: 1.15rem; line-height: 1; }
.ai-search__input { flex: 1 1 260px; min-width: 200px; }
.ai-search__feedback { margin-top: var(--sp-3); font-size: var(--fs-sm); }
.ai-search__feedback--error { color: var(--color-danger); }
.ai-search__note { color: var(--color-muted); margin-top: var(--sp-1); }

.ai-chips { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2); }
.ai-chips__label { color: var(--color-muted); }
.chip {
    display: inline-flex;
    align-items: center;
    padding: 2px var(--sp-2);
    border-radius: var(--radius-sm);
    background: var(--color-accent-soft);
    color: var(--color-accent);
    font-size: var(--fs-sm);
    font-weight: 600;
}

@media (max-width: 560px) {
    .ai-search__btn { width: 100%; }
}
