:root {
  --bg: #f6f7fb; --surface: #fff; --text: #14171f; --muted: #6b7280; --line: #e5e7eb;
  --accent: #3b5bfd; --accent-weak: #eef1ff; --hot: #e5484d; --warm: #f5a524; --cold: #6b8afd; --new: #9ca3af; --ok: #16a34a;
  --radius: 12px; color-scheme:light; font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #0f1117; --surface: #171a22; --text: #e8eaf0; --muted: #9aa1ae; --line: #262a35; --accent-weak: #1d2342; color-scheme:dark; }
}
:root[data-theme="dark"] { --bg: #0f1117; --surface: #171a22; --text: #e8eaf0; --muted: #9aa1ae; --line: #262a35; --accent-weak: #1d2342; color-scheme:dark; }
* { box-sizing: border-box; }
html { scrollbar-gutter:stable; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.45; }
a { color: var(--accent); text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
.layout { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
nav.side { background: var(--surface); border-right: 1px solid var(--line); padding: 20px 12px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; }
nav.side .logo { font-weight: 700; font-size: 18px; padding: 0 10px 18px; }
nav.side .logo span { color: var(--accent); }
.nav-group { display: flex; flex-direction: column; gap: 2px; margin-bottom: 16px; }
.nav-label { padding: 0 10px 7px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .09em; }
nav.side { overflow-y: auto; }
.section-tabs { display:flex; gap:6px; border-bottom:1px solid var(--line); padding-bottom:12px; margin-bottom:24px; flex-wrap:wrap; }
.section-tabs a { color:var(--muted); padding:9px 14px; border-radius:8px; }
.section-tabs a.active { background:var(--accent-weak); color:var(--accent); font-weight:600; }
.page-intro { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; margin-bottom:24px; flex-wrap:wrap; }
.page-intro h1 { margin-bottom:8px; }.page-intro p { margin:0; max-width:700px; }
.hub-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:16px; }
.settings-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }.metrics-grid { grid-template-columns:repeat(4,minmax(0,1fr)); }
@media(max-width:1100px){.metrics-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){.settings-grid,.metrics-grid{grid-template-columns:1fr}}
.hub-card { display:block; color:var(--text); padding:24px; background:var(--surface); border:1px solid var(--line); border-radius:12px; }
.hub-card:hover { border-color:var(--accent); }.hub-card p { color:var(--muted); margin:10px 0 18px; }.hub-card span { color:var(--accent); }
.flow-status { display:inline-flex; padding:4px 10px; background:var(--accent-weak); color:var(--accent); border-radius:6px; font-size:12px; font-weight:600; }
.flow-status.attention { background:color-mix(in srgb,var(--warm) 15%,var(--surface)); color:var(--warm); }
.flow-status.success { background:color-mix(in srgb,var(--ok) 12%,var(--surface)); color:var(--ok); }
.request-head { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; flex-wrap:wrap; margin-bottom:16px; }
.request-head h2 { margin:0 0 4px; font-size:18px; }.request-facts { display:grid; grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); gap:16px; margin:16px 0; }
.request-facts dt { font-size:12px; color:var(--muted); margin-bottom:4px; }.request-facts dd { margin:0; overflow-wrap:anywhere; }
.technical { border-top:1px solid var(--line); padding-top:12px; margin-top:16px; color:var(--muted); font-size:12px; }.technical summary { cursor:pointer; }.technical pre { white-space:pre-wrap; overflow-wrap:anywhere; }
.action-panel { margin-top:16px; padding:16px; background:var(--bg); border-radius:8px; }.action-panel summary { cursor:pointer; font-weight:600; }
.check-label { display:flex; align-items:flex-start; gap:10px; font-weight:400; }.check-label input { width:auto; margin-top:4px; }
.notice { padding:14px 16px; border:1px solid var(--line); border-left:3px solid var(--warm); border-radius:8px; margin:16px 0; }
.empty-state { text-align:center; padding:48px 24px; background:var(--surface); border:1px dashed var(--line); border-radius:12px; }.empty-state p { color:var(--muted); max-width:520px; margin:12px auto 20px; }
@media(max-width:860px){nav.side .nav-group{flex-direction:row;margin:0;flex-shrink:0;}nav.side .nav-label{display:none;}nav.side a{white-space:nowrap}.section-tabs{margin-bottom:20px}}
nav.side a { color: var(--text); padding: 8px 10px; border-radius: 8px; }
nav.side a.active { background: var(--accent-weak); color: var(--accent); }
nav.side .bottom { margin-top: auto; font-size: 12px; color: var(--muted); padding: 10px; }
main { padding: 28px 32px; max-width: 1480px; width: 100%; min-width:0; justify-self:center; }
.theme-toggle { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px; margin:4px 0 12px; border:1px solid var(--line); border-radius:9px; background:transparent; color:var(--text); cursor:pointer; flex-shrink:0; }
.theme-toggle:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.theme-track { width:32px; height:18px; border-radius:20px; background:var(--line); position:relative; flex-shrink:0; }
.theme-track::after { content:''; position:absolute; width:12px; height:12px; left:3px; top:3px; background:var(--muted); border-radius:50%; }
.theme-toggle[aria-checked="true"] .theme-track { background:var(--accent); }
.theme-toggle[aria-checked="true"] .theme-track::after { left:17px; background:#fff; }
h1 { font-size: 22px; margin: 0 0 20px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
h2 { font-size: 16px; margin: 0 0 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.grid { display: grid; gap: 16px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.kpi .label { color: var(--muted); font-size: 12px; }
.kpi .value { font-size: 26px; font-weight: 700; margin-top: 4px; }
.btn { background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 9px 16px; cursor: pointer; font-weight: 500; }
.btn:hover { filter: brightness(1.08); }
.btn.secondary { background: var(--accent-weak); color: var(--accent); }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.btn.danger { background: transparent; color: var(--hot); border: 1px solid var(--line); }
.btn:disabled { opacity: .5; cursor: default; }
label { display: block; font-weight: 500; margin: 14px 0 6px; }
label small { font-weight: 400; color: var(--muted); }
input, textarea, select { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
textarea { min-height: 80px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 500; }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--accent-weak); }
.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; color: #fff; }
.badge.hot { background: var(--hot); } .badge.warm { background: var(--warm); } .badge.cold { background: var(--cold); } .badge.new { background: var(--new); }
.badge.active { background: var(--ok); } .badge.paused, .badge.draft { background: var(--new); }
.muted { color: var(--muted); } .small { font-size: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.chat { display: flex; flex-direction: column; gap: 8px; padding: 16px; background: var(--bg); border-radius: var(--radius); height: 520px; overflow-y: auto; }
.msg { max-width: 75%; padding: 9px 13px; border-radius: 14px; white-space: pre-wrap; word-wrap: break-word; }
.msg.user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.msg.assistant { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.manager { align-self: flex-start; background: #fff4d6; color: #5b4500; border-bottom-left-radius: 4px; }
.msg .meta { font-size: 11px; opacity: .7; margin-top: 4px; }
.split { display: grid; grid-template-columns: 1fr 340px; gap: 16px; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 10px; }
.kv div:nth-child(odd) { color: var(--muted); }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 160px; }
.bars .bar { flex: 1; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; position: relative; }
.bars .bar .h { position: absolute; bottom: 0; left: 0; right: 0; background: var(--hot); border-radius: 3px 3px 0 0; }
.funnel div { display: flex; justify-content: space-between; padding: 8px 12px; border-radius: 8px; margin-bottom: 6px; color: #fff; font-weight: 500; }
.toast { position: fixed; bottom: 20px; right: 20px; background: var(--text); color: var(--bg); padding: 12px 16px; border-radius: 10px; z-index: 50; max-width: 380px; }
.auth { max-width: 380px; margin: 10vh auto; }
.tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); color: var(--text); }
.tabs a.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.agent-tabs { display:flex; gap:6px; flex-wrap:wrap; padding:6px; margin-bottom:20px; background:var(--surface); border:1px solid var(--line); border-radius:12px; }
.agent-tab { flex:1 1 auto; border:0; border-radius:8px; background:transparent; color:var(--muted); padding:12px 14px; cursor:pointer; font-weight:600; }
.agent-tab.active { color:var(--accent); background:var(--accent-weak); font-weight:600; }
.agent-tab:hover { color:var(--text); }.agent-tab.active:hover { color:var(--accent); }
.agent-editor > .card { padding:24px; }.agent-editor > .card > h2 { font-size:18px; }
.agent-editor label { margin-top:24px; margin-bottom:9px; font-size:14px; font-weight:600; color:var(--muted); }
.agent-editor label small { margin-left:8px; font-size:12px; font-weight:400; }
.agent-editor input,.agent-editor textarea,.agent-editor select { background:var(--bg); font-size:15px; line-height:1.6; padding:12px 14px; }
.agent-editor textarea { min-height:112px; max-height:560px; field-sizing:content; }
.agent-editor textarea[rows="2"] { min-height:72px; }
.agent-section { display:grid; grid-template-columns:minmax(190px, 1fr) minmax(0, 3fr); gap:40px; padding:32px 0; }
.agent-section:first-child { padding-top:4px; }
.agent-section:last-child { padding-bottom:4px; }
.agent-section + .agent-section { border-top:1px solid var(--line); }
#custom-sections:not(:empty) { border-top:1px solid var(--line); margin-top:28px; }
#custom-sections > .agent-section:first-child { padding-top:32px; }
.custom-section-actions { display:flex; flex-wrap:wrap; gap:6px; margin-top:18px; }
.custom-section-actions .btn { padding:6px 10px; font-size:13px; }
.custom-section-add { border-top:1px solid var(--line); margin-top:28px; padding-top:24px; }
.custom-section-add > .btn { margin:0 8px 8px 0; }
.custom-section-title { overflow-wrap:anywhere; }
.agent-section-heading h2 { font-size:19px; font-weight:600; margin:0 0 10px; }
.agent-section-heading p { font-size:13px; line-height:1.65; color:var(--muted); margin:0; max-width:240px; }
.agent-section-fields { min-width:0; }
.agent-section-fields > label:first-child,.agent-section-fields > .agent-field:first-child > label { margin-top:0; }
.agent-section-fields .row { align-items:flex-start; gap:16px; }
.agent-section-fields .row > div { flex:1; min-width:140px; }
.agent-editor .agent-hint { color:var(--muted); font-size:13px; line-height:1.6; margin:8px 0 0; }
.agent-editor .technical { font-size:13px; line-height:1.6; }
@media(max-width:1100px) {
  .agent-section { grid-template-columns:1fr; gap:20px; padding:28px 0; }
  .agent-section-heading p { max-width:600px; }
}
@media(max-width:600px) {
  .agent-editor > .card { padding:20px 16px; }
  .agent-tab { flex-basis:40%; padding:10px; }
  .agent-editor .agent-savebar { position:static; }
}
.agent-tab:focus-visible { outline:2px solid var(--accent); outline-offset:-2px; border-radius:6px; }
.agent-savebar { position:sticky; bottom:12px; display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:12px; padding:14px 20px; background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); box-shadow:0 4px 18px #0001; }
.plans { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.plan.current { outline: 2px solid var(--accent); }
.plan .price { font-size: 24px; font-weight: 700; margin: 8px 0; }
.empty { text-align: center; padding: 40px; color: var(--muted); }
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  nav.side { position: static; height: auto; flex-direction: row; overflow-x: auto; padding: 10px; }
  nav.side .logo, nav.side .bottom { display: none; }
  main { padding: 16px; }
  .split { grid-template-columns: 1fr; }
}

/* Navigation, filters and actions use distinct visual levels. */
nav.side a:hover:not(.active) { background:var(--bg); }
.breadcrumbs { display:flex; flex-wrap:wrap; align-items:center; gap:10px; font-size:13px; color:var(--muted); margin-bottom:18px; }
.breadcrumbs a { color:var(--accent); }
.filter-bar { display:flex; flex-wrap:wrap; align-items:flex-end; gap:18px; padding:16px 0; }
.filter-bar label { margin:0; min-width:180px; font-size:12px; color:var(--muted); }
.filter-bar select { display:block; margin-top:6px; color:var(--text); }
.field-options { border:1px solid var(--line); border-radius:8px; padding:16px; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.field-options legend { font-weight:600; padding:0 6px; }
.field-options label { margin:0; }
.contact-record { max-width:960px; }
.contact-record .request-facts { grid-template-columns:repeat(2,minmax(0,1fr)); gap:24px; }
.card:has(> table) { overflow-x:auto; }
@media(max-width:600px){.field-options,.contact-record .request-facts{grid-template-columns:1fr}.filter-bar label{flex:1;min-width:140px}.breadcrumbs{font-size:12px}}
/* Quiet, accessible product guidance; no animation or automatic overlays. */
.ui-icon { width:19px; height:19px; flex-shrink:0; vertical-align:middle; }
nav.side .nav-group a { display:flex; align-items:center; gap:10px; }
nav.side .nav-group a .ui-icon { color:var(--muted); }
nav.side .nav-group a.active .ui-icon { color:var(--accent); }
nav.side .logo { display:flex; align-items:center; gap:9px; }
nav.side .logo .brand-word { color:var(--text); }
.btn .ui-icon { width:17px; height:17px; margin-right:7px; }
a:focus-visible,button:focus-visible,summary:focus-visible { outline:2px solid var(--accent); outline-offset:4px; }
.help-page { max-width:1160px; margin:0 auto; }
.help-hero { display:grid; grid-template-columns:1.25fr 1fr; gap:40px; align-items:center; padding:36px; border:1px solid var(--line); background:var(--surface); border-radius:16px; }
.eyebrow { color:var(--accent); font-size:11px; letter-spacing:.12em; font-weight:700; }
.help-hero h2 { font-size:30px; letter-spacing:-.025em; line-height:1.25; margin:14px 0; }
.help-hero p { color:var(--muted); max-width:480px; margin:0 0 24px; line-height:1.65; }
.help-time { display:block; margin-top:12px; color:var(--muted); font-size:12px; }
.help-flow { background:var(--bg); border:1px solid var(--line); padding:24px; border-radius:12px; }
.help-flow>div { display:flex; gap:16px; align-items:center; font-weight:600; }
.help-flow .ui-icon { width:24px; height:24px; color:var(--accent); }
.help-flow small { display:block; font-size:12px; font-weight:400; color:var(--muted); margin-top:4px; }
.flow-line { display:block; height:25px; width:1px; background:var(--line); margin:6px 0 6px 12px; }
.help-section-heading { display:flex; flex-wrap:wrap; align-items:center; gap:16px; justify-content:space-between; margin:32px 0 16px; }
.help-section-heading h2 { font-size:18px; margin:0; }.help-section-heading span{font-size:12px;}
.help-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; align-items:start; }
.help-topic { border:1px solid var(--line); border-radius:12px; background:var(--surface); overflow:hidden; }
.help-topic summary { display:flex; align-items:flex-start; gap:14px; cursor:pointer; padding:22px; list-style:none; }
.help-topic summary::-webkit-details-marker { display:none; }
.help-topic h3 { font-size:15px; margin:0 0 6px; font-weight:600; }
.help-topic summary .muted { display:block; font-size:13px; line-height:1.5; }
.help-topic-icon { display:flex; padding:10px; background:var(--accent-weak); color:var(--accent); border-radius:9px; }
.help-expand { margin-left:auto; color:var(--muted); font-size:20px; line-height:1; }
.help-topic[open] { border-color:var(--accent); }.help-topic[open] .help-expand{font-size:0;}.help-topic[open] .help-expand:after{content:'−';font-size:20px;}
.help-topic-body { border-top:1px solid var(--line); padding:4px 22px 22px; line-height:1.65; }
.help-topic-body p,.help-topic-body ol { color:var(--muted); }.help-topic-body b { color:var(--text); }
.help-topic-body ol { padding-left:20px; }.help-topic-body li{margin:8px 0;}
.help-cta { display:inline-flex; gap:8px; align-items:center; font-weight:600; margin-top:6px; }
.help-footer { font-size:12px; color:var(--muted); padding:18px 0; }
.quick-start { padding:28px; border:1px solid var(--line); border-radius:12px; margin-top:20px; background:var(--surface); }
.quick-start .request-head p{margin-bottom:0;font-size:13px;}
.guide-agent { display:block; max-width:420px; }.guide-agent select{margin-top:6px;}
.guide-steps { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:24px; margin:24px 0; }
.guide-steps article { display:flex; flex-direction:column; align-items:flex-start; border-top:1px solid var(--line); padding-top:18px; }
.step-number { color:var(--accent); font-size:12px; font-weight:700; letter-spacing:.1em; }
.guide-steps h3 { font-size:16px; margin:12px 0 0; }.guide-steps p { color:var(--muted); line-height:1.6; font-size:13px; }
.guide-steps a { margin-top:auto; font-weight:600; font-size:13px; }.guide-steps .ui-icon{width:15px;}
.guide-bar { display:flex; align-items:center; gap:16px; background:var(--accent-weak); padding:12px 16px; border-radius:10px; margin-bottom:20px; }
.guide-bar>div{display:flex;align-items:center;gap:12px;flex:1;}.guide-bar small{display:block;color:var(--muted);font-size:12px;margin-top:2px;}.guide-bar b{font-size:13px;}.guide-bar>a{font-size:13px;white-space:nowrap;}.guide-bar button{padding:4px 8px;font-size:20px;}
@media(max-width:1000px){.help-hero{gap:24px;padding:28px;}.help-hero h2{font-size:26px;}}
@media(max-width:720px){.help-hero{grid-template-columns:1fr;padding:24px;}.help-flow{display:none;}.help-grid{grid-template-columns:1fr;}.guide-steps{grid-template-columns:1fr;gap:8px;}.quick-start{padding:20px;}.help-topic summary{padding:18px;}.guide-bar{gap:6px;}.guide-bar small{display:none;}.help-section-heading{gap:6px;}}
.help-page:has(.quick-start) .help-hero { display:none; }
nav.side .nav-group { margin-bottom:12px; }
nav.side .nav-group a { padding-top:7px; padding-bottom:7px; }
.help-page a:not(.btn), .help-page .eyebrow, .help-page .step-number, .guide-bar a { color:color-mix(in srgb,var(--accent) 72%,var(--text)); }
@media(max-width:600px){.guide-bar{flex-wrap:wrap;}.guide-bar>div{flex-basis:100%;}.guide-bar .guide-next{margin-right:auto;}}
.guide-instruction { display:block; padding:18px 20px; }
.guide-instruction>div:first-child { align-items:flex-start; }
.guide-instruction small { display:block; max-width:850px; line-height:1.55; margin-top:5px; }
.guide-prompts { margin:12px 0 12px 36px; padding-left:18px; font-size:13px; line-height:1.6; }
.guide-prompts li { margin:6px 0; }
.guide-actions { display:flex; gap:18px; align-items:center; flex-wrap:wrap; font-size:13px; }
.guide-actions button { margin-left:auto; font-size:12px; }
.guide-after { border-top:1px solid var(--line); padding-top:16px; font-size:13px; }
@media(max-width:600px){.guide-prompts{margin-left:0;}.guide-instruction small{display:block;}.guide-actions{gap:12px;}}

.help-tabs { margin-bottom:24px; }
.help-tabs a { display:inline-flex; align-items:center; gap:8px; }
.help-page .quick-start { margin-top:0; }
.help-timeline { display:block; list-style:none; padding:0; margin:28px 0; }
.help-timeline li { display:grid; grid-template-columns:42px minmax(0,1fr); gap:18px; position:relative; padding:0 0 32px; }
.help-timeline li:not(:last-child)::before { content:''; position:absolute; left:20px; top:44px; bottom:6px; width:1px; background:var(--line); }
.help-timeline li:last-child { padding-bottom:0; }
.help-timeline .step-number { display:flex; align-items:center; justify-content:center; width:42px; height:42px; border:1px solid var(--line); border-radius:50%; background:var(--accent-weak); }
.help-timeline h3 { margin:8px 0 0; }
.help-timeline p { max-width:680px; margin:10px 0 14px; }
.help-timeline a { display:inline-flex; align-items:center; gap:6px; }
@media(max-width:600px){.help-tabs{display:flex;flex-wrap:wrap;}.help-tabs a{flex:1;justify-content:center;text-align:center;}.help-timeline li{gap:12px;}}

.demo-banner { display:flex; flex-wrap:wrap; gap:8px 18px; align-items:center; border:1px solid var(--line); background:var(--accent-weak); padding:14px 18px; border-radius:10px; margin-bottom:22px; font-size:13px; }
.demo-banner span { color:var(--muted); flex:1; min-width:220px; }
[aria-disabled="true"] { opacity:.5; cursor:not-allowed; }
input[readonly],textarea[readonly] { cursor:text; }
button:disabled { cursor:not-allowed; opacity:.5; }
#guest-form input { flex:1; min-width:120px; }
#guest-error { color:var(--warm); }
#demo-publish-label[hidden] { display:none; }
