:root {
  --ink: #242522;
  --muted: #72756f;
  --muted-2: #969a91;
  --line: #e8e2d7;
  --surface: #fffdfa;
  --canvas: #f8f5ef;
  --canvas-deep: #f1ece3;
  --coral: #c85b39;
  --coral-dark: #a6462c;
  --coral-soft: #f8e6dc;
  --sage: #728369;
  --sage-dark: #4f624f;
  --sage-soft: #edf1e8;
  --shadow: 0 12px 35px rgba(73, 57, 38, .06);
}

* { box-sizing: border-box; }
html { background: var(--canvas); }
body { margin: 0; background: var(--canvas); color: var(--ink); font-family: 'DM Sans', Arial, sans-serif; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

aside {
  position: fixed;
  inset: 0 auto 0 0;
  width: 264px;
  height: 100vh;
  padding: 28px 17px 18px;
  display: flex;
  flex-direction: column;
  background: #fcfaf6;
  border-right: 1px solid var(--line);
  z-index: 2;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 10px; font-size: 20px; font-weight: 700; letter-spacing: -.5px; }
.logo { display: grid; place-items: center; width: 30px; height: 30px; color: #fff; background: var(--coral); border-radius: 9px; font-size: 17px; }
.brand-subtitle { margin: 4px 0 0 50px; color: var(--muted-2); font: 500 8px 'DM Mono', monospace; letter-spacing: 1.2px; }
.workspace { margin: 37px 2px 24px; padding: 12px 12px 13px; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; }
.workspace span { color: var(--muted-2); font: 500 9px 'DM Mono', monospace; letter-spacing: 1px; }
.workspace b { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; font-size: 12px; font-weight: 600; }
.workspace i, .user > i { color: var(--muted-2); font-size: 15px; }
nav { display: grid; gap: 3px; }
.nav { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border: 0; border-radius: 8px; background: transparent; color: #656964; text-align: left; font-size: 13px; font-weight: 500; transition: background .2s, color .2s; }
.nav i { width: 17px; color: #858980; font-size: 17px; }
.nav:hover { background: #f4eee5; color: var(--ink); }
.nav.active { background: var(--coral-soft); color: var(--coral-dark); font-weight: 700; }
.nav.active i { color: var(--coral); }
.side-bottom { margin-top: auto; }
.cost { margin: 0 5px 20px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.cost b { float: right; color: var(--ink); font-size: 11px; }
.meter { height: 5px; margin: 10px 0 8px; background: var(--canvas-deep); border-radius: 999px; overflow: hidden; }
.meter i { display: block; width: 0; height: 100%; background: var(--coral); border-radius: inherit; }
.cost small { color: var(--muted-2); font-size: 9px; }
.user { display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); text-align: left; font-size: 12px; }
.user-avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--coral-soft); color: var(--coral-dark); font-size: 10px; font-weight: 700; }
.user span:nth-child(2) { flex: 1; }
.user small { color: var(--muted-2); font-size: 9px; }

main { max-width: 1540px; min-height: 100vh; margin-left: 264px; padding: 31px 45px 48px; }
header { display: flex; align-items: flex-start; justify-content: space-between; gap: 25px; margin-bottom: 28px; }
.eyebrow { margin: 0 0 6px; color: var(--coral); font: 500 10px 'DM Mono', monospace; letter-spacing: 1.4px; }
h1 { margin: 0; color: var(--ink); font-family: 'Playfair Display', Georgia, serif; font-size: clamp(30px, 3vw, 42px); line-height: 1; letter-spacing: -1.7px; }
.page-note { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
h2, h3 { color: var(--ink); }
h2 { font-family: 'Playfair Display', Georgia, serif; }
h3 { margin: 0; font-size: 16px; letter-spacing: -.25px; }
.header-actions, .row { display: flex; align-items: center; gap: 10px; }
.header-actions { padding-top: 3px; }
.status, .tag, .pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 7px 10px; font: 500 9px 'DM Mono', monospace; letter-spacing: .5px; }
.status { background: var(--sage-soft); color: var(--sage-dark); }
.status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #6c956a; }
.status.good { background: var(--sage-soft); color: var(--sage-dark); }
.status.bad { background: #f8e4de; color: #a64531; }
.status.bad::before { background: #c85b39; }
.tag { background: var(--canvas-deep); color: var(--muted); }
.pill { background: rgba(255,255,255,.66); color: var(--coral-dark); letter-spacing: 1px; }
.outline, .ghost, .control-grid button { border: 1px solid #d8d0c5; border-radius: 8px; background: var(--surface); color: #5d625c; padding: 10px 13px; font-size: 11px; font-weight: 600; transition: border-color .2s, background .2s, color .2s, transform .2s; }
.outline:hover, .control-grid button:hover { border-color: #bcb0a1; background: #fff; color: var(--ink); }
.icon-button { display: inline-flex; align-items: center; gap: 7px; }
.primary { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 8px; background: var(--coral); color: #fff; padding: 11px 15px; box-shadow: 0 3px 0 var(--coral-dark); font-size: 12px; font-weight: 700; transition: background .2s, transform .2s; }
.primary:hover { background: var(--coral-dark); transform: translateY(-1px); }
.primary i { font-size: 15px; }
.primary span, .ghost span { margin-left: 2px; font-size: 15px; line-height: 0; }
.ghost { color: var(--coral-dark); background: rgba(255,255,255,.55); border-color: rgba(200,91,57,.35); }
.ghost:hover { background: #fff; color: var(--coral); }

.hero { position: relative; min-height: 255px; overflow: hidden; border: 1px solid #eadfd2; border-radius: 13px; background: #fbf2e8; box-shadow: var(--shadow); }
.hero-copy { position: relative; z-index: 1; max-width: 575px; padding: 40px 46px 39px; }
.hero h2 { max-width: 575px; margin: 18px 0 9px; font-size: clamp(31px, 3.3vw, 47px); line-height: 1.05; letter-spacing: -1.7px; }
.hero p { max-width: 420px; margin: 0 0 25px; color: #6c706a; font-size: 13px; line-height: 1.65; }
.hero-art { position: absolute; inset: 0; background: url('/assets/voiceforge-mountains.png') center right / cover no-repeat; }
.hero-art::after { content: ''; position: absolute; inset: 0 auto 0 0; width: 58%; background: rgba(251,242,232,.72); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 18px 0 21px; }
.stats article { position: relative; min-height: 139px; padding: 20px 20px 18px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); box-shadow: var(--shadow); }
.stats span { display: block; margin-top: 15px; color: var(--muted-2); font: 500 9px 'DM Mono', monospace; letter-spacing: .8px; }
.stats b { display: block; margin: 7px 0 2px; font-family: 'Playfair Display', Georgia, serif; font-size: 31px; line-height: 1; letter-spacing: -1px; }
.stats small { color: var(--muted); font-size: 10px; }
.metric-icon { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 10px; font-size: 17px; }
.metric-icon.coral { background: var(--coral-soft); color: var(--coral); }
.metric-icon.sage { background: var(--sage-soft); color: var(--sage-dark); }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: 1fr 1fr; }
.panel, .agent-card { border: 1px solid var(--line); border-radius: 11px; background: var(--surface); box-shadow: var(--shadow); }
.panel { padding: 21px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 17px; }
.panel-head p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.panel-head span { font-size: 8px; }
.link { border: 0; background: none; color: var(--coral-dark); font-size: 11px; font-weight: 700; }
.link:hover { color: var(--coral); }
.steps { margin: 0; padding: 0; list-style: none; }
.steps li { display: flex; gap: 12px; margin: 0; padding: 13px 0; border-top: 1px solid #f0ece5; }
.steps li:first-child { border-top: 0; }
.steps i { flex: 0 0 23px; display: grid; place-items: center; width: 23px; height: 23px; border: 1px solid #ddb9a9; border-radius: 50%; background: var(--coral-soft); color: var(--coral-dark); font: 500 10px 'DM Mono', monospace; font-style: normal; }
.steps li.complete i { border-color: #b9c8ad; background: var(--sage-soft); color: var(--sage-dark); }
.steps b, .feed b { font-size: 12px; }
.steps p, .muted { margin: 3px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.setup-link { margin-top: 4px; padding: 0; font-size: 10px; }
.feed-row { display: flex; gap: 9px; padding: 12px 0; border-top: 1px solid #f0ece5; }
.feed-row small { display: block; margin-top: 2px; color: var(--muted-2); font-size: 10px; }
.event-dot { display: inline-block; width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: var(--sage); }
.view { display: none; }
.view.shown { display: block; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 18px; }
.search { width: 280px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--muted-2); }
.search input { width: calc(100% - 20px); border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; }
.agent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 15px; }
.agent-card { position: relative; padding: 18px; }
.avatar { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 10px; background: var(--coral-soft); color: var(--coral-dark); font-weight: 700; }
.agent-top { position: absolute; top: 15px; right: 14px; display: flex; align-items: center; gap: 5px; }
.agent-card h3 { margin: 15px 0 7px; }
.agent-card p { height: 53px; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.6; }
.agent-meta { display: grid; gap: 6px; margin: 14px 0; padding: 10px 0; border-top: 1px solid #f0ece5; border-bottom: 1px solid #f0ece5; color: var(--muted); font: 10px 'DM Mono', monospace; }
.wide { width: 100%; }
.call-panel form, label { display: grid; gap: 6px; }
label { margin: 13px 0; color: #5f665f; font-size: 11px; font-weight: 700; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
input, select, textarea { padding: 10px; border: 1px solid #ddd5ca; border-radius: 7px; outline-color: #c9947e; background: #fff; color: var(--ink); font-size: 12px; }
textarea { min-height: 92px; resize: vertical; }
.check { display: block !important; color: var(--muted); font-size: 11px; font-weight: 500; }
.check input { margin-right: 7px; vertical-align: middle; accent-color: var(--coral); }
.check small { color: var(--muted-2); }
.confirm { padding: 9px; border-radius: 7px; background: #fbf2e0; color: #80653b; }
.control-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; }
.control-grid .danger { border-color: #e6c4ba; color: #a64531; }
.full { min-height: 430px; }
.events details { padding: 13px 5px; border-top: 1px solid #f0ece5; }
.events summary { display: flex; align-items: center; gap: 10px; list-style: none; cursor: pointer; font-size: 12px; }
.events time { margin-left: auto; color: var(--muted-2); font-size: 10px; }
.events pre { overflow: auto; padding: 13px; border-radius: 8px; background: #2d332e; color: #f0efe7; font: 10px 'DM Mono', monospace; }
.code { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--canvas); }
.code code { overflow: hidden; color: var(--muted); text-overflow: ellipsis; font-size: 11px; }
.code button { padding: 5px 8px; border: 0; border-radius: 5px; background: var(--coral-soft); color: var(--coral-dark); font-size: 10px; }
.small { margin-top: 14px; color: var(--muted); font-size: 10px; }
.connection { display: flex; align-items: flex-start; gap: 12px; padding: 15px 0; }
.connection i { width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; background: #e7ab68; }
.connection i.ok { background: #7ca26e; }
.connection b { font-size: 12px; }
.connection p, .notice p { margin: 3px 0; color: var(--muted); font-size: 11px; }
.notice { padding: 10px 12px; border-left: 3px solid #d78a58; background: #fbf2e0; font-size: 11px; }
.empty { padding: 35px; color: var(--muted-2); text-align: center; font-size: 12px; }
.error { color: #a64531; }
.runtime-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.runtime-pills span { padding: 4px 7px; border-radius: 999px; background: var(--sage-soft); color: var(--sage-dark); font: 9px 'DM Mono', monospace; }
.muted-button { opacity: .78; }
.number-list { display: grid; gap: 8px; }
.number-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-top: 1px solid #f0ece5; }
.number-row b { color: var(--sage-dark); font: 500 12px 'DM Mono', monospace; }
.number-row small { display: block; margin-top: 3px; color: var(--muted-2); font-size: 10px; }
.number-row .outline { padding: 7px 9px; font-size: 10px; }

dialog { width: min(580px, 90vw); padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 22px 80px rgba(73, 57, 38, .22); }
dialog::backdrop { background: rgba(39, 35, 29, .38); }
dialog form { padding: 25px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; }
.modal-head h2 { margin: 0; font-size: 24px; }
.close { width: 28px; height: 28px; border: 0; border-radius: 50%; background: var(--canvas-deep); color: var(--muted); font-size: 20px; }
.template-row { display: flex; gap: 6px; margin: 20px 0; }
.template-row button { padding: 7px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--sage-dark); font-size: 10px; }
#toast { position: fixed; right: 25px; bottom: 24px; z-index: 3; padding: 12px 16px; border-radius: 8px; background: var(--sage-dark); color: white; font-size: 12px; opacity: 0; transform: translateY(80px); transition: .25s; }
#toast.show { opacity: 1; transform: none; }
#toast.bad { background: #a64531; }

@media (max-width: 950px) {
  aside { position: static; width: auto; height: auto; padding: 15px 16px 10px; display: block; }
  .workspace { margin: 18px 0 12px; }
  .brand-subtitle, .side-bottom { display: none; }
  nav { display: flex; overflow-x: auto; gap: 3px; }
  .nav { width: auto; white-space: nowrap; }
  main { margin: 0; padding: 25px 20px 40px; }
  header { align-items: flex-start; }
  .header-actions { flex-wrap: wrap; justify-content: flex-end; }
  .hero-copy { padding: 34px 32px; }
  .stats, .grid.two { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  main { padding: 22px 15px 32px; }
  header { display: block; }
  .header-actions { justify-content: flex-start; margin-top: 18px; }
  .hero { min-height: 365px; }
  .hero-copy { max-width: 100%; padding: 28px 24px; }
  .hero-art { top: 115px; }
  .hero-art::after { inset: 0 0 auto; width: 100%; height: 57%; background: rgba(251,242,232,.8); }
  .hero h2 { font-size: 34px; }
  .stats, .grid.two, .form-row { grid-template-columns: 1fr; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .search { width: 100%; }
  .row { align-items: stretch; flex-direction: column; }
  .row button { justify-content: center; }
}
