/* Agent (/agent, js/agent.js): the stream on the left, the chosen mail or list on the right. Calm white cards, HV teal as the only accent,
   the Agent's own voice marked by a small teal spark. */
.agpg { display: flex; flex-direction: column; min-height: 0; height: calc(100vh - 56px); padding-bottom: 0 !important; }
.agpg .ph { flex: none; }
.agstat { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.agstat i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); flex: none; }
.agstat.busy i { background: var(--accent); animation: agPulse 1.2s ease-in-out infinite; }
.agstat.warn { color: var(--amber); } .agstat.warn i { background: var(--amber); }
@keyframes agPulse { 50% { opacity: .3; } }
.bi { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; margin-right: 6px; vertical-align: -3px; flex: none; }
.bi.r { margin: 0 0 0 6px; }
.ag { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(320px, 400px) minmax(0, 1fr); gap: 0; border-top: 1px solid var(--line); margin: 0 -24px; }
.agside { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--surface); }
.agmain { min-height: 0; overflow: auto; padding: 22px 28px 120px; scroll-behavior: smooth; }

/* drop / paste */
.agdrop { position: relative; margin: 14px 14px 10px; border: 1px dashed var(--line-strong); border-radius: 12px; background: var(--bg); transition: border-color .15s, background .15s; }
.agdrop:focus-within { border-style: solid; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-bg); }
.agdrop textarea { display: block; width: 100%; border: 0; background: transparent; resize: none; padding: 11px 12px 4px; font: 13px/1.5 var(--font); color: var(--text); outline: none; max-height: 260px; }
.agdrop textarea::placeholder { color: var(--muted); }
.agdropbar { display: flex; align-items: center; gap: 8px; padding: 6px 8px 8px 10px; }
.agdropbar .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.agfile { cursor: pointer; }
.agover { position: absolute; inset: 0; display: none; place-items: center; align-content: center; gap: 6px; border-radius: 12px; background: var(--accent-bg); color: var(--accent); font-size: 13px; pointer-events: none; }
.agover svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.agdrop.over { border-color: var(--accent); border-style: solid; } .agdrop.over .agover { display: grid; }

/* filters + search */
.agfilters { display: flex; gap: 8px; align-items: center; padding: 0 14px 10px; }
.agq { position: relative; display: flex; align-items: center; flex: 1; min-width: 0; }
.agq svg { position: absolute; left: 9px; width: 14px; height: 14px; fill: none; stroke: var(--muted); stroke-width: 2; pointer-events: none; }
.agq input { width: 100%; height: 30px; padding: 0 10px 0 29px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font: 13px var(--font); color: var(--text); }
.agq input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }

/* the stream */
.aglist { flex: 1; min-height: 0; overflow: auto; padding: 0 8px 24px; }
.agday { position: sticky; top: 0; z-index: 1; padding: 10px 8px 6px; font-size: 11.5px; font-weight: 600; color: var(--muted); background: var(--surface); }
.agrow { display: flex; gap: 11px; padding: 10px 10px 11px; border-radius: 10px; cursor: pointer; position: relative; outline: none; }
.agrow:hover { background: var(--hover); }
.agrow:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.agrow.on { background: var(--accent-bg); }
.agrow.on::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--accent); }
.agrow.done { opacity: .62; } .agrow.done:hover, .agrow.done.on { opacity: 1; }
.agrow.hot .agr1 b::after { content: ''; display: inline-block; width: 6px; height: 6px; margin-left: 6px; border-radius: 50%; background: var(--red); vertical-align: 2px; }
.agav { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; color: var(--text-2); background: var(--hover); border: 1px solid var(--line); }
.agav svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.agav.pdf, .agav.paste { border-radius: 9px; color: var(--accent); background: var(--accent-bg); border-color: transparent; }
.agav.big { width: 42px; height: 42px; font-size: 14px; }
.agrb { flex: 1; min-width: 0; }
.agr1 { display: flex; align-items: baseline; gap: 8px; } .agr1 b { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agr1 time { flex: none; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.agr2 { font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.agr2 .dn { width: 13px; height: 13px; fill: none; stroke: var(--green); stroke-width: 2.4; margin-right: 4px; vertical-align: -2px; }
.agr3 { font-size: 12.5px; color: var(--muted); line-height: 1.45; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.agchips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.agchip { display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 7px; border-radius: 999px; font-size: 11px; font-weight: 500; color: var(--text-2); background: var(--hover); border: 1px solid var(--line); white-space: nowrap; }
.agchip svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.agchip.ok { color: var(--green); background: var(--green-bg); border-color: transparent; }
.agchip.warn { color: var(--amber); background: var(--amber-bg); border-color: transparent; }
.agchip.bad { color: var(--red); background: var(--red-bg); border-color: transparent; }
.agchip.info { color: var(--violet); background: var(--violet-bg); border-color: transparent; }
.agchip.job { font-family: var(--mono); font-size: 11px; color: var(--accent); background: var(--accent-bg); border-color: transparent; }
.agreading { display: inline-flex; align-items: center; gap: 7px; color: var(--accent); }
.agreading i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--accent-bg); border-top-color: var(--accent); animation: agSpin .8s linear infinite; }
@keyframes agSpin { to { transform: rotate(360deg); } }
.agerr { color: var(--red); }
.agempty { display: grid; justify-items: center; gap: 6px; padding: 48px 24px; text-align: center; color: var(--muted); font-size: 12.5px; }
.agempty svg { width: 26px; height: 26px; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; margin-bottom: 4px; }
.agempty b { color: var(--text); font-size: 13.5px; }

/* the Agent's mark */
.agmark { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: var(--accent-bg); color: var(--accent); }
.agmark svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.agmark.sm { width: 24px; height: 24px; border-radius: 7px; } .agmark.sm svg { width: 14px; height: 14px; stroke-width: 2.1; }

/* welcome (nothing chosen) */
.agwelcome { max-width: 520px; margin: 8vh auto 0; text-align: left; }
.agwelcome h2 { margin: 18px 0 8px; font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.agwelcome p { color: var(--text-2); font-size: 14px; line-height: 1.6; margin: 0 0 14px; }
.agwelcome ul { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; }
.agwelcome li { display: flex; gap: 9px; align-items: flex-start; color: var(--text-2); font-size: 13.5px; }
.agwelcome li svg { flex: none; width: 16px; height: 16px; margin-top: 2px; fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* one item */
.aghead { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 18px; }
.aght { flex: 1; min-width: 0; }
.aght h2 { margin: 1px 0 3px; font-size: 19px; font-weight: 600; line-height: 1.3; letter-spacing: -.01em; overflow-wrap: anywhere; }
.agmeta { color: var(--text-2); font-size: 12.5px; overflow-wrap: anywhere; }
.aghb { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.aghb .btn.ic svg, .agback svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.agback { display: none; } .agback svg { transform: rotate(180deg); }
.agdone { display: inline-flex; align-items: center; gap: 5px; color: var(--green); font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.agdone svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.agcard { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 16px 18px; margin-bottom: 14px; }
.agh3 { margin: 22px 0 10px; font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }

.agthink { display: flex; gap: 14px; align-items: flex-start; } .agthink p { margin: 3px 0 12px; }
.agbars { display: grid; gap: 7px; } .agbars i { display: block; height: 9px; border-radius: 5px; background: linear-gradient(90deg, var(--hover) 25%, var(--line) 50%, var(--hover) 75%); background-size: 200% 100%; animation: agShim 1.4s linear infinite; }
.agbars i:nth-child(1) { width: 92%; } .agbars i:nth-child(2) { width: 74%; } .agbars i:nth-child(3) { width: 58%; }
@keyframes agShim { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .agbars i, .agreading i, .agstat.busy i { animation: none; } .agmain { scroll-behavior: auto; } }
.agskel { display: grid; gap: 10px; max-width: 600px; } .agskel i { height: 14px; border-radius: 6px; background: var(--hover); } .agskel i:first-child { height: 22px; width: 60%; }
.agerrbox { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 14px; }

.agsum { border-color: color-mix(in srgb, var(--accent) 22%, var(--line)); background: linear-gradient(180deg, color-mix(in srgb, var(--accent-bg) 55%, var(--surface)), var(--surface) 70%); }
.agsumh { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; } .agsumh b { font-size: 12.5px; color: var(--accent); margin-right: 2px; }
.agsumt { margin: 0; font-size: 15px; line-height: 1.6; color: var(--text); }
.agsug { display: flex; gap: 8px; margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--text-2); }
.agsug svg { flex: none; width: 15px; height: 15px; margin-top: 2px; fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.aglinks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.aglink { display: flex; align-items: center; gap: 9px; padding: 7px 11px 7px 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--text); text-decoration: none; min-width: 0; max-width: 100%; }
.aglink:hover { border-color: var(--accent); }
.aglink svg { flex: none; width: 16px; height: 16px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.aglink span { display: grid; min-width: 0; } .aglink b { font-weight: 600; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aglink small { color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aglink.nolink { padding-left: 11px; }

/* suggested actions */
.agacts { display: grid; gap: 10px; }
.agact { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.agact.isdone { background: var(--bg); }
.agact.wide { grid-template-columns: 32px minmax(0, 1fr); } .agact.wide .agactbtn { grid-column: 2; justify-content: flex-start; margin-top: 2px; }
.agacti { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--hover); color: var(--text-2); }
.agacti svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.agact.isdone .agacti { background: var(--green-bg); color: var(--green); }
.agacth { display: grid; gap: 1px; } .agacth small { font-size: 11.5px; color: var(--muted); } .agacth b { font-size: 13.5px; font-weight: 600; }
.agactb p { margin: 6px 0 0; color: var(--text-2); font-size: 13px; line-height: 1.5; }
.agactbtn { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.agta { display: block; width: 100%; margin-top: 8px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); font: 13px/1.55 var(--font); color: var(--text); resize: vertical; }
.agta:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-bg); }
.agwarn { display: flex; gap: 5px; align-items: flex-start; color: var(--amber) !important; font-size: 12px; }
.agwarn svg { flex: none; width: 13px; height: 13px; margin-top: 1px; fill: none; stroke: currentColor; stroke-width: 2; }
.agchg { display: grid; gap: 2px; margin-top: 8px; }
.agchgr { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; gap: 9px; align-items: center; padding: 6px 4px; border-top: 1px solid var(--line); font-size: 13px; cursor: pointer; }
.agchgr:first-child { border-top: 0; } .agchgr.off { cursor: default; opacity: .75; }
.agchgn { display: grid; min-width: 0; } .agchgn small { color: var(--muted); font-size: 11.5px; }
.agchgq { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--text-2); } .agchgq s { color: var(--muted); }

/* the equipment list */
.aglistsec { margin-top: 26px; scroll-margin-top: 12px; }
.aglh { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; } .aglh .agh3 { margin: 0; }
.agcounts { display: flex; gap: 12px; flex: 1; flex-wrap: wrap; }
.agcnt { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.agcnt i, .agdot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); flex: none; }
.agcnt.ok i, .st-ok .agdot { background: var(--green); } .agcnt.warn i, .st-check .agdot { background: var(--amber); }
.agcnt.bad i, .st-missing .agdot { background: var(--red); } .agcnt.info i, .st-text .agdot { background: var(--violet); }
.aglmeta { display: grid; grid-template-columns: 2fr 1.3fr 1.3fr 1.6fr; gap: 10px 12px; padding: 14px 16px; }
.aglmeta .field { margin: 0; } .aglmeta .field input { width: 100%; }
.agusage { grid-column: 1 / -1; margin: 0; display: flex; align-items: center; gap: 6px; }
.agusage svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; flex: none; }
.aglines { padding: 6px 0; }
.agsec { padding: 12px 16px 4px; font-size: 11.5px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.agl { display: grid; grid-template-columns: 10px 52px minmax(0, 1fr) 16px minmax(0, 1.15fr) 58px auto; gap: 10px; align-items: center; padding: 7px 16px; border-top: 1px solid var(--line); }
.agsec + .agl { border-top: 0; }
.agl.st-skip { opacity: .5; }
.agl.st-missing { background: color-mix(in srgb, var(--red-bg) 55%, transparent); }
.agl.st-check { background: color-mix(in srgb, var(--amber-bg) 45%, transparent); }
.agqty { width: 52px; height: 30px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); text-align: right; font: 500 13px var(--mono); color: var(--text); }
.agqty:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.agsrc { display: grid; min-width: 0; } .agsrc .agset { color: var(--accent); font-weight: 500; } .agsrc .t { font-size: 13px; color: var(--text); overflow-wrap: anywhere; } .agsrc small { color: var(--muted); font-size: 11.5px; }
.agto svg { width: 14px; height: 14px; fill: none; stroke: var(--line-strong); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.agpick { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 6px; min-width: 0; padding: 5px 8px; border: 1px solid transparent; border-radius: 8px; cursor: pointer; }
.agpick:hover { border-color: var(--line-strong); background: var(--surface); } .agpick:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.agpick .chev { flex: none; width: 13px; height: 13px; fill: none; stroke: var(--muted); stroke-width: 2.2; margin-left: auto; }
.agpn { display: grid; min-width: 0; } .agpn b { font-weight: 600; font-size: 13px; overflow-wrap: anywhere; } .agpn small { color: var(--muted); font-size: 11.5px; }
.agconf.c1 { color: var(--red); } .agconf.c2 { color: var(--amber); } .agconf.c3 { color: var(--green); }
.agnf { color: var(--red); font-weight: 500; } .agtextl { color: var(--violet); font-weight: 500; }
.agstk { display: inline-flex; align-items: baseline; justify-content: flex-end; width: 100%; gap: 1px; font: 600 12.5px var(--mono); }
.agstk small { font-weight: 400; color: var(--muted); font-size: 11px; }
.agstk.ok { color: var(--green); } .agstk.warn { color: var(--amber); } .agstk.bad { color: var(--red); }
.aglact { display: flex; gap: 5px; align-items: center; justify-content: flex-end; }
.agsub { all: unset; box-sizing: border-box; height: 24px; padding: 0 7px; border-radius: 6px; border: 1px solid var(--line); font-size: 11px; font-weight: 600; color: var(--muted); cursor: pointer; }
.agsub:hover { color: var(--text); } .agsub.on { color: var(--violet); background: var(--violet-bg); border-color: transparent; }
.agsub:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.agaddrow { position: relative; padding: 10px 16px 6px; border-top: 1px solid var(--line); }
.agpop, .agpicker { position: absolute; z-index: 30; left: 16px; right: 16px; top: calc(100% - 2px); padding: 5px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  box-shadow: 0 1px 2px rgba(0,0,0,.05), 0 12px 32px -6px rgba(0,0,0,.18); max-height: 320px; overflow: auto; }
.agpicker { position: fixed; right: auto; top: 0; display: flex; flex-direction: column; max-height: 380px; overflow: hidden; animation: agIn .12s ease-out; }
@keyframes agIn { from { opacity: 0; transform: translateY(-3px); } }
.agpicker .agq { margin: 3px 3px 6px; flex: none; }
.agpo { overflow: auto; min-height: 0; }
.agpop button, .agpo button, .agpf button { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.agpop button { display: grid; } .agpop button small, .agpo button small { display: block; color: var(--muted); font-size: 11.5px; }
.agpo button span { flex: 1; min-width: 0; display: grid; } .agpo button em { font-style: normal; font: 500 11.5px var(--mono); color: var(--text-2); white-space: nowrap; }
.agpop button:hover, .agpo button:hover, .agpf button:hover, .agpo button:focus-visible, .agpop button:focus-visible { background: var(--hover); outline: none; }
.agpo button.on { background: var(--accent-bg); }
.agpf { display: flex; gap: 2px; border-top: 1px solid var(--line); padding-top: 5px; margin-top: 4px; flex: none; }
.agpf button { width: auto; color: var(--text-2); font-size: 12.5px; }
.agpope { padding: 8px 10px; }
.agtarget { position: sticky; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 14px 0 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); box-shadow: 0 -4px 18px -8px rgba(0,0,0,.12); bottom: 12px; }
.agjobq { flex: 1 1 220px; max-width: 320px; position: relative; } .agtarget .agpop { left: 14px; right: auto; width: min(420px, calc(100% - 28px)); top: auto; bottom: calc(100% + 4px); }
.agjobpick { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; min-width: 0; } .agjobpick b { font-family: var(--mono); font-size: 12.5px; color: var(--accent); }
.agjobpick .btn.ic svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.2; }
.agfull { margin: 0; font-size: 12.5px; }
.agdiff p { margin: 8px 0 0; font-size: 13px; color: var(--text-2); } .agdiff .check { margin: 6px 0 0 4px; font-size: 13px; }

/* the original */
.agorig { margin-top: 26px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.agorig summary { padding: 12px 16px; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--text-2); list-style: none; }
.agorig summary::-webkit-details-marker { display: none; }
.agorig summary::before { content: '›'; display: inline-block; margin-right: 8px; transition: transform .15s; } .agorig[open] summary::before { transform: rotate(90deg); }
.agorig[open] summary { border-bottom: 1px solid var(--line); }
.agbody { margin: 0; padding: 14px 16px 16px; white-space: pre-wrap; overflow-wrap: anywhere; font: 13px/1.6 var(--font); color: var(--text-2); max-height: 560px; overflow: auto; }
.agbody.sm { padding: 8px 0 0; max-height: none; }
.agfiles { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px 0; }
.agfilechip { all: unset; box-sizing: border-box; display: inline-flex; align-items: center; gap: 8px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; font-size: 12.5px; max-width: 100%; }
.agfilechip:hover { border-color: var(--accent); } .agfilechip:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.agfilechip svg { flex: none; width: 16px; height: 16px; fill: none; stroke: var(--red); stroke-width: 1.8; } .agfilechip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .agfilechip small { color: var(--muted); }
.agpdf { display: flex; flex-direction: column; width: min(1000px, 94vw); height: 90vh; border-radius: 12px; overflow: hidden; background: var(--surface); }
.agpdfh { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); } .agpdf iframe { flex: 1; border: 0; width: 100%; background: var(--bg); }

/* Settings › Agent: the on / off switch */
.switch { position: relative; display: inline-block; width: 38px; height: 22px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line-strong); transition: background .15s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked + span { background: var(--accent); } .switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-bg), 0 0 0 1px var(--accent); }

/* narrower: list over detail */
@media (max-width: 1100px) { .ag { grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); } .agmain { padding: 18px 18px 120px; } .aglmeta { grid-template-columns: 1fr 1fr; }
  .agl { grid-template-columns: 10px 48px minmax(0, 1fr) minmax(0, 1.1fr) 52px; } .agl .agto { display: none; } .agl .aglact { grid-column: 3 / -1; justify-content: flex-start; } .agl .aglact:empty { display: none; } }
@media (max-width: 760px) {
  .agpg { height: auto; min-height: calc(100vh - 56px); }
  .ag { display: block; margin: 0 -12px; }
  .agside { border-right: 0; } .aglist { overflow: visible; }
  .agmain { display: none; padding: 14px 14px 100px; overflow: visible; }
  .agpg.has-sel .agside { display: none; } .agpg.has-sel .agmain { display: block; }
  .agback { display: inline-flex; } .aghead { flex-wrap: wrap; } .aghb { width: 100%; justify-content: flex-start; }
  .agact { grid-template-columns: 32px minmax(0, 1fr); } .agactbtn { grid-column: 1 / -1; justify-content: flex-start; }
  .aglmeta { grid-template-columns: 1fr; }
  .agcounts { order: 3; flex-basis: 100%; gap: 6px 12px; }
  .agtarget { padding: 10px; gap: 8px; }
  .agl { grid-template-columns: 10px 46px minmax(0, 1fr) auto; grid-template-areas: 'd q s s' '. . p p' '. . k a'; gap: 4px 10px; padding: 9px 12px; }
  .agl .agdot { grid-area: d; } .agl .agqty { grid-area: q; } .agl .agsrc { grid-area: s; } .agl .agpick { grid-area: p; margin-left: -8px; } .agl .agstock { grid-area: k; justify-self: start; } .agl .aglact { grid-area: a; }
  .agstk { justify-content: flex-start; }
  .agtarget { bottom: 8px; } .agtarget .btn.primary { width: 100%; justify-content: center; }
}
/* Ask: a whole-page conversation (core.js askChat; the message and card styles are shared with ⌘K in workspace.css) */
.agpg.agask { height: 100%; min-height: 0; box-sizing: border-box; }   /* fills the view under the bar, whatever the bar's height (two rows on phones) */
/* pinned to the view's edges rather than height: 100% (iPhone Safari let the page grow past the screen, hiding the text box) */
.view > .agpg.agask { position: absolute; inset: 0; height: auto; }
.agask .ph { margin-bottom: 0; }
.askwrap { flex: 1; min-height: 0; display: flex; flex-direction: column; border-top: 1px solid var(--line); margin: 0 -24px; }
.askres { flex: 1; min-height: 0; overflow-y: auto; }
.askres .aconv, .askres .aintro { max-width: 820px; margin: 0 auto; padding: 24px 24px 16px; }
.askres .amsg { font-size: 14px; } .askres .amsg.bot { max-width: 100%; }
.askres .aintro b { font-size: 15px; margin-bottom: 12px; }
.askres .aintro ul { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); justify-items: stretch; }
.askres .aintro li { display: flex; } .askres .aintro button { display: block; flex: 1; box-sizing: border-box; padding: 10px 12px; line-height: 1.4; }
.askbox { display: flex; align-items: flex-end; gap: 8px; width: calc(100% - 48px); max-width: 820px; margin: 0 auto; padding: 8px; box-sizing: border-box;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.askbox:focus-within { border-color: var(--accent); }
.askbox textarea { flex: 1; min-height: 24px; max-height: 200px; resize: none; border: 0; outline: 0; background: none; color: var(--text); font: inherit; font-size: 14px; line-height: 1.5; padding: 6px 6px; }
.askbox .btn.ic { width: 36px; height: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; flex: none; }
.askbox .btn.ic svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.askfoot { max-width: 820px; margin: 6px auto 12px; padding: 0 24px; color: var(--muted); font-size: 11.5px; text-align: center; }
@media (max-width: 600px) {
  .askwrap { margin: 0 -12px; } .askres .aconv, .askres .aintro { padding: 16px 12px 12px; }
  .askbox { width: calc(100% - 24px); margin-bottom: calc(10px + env(safe-area-inset-bottom)); } .askbox textarea { font-size: 16px; } .askfoot { display: none; }
}

.ag[hidden] { display: none; }
.agwhq { margin: 12px 0; max-width: 640px; }   /* All warehouses: choose whose mail (js/agent.js agLoad) */
