/* DrivenOS · AI Agents page (tools/build_pages.py ai_agents_page). Adapted from HighLevel's AI Agents screen, restyled for the site. */

/* ---------- comparison table ---------- */
.ag-table-wrap { margin-top: var(--head-gap); border: 1px solid var(--line); border-radius: 24px; overflow: hidden; background: var(--surface); }
.ag-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.ag-table th, .ag-table td { padding: 20px 24px; text-align: left; border-bottom: 1px solid var(--line); }
.ag-table tbody tr:last-child > * { border-bottom: 0; }
.ag-table thead th { padding-top: 22px; padding-bottom: 22px; background: var(--surface-2); font: 600 var(--fs-label) var(--font-label); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.ag-th { display: inline-flex; align-items: center; gap: 10px; }
.ag-th svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ag-table tbody th { font-weight: 500; color: var(--text); width: 22%; }
.ag-table td { color: var(--muted); }
.ag-table .is-us { background: color-mix(in srgb, var(--brand) 10%, transparent); color: var(--text); font-weight: 600; box-shadow: inset 1px 0 0 color-mix(in srgb, var(--brand) 45%, transparent), inset -1px 0 0 color-mix(in srgb, var(--brand) 45%, transparent); }
.ag-table thead .is-us { background: color-mix(in srgb, var(--brand) 22%, var(--surface-2)); color: var(--text); }
.ag-impact { display: inline-block; padding: 5px 11px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.ag-impact--medium-high { background: rgba(245,181,10,.14); color: #e8b64a; }
.ag-est { color: var(--text) !important; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ag-note { margin: 14px 4px 0; font-size: 13px; color: var(--muted); }
.ag-impact--very-high, .ag-impact--high { background: color-mix(in srgb, var(--brand) 18%, transparent); color: var(--accent); }
@media (max-width: 800px) {
  .ag-table thead { display: none; }
  .ag-table, .ag-table tbody, .ag-table tr, .ag-table th, .ag-table td { display: block; width: auto; }
  .ag-table tr { padding: 16px 18px; border-bottom: 1px solid var(--line); }
  .ag-table th, .ag-table td { padding: 4px 0; border: 0; }
  .ag-table .is-us { background: none; box-shadow: none; color: var(--accent); }
}

/* ---------- agent sections: text + mockup ---------- */
.ag-split { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 110px); align-items: center; padding: var(--section-y) var(--gutter); }
.ag-split--flip .ag-split__text { order: 2; }
.ag-split__text { max-width: 520px; }
.ag-kicker { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 18px; font: 600 var(--fs-label) var(--font-label); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.ag-kicker svg { width: 18px; height: 18px; fill: none; stroke: var(--accent); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ag-split__text .dp-lead { margin-top: 18px; }
.ag-split__visual { position: relative; display: grid; place-items: center; height: min(640px, 82svh); padding: clamp(24px, 4vw, 56px); border-radius: 28px; overflow: hidden;
  --panel: #171a17; --panel-hi: #20251f; --edge: #323a30; --ink: var(--text); --soft: var(--muted);
  background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--brand) 14%, transparent), transparent 62%), var(--surface); border: 1px solid var(--line); }
.ag-split__visual::before { content: ""; position: absolute; inset: 0; opacity: .5; pointer-events: none;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(70% 70% at 50% 50%, #000, transparent); mask-image: radial-gradient(70% 70% at 50% 50%, #000, transparent); }
.ag-split__visual > * { position: relative; }
@media (max-width: 900px) { .ag-split { grid-template-columns: 1fr; } .ag-split--flip .ag-split__text { order: 0; } .ag-split__visual { height: 560px; }
  .ag-split__visual .ag-phone { max-height: 500px; } }   /* fits inside the 560px panel and its padding */

/* voice agent phone — dark screen, fixed size (the transcript scrolls inside it) */
.ag-phone { height: 100%; max-height: 560px; aspect-ratio: 330 / 640; padding: 10px; border-radius: 46px; background: linear-gradient(145deg, #2b2e2a, #0c0d0c 55%, #1c1f1b);
  box-shadow: 0 0 0 1.5px #3b3f3a, 0 40px 90px -30px rgba(0,0,0,.8), 0 0 80px -20px color-mix(in srgb, var(--brand) 35%, transparent); }
.ag-phone__screen { position: relative; height: 100%; display: flex; flex-direction: column; border-radius: 37px; overflow: hidden; background: #0f110f; color: #eef1ee; font-family: Inter, sans-serif; }
.ag-phone__island { position: absolute; top: 10px; left: 50%; width: 92px; height: 26px; margin-left: -46px; border-radius: 16px; background: #000; }
.ag-phone__status { display: flex; justify-content: space-between; padding: 13px 24px 0; height: 42px; font-size: 12.5px; font-weight: 600; }
.ag-phone__who { display: flex; align-items: center; gap: 10px; padding: 6px 14px 12px; border-bottom: 1px solid #262b25; }
.ag-phone__who b { display: block; font-size: 14px; } .ag-phone__who small { display: block; font-size: 11.5px; color: #8f978c; }
.ag-phone__who small::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: #5d665a; vertical-align: 1px; }
.ag-phone.is-live .ag-phone__who small::before { background: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 30%, transparent); }
.ag-phone__spark { margin-left: auto; width: 17px; height: 17px; color: #7c8579; } .ag-phone__spark svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.6; }
.ag-avatar { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--brand); color: #fff; font: 600 12.5px Inter, sans-serif; }
.ag-avatar--g { background: var(--panel-hi); color: var(--ink); border: 1px solid var(--edge); }
.ag-orb { position: relative; display: grid; place-items: center; width: 118px; height: 118px; margin: 16px auto 4px; flex: none; }
.ag-orb__dots { position: absolute; inset: 0; width: 100%; height: 100%; fill: color-mix(in srgb, var(--brand) 80%, #cfe9da); opacity: .85; animation: ag-spin 18s linear infinite; }
.ag-orb__core { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%; background: #1b201a; border: 1px solid #323a30; color: var(--brand); box-shadow: 0 6px 20px rgba(0,0,0,.4); }
.ag-orb__core svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ag-phone.is-live .ag-orb__dots { animation-duration: 5s; }
.ag-phone.is-talking .ag-orb { animation: ag-pulse 1.1s ease-in-out infinite; }
.ag-phone.is-talking .ag-orb__core { box-shadow: 0 0 0 6px color-mix(in srgb, var(--brand) 28%, transparent), 0 6px 20px rgba(0,0,0,.4); }
@keyframes ag-spin { to { transform: rotate(360deg); } }
@keyframes ag-pulse { 50% { transform: scale(1.07); } }
.ag-transcript { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; padding: 10px 13px 18px; overflow: hidden; font-size: 12.5px; line-height: 1.4; }
.ag-transcript p { flex: none; margin: 0; padding: 8px 11px; border-radius: 13px; max-width: 86%; animation: ag-in .4s var(--ease); }
.ag-say { display: block; margin-bottom: 2px; font-size: 10.5px; font-weight: 600; color: #8f978c; }
.ag-transcript .is-caller { align-self: flex-end; background: #20251f; border: 1px solid #323a30; border-bottom-right-radius: 4px; }
.ag-transcript .is-ai { align-self: flex-start; background: color-mix(in srgb, var(--brand) 26%, #121512); border-bottom-left-radius: 4px; }
.ag-transcript .is-ai .ag-say { color: #a9d8bd; }
.ag-transcript .is-done { align-self: center; background: var(--brand); color: #fff; font-weight: 600; border-radius: 999px; padding: 6px 13px; }
@keyframes ag-in { from { opacity: 0; transform: translateY(8px); } }

/* chats (sales + scheduler) and the review card — dark panels, FIXED height: messages fill in from the bottom and older ones
   scroll up out of view, so nothing on the page moves */
.ag-chat, .ag-review { display: flex; flex-direction: column; width: min(460px, 100%); height: 470px; padding: 20px; border-radius: 18px;
  background: var(--panel); border: 1px solid var(--edge); color: var(--ink); box-shadow: 0 30px 70px -30px rgba(0,0,0,.7); font: 14px/1.5 Inter, sans-serif; }
.ag-chat__head { flex: none; display: flex; align-items: center; gap: 12px; margin-bottom: 8px; font-size: 12.5px; font-weight: 600; color: var(--soft); }
.ag-chat__head span { flex: 1; height: 1px; background: var(--edge); }
.ag-chat__body { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 56px); mask-image: linear-gradient(180deg, transparent, #000 56px); }   /* older messages fade out at the top */
.ag-msg { flex: none; }
.ag-msg p { margin: 0; }
.ag-msg--in { display: flex; justify-content: flex-end; }
.ag-msg--in p { max-width: 82%; padding: 9px 13px; border-radius: 14px 14px 4px 14px; border: 1px solid var(--edge); background: var(--panel-hi); }
.ag-msg--ai p { max-width: 92%; padding: 9px 13px; border-radius: 14px 14px 14px 4px; background: color-mix(in srgb, var(--brand) 20%, var(--panel)); }
.ag-who { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 5px; font-size: 12px; font-weight: 600; color: var(--accent); }
.ag-who svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; }
[data-chat] .ag-msg, [data-chat] .ag-review__reply { display: none; }
[data-chat] .is-shown { display: block !important; animation: ag-in .6s var(--ease); }
.ag-chat__body, .ag-review__foot { padding-bottom: 4px; transition: opacity .6s ease; }
.is-resetting .ag-chat__body, .is-resetting .ag-review__foot { opacity: 0; }   /* the loop fades out before replaying */
[data-chat] .ag-msg--in.is-shown { display: flex !important; }
.ag-typing { display: none; flex: none; align-items: center; gap: 5px; margin: 8px 0 6px; padding: 12px 15px; width: max-content; border-radius: 14px 14px 14px 4px; background: var(--panel-hi); border: 1px solid var(--edge); }   /* breathing room above and below */
.ag-typing.is-on { display: flex; }
.ag-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--soft); animation: ag-dot 1.3s ease-in-out infinite; }
.ag-typing i:nth-child(2) { animation-delay: .2s; } .ag-typing i:nth-child(3) { animation-delay: .4s; }
@keyframes ag-dot { 50% { transform: translateY(-3px); opacity: .5; } }
.ag-sched { display: grid; grid-template-columns: 1fr 200px; gap: 16px; align-items: center; width: 100%; max-width: 660px; }
.ag-sched .ag-chat { width: 100%; }
.ag-cal { padding: 16px; border-radius: 18px; background: var(--panel); border: 1px solid var(--edge); color: var(--ink); font: 13px Inter, sans-serif; }
.ag-cal__head { margin-bottom: 10px; font-weight: 600; color: var(--soft); }
.ag-cal__slot { padding: 10px 12px; margin-top: 8px; border-radius: 10px; background: var(--panel-hi); font-weight: 600; }
.ag-cal__slot span { display: block; font-weight: 400; color: var(--soft); font-size: 12px; }
.ag-cal__slot--old { opacity: .45; text-decoration: line-through; }
.ag-cal__slot--new { background: color-mix(in srgb, var(--brand) 30%, var(--panel-hi)); box-shadow: inset 3px 0 0 var(--brand); }
@media (max-width: 700px) { .ag-sched { grid-template-columns: 1fr; } .ag-cal { display: none; } }
.ag-review__top { flex: none; display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--edge); }
.ag-review__top b { display: block; } .ag-review__top small { color: var(--soft); }
.ag-review__ico { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: color-mix(in srgb, var(--brand) 20%, var(--panel)); color: var(--accent); }
.ag-review__ico svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.ag-review__body { flex: none; padding: 16px 0 6px; }
.ag-review__who { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.ag-review__who b { display: block; } .ag-review__who small { margin-left: auto; color: var(--soft); }
.ag-review__who .stars { color: #f5b50a; letter-spacing: 1px; font-size: 13px; }
.ag-review__body p { margin: 0; color: var(--soft); }
.ag-review__foot { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; }
.ag-review__reply { padding: 14px 16px; border-radius: 14px; background: color-mix(in srgb, var(--brand) 18%, var(--panel)); }
.ag-review__reply p { margin: 0; }

/* ---------- find the right agent ---------- */
.ag-picker { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(28px, 5vw, 90px); align-items: start; margin-top: var(--head-gap); }
.ag-picklist { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.ag-pick { display: block; width: 100%; padding: 22px 0; border-bottom: 1px solid var(--line); text-align: left; color: var(--muted); position: relative; }
.ag-pick__row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.ag-pick__row b { font: 400 clamp(22px, 2vw, 30px)/1.1 var(--font-display); letter-spacing: -.02em; transition: color .3s; }
.ag-pick__row small { font-size: 13px; }
.ag-pick__more { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .5s var(--ease); }
.ag-pick__more > * { overflow: hidden; }
.ag-pick__more span:first-child { display: block; padding-top: 0; color: var(--muted); font-size: 15px; line-height: 1.6; }
.ag-pick__more .dp-link { display: none; }
.ag-pick.is-on { color: var(--text); }
.ag-pick.is-on .ag-pick__row b { color: var(--text); }
.ag-pick.is-on .ag-pick__more { grid-template-rows: 1fr; }
.ag-pick.is-on .ag-pick__more span:first-child { padding-top: 10px; }
.ag-pick::after { content: ""; position: absolute; left: 0; bottom: -1px; height: 2px; width: 0; background: var(--brand); transition: width .6s var(--ease); }
.ag-pick.is-on::after { width: 55%; }
.ag-cards { position: sticky; top: 110px; }
.ag-card { display: none; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.ag-card.is-on { display: block; animation: ag-in .5s var(--ease); }
.ag-card__head { display: flex; align-items: center; gap: 14px; padding: 22px 24px; }
.ag-card__head b { display: block; font: 400 22px var(--font-display); letter-spacing: -.02em; }
.ag-card__head small { display: block; margin-top: 2px; color: var(--muted); font-size: 14px; line-height: 1.5; max-width: 32em; }
.ag-card__ico { display: grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 12px; background: color-mix(in srgb, var(--brand) 18%, transparent); color: var(--accent); }
.ag-card__ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ag-card__tag { align-self: flex-start; margin-left: auto; flex: none; padding: 6px 12px; border-radius: 999px; background: color-mix(in srgb, var(--brand) 16%, transparent); color: var(--accent); font-size: 12.5px; font-weight: 600; }
.ag-card__stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ag-card__stats div { padding: 18px 16px; text-align: center; }
.ag-card__stats div + div { border-left: 1px solid var(--line); }
.ag-card__stats b { display: block; font: 400 24px/1.1 var(--font-display); letter-spacing: -.02em; }
.ag-card__stats small { color: var(--muted); font-size: 13px; }
.ag-card__list { display: grid; gap: 12px; margin: 0; padding: 22px 24px; list-style: none; }
.ag-card__list li { display: flex; align-items: center; gap: 12px; font-size: 15px; }
.ag-card__list i { display: grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: 50%; background: color-mix(in srgb, var(--brand) 20%, transparent); color: var(--accent); }
.ag-card__list i svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.6; }
.ag-card__foot { padding: 0 24px 24px; }
@media (max-width: 900px) { .ag-picker { grid-template-columns: 1fr; } .ag-cards { position: static; } .ag-card__head { flex-wrap: wrap; } }
@media (prefers-reduced-motion: reduce) { .ag-orb__dots { animation: none; } }
