/* Signature Agents -- retro.css (homepage, /start, /thanks) */
/* An XP-era desktop: the IM window (what your agent did while you were away), */
/* the agent list (what it's connected to), and one tabbed Properties dialog.  */
/* /start and /thanks are a Setup Wizard. Legal pages keep site.css.         */
/* No em-dashes anywhere in this file.                                        */

:root {
  color-scheme: light;
  --sky-top: #2f6fd0; --sky-mid: #8ec2f0; --hill: #5aa632; --hill-dark: #3a7f1c;
  --face: #ece9d8; --face-line: #aca899; --paper: #ffffff; --ink: #000000; --muted: #5b5b5b;
  --field-line: #7f9db9; --rule: #e3e3d8;
  --xp-blue: #0a54e3; --xp-blue2: #3d8bf5; --xp-line: #0831d9; --close: #e0461f;
  --me: #d40000; --them: #0000e0; --ok: #1f8a1f; --wait: #b77900; --wait-bg: #fff4cc;
  --hl: #ffff66; --sel: #316ac5; --task: #245edb; --start: #3c9a3c; --legend: #0046d5;
  --f-ui: Tahoma, "Segoe UI", Verdana, Geneva, sans-serif;
  --f-im: "Times New Roman", Times, serif;
  --f-head: "Trebuchet MS", "Lucida Grande", Tahoma, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
html, body { min-height: 100%; }
body {
  margin: 0; font: 12px var(--f-ui); color: var(--ink);
  background:
    radial-gradient(120% 60% at 20% 108%, var(--hill) 0 58%, transparent 58.3%),
    radial-gradient(140% 55% at 85% 112%, var(--hill-dark) 0 58%, transparent 58.3%),
    linear-gradient(180deg, var(--sky-top), var(--sky-mid) 75%);
  background-color: var(--sky-top); background-attachment: fixed;
  padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px));
}
a { color: #0033cc; }
:focus-visible { outline: 2px dotted #000; outline-offset: 2px; }
button, input, select { font: inherit; }
svg { display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.desk {
  max-width: 1060px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 28px 32px;
  display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 22px 26px; align-items: start;
}

/* Hero copy, straight on the wallpaper */
.hero { grid-column: 1 / -1; color: #fff; display: grid; gap: 12px; max-width: 640px; }
.logo { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font: bold 15px var(--f-head); text-shadow: 1px 1px 2px rgba(0,0,0,.4); }
.hero h1 { margin: 0; font: bold clamp(28px, 5vw, 44px)/1.05 var(--f-head); letter-spacing: -.5px; text-shadow: 2px 2px 3px rgba(0,30,90,.45); text-wrap: balance; }
.hero-sub { margin: 0; font: 15px/1.5 var(--f-head); max-width: 56ch; text-shadow: 1px 1px 2px rgba(0,30,90,.5); }
.preview-form { display: grid; gap: 6px; }
.preview-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.preview-label { font: bold 12px var(--f-ui); text-shadow: 1px 1px 1px rgba(0,0,0,.4); }
.preview-input { font: 13px var(--f-ui); padding: 4px 6px; border: 1px solid var(--field-line); width: min(260px, 100%); }
.preview-input:disabled, .preview-btn:disabled { opacity: .7; cursor: progress; }
.preview-status { margin: 0; min-height: 16px; font: bold 12px var(--f-ui); text-shadow: 1px 1px 1px rgba(0,0,0,.5); }
.preview-status.error { color: var(--hl); }
.spots { margin: 0; font: bold 12px var(--f-ui); text-shadow: 1px 1px 1px rgba(0,0,0,.45); }
.spots b { color: var(--hl); }

.btn {
  font: 12px var(--f-ui); color: var(--ink); background: linear-gradient(#fff, #e3e3db);
  border: 1px solid #003c74; border-radius: 3px; padding: 4px 14px; cursor: pointer; text-decoration: none; display: inline-block;
}
.btn:hover { box-shadow: inset 0 0 0 1px #f8b330; }
.btn.primary { font-weight: bold; box-shadow: inset 0 0 0 1px #4b86e8; }
.btn[disabled] { color: #a0a0a0; border-color: #c9c5b2; cursor: default; box-shadow: none; }

/* Windows */
.win { background: var(--face); border: 1px solid var(--xp-line); border-radius: 8px 8px 0 0; box-shadow: 3px 4px 14px rgba(0,0,0,.35); overflow: hidden; min-width: 0; scroll-margin-top: 12px; }
.bar {
  display: flex; align-items: center; gap: 6px; padding: 4px 4px 4px 8px; color: #fff; font: bold 12px var(--f-ui);
  background: linear-gradient(180deg, var(--xp-blue2) 0%, var(--xp-blue) 16%, #0846c9 82%, #0638a8 100%);
  text-shadow: 1px 1px 0 #0a246a;
}
.bar .t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctl { display: flex; gap: 2px; }
.ctl span { width: 19px; height: 19px; border: 1px solid #fff; border-radius: 3px; background: linear-gradient(#5b9bff, #2563df); display: grid; place-items: center; font-size: 10px; }
.ctl span.x { background: linear-gradient(#f08a6b, var(--close)); }
.menu { display: flex; gap: 12px; padding: 2px 8px; font-size: 11px; color: #444; border-bottom: 1px solid #d0ccb8; }

/* IM window */
.status { margin: 6px 6px 0; padding: 5px 8px; background: var(--paper); border: 1px solid var(--field-line); font-size: 11px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.status i { color: var(--ink); }
.log { margin: 6px; background: var(--paper); border: 1px solid var(--field-line); padding: 10px; font: 16px/1.4 var(--f-im); display: grid; gap: 9px; align-content: start; min-height: 300px; max-height: 460px; overflow-y: auto; }
.log p { margin: 0; }
.divider { font: 11px var(--f-ui); color: var(--muted); display: flex; align-items: center; gap: 8px; }
.divider::before, .divider::after { content: ""; height: 1px; background: #d5d5d5; flex: 1; }
.me { color: var(--me); font-weight: bold; }
.them { color: var(--them); font-weight: bold; }
.ts { color: #777; font-size: 13px; }
.chip { font: bold 10px var(--f-ui); padding: 1px 5px; border-radius: 8px; white-space: nowrap; vertical-align: 2px; margin-left: 4px; }
.chip.done { color: var(--ok); border: 1px solid var(--ok); }
.chip.wait { color: var(--wait); border: 1px solid var(--wait); background: var(--wait-bg); }
.ask { background: var(--wait-bg); border: 1px solid #e4cf7a; padding: 8px; display: grid; gap: 8px; }
.ask .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.draft { font-style: italic; border-left: 3px solid #c9c5b2; padding-left: 8px; color: #333; }
.typing { color: #777; font: italic 13px var(--f-im); }
.compose { margin: 0 6px; display: flex; gap: 6px; padding-bottom: 8px; }
.compose input { flex: 1; min-width: 0; font: 15px var(--f-im); padding: 6px; border: 1px solid var(--field-line); }

/* Agent list */
.buddy { position: sticky; top: calc(16px + env(safe-area-inset-top, 0px)); }
.bl-head { margin: 6px; background: var(--paper); border: 1px solid var(--face-line); padding: 8px; display: grid; justify-items: center; gap: 4px; }
.bl-head .tile { width: 100%; max-width: 228px; aspect-ratio: 2.2/1; display: grid; place-items: center; background: linear-gradient(#1b3fa6, #0c2470); border: 1px solid #000; }
.bl-head .nm { font: bold 11px var(--f-ui); }
.bl { margin: 0 6px; background: var(--paper); border: 1px solid var(--field-line); padding: 6px 4px; min-height: 220px; }
.grp { display: flex; gap: 4px; align-items: center; font-weight: bold; padding: 1px 3px; cursor: pointer; user-select: none; }
.grp .tri { width: 9px; font-size: 8px; }
.grp.hl { background: var(--hl); }
.bud { display: flex; gap: 6px; align-items: center; padding: 1px 4px 1px 20px; }
.bud[tabindex] { cursor: pointer; }
.bud[tabindex]:hover, .bud[tabindex]:focus-visible { background: var(--sel); color: #fff; outline: none; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: #2bb22b; border: 1px solid #126812; }
.bud.idle .dot { background: #f2c200; border-color: #8a6d00; }
.bud.open .dot { background: #fff; border-color: #888; }
.bud small { color: #888; font-size: 10px; }
.bud[tabindex]:hover small { color: #dde; }
.bl-foot { padding: 6px; display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.bl-foot select { font: 11px var(--f-ui); max-width: 150px; }

/* Wide windows: preview result and Properties dialog */
.wide { grid-column: 1 / -1; width: 100%; }
.props { max-width: 760px; justify-self: center; }
.tabs { display: flex; gap: 2px; padding: 8px 8px 0; flex-wrap: wrap; }
.tab {
  border: 1px solid #919b9c; border-bottom: 0; background: linear-gradient(#fff, #ecebe5); padding: 4px 10px;
  border-radius: 3px 3px 0 0; cursor: pointer; font: 12px var(--f-ui); position: relative; top: 1px;
}
.tab[aria-selected="true"] { background: #fcfcfe; border-top: 2px solid #ffc83c; padding-top: 3px; z-index: 1; }
.pane { margin: 0 8px; background: #fcfcfe; border: 1px solid #919b9c; padding: 14px 16px; min-height: 220px; scroll-margin-top: 60px; }
.pane h2 { margin: 0 0 10px; font: bold 14px var(--f-ui); }
.pane p { margin: 0; line-height: 1.55; max-width: 62ch; }
fieldset { border: 1px solid #d0d0bf; border-radius: 3px; margin: 0; padding: 8px 12px 10px; display: grid; gap: 4px; min-width: 0; }
legend { color: var(--legend); padding: 0 4px; }
.stack { display: grid; gap: 12px; }
.cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.cols ul, fieldset ul { margin: 2px 0 0; padding-left: 16px; display: grid; gap: 3px; line-height: 1.4; }
.price { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.price-main { font: bold 26px var(--f-ui); font-variant-numeric: tabular-nums; }
.price-strike { color: #888; text-decoration: line-through; }
table.tiers { border-collapse: collapse; width: 100%; }
table.tiers td { padding: 4px 6px; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.tiers td.n { text-align: right; white-space: nowrap; font-weight: bold; font-variant-numeric: tabular-nums; }
.fine { color: var(--muted); font-size: 11px; }
.faq { display: grid; gap: 4px; }
.faq details { border-bottom: 1px solid var(--rule); padding: 5px 0; }
.faq summary { cursor: pointer; font-weight: bold; }
.faq details p { margin-top: 4px; }
.quote { font: italic 14px/1.45 Georgia, "Times New Roman", serif; }
.dlg-btns { display: flex; justify-content: flex-end; gap: 6px; padding: 10px 8px; flex-wrap: wrap; }

/* Footer on the wallpaper */
.foot { grid-column: 1 / -1; color: #fff; font-size: 11px; text-shadow: 1px 1px 1px rgba(0,0,0,.5); display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; }
.foot a { color: #fff; }

/* Taskbar */
.taskbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  background: linear-gradient(180deg, #3f8cf3 0%, var(--task) 12%, #1f4fc2 90%, #1941a5 100%);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.taskbar .row { height: 36px; display: flex; align-items: center; gap: 6px; padding-right: max(10px, env(safe-area-inset-right, 0px)); }
.start {
  height: 100%; display: flex; align-items: center; gap: 6px; padding: 0 16px 0 max(12px, env(safe-area-inset-left, 0px));
  background: linear-gradient(180deg, #5eb95e, var(--start) 30%, #2f7f2f); color: #fff; text-decoration: none;
  font: italic bold 15px var(--f-head); text-shadow: 1px 1px 1px rgba(0,0,0,.5); border-radius: 0 12px 12px 0; white-space: nowrap;
}
.task { min-width: 0; flex: 0 1 170px; height: 26px; display: flex; align-items: center; gap: 6px; padding: 0 8px; color: #fff; text-decoration: none; font-size: 11px; border-radius: 3px; background: #3c81f3; border: 1px solid #1a3e9a; white-space: nowrap; overflow: hidden; }
.task span { overflow: hidden; text-overflow: ellipsis; }
.tray { margin-left: auto; height: 100%; display: flex; align-items: center; gap: 8px; padding: 0 10px; background: #0f9ae9; border-left: 1px solid #0b6fc2; color: #fff; font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tray .bubble { font-size: 10px; }

/* Website preview result (filled by preview.js) */
.preview-body { margin: 6px; background: #fcfcfe; border: 1px solid #919b9c; padding: 14px 16px; display: grid; gap: 12px; }
.preview-body h2 { margin: 0; font: bold 16px var(--f-ui); }
.preview-body h2:focus { outline: none; }
.preview-body p { margin: 0; line-height: 1.55; }
.preview-summary { font-size: 13px; max-width: 72ch; }
.preview-thin, .preview-note { color: var(--muted); font-size: 11px; }
.preview-flows { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.preview-flow { border: 1px solid #d0d0bf; border-radius: 3px; padding: 8px 12px 10px; background: var(--paper); display: grid; gap: 4px; }
.preview-flow-tag { font: bold 10px var(--f-ui); color: var(--legend); letter-spacing: .5px; }
.preview-flow-title { margin: 0; font: bold 13px var(--f-ui); }
.preview-flow-meta { color: var(--muted); font-size: 11px; }
.preview-approval { color: var(--wait); font-weight: bold; }
.preview-cta { display: flex; gap: 6px; flex-wrap: wrap; }

/* Stack diagram: same structure as before, retro colors */
.stack-dia {
  --r-owner: #000000; --r-iface: #0a54e3; --r-agent: #b77900; --r-gate: #c0392b; --r-mem: #6a3fb5;
  --r-job: #1f8a1f; --r-flow: #0a54e3; --r-team: #c0392b; --r-svc: #808080;
  position: relative; border: 1px solid var(--field-line); background: var(--paper); padding: 4px 14px 14px;
}
.stack-edges { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.stack-band { position: relative; display: grid; grid-template-columns: 130px 1fr; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px dotted #c9c5b2; }
.stack-band:first-of-type { border-top: none; }
.stack-band-label { font: bold 10px var(--f-ui); text-transform: uppercase; letter-spacing: .8px; color: var(--muted); }
.stack-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 24px; position: relative; z-index: 1; }
.stack-card {
  --c: var(--r-svc);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-width: 140px; max-width: 210px; min-height: 52px; padding: 7px 12px;
  background: linear-gradient(#fff, #f1efe4); border: 1px solid var(--c); border-left-width: 4px; border-radius: 3px;
  font: 12px var(--f-ui); color: var(--ink); text-align: center; cursor: pointer;
}
.stack-card:hover, .stack-card.is-selected { box-shadow: inset 0 0 0 1px #f8b330; background: #fffbe6; }
.stack-tag { font-size: 9px; font-weight: bold; letter-spacing: .5px; color: var(--c); line-height: 1.2; }
.stack-name { font-weight: bold; line-height: 1.25; }
.r-owner { --c: var(--r-owner); } .r-iface { --c: var(--r-iface); } .r-agent { --c: var(--r-agent); }
.r-gate { --c: var(--r-gate); } .r-mem { --c: var(--r-mem); } .r-job { --c: var(--r-job); }
.r-flow { --c: var(--r-flow); } .r-team { --c: var(--r-team); } .r-svc { --c: var(--r-svc); }
.stack-edges .edge { fill: none; stroke: #9a9a9a; stroke-width: 1.3; transition: opacity .15s, stroke .15s; }
.stack-edges .edge.hand { stroke-dasharray: 5 4; }
.stack-edges .edge.gated { stroke: #d08a4a; stroke-width: 1.5; }
.stack-edges .arr { fill: #9a9a9a; }
.stack-edges .arr.ok { fill: #d08a4a; }
.stack-dia.selecting .edge { opacity: .22; }
.stack-dia.selecting .edge.hi { opacity: 1; stroke: #000; stroke-width: 1.9; }
.stack-dia.selecting .edge.gated.hi { stroke: var(--r-gate); }
.stack-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 11px; color: var(--muted); }
.stack-key { display: inline-flex; align-items: center; gap: 6px; }
.key-line { stroke: #9a9a9a; stroke-width: 1.6; }
.key-line.hand { stroke-dasharray: 5 4; }
.key-line.gated { stroke: #d08a4a; stroke-width: 1.8; }
.stack-detail { border: 1px solid #d0d0bf; background: var(--paper); padding: 10px 12px; min-height: 120px; display: grid; gap: 4px; align-content: start; }
.stack-detail-tag { font: bold 10px var(--f-ui); color: var(--muted); letter-spacing: .5px; }
.stack-detail-title { margin: 0; font: bold 14px var(--f-ui); }
.stack-detail-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 11px; color: var(--muted); }

/* Setup Wizard: /start and /thanks */
.wiz-desk {
  max-width: 720px; margin: 0 auto; display: grid; gap: 16px; padding-block: 28px 32px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.wiz-body { display: grid; grid-template-columns: 120px minmax(0, 1fr); background: var(--paper); border-bottom: 1px solid var(--face-line); }
.wiz-side { background: linear-gradient(180deg, #1b3fa6, #3d8bf5 70%, #8ec2f0); display: flex; justify-content: center; padding-top: 22px; }
.wiz-main { padding: 18px 20px 20px; display: grid; gap: 14px; align-content: start; min-height: 360px; }
.wiz-main .intake-step { display: none; }
.wiz-main .intake-step.active { display: grid; gap: 14px; }
.step-title { margin: 0; font: bold 18px var(--f-head); }
.step-hint { margin: -6px 0 0; line-height: 1.5; color: var(--muted); max-width: 60ch; font-size: 12px; }
.opts { display: grid; gap: 6px; }
.opts.row { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.opts.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.opt { display: flex; gap: 6px; align-items: flex-start; cursor: pointer; line-height: 1.35; }
.opt input { margin: 1px 0 0; flex: none; }
.opt b { font-weight: bold; }
.opt small { display: block; color: var(--muted); font-size: 11px; }
.opt.agree { background: var(--face); border: 1px solid var(--face-line); padding: 8px; }
.field-group { display: grid; gap: 10px; }
.field-wrap { display: grid; gap: 3px; }
.field-label { font-weight: normal; }
.optional { color: var(--muted); }
.field-input, .field-textarea { font: 13px var(--f-ui); padding: 4px 6px; border: 1px solid var(--field-line); background: var(--paper); width: 100%; max-width: 360px; }
.field-textarea { max-width: none; min-height: 150px; resize: vertical; line-height: 1.45; }
.field-input.invalid, .field-textarea.invalid { border-color: #c0392b; background: #fff5f3; }
.field-meta { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.field-note { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
#gw-note { color: var(--wait); background: var(--wait-bg); border: 1px solid #e4cf7a; padding: 4px 8px; font-size: 11px; margin-top: 4px; }
#char-count { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.field-error { display: none; margin: 0; color: #c0392b; font-size: 11px; font-weight: bold; }
.field-error.visible { display: block; }
.other-input-wrap { display: none; gap: 3px; }
.other-input-wrap.visible { display: grid; }
.plan-badge { margin: 0; display: inline-block; justify-self: start; background: var(--wait-bg); border: 1px solid #e4cf7a; padding: 3px 8px; font-weight: bold; }
.next-steps { margin: 2px 0 0; padding-left: 18px; display: grid; gap: 4px; line-height: 1.45; }
.hp-field { position: absolute; left: -9999px; opacity: 0; }
.wiz-progress { display: flex; align-items: center; gap: 10px; padding: 10px 12px 0; font-size: 11px; color: var(--muted); }
.xp-progress { flex: 1; height: 14px; border: 1px solid #686868; border-radius: 3px; background: var(--paper); padding: 1px; }
.xp-progress-fill {
  height: 100%; width: 0%; transition: width .25s;
  background: repeating-linear-gradient(90deg, #2fcf2f 0 8px, transparent 8px 10px);
}
.wiz-btns { align-items: center; }
.submit-error { display: none; margin-right: auto; color: #c0392b; font-size: 11px; font-weight: bold; }
.submit-error.visible { display: block; }
@media (max-width: 560px) {
  .wiz-body { grid-template-columns: minmax(0, 1fr); }
  .wiz-side { display: none; }
  .opts.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wiz-main { min-height: 0; }
}
@media (prefers-reduced-motion: reduce) { .xp-progress-fill { transition: none; } }

@media (max-width: 760px) {
  .desk { grid-template-columns: minmax(0, 1fr); }
  .buddy { position: static; }
  .cols { grid-template-columns: minmax(0, 1fr); }
  .task, .tray .bubble { display: none; }
  .stack-band { grid-template-columns: 1fr; gap: 8px; padding: 10px 0; }
  .stack-card { min-width: 0; flex: 1 1 130px; max-width: none; }
  .stack-dia .edge { opacity: .35; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
