/* ══ agents-addon.css — Aether Messenger agent cards ═════════════════════ */

/* ── Quick chip bar ── */
#agChips {
  display: none;
  flex-wrap: nowrap;
  gap: 6px;
  padding: 9px 16px 10px;
  overflow-x: auto;
  flex-shrink: 0;
  border-top: 1px solid rgba(255,255,255,.055);
  -webkit-overflow-scrolling: touch;
  -ms-overflow-style: none;
  scrollbar-width: none;
  /* Fade edges so scroll feels native */
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 16px, #000 calc(100% - 16px), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 16px, #000 calc(100% - 16px), transparent 100%);
}
#agChips::-webkit-scrollbar { display: none }

/* ── Agent chip — unified pill style ── */
.ag-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  /* Fixed 34px height — same as .pchip in AI Filter bar */
  height: 34px;
  padding: 0 14px;
  border-radius: 100px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  font-family: inherit;
  color: var(--t2);
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.10);
  transition:
    background .18s ease,
    color .18s ease,
    border-color .18s ease,
    box-shadow .18s ease,
    transform .12s ease;
  flex-shrink: 0;
  /* Touch: minimum 44px tall area but visually 34px */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  line-height: 1;
  position: relative;
  overflow: hidden;
  /* Prevent text selection on double-tap (iOS) */
  -webkit-user-select: none;
}

/* Shimmer sweep on hover */
.ag-chip::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,.06) 50%, transparent 60%);
  transform: translateX(-100%);
  transition: transform .45s ease;
  pointer-events: none;
}

/* Desktop hover — lift + accent glow */
@media (hover: hover) {
  .ag-chip:hover {
    background: rgba(108,99,255,.13);
    border-color: rgba(108,99,255,.30);
    color: var(--accent);
    box-shadow: 0 0 0 3px rgba(108,99,255,.08), 0 3px 14px rgba(108,99,255,.16);
    transform: translateY(-1.5px);
  }
  .ag-chip:hover::before { transform: translateX(100%); }
}

/* Active / tap — shrink (works on all devices) */
.ag-chip:active {
  transform: scale(.95) translateY(0) !important;
  box-shadow: none !important;
  background: rgba(108,99,255,.18) !important;
  border-color: rgba(108,99,255,.35) !important;
  color: var(--accent) !important;
}

.ag-chip.italic { font-style: italic; }

/* ── History chips — words from previous conversation ── */
.ag-chip-hist {
  background: rgba(0,201,167,.07);
  border-color: rgba(0,201,167,.24);
  color: rgba(0,201,167,.85);
}
@media (hover: hover) {
  .ag-chip-hist:hover {
    background: rgba(0,201,167,.16);
    border-color: rgba(0,201,167,.50);
    color: #00c9a7;
    box-shadow: 0 0 0 3px rgba(0,201,167,.08), 0 3px 14px rgba(0,201,167,.18);
  }
}
.ag-chip-hist:active {
  background: rgba(0,201,167,.22) !important;
  border-color: rgba(0,201,167,.55) !important;
  color: #00c9a7 !important;
}
/* Clockwise arrow icon inside history chips */
.ag-chip-ico {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .65;
  margin-right: -1px;
}

/* ── Daily stats bar (Weight Coach) ── */
#agStats{display:none;padding:9px 20px 8px;border-bottom:1px solid rgba(255,255,255,.055);background:rgba(255,107,53,.03);flex-shrink:0}
#agStats.show{display:block}
.ags-row{display:flex;gap:0;margin-bottom:7px}
.ags-cell{flex:1;text-align:center;border-right:1px solid rgba(255,255,255,.055)}
.ags-cell:last-child{border-right:none}
.ags-lbl{font-size:10.5px;color:var(--t3)}
.ags-val{font-size:13px;font-weight:600;margin-top:1px}
.ags-bar{height:3px;background:rgba(255,255,255,.07);border-radius:3px;overflow:hidden}
.ags-fill{height:100%;border-radius:3px;background:#ff6b35;transition:width .4s ease}
.ags-foot{display:flex;justify-content:space-between;margin-top:4px;font-size:10px;color:var(--t3)}

/* ── Word card ── */
.ag-wc{max-width:320px;background:rgba(255,255,255,.025);border:1px solid rgba(0,201,167,.2);border-radius:16px;overflow:hidden;animation:agPop .25s cubic-bezier(.34,1.56,.64,1) both}
.ag-wc-head{background:linear-gradient(135deg,rgba(0,201,167,.12),rgba(0,201,167,.03));padding:13px 15px 11px;border-bottom:1px solid rgba(0,201,167,.12)}
.ag-wc-top{display:flex;align-items:flex-start;justify-content:space-between;margin-bottom:5px}
.ag-wc-word{font-size:21px;font-weight:700;letter-spacing:-.3px}
.ag-wc-badges{display:flex;gap:4px;flex-wrap:wrap;justify-content:flex-end;margin-top:2px}
.ag-wc-lvl{font-size:10px;font-weight:700;padding:2px 8px;border-radius:20px;border:1px solid}
.ag-wc-pos{font-size:10px;background:rgba(255,255,255,.07);color:var(--t2);padding:2px 8px;border-radius:20px}
.ag-wc-ipa{font-size:12.5px;color:#00c9a7;letter-spacing:.3px;margin-bottom:3px}
.ag-wc-trans{font-size:16px;font-weight:600}
.ag-wc-freq{font-size:10.5px;color:var(--t3);margin-top:2px}
.ag-wc-body{padding:11px 15px}
.ag-wc-def{font-size:12.5px;color:var(--t2);line-height:1.55;margin-bottom:10px;font-style:italic}
.ag-wc-ex{font-size:12.5px;color:rgba(240,240,248,.7);padding-left:10px;border-left:2px solid rgba(0,201,167,.35);margin-bottom:6px;line-height:1.45}
.ag-wc-tags{display:flex;gap:5px;flex-wrap:wrap;margin-top:10px}
.ag-wc-syn{font-size:11px;background:rgba(0,201,167,.08);color:#00c9a7;padding:2px 9px;border-radius:20px;border:1px solid rgba(0,201,167,.18)}
.ag-wc-ant{font-size:11px;background:rgba(239,68,68,.07);color:#f87171;padding:2px 9px;border-radius:20px;border:1px solid rgba(239,68,68,.18)}
.ag-wc-etym{font-size:11px;color:var(--t3);line-height:1.5;margin-top:9px}
.ag-wc-tip{margin-top:10px;background:rgba(0,201,167,.07);border:1px solid rgba(0,201,167,.16);border-radius:9px;padding:8px 11px;font-size:12px;color:#00c9a7;line-height:1.5}
.lvl-A1{background:rgba(34,197,94,.14);color:#22c55e;border-color:rgba(34,197,94,.28)}
.lvl-A2{background:rgba(132,204,22,.14);color:#84cc16;border-color:rgba(132,204,22,.28)}
.lvl-B1{background:rgba(234,179,8,.14);color:#eab308;border-color:rgba(234,179,8,.28)}
.lvl-B2{background:rgba(249,115,22,.14);color:#f97316;border-color:rgba(249,115,22,.28)}
.lvl-C1{background:rgba(239,68,68,.14);color:#ef4444;border-color:rgba(239,68,68,.28)}
.lvl-C2{background:rgba(220,38,38,.14);color:#dc2626;border-color:rgba(220,38,38,.28)}

/* ── Food card ── */
.ag-food{max-width:295px;background:rgba(255,255,255,.025);border:1px solid rgba(255,107,53,.2);border-radius:16px;overflow:hidden;animation:agPop .25s cubic-bezier(.34,1.56,.64,1) both}
.ag-food-head{background:linear-gradient(135deg,rgba(255,107,53,.1),rgba(255,107,53,.03));padding:11px 14px;border-bottom:1px solid rgba(255,107,53,.12);display:flex;align-items:center;justify-content:space-between}
.ag-food-info{display:flex;align-items:center;gap:9px}
.ag-food-em{font-size:24px}
.ag-food-nm{font-weight:600;font-size:13.5px;line-height:1.2}
.ag-food-ok{font-size:10.5px;color:var(--t3);margin-top:2px}
.ag-food-kcal{font-size:22px;font-weight:700;color:#ff6b35;text-align:right;line-height:1}
.ag-food-kl{font-size:10px;color:var(--t3);text-align:right}
.ag-food-body{padding:11px 14px}
.ag-macro-grid{display:grid;grid-template-columns:1fr 1fr 1fr;gap:5px;margin-bottom:9px}
.ag-macro-cell{background:rgba(255,255,255,.04);border-radius:9px;padding:7px 5px;text-align:center}
.ag-macro-val{font-size:13px;font-weight:700}
.ag-macro-lbl{font-size:10px;color:var(--t3);margin-top:1px}
.ag-macro-bar{display:flex;height:3px;border-radius:3px;overflow:hidden;gap:1px;margin-bottom:9px}
.ag-macro-seg{min-width:1px}
.ag-hdots{display:flex;gap:3px;align-items:center}
.ag-hdot{width:6px;height:6px;border-radius:50%}
.ag-food-msg{font-size:12.5px;color:#ff6b35;line-height:1.45;margin-top:6px}

/* ── Workout card ── */
.ag-wo{max-width:275px;background:rgba(255,255,255,.025);border:1px solid rgba(255,107,53,.2);border-radius:16px;overflow:hidden;animation:agPop .25s cubic-bezier(.34,1.56,.64,1) both}
.ag-wo-head{background:linear-gradient(135deg,rgba(255,107,53,.1),rgba(255,107,53,.03));padding:11px 14px;border-bottom:1px solid rgba(255,107,53,.12);display:flex;align-items:center;gap:9px}
.ag-wo-em{font-size:24px}
.ag-wo-nm{font-weight:600;font-size:13.5px}
.ag-wo-meta{display:flex;gap:5px;margin-top:3px;align-items:center}
.ag-zone{font-size:10px;padding:2px 8px;border-radius:20px;border:1px solid;font-weight:500}
.ag-zone-lbl{font-size:10px;color:var(--t3)}
.ag-wo-body{padding:11px 14px}
.ag-wo-stats{display:flex;gap:20px;margin-bottom:10px}
.ag-wo-sv{font-size:20px;font-weight:700}
.ag-wo-sl{font-size:10px;color:var(--t3)}
.ag-int-bar{height:3px;background:rgba(255,255,255,.07);border-radius:3px;overflow:hidden;margin-bottom:9px}
.ag-int-fill{height:100%;border-radius:3px}
.ag-wo-msg{font-size:12.5px;color:#ff6b35;line-height:1.45}

/* ── Weight card ── */
.ag-wt{max-width:240px;background:rgba(255,255,255,.025);border:1px solid rgba(255,107,53,.2);border-radius:16px;overflow:hidden;animation:agPop .25s cubic-bezier(.34,1.56,.64,1) both}
.ag-wt-head{background:linear-gradient(135deg,rgba(255,107,53,.1),rgba(255,107,53,.03));padding:13px 15px;border-bottom:1px solid rgba(255,107,53,.12);display:flex;align-items:center;gap:11px}
.ag-wt-em{font-size:24px}
.ag-wt-kg{display:flex;align-items:baseline;gap:4px}
.ag-wt-val{font-size:25px;font-weight:700}
.ag-wt-unit{font-size:13px;color:var(--t2)}
.ag-wt-delta{font-size:13px;font-weight:600;margin-top:2px}
.ag-wt-bmi{font-size:10.5px;color:var(--t3);margin-top:2px}
.ag-wt-loss{color:#22c55e}
.ag-wt-gain{color:#ef4444}
.ag-wt-msg{padding:9px 13px;font-size:12.5px;color:#ff6b35;line-height:1.45}

@keyframes agPop{from{opacity:0;transform:translateY(5px) scale(.97)}to{opacity:1;transform:none}}

/* ── Task Manager Card ──────────────────────────────────────────────────── */
.ag-tm{max-width:360px;background:rgba(255,255,255,.025);border:1px solid rgba(108,99,255,.2);border-radius:18px;overflow:hidden;animation:agPop .25s cubic-bezier(.34,1.56,.64,1) both}

/* Header */
.ag-tm-head{display:flex;align-items:center;justify-content:space-between;padding:13px 15px 8px;background:linear-gradient(135deg,rgba(108,99,255,.12),rgba(6,182,212,.08))}
.ag-tm-head-left{display:flex;align-items:center;gap:8px}
.ag-tm-head-title{font-size:12px;font-weight:700;letter-spacing:.6px;text-transform:uppercase;color:rgba(108,99,255,.9)}
.ag-tm-head-count{font-size:11.5px;color:var(--t3);background:rgba(255,255,255,.06);padding:1px 7px;border-radius:20px}
.ag-tm-head-right{display:flex;align-items:center;gap:7px}
.ag-tm-badge-today{font-size:10px;font-weight:700;color:#00c9a7;background:rgba(0,201,167,.12);padding:2px 8px;border-radius:20px;letter-spacing:.2px}
.ag-tm-pct{font-size:12px;font-weight:700;color:rgba(108,99,255,.7)}

/* Progress bar */
.ag-tm-progress{height:3px;background:rgba(255,255,255,.06);margin:0 0 4px}
.ag-tm-progress-fill{height:100%;background:linear-gradient(90deg,#6C63FF,#06b6d4);border-radius:0 3px 3px 0;transition:width .5s cubic-bezier(.4,0,.2,1)}

/* Task list */
.ag-tm-list{padding:4px 0}

/* Task row */
.ag-tm-row{display:flex;align-items:center;gap:10px;padding:9px 12px 9px 0;border-bottom:1px solid rgba(255,255,255,.04);position:relative;transition:background .12s}
.ag-tm-row:last-child{border-bottom:none}
.ag-tm-row:hover{background:rgba(255,255,255,.03)}
.ag-tm-row.done .ag-tm-text{text-decoration:line-through;opacity:.4}
.ag-tm-row.done .ag-tm-emoji{opacity:.3}

/* Priority bar (left edge) */
.ag-tm-prio-bar{width:3px;height:100%;position:absolute;left:0;top:0;bottom:0;border-radius:0 2px 2px 0}

/* Checkbox */
.ag-tm-cb{width:30px;height:30px;padding:0;background:none;border:none;cursor:pointer;flex-shrink:0;display:flex;align-items:center;justify-content:center;border-radius:50%;transition:background .12s;margin-left:10px}
.ag-tm-cb:hover{background:rgba(255,255,255,.06)}
.ag-tm-cb svg{width:20px;height:20px}

/* Body */
.ag-tm-body{flex:1;min-width:0}
.ag-tm-title{display:flex;align-items:center;gap:6px;margin-bottom:3px}
.ag-tm-emoji{font-size:14px;flex-shrink:0}
.ag-tm-text{font-size:13.5px;font-weight:500;color:var(--t1);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transition:all .2s}
.ag-tm-meta{display:flex;align-items:center;gap:5px;flex-wrap:wrap}
.ag-tm-due{font-size:10px;font-weight:700;padding:1.5px 7px;border-radius:20px;letter-spacing:.2px}
.ag-tm-prio-pill{font-size:10px;padding:1.5px 7px;border-radius:20px;font-weight:600}

/* Delete button */
.ag-tm-del{width:26px;height:26px;background:none;border:none;cursor:pointer;color:var(--t3);opacity:0;display:flex;align-items:center;justify-content:center;border-radius:6px;transition:opacity .15s,background .12s;flex-shrink:0}
.ag-tm-row:hover .ag-tm-del{opacity:1}
.ag-tm-del:hover{background:rgba(248,113,113,.15);color:#f87171}

/* Footer message */
.ag-tm-footer{padding:10px 14px;font-size:12.5px;color:var(--t3);border-top:1px solid rgba(255,255,255,.05);background:rgba(255,255,255,.02);line-height:1.5}

/* Empty state */
.ag-tm-empty{padding:28px 20px;text-align:center}
.ag-tm-empty-ico{font-size:32px;margin-bottom:8px}
.ag-tm-empty-title{font-size:15px;font-weight:600;color:var(--t1);margin-bottom:4px}
.ag-tm-empty-sub{font-size:12px;color:var(--t3)}
