/* OP-020 — Mayla's saved agents: the agent selector in the panel's head, its list (a drawer over the panel's body, the
   History's look), the picked agent's greeting as the panel's first turn (js/onix-mayla-agents.js,
   Components/Layout/MaylaAgentPicker.razor) and the Mayla agents page (Components/Pages/Mayla/MaylaAgentsView.razor).
   Tokens only (css/onix-theme.css), so both themes come for free. */

/* ── the selector in the head: beside the mode switch, as tall as it, with a chevron for the list it opens ── */

.mayla-agent-pick {
    display: inline-flex; align-items: center; gap: 5px; max-width: 140px; height: 28px;
    padding: 0 10px 0 9px; border: 1px solid var(--line); border-radius: 999px;
    background: var(--panel); color: var(--ink); cursor: pointer;
    font: 600 12px/1.2 var(--font-text);
}
.mayla-agent-pick svg { flex: none; width: 15px; height: 15px; color: var(--muted); }
.mayla-agent-pick-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mayla-agent-pick::after {
    content: ""; flex: none; width: 6px; height: 6px; margin: -3px 0 0 2px;
    border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); opacity: .55;
}
.mayla-agent-pick[aria-expanded="true"]::after { margin-top: 3px; transform: rotate(-135deg); }
.mayla-agent-pick:hover { border-color: var(--brand); background: var(--brand-soft); }
.mayla-agent-pick:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.mayla-agent-pick.is-agent { border-color: var(--brand); color: var(--brand-strong, var(--brand)); background: var(--brand-soft); }
.mayla-agent-pick.is-agent svg { color: currentColor; }

/* ── the list of agents ─────────────────────────────────────────────── */

.mayla-agents-drawer .mayla-overline { margin: 10px 16px 2px; }
.mayla-agents-drawer .mayla-overline[hidden], .mayla-agents-list[hidden] { display: none; }
.mayla-agents-list { margin: 0; padding: 2px 8px; list-style: none; }
.mayla-agents-mine, .mayla-agents-shared { overflow-y: auto; }
.mayla-agent-item {
    width: 100%; display: flex; flex-direction: column; gap: 2px;
    padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--ink);
    text-align: left; cursor: pointer; font-family: var(--font-text);
}
.mayla-agent-item strong { font: 600 14px/1.3 var(--font-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mayla-agent-item small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mayla-agent-item:hover { background: var(--panel-hover); }
.mayla-agent-item:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.mayla-agent-item.is-current { background: var(--brand-soft); }
.mayla-agents-drawer .mayla-note { margin: 6px 16px; }
.mayla-agents-drawer .mayla-note[hidden] { display: none; }
.mayla-agents-foot {
    margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap;
    padding: 10px 16px 12px; border-top: 1px solid var(--hairline, var(--line));
}

/* ── the greeting: the first turn of the empty panel ────────────────── */

.mayla-agent-top[hidden] { display: none; }
.mayla-panel.mayla-has-agent .mayla-empty { display: none; }
.mayla-agent-greeting {
    margin: 12px 14px 4px; padding: 12px 14px; border-radius: 14px;
    background: var(--bg-soft, var(--panel-2)); border: 1px solid var(--hairline, var(--line));
}
.mayla-agent-greeting-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.mayla-agent-greeting-name { font: 700 15px/1.2 var(--font-display); }
.mayla-agent-greeting-handle { color: var(--muted); font-size: 12px; }
.mayla-agent-greeting-text p { margin: 0 0 6px; }
.mayla-agent-greeting .mayla-overline[hidden] { display: none; }
.mayla-agent-badge {
    margin: 8px 14px 0; padding: 4px 10px; border-radius: 999px; width: max-content; max-width: calc(100% - 28px);
    background: var(--brand-soft); color: var(--brand-strong, var(--brand)); font: 600 12px/1.3 var(--font-text);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── the Mayla agents page ──────────────────────────────────────────── */

.mayla-agents-intro { margin: 6px 0 10px; }
.mayla-agents-form textarea { width: 100%; }
.mayla-agents-describe {
    display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: end;
    margin-bottom: 12px; padding: 10px 12px; border-radius: 12px; background: var(--brand-soft);
}
.mayla-agents-describe .muted { grid-column: 1 / -1; margin: 0; font-size: 12px; }
.mayla-agents-count { margin: 2px 0 8px; font-size: 12px; }
.mayla-agents-commands { margin: 10px 0 0; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; }
.mayla-agents-commands legend { padding: 0 4px; font-weight: 600; font-size: 0.85rem; }
.mayla-agents-chosen { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; padding: 0; list-style: none; }
.mayla-agents-chip {
    display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 10px; border-radius: 999px;
    background: var(--brand-soft); color: var(--ink); font-size: 13px;
}
.mayla-agents-chip-x {
    width: 22px; height: 22px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1;
}
.mayla-agents-chip-x:hover { background: var(--panel-hover); color: var(--danger); }
.mayla-agents-matches { margin: 6px 0 0; padding: 0; list-style: none; }
.mayla-agents-matches li {
    display: grid; grid-template-columns: 1fr auto; grid-template-areas: "title add" "meta add"; gap: 0 10px; align-items: center;
    padding: 6px 4px; border-bottom: 1px solid var(--hairline, var(--line));
}
.mayla-agents-match-title { grid-area: title; font-weight: 550; }
.mayla-agents-matches small { grid-area: meta; }
.mayla-agents-matches .button { grid-area: add; }
.mayla-agents-people { margin: 6px 0; padding: 0; list-style: none; columns: 2 220px; }
.mayla-agents-facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 8px 0; }
.mayla-agents-facts dt { color: var(--muted); }
.mayla-agents-facts dd { margin: 0; overflow-wrap: anywhere; }

@media (max-width: 640px) {
    .mayla-agents-describe { grid-template-columns: 1fr; }
    .mayla-agent-pick { max-width: 110px; }
}

/* ── OP-027: the ready-made agents (the Templates tab) ─────────────── */

.mayla-agents-tabs { margin: 4px 0 10px; }
.mayla-templates { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; margin: 10px 0 16px; }
.mayla-template { display: flex; flex-direction: column; gap: 6px; }
.mayla-template h3 { margin: 0; font-family: var(--font-display); }
.mayla-template h3 small { font-weight: 500; color: var(--muted); }
.mayla-template-summary { margin: 0; }
.mayla-template .mayla-agents-facts { flex: 1; }
.mayla-template-actions { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
