/* AI agent demos — shared by /agents/ and every /agents/<name>/ page.
   Builds on /assets/css/style.css (same tokens: --ink, --paper, --coral, --sans, --serif). */

/* display rules below (flex, grid) would otherwise override the hidden attribute */
[hidden] { display: none !important; }

.agents-hero { padding: calc(var(--header-h) + 60px) 0 10px; }
.demo-wrap { padding: calc(var(--header-h) + 44px) 0 40px; }
.crumb { font-size: 14.5px; color: var(--muted); margin: 0 0 10px; }
.crumb a { color: inherit; }

/* trade picker */
.trade-pick { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 22px 0 6px; }
.trade-pick label { font-size: 14px; font-weight: 600; color: var(--muted); }
.trade-pick select {
  font: 500 15.5px/1 var(--sans); color: var(--ink); background: var(--white);
  border: 1px solid var(--line); border-radius: 999px; padding: 11px 38px 11px 16px;
  appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat;
}

/* gallery cards */
.agent-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(216px, 1fr)); gap: 16px; padding: 30px 0 10px; }
.side-panel .empty { color: var(--muted); font-size: 14.5px; }
.agent-card {
  display: grid; gap: 8px; align-content: start; text-decoration: none; color: inherit;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 24px;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.agent-card:hover { transform: translateY(-4px); box-shadow: 0 26px 50px -30px rgba(22,24,31,.5); }
.agent-card .agent-num { font-size: 12px; font-weight: 600; letter-spacing: .18em; color: var(--coral-deep); }
.agent-card b { font-size: 21px; letter-spacing: -.01em; }
.agent-card span { color: var(--muted); font-size: 15px; }
.agent-card .go { color: var(--coral-deep); font-weight: 600; margin-top: 6px; }

/* demo page layout */
.demo-grid { display: grid; grid-template-columns: 1fr 380px; gap: 48px; align-items: start; }
.demo-how { font-size: 16px; color: var(--ink); background: var(--coral-soft); border-radius: var(--radius-sm);
  padding: 14px 16px; margin: 18px 0 0; }
.demo-note { color: var(--muted); font-size: 13.5px; line-height: 1.5; border-top: 1px solid var(--line);
  padding-top: 16px; margin-top: 26px; max-width: 620px; }

/* the owner's side of the story */
.side-panel:empty { display: none; }
.side-panel { margin-top: 26px; background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px 22px 18px; }
.side-panel h3 { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.side-panel .row { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-top: 1px solid var(--line); font-size: 15px; }
.side-panel .row:first-of-type { border-top: 0; }
.side-panel .t { color: var(--muted); font-size: 13px; min-width: 64px; padding-top: 2px; }
.side-panel .tag { display: inline-block; font-size: 11.5px; font-weight: 600; border-radius: 999px; padding: 3px 9px; margin-left: 6px; }
.tag-ok { background: #E3F4EA; color: var(--green); }
.tag-warn { background: var(--coral-soft); color: var(--coral-deep); }
.tag-info { background: var(--paper-2); color: var(--ink); }
.row.flash { animation: flash 1.2s var(--ease); }
@keyframes flash { from { background: var(--coral-soft); } to { background: transparent; } }
.draft { background: var(--paper); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 14.5px; margin: 8px 0 12px; }
.panel-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* phone */
.phone-col { position: sticky; top: calc(var(--header-h) + 20px); }
.phone {
  width: 100%; height: 700px; display: flex; flex-direction: column; overflow: hidden;
  background: #F6F5F2; border: 11px solid var(--ink); border-radius: 46px;
  box-shadow: 0 40px 80px -50px rgba(22,24,31,.7);
}
.phone-status { display: flex; justify-content: space-between; align-items: center; padding: 12px 24px 4px;
  font-size: 13px; font-weight: 600; }
.phone-status .dots { display: flex; gap: 3px; }
.phone-status .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--ink); display: block; }
.phone-head { display: flex; align-items: center; gap: 11px; padding: 10px 18px 12px; border-bottom: 1px solid var(--line); background: var(--white); }
.phone-head .av { width: 38px; height: 38px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: 15px; flex: none; }
.phone-head b { display: block; font-size: 15px; line-height: 1.2; }
.phone-head small { color: var(--muted); font-size: 12.5px; }
.phone-head .live { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--green); display: flex; align-items: center; gap: 6px; }
.phone-head .live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

.thread { flex: 1; overflow-y: auto; padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 8px; scroll-behavior: smooth; }
.bubble { max-width: 84%; padding: 10px 13px; border-radius: 18px; font-size: 14.5px; line-height: 1.45;
  animation: rise .28s var(--ease); white-space: pre-line; }
.bubble.them { background: var(--white); border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 6px; }
.bubble.me { background: var(--coral); color: #fff; align-self: flex-end; border-bottom-right-radius: 6px; }
.bubble a { color: inherit; font-weight: 600; }
.bubble .link { color: #1a6ed8; text-decoration: underline; word-break: break-all; }
.sys { align-self: center; font-size: 12px; color: var(--muted); text-align: center; padding: 4px 10px; animation: rise .28s var(--ease); }
.sys.missed { color: var(--coral-deep); font-weight: 600; background: var(--coral-soft); border-radius: 999px; }
.typing { align-self: flex-start; background: var(--white); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; display: flex; gap: 4px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted-light); animation: bob 1s infinite; display: block; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bob { 50% { transform: translateY(-4px); } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px 10px; max-height: 170px; overflow-y: auto; }
.chips:empty { display: none; }
.chip { font: 500 13.5px/1.2 var(--sans); color: var(--ink); background: var(--white); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 12px; cursor: pointer; text-align: left; }
.chip:hover { border-color: var(--ink); }
.chip.primary { background: var(--ink); color: #fff; border-color: var(--ink); }

.composer { display: flex; gap: 8px; padding: 8px 12px 14px; border-top: 1px solid var(--line); background: var(--white); }
.composer input { flex: 1; font: 400 15px/1 var(--sans); border: 1px solid var(--line); border-radius: 999px; padding: 11px 14px; min-width: 0; }
.composer input:focus { outline: 2px solid var(--coral); outline-offset: 1px; }
.composer button { width: 42px; border-radius: 50%; border: 0; background: var(--coral); color: #fff; font-size: 18px; cursor: pointer; }

/* in-phone web page (review request) */
.webpage { align-self: stretch; background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 18px 16px;
  text-align: center; animation: rise .28s var(--ease); }
.webpage h4 { margin: 0 0 4px; font-size: 17px; }
.webpage p { margin: 0 0 12px; color: var(--muted); font-size: 13.5px; }
.stars { display: flex; justify-content: center; gap: 6px; margin: 8px 0 12px; }
.stars button { border: 0; background: none; font-size: 30px; line-height: 1; cursor: pointer; color: #D9D6CF; padding: 0; }
.stars button.on { color: #F5A524; }
.webpage .btn { width: 100%; justify-content: center; margin-top: 6px; }
.webpage .small-link { display: block; margin-top: 10px; font-size: 13px; color: var(--muted); text-decoration: underline; cursor: pointer; background: none; border: 0; width: 100%; }

.phone-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; }
.speak { font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 8px; cursor: pointer; }

@media (max-width: 960px) {
  .demo-grid { grid-template-columns: 1fr; gap: 28px; }
  .phone-col { position: static; max-width: 400px; margin: 0 auto; width: 100%; }
  .phone { height: 620px; }
}
@media (prefers-reduced-motion: reduce) {
  .bubble, .sys, .webpage { animation: none; }
  .phone-head .live::before, .typing i { animation: none; }
}
