/* Agent bar + drawer (ported from the MimirOne Agent Bar mockup), recoloured
   to the app palette: navy ground, gold primary, blue accent. Shared by
   Components/UI/ContinuumAgentBar.razor (header, Executive) and the Traversal
   page (floating, recruiter). Every rule is scoped under .ag-root. */

.ag-root {
    --ag-bg: #07111f;
    --ag-bg2: #0b1a2e;
    --ag-panel: #0c1b30;
    --ag-ink: #eef3fb;
    --ag-dim: #9aabc4;
    --ag-faint: #64758c;
    --ag-line: rgba(140, 175, 230, .14);
    --ag-line2: rgba(216, 168, 62, .32);
    --ag-a1: #f0c85e;
    --ag-a2: #4f8dff;
    --ag-on: #0a1119;
    --ag-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
    flex: 1;
    display: flex;
    justify-content: center;
    min-width: 0;
}

/* ---------------- pill ---------------- */
@property --agAng {
    syntax: '<angle>';
    inherits: false;
    initial-value: 0deg;
}

.ag-root .ag-pill {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    width: min(480px, 100%);
    height: 40px;
    padding: 0 12px 0 14px;
    min-width: 0;
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--ag-dim);
    text-align: left;
    cursor: pointer;
    font-size: 13.5px;
    background:
        linear-gradient(var(--ag-bg2), var(--ag-bg2)) padding-box,
        conic-gradient(from var(--agAng), var(--ag-line2) 0deg, var(--ag-a1) 70deg, var(--ag-a2) 130deg, var(--ag-line2) 200deg, var(--ag-line2) 360deg) border-box;
    animation: agAng 8s linear infinite;
    transition: box-shadow .35s, color .2s;
}

@keyframes agAng {
    to { --agAng: 360deg; }
}

.ag-root .ag-pill:hover { color: var(--ag-ink); }
.ag-root .ag-pill:focus-visible { outline: 2px solid var(--ag-a1); outline-offset: 3px; }
.ag-root .ag-ico { width: 16px; height: 16px; flex: none; color: var(--ag-a1); }
.ag-root .ag-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-root .ag-pill kbd { flex: none; padding: 1px 7px; border: 1px solid var(--ag-line2); border-radius: 7px; background: none; font: 500 10.5px var(--ag-mono); color: var(--ag-faint); }
.ag-root .ag-chev { width: 14px; height: 14px; flex: none; transition: transform .4s; }
.ag-root .ag-badge { flex: none; min-width: 20px; padding: 1px 7px; border-radius: 999px; background: linear-gradient(120deg, var(--ag-a1), var(--ag-a2)); color: var(--ag-on); font: 600 10.5px/1.55 var(--ag-mono); text-align: center; }
.ag-root.ag-open .ag-pill { color: var(--ag-ink); box-shadow: 0 0 34px color-mix(in srgb, var(--ag-a1) 30%, transparent); }
.ag-root.ag-open .ag-chev { transform: rotate(180deg); }

/* ---------------- scrim + drawer (fixed, below the 4.5rem top bar) ---------------- */
.ag-root .ag-scrim {
    position: fixed;
    inset: 4.5rem 0 0 0;
    z-index: 1040;
    opacity: 0;
    pointer-events: none;
    background: radial-gradient(ellipse at 50% 0%, color-mix(in srgb, var(--ag-bg2) 55%, transparent), color-mix(in srgb, var(--ag-bg) 84%, transparent));
    -webkit-backdrop-filter: blur(10px) saturate(.9);
    backdrop-filter: blur(10px) saturate(.9);
    transition: opacity .5s ease;
}

.ag-root.ag-open .ag-scrim { opacity: 1; pointer-events: auto; }

.ag-root .ag-drawer {
    position: fixed;
    z-index: 1045;
    top: calc(4.5rem + 12px);
    left: 0;
    right: 0;
    margin-inline: auto;
    width: min(1180px, calc(100% - 32px));
    height: min(640px, calc(100vh - 4.5rem - 32px));
    border: 1px solid var(--ag-line2);
    border-radius: 30px;
    overflow: hidden;
    color: var(--ag-ink);
    background: color-mix(in srgb, var(--ag-panel) 80%, transparent);
    -webkit-backdrop-filter: blur(30px) saturate(1.6);
    backdrop-filter: blur(30px) saturate(1.6);
    box-shadow: 0 44px 110px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .08);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-28px) scale(.985);
    transition: transform .55s cubic-bezier(.2, .9, .2, 1), opacity .35s ease, visibility 0s linear .55s;
}

.ag-root.ag-open .ag-drawer {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition: transform .55s cubic-bezier(.2, .9, .2, 1), opacity .35s ease, visibility 0s;
}

.ag-root .ag-drawer::before {
    content: "";
    position: absolute;
    inset: -25%;
    pointer-events: none;
    background:
        radial-gradient(38% 42% at 18% 12%, color-mix(in srgb, var(--ag-a2) 22%, transparent), transparent 70%),
        radial-gradient(34% 38% at 88% 18%, color-mix(in srgb, var(--ag-a1) 18%, transparent), transparent 70%),
        radial-gradient(40% 40% at 60% 100%, color-mix(in srgb, var(--ag-a2) 12%, transparent), transparent 70%);
    animation: agDrift 22s ease-in-out infinite alternate;
}

@keyframes agDrift {
    from { transform: translate3d(-2%, -1%, 0) rotate(0deg); }
    to { transform: translate3d(3%, 2%, 0) rotate(6deg); }
}

.ag-root .i { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.ag-root .ag-close { position: absolute; z-index: 3; top: 14px; right: 14px; width: 34px; height: 34px; display: grid; place-items: center; padding: 0; background: color-mix(in srgb, var(--ag-bg) 50%, transparent); border: 1px solid var(--ag-line2); border-radius: 999px; color: var(--ag-dim); cursor: pointer; }
.ag-root .ag-close:hover { color: var(--ag-ink); border-color: var(--ag-a1); }

.ag-root .ag-tabs { display: none; position: relative; z-index: 2; gap: 4px; padding: 12px 60px 0 14px; }
.ag-root .ag-tabs button { padding: 8px 14px; background: transparent; border: 0; border-radius: 999px; color: var(--ag-dim); font-size: 13px; cursor: pointer; }
.ag-root .ag-tabs button[aria-selected="true"] { color: var(--ag-ink); background: linear-gradient(100deg, color-mix(in srgb, var(--ag-a1) 20%, transparent), color-mix(in srgb, var(--ag-a2) 20%, transparent)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ag-a1) 35%, transparent); }
.ag-root .ag-tabs .n { margin-left: 6px; padding: 0 7px; border-radius: 999px; background: linear-gradient(120deg, var(--ag-a1), var(--ag-a2)); color: var(--ag-on); font: 600 10.5px/1.7 var(--ag-mono); }

.ag-root .ag-grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; height: 100%; padding: 16px; }
.ag-root .ag-card { display: flex; flex-direction: column; min-width: 0; min-height: 0; border: 1px solid var(--ag-line); border-radius: 22px; background: color-mix(in srgb, var(--ag-bg) 50%, transparent); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04); }
.ag-root.ag-open .ag-card { animation: agRise .6s cubic-bezier(.2, .9, .2, 1) both; }
.ag-root.ag-open .ag-rec { animation-delay: .1s; }

@keyframes agRise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}

.ag-root .ag-card-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 14px; }
.ag-root .ag-card-h h2 { display: flex; align-items: center; gap: 9px; margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -.01em; color: var(--ag-ink); }
.ag-root .ag-card-h h2 svg { width: 16px; height: 16px; color: var(--ag-a1); flex: none; }
.ag-root .ag-card-h p { margin: 6px 0 0; max-width: 60ch; color: var(--ag-dim); font-size: 12.5px; line-height: 1.55; }
.ag-root .ag-end { flex: none; margin-right: 44px; padding: 5px 12px; border: 1px solid var(--ag-line2); border-radius: 999px; background: transparent; color: var(--ag-dim); font-size: 12px; cursor: pointer; }
.ag-root .ag-end:hover:not(:disabled) { color: var(--ag-ink); border-color: var(--ag-a1); }
.ag-root .ag-rec .ag-card-h { padding-right: 60px; }

.ag-root .ag-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 20px 18px; scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--ag-a1) 35%, transparent) transparent; }

.ag-root .ag-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; min-height: 100%; text-align: center; }
.ag-root .ag-empty p { margin: 0; max-width: 42ch; color: var(--ag-dim); font-size: 13.5px; line-height: 1.65; }

.ag-root .ag-orb {
    position: relative;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    animation: agFloat 6s ease-in-out infinite;
    background: radial-gradient(circle at 32% 26%, #fff 0, color-mix(in srgb, var(--ag-a1) 65%, #fff) 12%, var(--ag-a1) 32%, var(--ag-a2) 66%, color-mix(in srgb, var(--ag-a2) 30%, transparent) 72%);
    box-shadow: 0 0 60px color-mix(in srgb, var(--ag-a2) 50%, transparent), 0 0 120px color-mix(in srgb, var(--ag-a1) 25%, transparent);
}

.ag-root .ag-orb::after { content: ""; position: absolute; inset: -12px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--ag-a1) 40%, transparent); animation: agPulse 3.2s ease-out infinite; }

@keyframes agFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@keyframes agPulse {
    from { transform: scale(.9); opacity: .9; }
    to { transform: scale(1.35); opacity: 0; }
}

.ag-root .ag-go { display: inline-flex; align-items: center; gap: 9px; padding: 12px 24px; border: 0; border-radius: 999px; background: linear-gradient(110deg, var(--ag-a1), var(--ag-a2)); color: var(--ag-on); font-weight: 600; font-size: 13.5px; cursor: pointer; box-shadow: 0 10px 34px color-mix(in srgb, var(--ag-a1) 35%, transparent); transition: transform .2s, box-shadow .2s; }
.ag-root .ag-go:hover { transform: translateY(-1px); box-shadow: 0 14px 40px color-mix(in srgb, var(--ag-a1) 48%, transparent); }
.ag-root .ag-go svg { width: 12px; height: 12px; }
.ag-root .ag-go:focus-visible, .ag-root .ag-close:focus-visible, .ag-root .ag-send:focus-visible, .ag-root .ag-tabs button:focus-visible, .ag-root .ag-disc:focus-visible, .ag-root .ag-cand button:focus-visible { outline: 2px solid var(--ag-a1); outline-offset: 2px; }

/* "Reading your Continuum" — each row flips spinner -> check in turn */
.ag-root .ag-read { margin-bottom: 14px; padding: 14px 16px; border: 1px solid var(--ag-line); border-radius: 18px; background: color-mix(in srgb, var(--ag-a1) 5%, transparent); font: 400 12px var(--ag-mono); color: var(--ag-dim); }
.ag-root .ag-read strong { display: block; margin-bottom: 8px; font: 500 10.5px var(--ag-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ag-a1); }
.ag-root .ag-read-row { display: flex; align-items: center; gap: 10px; padding: 3px 0; }
.ag-root .ag-read-row em { margin-left: auto; font-style: normal; color: var(--ag-ink); }
.ag-root .ag-state { position: relative; width: 14px; height: 14px; display: grid; place-items: center; flex: none; }
.ag-root .ag-spin { width: 11px; height: 11px; border: 1.5px solid var(--ag-line2); border-top-color: var(--ag-a1); border-radius: 50%; animation: agRot .8s linear infinite, agHide 0s linear forwards; animation-delay: 0s, calc(.45s + var(--i) * .45s); }
.ag-root .ag-okico { position: absolute; inset: 0; width: 13px; height: 13px; margin: auto; color: var(--ag-a1); opacity: 0; animation: agShow .2s ease forwards; animation-delay: calc(.45s + var(--i) * .45s); }

@keyframes agRot { to { transform: rotate(360deg); } }
@keyframes agHide { to { opacity: 0; } }
@keyframes agShow { to { opacity: 1; } }

/* messages */
.ag-root .msg { display: flex; gap: 10px; max-width: 90%; margin-bottom: 12px; }
.ag-root .msg.user { margin-left: auto; flex-direction: row-reverse; }
.ag-root .av { flex: none; width: 26px; height: 26px; margin-top: 1px; border-radius: 50%; display: grid; place-items: center; color: var(--ag-on); background: linear-gradient(135deg, var(--ag-a1), var(--ag-a2)); }
.ag-root .av svg { width: 12px; height: 12px; }
.ag-root .bubble { padding: 11px 16px; border-radius: 20px; font-size: 13.5px; line-height: 1.6; overflow-wrap: anywhere; white-space: pre-wrap; }
.ag-root .msg.agent .bubble { border: 1px solid var(--ag-line); border-top-left-radius: 6px; background: color-mix(in srgb, var(--ag-a2) 8%, transparent); }
.ag-root .msg.user .bubble { border: 1px solid color-mix(in srgb, var(--ag-a1) 38%, transparent); border-top-right-radius: 6px; background: linear-gradient(120deg, color-mix(in srgb, var(--ag-a1) 18%, transparent), color-mix(in srgb, var(--ag-a2) 18%, transparent)); }
.ag-root .typing .bubble i { display: inline-block; width: 6px; height: 6px; margin: 0 2px; border-radius: 50%; background: var(--ag-dim); animation: agDots 1.1s infinite; }
.ag-root .typing .bubble i:nth-child(2) { animation-delay: .15s; }
.ag-root .typing .bubble i:nth-child(3) { animation-delay: .3s; }

@keyframes agDots {
    0%, 60%, 100% { opacity: .25; transform: none; }
    30% { opacity: 1; transform: translateY(-3px); }
}

/* candidate nodes */
.ag-root .ag-cand { max-width: 90%; margin: -2px 0 14px 36px; padding: 14px 16px; border: 1px solid var(--ag-line2); border-radius: 20px; background: color-mix(in srgb, var(--ag-a1) 6%, transparent); transition: opacity .3s; }
.ag-root .ag-cand.is-skipped { opacity: .5; }
.ag-root .ag-cand small { display: block; margin-bottom: 6px; width: fit-content; font: 500 10.5px var(--ag-mono); letter-spacing: .12em; text-transform: uppercase; background: linear-gradient(100deg, var(--ag-a1), var(--ag-a2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ag-root .ag-cand strong { display: block; font-size: 14px; line-height: 1.35; font-weight: 600; }
.ag-root .ag-cand-body { margin: 6px 0 0; color: var(--ag-dim); font-size: 12.5px; line-height: 1.55; }
.ag-root .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; color: var(--ag-dim); font-size: 12px; }
.ag-root .meta i { width: 8px; height: 8px; border-radius: 50%; background: var(--dc); box-shadow: 0 0 10px var(--dc); }
.ag-root .acts { display: flex; gap: 8px; margin-top: 12px; }
.ag-root .ag-cand button { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--ag-line2); background: transparent; color: var(--ag-ink); font-size: 12.5px; cursor: pointer; }
.ag-root .ag-cand button.add { border-color: transparent; background: linear-gradient(110deg, var(--ag-a1), var(--ag-a2)); color: var(--ag-on); font-weight: 600; }
.ag-root .ag-cand button:hover:not(:disabled) { filter: brightness(1.12); }
.ag-root .ag-cand button:disabled { opacity: .6; cursor: default; }
.ag-root .done { display: flex; align-items: center; gap: 8px; margin-top: 10px; color: var(--ag-a1); font-size: 12.5px; }
.ag-root .done svg { width: 14px; height: 14px; }

/* proposed relationships */
.ag-root .ag-rel { display: flex; align-items: center; gap: 10px; max-width: 90%; margin: -4px 0 14px 36px; padding: 10px 14px; border: 1px dashed var(--ag-line2); border-radius: 16px; font-size: 12.5px; color: var(--ag-dim); }
.ag-root .ag-rel > svg { width: 15px; height: 15px; flex: none; color: var(--ag-a2); }
.ag-root .ag-rel-text { flex: 1; min-width: 0; }
.ag-root .ag-rel-text b { color: var(--ag-ink); font-weight: 600; }
.ag-root .ag-rel-text em { font-style: normal; color: var(--ag-a2); }
.ag-root .ag-rel button { flex: none; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--ag-line2); background: transparent; color: var(--ag-ink); font-size: 12px; cursor: pointer; }
.ag-root .ag-rel-ok { flex: none; color: var(--ag-a1); font-size: 12px; }
.ag-root .ag-rel-hint { flex: none; color: var(--ag-faint); font-size: 11.5px; }

.ag-root .ag-err { margin: 6px 0 12px; padding: 8px 12px; border: 1px solid rgba(224, 87, 91, .4); border-radius: 12px; background: rgba(224, 87, 91, .12); color: #ffd7d8; font-size: 12.5px; }

/* composer */
.ag-root .ag-input { display: flex; align-items: flex-end; gap: 10px; padding: 12px 16px 16px; }
.ag-root .ag-input textarea { flex: 1; min-width: 0; max-height: 120px; padding: 12px 18px; resize: none; border: 1px solid var(--ag-line2); border-radius: 22px; background: color-mix(in srgb, var(--ag-bg) 60%, transparent); color: var(--ag-ink); font-family: inherit; font-size: 13.5px; line-height: 1.5; }
.ag-root .ag-input textarea::placeholder { color: var(--ag-faint); }
.ag-root .ag-input textarea:focus-visible { outline: 2px solid var(--ag-a1); outline-offset: 1px; }
.ag-root .ag-send { flex: none; width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: linear-gradient(120deg, var(--ag-a1), var(--ag-a2)); color: var(--ag-on); cursor: pointer; box-shadow: 0 8px 24px color-mix(in srgb, var(--ag-a1) 32%, transparent); }
.ag-root .ag-send:disabled { opacity: .4; cursor: default; box-shadow: none; }
.ag-root .ag-send .i { width: 17px; height: 17px; }

/* recommendations */
.ag-root .ag-muted { color: var(--ag-dim); font-size: 13px; }
.ag-root .ag-muted a { color: var(--ag-a1); }
.ag-root .ag-recs { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.ag-root .ag-recs li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; padding: 16px; border: 1px solid var(--ag-line); border-radius: 20px; background: color-mix(in srgb, var(--ag-a1) 4%, transparent); transition: border-color .25s, background .25s, transform .25s; }
.ag-root .ag-recs li:hover { border-color: color-mix(in srgb, var(--ag-a1) 45%, transparent); background: color-mix(in srgb, var(--ag-a1) 8%, transparent); transform: translateY(-1px); }
.ag-root .bulb { width: 17px; height: 17px; margin-top: 2px; color: var(--ag-a1); }
.ag-root .ag-recs p { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--ag-ink); }
.ag-root .ag-disc { align-self: start; width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border: 1px solid transparent; border-radius: 50%; background: transparent; color: var(--ag-faint); cursor: pointer; }
.ag-root .ag-disc:hover:not(:disabled) { color: var(--ag-a1); border-color: color-mix(in srgb, var(--ag-a1) 45%, transparent); background: color-mix(in srgb, var(--ag-a1) 10%, transparent); }
.ag-root .ag-disc svg { width: 15px; height: 15px; }

.ag-root .ag-toast { position: absolute; z-index: 4; left: 50%; bottom: 22px; transform: translate(-50%, 8px); padding: 9px 16px; border: 1px solid var(--ag-line2); border-radius: 999px; background: color-mix(in srgb, var(--ag-panel) 94%, transparent); color: var(--ag-ink); font-size: 12.5px; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; }
.ag-root .ag-toast.on { opacity: 1; transform: translate(-50%, 0); }

/* narrow screens: icon-only pill, tabs between the two cards */
@media (max-width: 899px) {
    .ag-root { justify-content: flex-end; }
    .ag-root .ag-pill { width: auto; padding: 0 12px; }
    .ag-root .ag-t, .ag-root .ag-pill kbd, .ag-root .ag-chev { display: none; }
    .ag-root .ag-drawer { width: calc(100% - 16px); height: calc(100vh - 4.5rem - 20px); border-radius: 26px; }
    .ag-root .ag-tabs { display: flex; }
    .ag-root .ag-grid { grid-template-columns: minmax(0, 1fr); height: calc(100% - 54px); padding: 12px; }
    .ag-root .ag-drawer:not(.ag-tab-rec) .ag-rec { display: none; }
    .ag-root .ag-drawer.ag-tab-rec .ag-chat { display: none; }
    .ag-root .ag-end { margin-right: 0; }
    .ag-root .msg, .ag-root .ag-cand, .ag-root .ag-rel { max-width: 96%; }
}

@media (prefers-reduced-motion: reduce) {
    .ag-root .ag-pill, .ag-root .ag-orb, .ag-root .ag-orb::after, .ag-root .ag-drawer::before, .ag-root .ag-spin { animation: none; }
    .ag-root .ag-okico { animation: none; opacity: 1; }
    .ag-root .ag-spin { display: none; }
    .ag-root .ag-drawer, .ag-root.ag-open .ag-drawer { transform: none; transition: opacity .15s, visibility 0s; }
    .ag-root.ag-open .ag-card { animation: none; }
    .ag-root .ag-scrim { transition: opacity .15s; }
}


/* Page-owned bar (Traversal): floats into the middle of the 4.5rem header. */
.ag-root.ag-floating {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 4.5rem;
    z-index: 35;
    align-items: center;
    pointer-events: none;
}

/* A page with its own bar (Traversal, Opportunity Preparation) takes the header slot:
   the Continuum agent steps aside but keeps its space so the header doesn't shift. */
body:has(.ag-root.ag-floating) .topbar .ag-root:not(.ag-floating) { visibility: hidden; }

/* pointer-events is inherited: re-enable it on everything interactive, or clicks
   inside the drawer fall through to the scrim (which closes it). */
.ag-root.ag-floating .ag-pill,
.ag-root.ag-floating .ag-drawer { pointer-events: auto; }

@media (min-width: 641px) {
    .ag-root.ag-floating { left: var(--mo-sidebar-w); transition: left .32s cubic-bezier(.2, .8, .2, 1); }
}

/* narrow screens: a round button bottom-right instead of the header slot */
@media (max-width: 899px) {
    .ag-root.ag-floating { top: auto; bottom: 16px; left: auto; right: 16px; height: auto; }
    .ag-root.ag-floating .ag-pill { height: 48px; padding: 0 16px; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); }
}

/* composer extras used by the Traversal drawer */
.ag-root .ag-chips { display: flex; gap: 8px; overflow-x: auto; padding: 0 16px 2px; scrollbar-width: thin; }
.ag-root .ag-chips button { flex: none; padding: 6px 12px; border: 1px solid var(--ag-line2); border-radius: 999px; background: transparent; color: var(--ag-dim); font-size: 12px; white-space: nowrap; cursor: pointer; }
.ag-root .ag-chips button:hover { color: var(--ag-ink); border-color: var(--ag-a1); }
.ag-root .ag-foot { padding: 0 18px 12px; color: var(--ag-faint); font-size: 11.5px; }
.ag-root .ag-closed { padding: 0 16px 12px; }
.ag-root .ag-inbox-note { margin: 0 0 12px; color: var(--ag-dim); font-size: 12.5px; line-height: 1.55; }
.ag-root .ag-inbox .ag-cand { max-width: none; margin: 0 0 12px; }
.ag-root .ag-inbox .ag-rel { max-width: none; margin: 0 0 12px; }
.ag-root .ag-src { margin-top: 8px; color: var(--ag-dim); font-size: 12px; }
.ag-root .ag-src b { color: var(--ag-ink); font-weight: 500; }
.ag-root .ag-chat-chip { display: flex; align-items: center; gap: 8px; max-width: 90%; margin: -4px 0 14px 36px; color: var(--ag-dim); font-size: 12px; }
.ag-root .ag-chat-chip button { padding: 0; border: 0; background: none; color: var(--ag-a1); font-size: 12px; cursor: pointer; }
.ag-root .ag-hist { max-width: 90%; margin: -6px 0 14px 36px; color: var(--ag-faint); font-size: 11.5px; font-style: italic; }


/* Traversal drawer: Inbox / Discoveries switch in the right card */
.ag-root .ag-side-tabs { display: inline-flex; gap: 4px; padding: 3px; border: 1px solid var(--ag-line); border-radius: 999px; background: color-mix(in srgb, var(--ag-bg) 50%, transparent); }
.ag-root .ag-side-tabs button { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border: 0; border-radius: 999px; background: transparent; color: var(--ag-dim); font-size: 13px; font-weight: 600; cursor: pointer; transition: color .2s, background .2s; }
.ag-root .ag-side-tabs button svg { width: 14px; height: 14px; }
.ag-root .ag-side-tabs button:hover { color: var(--ag-ink); }
.ag-root .ag-side-tabs button.is-active { color: var(--ag-ink); background: linear-gradient(100deg, color-mix(in srgb, var(--ag-a1) 22%, transparent), color-mix(in srgb, var(--ag-a2) 22%, transparent)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ag-a1) 35%, transparent); }
.ag-root .ag-side-tabs button.is-active svg { color: var(--ag-a1); }
.ag-root .ag-side-tabs .n { padding: 0 7px; border-radius: 999px; background: linear-gradient(120deg, var(--ag-a1), var(--ag-a2)); color: var(--ag-on); font: 600 10.5px/1.7 var(--ag-mono); }
.ag-root .ag-card-h .ag-side-tabs + p { margin-top: 10px; }
.ag-root .ag-disc-rel { display: block; margin-top: 8px; color: var(--ag-dim); font-size: 12px; line-height: 1.5; }
.ag-root .ag-grounded { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; padding: 2px 9px; border: 1px solid color-mix(in srgb, var(--ag-a2) 45%, transparent); border-radius: 999px; color: var(--ag-a2); font: 500 10.5px var(--ag-mono); letter-spacing: .06em; text-transform: uppercase; }
