:root {
  --bg: #f6f7f7;
  --surface: #ffffff;
  --surface-2: #f0f2f2;
  --border: #dde3e2;
  --border-strong: #c7d0ce;
  --text: #16211f;
  --muted: #63726e;
  --primary: #0f766e;
  --primary-600: #0e6b64;
  --primary-700: #0b5952;
  --primary-050: #e9faf6;
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --warn: #b54708;
  --ok: #067647;
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 33, 31, .06), 0 4px 16px rgba(16, 33, 31, .05);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary-700); text-decoration: none; }
a:hover { text-decoration: underline; }

.mono { font-family: var(--font-mono); }
.hidden { display: none !important; }

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(1200px 600px at 80% -10%, #e9faf6 0%, transparent 55%),
    var(--bg);
  padding: 20px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 32px 28px;
}
.login-card .brand { margin-bottom: 22px; }
.login-card .brand-row { justify-content: center; }
.login-card .brand-sub { text-align: center; }
.brand-mark {
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: -.02em;
  font-size: 24px;
  color: var(--text);
}
.brand-mark .dot { color: var(--primary); }
.brand-sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.brand-row { display: flex; align-items: center; gap: 8px; }
.brand-link { text-decoration: none; color: inherit; cursor: pointer; }
.brand-link:hover { opacity: .85; text-decoration: none; }
.brand-logo { height: 24px; width: auto; display: block; flex: none; }
.login-err { color: var(--danger); font-size: 13px; margin-top: 10px; min-height: 18px; }

/* ---------- App shell ---------- */
.app {
  display: grid;
  grid-template-columns: 236px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar .brand { padding: 6px 8px 18px; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 8px;
  color: var(--text);
  font-weight: 500;
}
.nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav a.active { background: var(--primary-050); color: var(--primary-700); }
.nav a svg { width: 17px; height: 17px; stroke-width: 1.9; }
.sidebar-foot {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  font-size: 12.5px;
  color: var(--muted);
}
.sidebar-foot .who { color: var(--text); font-weight: 600; }
.sidebar-foot .ver { font-family: var(--font-mono); font-size: 11px; margin-top: 3px; }
.sidebar-foot button { margin-top: 10px; }

.main { padding: 26px 30px 60px; max-width: 1200px; width: 100%; }
.main:has(.agent-wrap) { max-width: 1600px; height: 100vh; display: flex; flex-direction: column; padding-bottom: 24px; }
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.page-head h1 { font-size: 21px; margin: 0; letter-spacing: -.01em; }
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.crumb { color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.crumb a { color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  font: inherit;
  font-weight: 600;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-600); }
.btn-danger { background: #fff; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger-bg); }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ---------- Cards / tiles ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad { padding: 18px 20px; }
.card + .card { margin-top: 18px; }
.card-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 14px; }

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.tile .n { font-family: var(--font-mono); font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.tile .l { color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; }

/* ---------- Pipeline funnel ---------- */
.funnel { display: flex; flex-direction: column; gap: 8px; }
.funnel-row { display: grid; grid-template-columns: 150px 1fr 44px; align-items: center; gap: 12px; }
.funnel-row .fl { font-size: 13px; color: var(--text); }
.funnel-bar { height: 22px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.funnel-bar > span { display: block; height: 100%; background: var(--primary); border-radius: 6px; min-width: 2px; }
.funnel-row .fn { font-family: var(--font-mono); text-align: right; color: var(--muted); }

/* ---------- Tables ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.search { flex: 1; min-width: 200px; position: relative; }
.search input { width: 100%; }
table.table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.table thead th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); font-weight: 700; padding: 11px 14px; border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.table tbody td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover { background: var(--primary-050); }
.table .num { font-family: var(--font-mono); color: var(--muted); }
.t-strong { font-weight: 600; }
.t-sub { color: var(--muted); font-size: 12.5px; }

/* ---------- Pills / badges ---------- */
.pill { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge { display: inline-block; padding: 2px 7px; border-radius: 6px; font-size: 11.5px; background: var(--surface-2); color: var(--muted); margin: 0 4px 4px 0; font-family: var(--font-mono); }
.st-gray { background: #eef1f0; color: #4b5854; }
.st-blue { background: #e6f0fb; color: #1d4ed8; }
.st-amber { background: #fdf0d5; color: #92400e; }
.st-green { background: #dcfae6; color: #067647; }
.st-red { background: #fee4e2; color: #b42318; }
.job-open { background: #dcfae6; color: #067647; }
.job-closed { background: #eef1f0; color: #4b5854; }
.job-hold { background: #fdf0d5; color: #92400e; }

/* ---------- Forms ---------- */
label.label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
input, select, textarea {
  font: inherit; width: 100%; padding: 8px 11px; border: 1px solid var(--border-strong);
  border-radius: 8px; background: #fff; color: var(--text);
}
textarea { resize: vertical; min-height: 78px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.field { margin-bottom: 0; }

/* ---------- Detail layout ---------- */
.detail-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; align-items: start; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.resume-pre { font-family: var(--font-mono); font-size: 12px; white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 12px; max-height: 280px; overflow: auto; color: #2a3532; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.list-row { padding: 12px 0; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: none; }
.stars { color: #d1a12a; letter-spacing: 1px; }
.stars .off { color: var(--border-strong); }

/* ---------- Empty state ---------- */
.empty { text-align: center; color: var(--muted); padding: 40px 20px; }
.empty h3 { color: var(--text); margin: 0 0 6px; font-size: 15px; }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(16, 33, 31, .42); display: grid; place-items: center; padding: 20px; z-index: 50; }
.modal { background: var(--surface); border-radius: 14px; box-shadow: 0 20px 60px rgba(16,33,31,.28); width: 100%; max-width: 560px; max-height: 90vh; overflow: auto; }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 16px; }
.modal-body { padding: 20px 22px; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
.modal .err { color: var(--danger); font-size: 13px; min-height: 16px; margin-top: 8px; }

/* ---------- Toast ---------- */
#toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 80; }
.toast { background: var(--text); color: #fff; padding: 11px 15px; border-radius: 9px; font-size: 13.5px; box-shadow: var(--shadow); max-width: 340px; }
.toast.err { background: var(--danger); }
.toast.ok { background: var(--ok); }

/* ---------- Mobile ---------- */
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px; }
  .sidebar .brand { padding: 4px 8px; }
  .nav { flex-direction: row; flex-wrap: wrap; flex: 1 1 100%; }
  .sidebar-foot { border-top: none; padding-top: 0; display: flex; align-items: center; gap: 12px; }
  .sidebar-foot button { margin-top: 0; }
  .main { padding: 18px 16px 50px; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .funnel-row { grid-template-columns: 110px 1fr 40px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- AgentX AI Agent (v0.2.0) ---------- */
.ai-banner {
  background: var(--danger-bg);
  border: 1px solid #f3c9c4;
  color: #8a2b22;
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 18px;
  font-size: 13.5px;
  line-height: 1.5;
}
.ai-banner code {
  background: #fff;
  border: 1px solid #f0d3cf;
  border-radius: 5px;
  padding: 1px 5px;
  font-family: var(--font-mono);
  font-size: 12px;
}
.agent-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}
.agent-grid > div > .card + .card { margin-top: 18px; }
.agent-grid textarea { width: 100%; min-height: 120px; resize: vertical; }
@media (max-width: 900px) {
  .agent-grid { grid-template-columns: 1fr; }
}

.progress {
  height: 8px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}
.progress > span {
  display: block;
  height: 100%;
  background: var(--primary);
  transition: width .4s ease;
}

.score-big {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 600;
  color: var(--primary);
  line-height: 1;
}

.autofill {
  border: 1px dashed var(--border-strong);
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 16px;
}
.autofill input[type=file] { margin-top: 6px; }

/* chat */
.chat-card { display: flex; flex-direction: column; min-height: 440px; }
.chat-log {
  flex: 1;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface-2);
  min-height: 240px;
  max-height: 460px;
}
.chat-log:empty::before {
  content: "Ask for a shortlist, paste a JD, or attach a résumé.";
  color: var(--muted);
  font-size: 13px;
}
.chat-input { margin-top: 10px; }
.chat-input textarea { width: 100%; min-height: 60px; resize: vertical; }
.msg { margin-bottom: 10px; display: flex; flex-direction: column; }
.msg.user { align-items: flex-end; }
.msg.bot { align-items: flex-start; }
.msg .bubble {
  max-width: 88%;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  white-space: normal;
  word-wrap: break-word;
}
.msg.user .bubble {
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.msg.bot .bubble {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.doc-btn { margin-top: 6px; align-self: flex-start; }

/* ---------- AgentX unified chat (WhatsApp-style, v0.2.1) ---------- */
.agent-wrap { display: flex; flex-direction: column; position: relative; flex: 1; min-height: 0; }
.agent-top h1 { margin: 0; }
.agent-top .sub { margin-top: 2px; }
.agent-top { margin-bottom: 14px; }

.wa {
  display: flex;
  flex-direction: column;
  height: auto; min-height: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.wa-log {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wa-row { display: flex; }
.wa-row.me { justify-content: flex-end; }
.wa-row.bot { justify-content: flex-start; }
.wa-bubble {
  max-width: 84%;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
  box-shadow: 0 1px 1px rgba(16,33,31,.08);
}
.wa-row.me .wa-bubble {
  background: var(--primary-050);
  border: 1px solid #cdeee6;
  color: var(--text);
  border-bottom-right-radius: 4px;
}
.wa-row.bot .wa-bubble {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.wa-bubble a { color: var(--primary-700); font-weight: 500; }
.wa-bubble .msg-clip { width: 15px; height: 15px; display: inline-block; vertical-align: -2px; margin-right: 5px; opacity: .7; }
.wa-err { color: var(--danger); }
.wa-typing { letter-spacing: 2px; color: var(--muted); }

/* rich agent content */
.wa-head { font-weight: 600; margin-bottom: 8px; }
.wa-items { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.wa-item { font-size: 13.5px; }
.wa-sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.wa-cands { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.wa-cand { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--surface); }
.wa-cand-h { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.wa-cand-h .score-big { margin-left: auto; font-size: 20px; }
.wa-rank { font-family: var(--font-mono); color: var(--muted); font-size: 12px; }
.wa-just { margin: 6px 0; font-size: 13.5px; }
.wa-doc {
  margin-top: 8px;
  font: inherit;
  font-size: 12.5px;
  padding: 4px 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  border-radius: 7px;
  cursor: pointer;
}
.wa-doc:hover { background: var(--surface-2); }

/* composer */
.wa-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px 0; align-items: center; }
.wa-chips:empty { display: none; }
.wa-modetag {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  color: var(--primary-700); background: var(--primary-050);
  border: 1px solid #cdeee6; border-radius: 6px; padding: 2px 7px;
}
.wa-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12.5px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 999px; padding: 3px 6px 3px 10px;
}
.wa-chip button {
  border: none; background: var(--border-strong); color: #fff;
  width: 16px; height: 16px; border-radius: 50%; cursor: pointer; line-height: 1; font-size: 12px; padding: 0;
}
.wa-bar {
  display: flex; align-items: flex-end; gap: 8px;
  padding: 10px 12px; border-top: 1px solid var(--border); background: var(--surface);
}
.wa-attach { position: relative; }
.wa-clip {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--border-strong); background: var(--surface);
  font-size: 20px; line-height: 1; color: var(--muted); cursor: pointer; flex: none;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.wa-clip img { width: 18px; height: 18px; display: block; opacity: .55; }
.wa-clip:hover img { opacity: .85; }
.wa-clip:hover { background: var(--surface-2); }
.wa-clip:disabled { opacity: .5; cursor: default; }
.wa-menu {
  position: absolute; bottom: 46px; left: 0; z-index: 20;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: var(--shadow); padding: 6px; min-width: 240px;
}
.wa-menu button {
  display: block; width: 100%; text-align: left;
  border: none; background: none; font: inherit; font-size: 13.5px;
  padding: 9px 10px; border-radius: 7px; cursor: pointer; color: var(--text);
}
.wa-menu button:hover { background: var(--surface-2); }
.wa-input {
  flex: 1; resize: none; overflow-y: auto;
  border: 1px solid var(--border-strong); border-radius: 20px;
  padding: 9px 14px; font: inherit; font-size: 14px; line-height: 1.4;
  min-height: 40px; max-height: 120px; background: var(--surface);
}
.wa-input:focus { outline: none; border-color: var(--primary); }
.wa-send {
  flex: none; border: none; background: var(--primary); color: #fff;
  border-radius: 20px; padding: 9px 18px; font: inherit; font-weight: 600; cursor: pointer; height: 38px;
}
.wa-send:hover { background: var(--primary-600); }
.wa-send:disabled { opacity: .55; cursor: default; }

/* ---------- v0.2.2: lighter agent header + bulk-select ---------- */
.agent-top h1 { color: var(--muted); font-weight: 400; letter-spacing: -.02em; font-family: var(--font-mono); font-size: 20px; text-transform: uppercase; }

.bulk-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 12px;
  background: var(--primary-050); border: 1px solid #cdeee6;
  border-radius: 10px; padding: 8px 14px;
}
.bulk-bar.hidden { display: none; }
.bulk-actions { display: flex; gap: 8px; }
.cb-cell { width: 34px; text-align: center; padding-left: 8px; padding-right: 0; }
.cb-cell input { width: 16px; height: 16px; cursor: pointer; vertical-align: middle; }

/* "AgentX" black + bold; rest of the title stays light grey */
.agent-top h1 .ax { color: var(--text); font-weight: 700; }

/* ---------- v0.3.0: chat sessions sidebar + logo ---------- */
.agent-top h1 svg { margin-right: 6px; vertical-align: middle; }
.btn-block { width: 100%; display: block; }

.agent-body { display: flex; gap: 32px; align-items: stretch; flex: 1; min-height: 0; }
.wa { flex: 1; min-width: 0; order: 1; }
.wa-sessions {
  width: 244px; flex: none;
  height: auto;
  display: flex; flex-direction: column; gap: 8px;
  order: 2;
}
.wa-sesstitle {
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); padding: 4px 2px 0;
}
.wa-sesslist { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding-right: 2px; }
.wa-sess {
  border: 1px solid var(--border); border-radius: 9px;
  padding: 8px 10px; background: var(--surface);
}
.wa-sess.active { border-color: var(--primary); background: var(--primary-050); }
.wa-sess-title {
  font-size: 13px; font-weight: 500; color: var(--text); cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wa-sess-title:hover { color: var(--primary-700); }
.wa-sess-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.wa-sess-actions { margin-top: 5px; display: flex; gap: 10px; }
.wa-sess-actions button {
  border: none; background: none; padding: 0; cursor: pointer;
  font: inherit; font-size: 11px; color: var(--muted);
}
.wa-sess-actions button:hover { text-decoration: underline; }
.wa-sess-actions [data-del] { color: var(--danger); }

.wa-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; text-align: center; color: var(--muted); gap: 10px; padding: 20px;
}
.wa-empty-t { max-width: 320px; font-size: 13.5px; line-height: 1.5; }

@media (max-width: 820px) {
  .main:has(.agent-wrap) { height: auto; display: block; }
  .agent-body { flex-direction: column; }
  .wa { order: 0; height: min(70vh, 520px); }
  .wa-sessions { width: auto; height: auto; order: 0; }
  .wa-sesslist { max-height: 200px; }
  .agent-top { padding-right: 0; }
}

/* centre the agent header over the chat area, matching the empty-state.
   276px = history panel (244) + gap (32); dropped to 0 when history is hidden */
.agent-top { text-align: center; padding-right: 276px; }
.agent-wrap:has(.agent-body.sessions-hidden) .agent-top { padding-right: 0; }

/* collapsible chat-history sidebar */
.wa-toggle {
  position: absolute; top: 0; right: 0;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--muted); font: inherit; font-size: 12px;
  padding: 5px 10px; border-radius: 8px; cursor: pointer; white-space: nowrap;
}
.wa-toggle:hover { background: var(--surface-2); color: var(--text); }
.agent-body.sessions-hidden .wa-sessions { display: none; }
@media (max-width: 820px) {
  .wa-toggle { display: none; }
  .agent-body.sessions-hidden .wa-sessions { display: flex; }
}
