/* HomeSignal™ panel + agent dashboard. Uses the site's tokens from styles.css. */

/* ---------- Launcher ---------- */
.hs-launch { position: fixed; right: 20px; bottom: 20px; z-index: 900; display: flex; align-items: center; gap: 12px; padding: 12px 20px 12px 16px; border: 0; border-radius: 999px; background: var(--ink); color: #fff; font: inherit; cursor: pointer; box-shadow: 0 0 0 2px var(--accent), 0 14px 34px rgba(0,0,0,.28); transition: transform .2s, box-shadow .2s; text-align: left; }
.hs-launch:hover { transform: translateY(-2px); box-shadow: 0 0 0 2px var(--accent-bright), 0 18px 40px rgba(0,0,0,.32); }
.hs-launch:focus-visible { outline: 3px solid var(--accent-bright); outline-offset: 3px; }
.hs-launch-txt { display: flex; flex-direction: column; line-height: 1.15; }
.hs-launch strong { font-family: 'Playfair Display', Georgia, serif; font-weight: 500; font-size: 17px; letter-spacing: .01em; }
.hs-launch sup, .hs-panel sup { font-size: .55em; }
.hs-launch small { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-bright); }
.hs-pulse { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(197,169,94,.7); animation: hs-pulse 2.4s infinite; flex: none; }
@keyframes hs-pulse { 0% { box-shadow: 0 0 0 0 rgba(197,169,94,.65); } 70% { box-shadow: 0 0 0 12px rgba(197,169,94,0); } 100% { box-shadow: 0 0 0 0 rgba(197,169,94,0); } }
body.hs-open .hs-launch { opacity: 0; pointer-events: none; }

/* ---------- Panel ---------- */
.hs-panel { position: fixed; right: 20px; bottom: 20px; z-index: 950; width: min(420px, calc(100vw - 24px)); max-height: min(720px, calc(100vh - 40px)); display: flex; flex-direction: column; background: #fff; border-top: 4px solid var(--accent); box-shadow: 0 28px 70px rgba(0,0,0,.35); overflow: hidden; color: var(--text); }
.hs-panel[hidden] { display: none; }
.hs-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 18px 14px; background: var(--ink); color: #fff; }
.hs-head > div { flex: 1; min-width: 0; }
.hs-head h2 { font-size: 24px; margin: 0; line-height: 1.2; outline: none; }
.hs-head p { margin: 4px 0 0; color: #d9d4c7; font-size: 14px; line-height: 1.45; }
.hs-mark { color: var(--accent-bright); font-size: 22px; line-height: 1.2; }
.hs-icon { flex: none; width: 34px; height: 34px; border: 1px solid rgba(255,255,255,.3); background: transparent; color: #fff; border-radius: 50%; font-size: 18px; line-height: 1; cursor: pointer; }
.hs-icon:hover, .hs-icon:focus-visible { border-color: var(--accent-bright); color: var(--accent-bright); outline: none; }
.hs-progress { height: 4px; background: var(--accent-soft); }
.hs-progress span { display: block; height: 100%; background: var(--accent-grad); transition: width .3s; }
.hs-body { padding: 16px 18px; overflow-y: auto; flex: 1; }
.hs-paths { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.hs-path { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px 12px; border: 1px solid var(--line); background: var(--paper); font: inherit; text-align: left; cursor: pointer; transition: border-color .2s, background .2s; color: var(--text); }
.hs-path:hover, .hs-path:focus-visible { border-color: var(--accent); background: var(--accent-soft); outline: none; }
.hs-path strong { font-size: 15px; }
.hs-path small { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.hs-ico { font-size: 22px; }
.hs-wide { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin: 0 0 10px; padding: 13px 14px; border: 1px solid var(--ink); background: var(--ink); color: #fff; font: inherit; font-weight: 600; cursor: pointer; text-align: center; }
.hs-wide:hover, .hs-wide:focus-visible { background: #000; box-shadow: inset 0 -3px 0 var(--accent); outline: none; }
.hs-wide.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.hs-wide.ghost:hover, .hs-wide.ghost:focus-visible { border-color: var(--accent); box-shadow: none; }
.hs-link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent-strong); text-decoration: underline; cursor: pointer; }
.hs-fine { margin: 0; padding: 10px 18px 14px; font-size: 11.5px; line-height: 1.5; color: var(--muted); border-top: 1px solid var(--line); }
.hs-chat .hs-fine { padding: 10px 0 0; border: 0; }
.hs-fine a { text-decoration: underline; }

/* Form steps */
.hs-form { display: flex; flex-direction: column; gap: 14px; }
.hs-field { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.hs-field > label, .hs-field > legend { font-weight: 600; font-size: 14px; padding: 0; margin-bottom: 6px; }
.hs-field > label { margin-bottom: 0; }
.hs-field small { font-weight: 400; color: var(--muted); }
.hs-field input, .hs-field select, .hs-field textarea { width: 100%; font: inherit; font-size: 16px; padding: 11px 12px; border: 1px solid var(--line); background: #fff; color: var(--text); border-radius: 0; }
.hs-field input:focus, .hs-field select:focus, .hs-field textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.hs-req { color: var(--warn); }
.hs-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.hs-chip { padding: 8px 13px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font: inherit; font-size: 14px; color: var(--text); cursor: pointer; transition: all .15s; }
.hs-chip:hover { border-color: var(--accent); }
.hs-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hs-chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.hs-chip.on::before { content: "✓ "; color: var(--accent-bright); }
.hs-consent { display: flex; gap: 10px; align-items: flex-start; font-size: 12.5px; line-height: 1.5; color: var(--muted); padding: 12px; background: var(--paper); border: 1px solid var(--line); }
.hs-consent input { width: 18px; height: 18px; margin-top: 2px; flex: none; accent-color: var(--ink); }
.hs-consent a { text-decoration: underline; color: var(--text); }
.hs-error { margin: 0; color: #9b2c1f; font-size: 14px; font-weight: 600; }
.hs-error:empty { display: none; }
.hs-nav { display: flex; gap: 10px; justify-content: space-between; }
.hs-btn { padding: 12px 18px; border: 1px solid var(--ink); background: var(--ink); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.hs-btn:hover, .hs-btn:focus-visible { box-shadow: inset 0 -3px 0 var(--accent); outline: none; }
.hs-btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.hs-btn:disabled { opacity: .6; cursor: progress; }
.hs-done { text-align: center; padding: 8px 4px 14px; }
.hs-done p { margin: 8px 0; line-height: 1.6; }
.hs-check { display: inline-flex; width: 52px; height: 52px; border-radius: 50%; align-items: center; justify-content: center; font-size: 26px; background: var(--accent-soft); color: var(--accent-strong); border: 2px solid var(--accent); }
.hs-note { font-size: 13px; color: var(--warn); }
.hs-h3 { font-family: 'DM Sans', sans-serif; font-weight: 700; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-strong); margin: 8px 0 10px; }

/* Chat */
.hs-chat { display: flex; flex-direction: column; gap: 10px; }
.hs-chat-log { display: flex; flex-direction: column; gap: 8px; max-height: 340px; min-height: 160px; overflow-y: auto; padding-right: 2px; }
.hs-msg { max-width: 88%; padding: 10px 13px; font-size: 14.5px; line-height: 1.55; border-radius: 14px; }
.hs-msg.ai { align-self: flex-start; background: var(--cream); border-bottom-left-radius: 4px; }
.hs-msg.me { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 4px; }
.hs-msg a { text-decoration: underline; color: var(--accent-strong); }
.hs-chat-form { display: flex; gap: 8px; }
.hs-chat-form input { flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 11px 12px; border: 1px solid var(--line); }
.hs-chat-form input:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.hs-typing { display: flex; gap: 4px; }
.hs-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: hs-dot 1s infinite ease-in-out; }
.hs-typing span:nth-child(2) { animation-delay: .15s; } .hs-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes hs-dot { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

@media (max-width: 600px) {
  .hs-launch { right: 12px; bottom: 12px; padding: 10px 16px 10px 13px; }
  .hs-launch small { display: none; }
  .hs-panel { right: 0; bottom: 0; width: 100vw; max-height: 92vh; }
  .hs-paths { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .hs-pulse, .hs-typing span { animation: none; } .hs-launch, .hs-progress span { transition: none; } }
@media print { .hs-launch, .hs-panel { display: none !important; } }

/* ---------- Agent dashboard (/one/signals) ---------- */
.sig { padding: 34px 6% 80px; background: var(--paper); min-height: 70vh; }
.sig h1 { font-size: clamp(34px, 4vw, 54px); margin: 8px 0 6px; }
.sig-top { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; }
.sig-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sig-controls select, .sig-filters select, .sig-filters input { font: inherit; padding: 9px 10px; border: 1px solid var(--line); background: #fff; }
.sig-status { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; padding: 0; list-style: none; }
.sig-status li { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); padding: 8px 12px; font-size: 13.5px; }
.sig-status .ok::before, .sig-status .off::before, .sig-status .warn::before { font-weight: 700; }
.sig-status .ok::before { content: "✓"; color: var(--good); }
.sig-status .off::before { content: "○"; color: var(--muted); }
.sig-status .warn::before { content: "!"; color: var(--warn); }
.sig-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.sig-kpi { background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--accent); padding: 16px 16px 14px; }
.sig-kpi small { display: block; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; color: var(--muted); }
.sig-kpi strong { display: block; font-family: 'Playfair Display', Georgia, serif; font-weight: 500; font-size: 38px; line-height: 1.15; margin: 6px 0 2px; color: var(--ink); }
.sig-kpi span { font-size: 13px; color: var(--muted); }
.sig-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; margin-bottom: 14px; }
.sig-card { background: #fff; border: 1px solid var(--line); padding: 18px 18px 16px; min-width: 0; }
.sig-card h2 { font-family: 'DM Sans', sans-serif; font-size: 15px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin: 0 0 12px; color: var(--ink); }
.sig-card h2 small { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--muted); }
.sig-chart { position: relative; }
.sig-chart svg { width: 100%; height: 190px; display: block; overflow: visible; }
.sig-chart .bar { fill: var(--accent); }
.sig-chart .bar:hover, .sig-chart .hit:hover + .bar { fill: var(--accent-strong); }
.sig-chart .grid { stroke: var(--line); stroke-width: 1; }
.sig-chart text { font-size: 11px; fill: var(--muted); font-family: 'DM Sans', sans-serif; }
.sig-tip { position: absolute; pointer-events: none; background: var(--ink); color: #fff; font-size: 12.5px; padding: 6px 9px; white-space: nowrap; transform: translate(-50%, -110%); }
.sig-tip[hidden] { display: none; }
.sig-funnel { display: flex; flex-direction: column; gap: 9px; }
.sig-row { display: grid; grid-template-columns: 130px 1fr 54px; gap: 10px; align-items: center; font-size: 14px; }
.sig-row .track { height: 14px; background: var(--cream); position: relative; }
.sig-row .fill { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: 0 4px 4px 0; min-width: 2px; }
.sig-row b { text-align: right; font-variant-numeric: tabular-nums; }
.sig-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.sig-table th { text-align: left; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); padding: 8px 8px; font-weight: 700; white-space: nowrap; }
.sig-table td { border-bottom: 1px solid var(--line); padding: 9px 8px; vertical-align: top; }
.sig-table td.num, .sig-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.sig-table tbody tr.click { cursor: pointer; }
.sig-table tbody tr.click:hover, .sig-table tbody tr.click:focus-visible { background: var(--accent-soft); outline: none; }
.sig-scroll { overflow-x: auto; }
.sig-pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--cream); border: 1px solid var(--line); white-space: nowrap; }
.sig-pill.q { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); }
.sig-pill.st-new::before { content: "● "; color: var(--cold); }
.sig-pill.st-contacted::before { content: "◐ "; color: var(--accent-strong); }
.sig-pill.st-appointment::before { content: "📅 "; }
.sig-pill.st-client::before { content: "✓ "; color: var(--good); }
.sig-pill.st-closed::before { content: "– "; color: var(--muted); }
.sig-pill.bad { background: #fbeeea; border-color: #e2b3a8; color: #8a2f1c; }
.sig-pill.bad::before { content: "! "; }
.sig-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.sig-filters input { flex: 1; min-width: 200px; }
.sig-attn { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sig-attn li { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; border: 1px solid var(--line); padding: 10px 12px; font-size: 14px; }
.sig-attn li > div { min-width: 0; flex: 1; }
.sig-attn small { color: var(--muted); display: block; }
.sig-empty { color: var(--muted); font-size: 14px; margin: 4px 0; }
.sig-drawer { position: fixed; inset: 0 0 0 auto; width: min(640px, 100vw); background: #fff; z-index: 1000; box-shadow: -20px 0 60px rgba(0,0,0,.25); overflow-y: auto; padding: 0 0 40px; border: 0; margin: 0; max-height: none; height: 100vh; }
.sig-drawer::backdrop { background: rgba(0,0,0,.45); }
.sig-drawer header { position: sticky; top: 0; background: var(--ink); color: #fff; padding: 18px 22px; display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; z-index: 2; }
.sig-drawer header h2 { margin: 0; font-size: 28px; }
.sig-drawer header p { margin: 4px 0 0; color: #d9d4c7; font-size: 14px; }
.sig-drawer section { padding: 16px 22px; border-bottom: 1px solid var(--line); }
.sig-drawer h3 { font-family: 'DM Sans', sans-serif; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-strong); margin: 0 0 10px; font-weight: 700; }
.sig-dl { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; margin: 0; font-size: 14px; }
.sig-dl dt { color: var(--muted); }
.sig-dl dd { margin: 0; word-break: break-word; white-space: pre-line; }
.sig-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sig-actions label { display: flex; gap: 6px; align-items: center; font-size: 14px; }
.sig-actions select { font: inherit; padding: 8px; border: 1px solid var(--line); }
.sig-timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.sig-timeline li { border-left: 3px solid var(--line); padding: 4px 0 4px 12px; font-size: 14px; }
.sig-timeline li.sent { border-color: var(--good); }
.sig-timeline li.failed { border-color: #c0533a; }
.sig-timeline li.draft, .sig-timeline li.scheduled { border-color: var(--accent); }
.sig-timeline .meta { font-size: 12px; color: var(--muted); }
.sig-timeline pre { white-space: pre-wrap; font: inherit; font-size: 13.5px; background: var(--paper); padding: 10px; margin: 6px 0; max-height: 220px; overflow: auto; }
.sig-timeline textarea, .sig-compose textarea, .sig-compose input, .sig-note textarea { width: 100%; font: inherit; font-size: 14px; padding: 9px; border: 1px solid var(--line); }
.sig-compose, .sig-note { display: flex; flex-direction: column; gap: 8px; }
.sig-settings { width: min(900px, 96vw); max-height: 92vh; padding: 0; border: 0; border-top: 4px solid var(--accent); }
.sig-settings::backdrop { background: rgba(0,0,0,.5); }
.sig-settings form { display: flex; flex-direction: column; }
.sig-settings .sig-set-body { padding: 18px 22px; overflow-y: auto; max-height: calc(92vh - 140px); }
.sig-settings .sig-set-head, .sig-settings .sig-set-foot { padding: 14px 22px; display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--paper); border-bottom: 1px solid var(--line); }
.sig-settings .sig-set-foot { border-top: 1px solid var(--line); border-bottom: 0; }
.sig-settings h2 { margin: 0; font-size: 26px; }
.sig-settings h3 { font-family: 'DM Sans', sans-serif; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-strong); margin: 22px 0 10px; }
.sig-agent { border: 1px solid var(--line); padding: 12px; margin-bottom: 10px; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.sig-agent label, .sig-settings .sig-inline label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; }
.sig-agent input, .sig-agent select, .sig-settings input[type=number], .sig-settings textarea, .sig-settings input[type=text], .sig-settings select { font: inherit; font-weight: 400; font-size: 14px; padding: 8px; border: 1px solid var(--line); }
.sig-agent select[multiple] { min-height: 110px; }
.sig-agent .full { grid-column: 1 / -1; display: flex; flex-direction: row; justify-content: space-between; align-items: center; gap: 10px; font-weight: 400; }
.sig-inline { display: flex; flex-wrap: wrap; gap: 14px; }
.sig-checks { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 14px; }
.sig-checks label { display: flex; gap: 6px; align-items: center; font-weight: 400 !important; flex-direction: row !important; }
.sig-tpl { border: 1px solid var(--line); padding: 12px; margin-bottom: 10px; display: flex; flex-direction: column; gap: 6px; }
.sig-tpl textarea { min-height: 150px; }
.sig-help { font-size: 13px; color: var(--muted); line-height: 1.6; }
.sig-help code { background: var(--cream); padding: 1px 5px; font-size: 12px; }
@media (max-width: 900px) { .sig-grid { grid-template-columns: 1fr; } .sig-dl { grid-template-columns: 1fr; } .sig-dl dt { margin-top: 6px; } }
