/* ============================================================================
 * Olyvia Agent — concept demo. All color/type/space pulled from the OH!
 * Esthetics design system tokens (imported below) so the whole surface is
 * genuinely on-brand.
 * ==========================================================================*/
@import url("fonts.css");
@import url("colors.css");
@import url("typography.css");
@import url("spacing.css");
@import url("effects.css");

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  color: var(--text-body);
  background: var(--surface-page);
  background-image:
    radial-gradient(ellipse 60% 50% at 12% 0%, rgba(167,195,227,.28), transparent 60%),
    radial-gradient(ellipse 50% 45% at 100% 8%, rgba(200,218,233,.30), transparent 55%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
b { color: var(--text-strong); font-weight: var(--weight-semibold); }
code { font-family: var(--font-mono); font-size: .82em; background: var(--ice);
  padding: .05em .35em; border-radius: 4px; color: var(--deep-blue); }

/* ---------------------------------------------------------------- top bar */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-4); padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--border-default);
  background: rgba(255,255,255,.72); backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: var(--space-3); }
.brand-mark { height: 34px; width: auto; }
.brand-txt { display: flex; align-items: center; gap: var(--space-3); }
.brand-txt b { font-family: var(--font-display); font-weight: var(--weight-semibold);
  font-size: var(--text-lg); color: var(--charcoal); letter-spacing: var(--tracking-tight); }
.concept-chip {
  font-size: var(--text-xs); letter-spacing: var(--tracking-wide); text-transform: uppercase;
  color: var(--deep-blue); background: var(--ice); border: 1px solid var(--azure);
  padding: 2px 8px; border-radius: var(--radius-full); font-weight: var(--weight-semibold);
}
.tagline { margin: 0; font-family: var(--font-display); font-style: italic;
  color: var(--slate); font-size: var(--text-md); }

/* ---------------------------------------------------------------- mobile tabs */
.tabbar { display: none; }

/* ---------------------------------------------------------------- stage / columns */
.stage {
  display: grid;
  grid-template-columns: 1fr minmax(340px, 400px) 1fr;
  gap: var(--space-5);
  align-items: start;
  max-width: 1320px; margin: 0 auto; padding: var(--space-6);
}
.panel { min-width: 0; }
.col-chat { position: sticky; top: 84px; }

.panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.panel-head h2 { font-family: var(--font-display); font-weight: var(--weight-semibold);
  color: var(--charcoal); font-size: var(--text-xl); margin: 0 0 var(--space-1); }
.panel-sub { font-size: var(--text-sm); line-height: var(--leading-relaxed);
  color: var(--slate); margin: 0 0 var(--space-4); }
.pill { font-size: var(--text-xs); background: var(--white); border: 1px solid var(--border-default);
  padding: 3px 10px; border-radius: var(--radius-full); color: var(--slate); }
.pill b { color: var(--vivid-blue); }

/* ---------------------------------------------------------------- KB panel */
.kb-group { margin-bottom: var(--space-4); }
.kb-group-head {
  font-family: var(--font-mono); font-size: var(--text-xs); color: var(--deep-blue);
  letter-spacing: .02em; display: flex; flex-direction: column; margin-bottom: var(--space-2);
  border-bottom: 1px solid var(--divider); padding-bottom: 4px;
}
.kb-group-head span { color: var(--text-muted); font-family: var(--font-body); font-size: 11px; margin-top: 2px; }
.kb-item {
  background: var(--surface-card); border: 1px solid var(--border-default);
  border-left: 3px solid var(--azure); border-radius: var(--radius-md);
  padding: var(--space-3); margin-bottom: var(--space-2);
  box-shadow: var(--shadow-card); transition: box-shadow .2s, transform .2s;
}
.kb-item:hover { box-shadow: var(--shadow-soft); }
.kb-file { font-family: var(--font-mono); font-size: 11px; color: var(--slate-light); }
.kb-title { font-size: var(--text-sm); color: var(--charcoal); font-weight: var(--weight-medium); margin-top: 2px; }
.kb-item.flash { animation: flash 1.4s var(--ease-out); border-left-color: var(--vivid-blue); }
@keyframes flash {
  0% { background: var(--pastel-azure); transform: scale(1.015); box-shadow: var(--shadow-raised); }
  100% { background: var(--surface-card); transform: none; }
}

/* ---------------------------------------------------------------- phone / thread */
.phone {
  background: var(--white); border-radius: 34px; border: 1px solid var(--border-default);
  box-shadow: var(--shadow-raised); overflow: hidden; display: flex; flex-direction: column;
  height: min(76vh, 720px); position: relative;
}
.phone-notch { position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  width: 120px; height: 22px; background: var(--charcoal); border-radius: var(--radius-full); z-index: 5; opacity: .9; }
.phone-head {
  display: flex; align-items: center; gap: var(--space-3); padding: 30px var(--space-4) var(--space-3);
  border-bottom: 1px solid var(--divider); background: rgba(237,243,249,.7); backdrop-filter: blur(6px);
}
.ph-av { width: 34px; height: 34px; border-radius: 50%; background: var(--ice); padding: 5px; border: 1px solid var(--azure); }
.phone-head b { display: block; font-size: var(--text-sm); color: var(--charcoal); }
.phone-head span { font-size: 11px; color: var(--text-muted); }

.thread { flex: 1; overflow-y: auto; padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2);
  scroll-behavior: smooth; background:
    radial-gradient(ellipse 80% 30% at 50% 0%, rgba(237,243,249,.6), transparent 70%); }

.msg { max-width: 82%; padding: var(--space-3) var(--space-4); border-radius: 20px; font-size: var(--text-sm);
  line-height: var(--leading-relaxed); animation: pop .28s var(--ease-out); word-wrap: break-word; }
.msg p { margin: 0; }
.msg.me { align-self: flex-end; background: var(--vivid-blue); color: var(--white); border-bottom-right-radius: 6px; }
.msg.me p { color: var(--white); }
.msg.agent { align-self: flex-start; background: var(--ice); color: var(--slate); border: 1px solid var(--border-default); border-bottom-left-radius: 6px; }
.msg.event { align-self: center; max-width: 92%; text-align: center; font-size: 12px; background: var(--soft-gold);
  color: var(--charcoal); border-radius: var(--radius-full); padding: 6px 14px; opacity: .95; }
.msg.has-card { max-width: 90%; padding: var(--space-2); background: transparent; border: none; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

.typing { padding: 12px 16px; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--slate-light); animation: blink 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .2s; } .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,60%,100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

/* ---------------------------------------------------------------- composer / chips */
.composer { border-top: 1px solid var(--divider); padding: var(--space-3); background: var(--surface-card); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--space-3); max-height: 128px; overflow-y: auto; }
.chip {
  font-family: var(--font-body); font-size: 12px; cursor: pointer;
  background: var(--white); color: var(--deep-blue); border: 1px solid var(--azure);
  padding: 6px 11px; border-radius: var(--radius-full); transition: var(--transition-cta);
}
.chip:hover:not(:disabled) { background: var(--ice); box-shadow: var(--shadow-soft); transform: translateY(-1px); }
.chip:disabled { opacity: .5; cursor: default; }
.chip.used { opacity: .5; border-color: var(--border-default); color: var(--slate-light); }
.chip.used::after { content: " ✓"; color: var(--success); }
.fake-input { display: flex; align-items: center; gap: var(--space-2); background: var(--ice);
  border: 1px solid var(--border-default); border-radius: var(--radius-full); padding: 8px var(--space-3); }
.fake-input span { flex: 1; font-size: 13px; color: var(--text-muted); }
.send { width: 28px; height: 28px; border-radius: 50%; border: none; background: var(--azure); color: var(--white); font-size: 15px; cursor: default; }

/* ---------------------------------------------------------------- trace panel */
.trace { display: flex; flex-direction: column; gap: var(--space-2); min-height: 120px; }
.trace-idle { font-size: var(--text-sm); color: var(--text-muted); font-style: italic;
  padding: var(--space-4); text-align: center; border: 1px dashed var(--border-default); border-radius: var(--radius-lg); }
.trace-step { background: var(--surface-card); border: 1px solid var(--border-default);
  border-radius: var(--radius-lg); padding: var(--space-3); box-shadow: var(--shadow-card); }
.trace-step.enter { opacity: 0; transform: translateX(10px); }
.trace-step:not(.enter) { transition: opacity .4s, transform .4s; opacity: 1; transform: none; }
.ts-node { display: flex; align-items: center; gap: var(--space-2); margin-bottom: 5px; font-size: var(--text-sm); color: var(--charcoal); }
.ts-emoji { width: 26px; height: 26px; display: grid; place-items: center; background: var(--ice);
  border-radius: 50%; border: 1px solid var(--azure); font-size: 14px; flex: none; }
.ts-node i { font-style: normal; color: var(--slate-light); font-size: 12px; }
.ts-text { font-size: 12.5px; line-height: var(--leading-relaxed); color: var(--slate); }
.role { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; font-weight: var(--weight-semibold);
  padding: 1px 7px; border-radius: var(--radius-full); margin-left: 4px; }
.role.generator { background: var(--ice); color: var(--azure-blue); border: 1px solid var(--azure); }
.role.evaluator { background: #EAF3EA; color: var(--success); border: 1px solid var(--success); }
.pass { display: inline-block; margin-top: 4px; font-size: 11px; color: var(--success); font-weight: var(--weight-semibold); }
.legend { margin-top: var(--space-4); display: flex; flex-direction: column; gap: 6px; font-size: 11.5px; color: var(--slate); }
.legend .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.dot.gen { background: var(--azure-blue); } .dot.eval { background: var(--success); } .dot.gate { background: var(--soft-gold); }

/* ---------------------------------------------------------------- agent cards */
.agent-card { width: 100%; }
.agent-card > * { animation: pop .3s var(--ease-out); }

/* IG post */
.ig-post { margin: 0; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-raised); border: 1px solid var(--border-default); }
.ig-wash { position: relative; aspect-ratio: 1/1; background: var(--watercolor); padding: var(--space-5);
  display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; overflow: hidden; }
.ig-eyebrow { margin: 0 0 var(--space-3); font-size: 11px; letter-spacing: var(--tracking-wider); text-transform: uppercase; color: var(--deep-blue); font-weight: var(--weight-semibold); }
.ig-headline { font-family: var(--font-display); font-weight: var(--weight-light); font-size: clamp(1.5rem, 6vw, 2rem);
  line-height: var(--leading-tight); color: var(--charcoal); margin: 0 0 var(--space-3); }
.ig-price { font-family: var(--font-display); margin: 0 0 4px; font-size: 1.1rem; color: var(--deep-blue); }
.ig-price b { font-size: 1.5rem; color: var(--vivid-blue); }
.ig-price span { color: var(--slate); font-size: .85rem; }
.ig-sub { margin: 0 0 var(--space-4); font-size: 12px; color: var(--slate); }
.ig-cta { display: inline-block; background: var(--vivid-blue); color: var(--white); font-weight: var(--weight-semibold);
  font-size: 13px; letter-spacing: var(--tracking-cta); padding: 10px 22px; border-radius: var(--radius-full); box-shadow: var(--shadow-cta); }
.botanical { position: absolute; width: 90px; height: 90px; opacity: .5;
  background: no-repeat center/contain; }
.bot-tl { top: -10px; left: -12px; transform: rotate(-20deg); background-image: url("../assets/botanicals/sprig.svg"); }
.bot-br { bottom: -12px; right: -10px; transform: rotate(160deg); background-image: url("../assets/botanicals/eucalyptus.svg"); }
.ig-meta { display: flex; align-items: center; justify-content: space-between; padding: 10px var(--space-3);
  background: var(--white); font-size: 12px; }
.ig-handle { color: var(--charcoal); font-weight: var(--weight-medium); }
.brand-pass { color: var(--success); font-size: 11px; }

/* doc card (menu / membership) */
.doc-card { background: var(--white); border: 1px solid var(--border-default); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-card); }
.doc-card.foundation { border: 1px solid var(--azure); border-top: 3px solid var(--vivid-blue); }
.doc-head { font-family: var(--font-mono); font-size: 11.5px; color: var(--slate); padding: 8px var(--space-3);
  background: var(--ice); border-bottom: 1px solid var(--divider); display: flex; align-items: center; gap: 6px; }
.doc-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); flex: none; }
.found-tag { margin-left: auto; color: var(--vivid-blue); font-family: var(--font-body); font-weight: var(--weight-semibold); }
.doc-body { padding: var(--space-4); }
.menu-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.menu-name { font-family: var(--font-display); font-size: 1.15rem; color: var(--charcoal); }
.menu-price { font-weight: var(--weight-semibold); color: var(--vivid-blue); }
.menu-desc { margin: 0; font-size: 13px; line-height: var(--leading-body); color: var(--slate); }
.mem-name { font-family: var(--font-display); font-weight: var(--weight-medium); color: var(--charcoal); margin: 0 0 2px; font-size: 1.25rem; }
.mem-price { margin: 0 0 var(--space-3); color: var(--deep-blue); } .mem-price b { font-size: 1.3rem; color: var(--vivid-blue); }
.mem-price span { color: var(--slate); font-size: 12px; }
.mem-list { margin: 0; padding-left: 18px; font-size: 13px; color: var(--slate); line-height: var(--leading-body); }
.doc-foot { font-size: 11px; color: var(--text-muted); padding: 8px var(--space-3); border-top: 1px solid var(--divider); background: var(--cloud); }

/* client list */
.list-card { background: var(--white); border: 1px solid var(--border-default); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-card); }
.list-head { font-size: 12px; color: var(--slate); padding: 10px var(--space-3); background: var(--ice); border-bottom: 1px solid var(--divider); }
.client-row { display: flex; align-items: center; gap: var(--space-3); padding: 10px var(--space-3); border-bottom: 1px solid var(--divider); }
.client-row:last-child { border-bottom: none; }
.client-av { width: 30px; height: 30px; border-radius: 50%; background: var(--pastel-azure); color: var(--deep-blue);
  display: grid; place-items: center; font-weight: var(--weight-semibold); font-size: 13px; flex: none; }
.client-main { flex: 1; min-width: 0; } .client-main b { display: block; font-size: 13px; color: var(--charcoal); }
.client-main span { font-size: 11px; color: var(--text-muted); }
.client-note { font-size: 11px; color: var(--deep-blue); text-align: right; max-width: 40%; }

/* SMS drafts */
.sms-draft { background: var(--white); border: 1px solid var(--border-default); border-radius: var(--radius-lg);
  padding: var(--space-3); box-shadow: var(--shadow-card); }
.sms-draft.stacked { margin-bottom: var(--space-2); }
.sms-to { font-size: 11px; color: var(--slate-light); margin-bottom: 6px; }
.sms-to span { color: var(--danger); }
.sms-bubble { background: var(--ice); border-radius: 14px; padding: 10px var(--space-3); font-size: 13px; line-height: var(--leading-relaxed); color: var(--charcoal); }
.sms-bubble.mono { font-family: var(--font-mono); }
.sms-actions { display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-2); flex-wrap: wrap; }
.copy-btn { font-family: var(--font-body); font-size: 12px; font-weight: var(--weight-semibold); cursor: pointer;
  background: var(--vivid-blue); color: var(--white); border: none; padding: 7px 14px; border-radius: var(--radius-full); transition: var(--transition-cta); }
.copy-btn:hover { background: var(--cta-hover); box-shadow: var(--shadow-cta); }
.copy-btn.copied { background: var(--success); }
.gate-note { font-size: 11px; color: var(--slate); }

/* week plan */
.week-card { display: grid; gap: 6px; background: var(--white); border: 1px solid var(--border-default);
  border-radius: var(--radius-lg); padding: var(--space-3); box-shadow: var(--shadow-card); }
.week-day { border-left: 3px solid var(--mist); padding: 6px 0 6px var(--space-3); }
.week-day.heavy { border-left-color: var(--vivid-blue); background: linear-gradient(90deg, rgba(237,243,249,.6), transparent); }
.wd-head { display: flex; align-items: baseline; gap: var(--space-3); margin-bottom: 2px; }
.wd-head b { font-size: 13px; color: var(--charcoal); } .wd-head span { font-size: 11px; color: var(--deep-blue); }
.week-day ul { margin: 0; padding-left: 18px; font-size: 12px; color: var(--slate); line-height: 1.5; }

/* ---------------------------------------------------------------- footer */
.footnote { text-align: center; font-size: 12px; color: var(--text-muted); padding: var(--space-6);
  max-width: 620px; margin: 0 auto; line-height: var(--leading-relaxed); }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 960px) {
  .tagline { display: none; }
  .tabbar { display: flex; gap: 6px; padding: var(--space-3) var(--space-4); position: sticky; top: 58px; z-index: 15;
    background: rgba(255,255,255,.82); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border-default); }
  .tab { flex: 1; font-family: var(--font-body); font-size: 12px; cursor: pointer; background: transparent;
    border: 1px solid var(--border-default); color: var(--slate); padding: 8px; border-radius: var(--radius-full); }
  .tab.active { background: var(--vivid-blue); color: var(--white); border-color: var(--vivid-blue); }
  .stage { grid-template-columns: 1fr; padding: var(--space-4); gap: 0; }
  .panel { display: none; }
  .panel.show { display: block; }
  .col-chat { position: static; }
  .phone { height: calc(100vh - 220px); min-height: 460px; border-radius: 24px; }
}
@media (max-width: 420px) {
  .topbar { padding: var(--space-3) var(--space-4); }
  .msg { max-width: 88%; }
}
