:root {
  --blue: #465496; --blue-d: #36427a; --blue-l: #eef0f8; --blue-m: #c9cfe6;
  --pink: #B1377F; --pink-d: #8f2b66; --pink-l: #f8ecf3;
  --ink: #1b1b22; --muted: #6b6b76; --line: #e3e3ea; --bg: #f6f6f9; --white: #fff;
  --ok: #2f7d4f; --warn: #a86a00; --tbd: #fff3c4;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: 'Poppins', system-ui, sans-serif; font-size: 14px; color: var(--ink); background: var(--bg); }
a { color: var(--blue); }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }

header.top { position: sticky; top: 0; z-index: 50; background: var(--white); border-bottom: 3px solid var(--blue); display: flex; align-items: center; gap: 22px; padding: 0 24px; height: 60px; }
.brand { display: flex; align-items: baseline; gap: 8px; text-decoration: none; color: var(--ink); }
.brand b { font-weight: 700; font-size: 20px; color: var(--blue); letter-spacing: .3px; }
.brand span { font-size: 13px; color: var(--pink); font-weight: 600; }
nav.main { display: flex; gap: 4px; }
nav.main a { text-decoration: none; color: var(--muted); padding: 8px 12px; border-radius: 6px; font-weight: 500; }
nav.main a.on, nav.main a:hover { color: var(--blue); background: var(--blue-l); }
.who { margin-left: auto; font-size: 12px; color: var(--muted); display: flex; gap: 10px; align-items: center; }
.who button { background: none; border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px; color: var(--muted); }

main { max-width: 1280px; margin: 0 auto; padding: 22px 24px 80px; }
h1 { font-size: 22px; margin: 0 0 4px; color: var(--blue-d); font-weight: 600; }
h2 { font-size: 17px; margin: 22px 0 8px; color: var(--blue-d); font-weight: 600; }
h3 { font-size: 13px; margin: 18px 0 8px; color: var(--pink); text-transform: uppercase; letter-spacing: .8px; font-weight: 600; }
.sub { color: var(--muted); font-size: 12px; }
.intro { color: var(--muted); margin: 0 0 16px; max-width: 760px; }

.btn { background: var(--pink); color: #fff; border: 0; border-radius: 8px; padding: 9px 16px; font-weight: 600; }
.btn:hover { background: var(--pink-d); }
.btn.alt { background: var(--white); color: var(--blue); border: 1px solid var(--blue-m); }
.btn.alt:hover { background: var(--blue-l); }
.btn.sm { padding: 5px 10px; font-size: 12px; font-weight: 500; }
.btn:disabled { opacity: .5; cursor: default; }

.card { background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; margin-bottom: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }

/* Client list */
table.list { width: 100%; border-collapse: collapse; background: var(--white); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
table.list th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 600; padding: 10px 12px; background: #fafafc; border-bottom: 1px solid var(--line); }
table.list td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
table.list tr.click { cursor: pointer; }
table.list tr.click:hover td { background: var(--blue-l); }
.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 11px; font-weight: 600; background: var(--blue-l); color: var(--blue); white-space: nowrap; }
.pill.test { background: var(--tbd); color: #7a5a00; border: 1px dashed #c9a400; }
.pill.pink { background: var(--pink-l); color: var(--pink); }
.pill.ok { background: #e6f3ec; color: var(--ok); }
.bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; width: 120px; display: inline-block; vertical-align: middle; margin-right: 6px; }
.bar i { display: block; height: 100%; background: var(--blue); }

/* Client workspace */
.ws { display: grid; grid-template-columns: 230px 1fr; gap: 22px; align-items: start; }
.side { position: sticky; top: 82px; background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.side a { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 7px; text-decoration: none; color: var(--ink); font-size: 13px; }
.side a:hover { background: var(--blue-l); }
.side a.on { background: var(--blue); color: #fff; }
.side a .n { margin-left: auto; font-size: 10px; font-weight: 600; background: var(--tbd); color: #7a5a00; border-radius: 99px; padding: 1px 7px; }
.side a.on .n { background: rgba(255,255,255,.25); color: #fff; }
.side a .ok { margin-left: auto; color: var(--ok); font-size: 12px; }
.side a.on .ok { color: #fff; }
.side hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
.wshead { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.testbanner { background: var(--tbd); border: 1px dashed #c9a400; color: #6a4e00; border-radius: 8px; padding: 8px 12px; margin-bottom: 14px; font-size: 13px; }

/* Forms */
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.f { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.f.wide { grid-column: 1 / -1; }
.f label { font-size: 12px; font-weight: 600; color: #3a3a46; }
.f label .key { color: var(--pink); margin-left: 3px; }
.f .help { font-size: 11px; color: var(--muted); }
[hidden] { display: none !important; }
.f input[type=text], .f input[type=password], .f input[type=email], .f input[type=url], .f input[type=date], .f input[type=number], .f select, .f textarea, td input, td select {
  border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; background: var(--white); width: 100%; }
.f textarea { min-height: 78px; resize: vertical; }
.f input:focus, .f select:focus, .f textarea:focus, td input:focus, td select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-l); }
.f.gap input, .f.gap select, .f.gap textarea { background: #fffdf2; border-color: #e8d98a; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips label { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 99px; padding: 5px 11px; font-weight: 400; font-size: 13px; cursor: pointer; background: var(--white); }
.chips label.on { border-color: var(--blue); background: var(--blue-l); color: var(--blue-d); font-weight: 500; }
.chips input { margin: 0; accent-color: var(--blue); }
.yn { display: flex; gap: 6px; }
.yn button { border: 1px solid var(--line); background: var(--white); border-radius: 7px; padding: 6px 16px; }
.yn button.on { background: var(--blue); color: #fff; border-color: var(--blue); }
table.rows { width: 100%; border-collapse: collapse; }
table.rows th { font-size: 11px; color: var(--muted); text-align: left; font-weight: 600; padding: 4px 6px; }
table.rows td { padding: 3px 4px; }
table.rows td.x { width: 30px; text-align: center; }
.x button, button.x { background: none; border: 0; color: var(--muted); font-size: 16px; padding: 2px 6px; }
.x button:hover, button.x:hover { color: var(--pink); }
.savebar { position: sticky; bottom: 0; background: rgba(246,246,249,.95); border-top: 1px solid var(--line); padding: 10px 0; margin-top: 16px; display: flex; gap: 10px; align-items: center; }
.saved { font-size: 12px; color: var(--muted); }
.saved.dirty { color: var(--pink); font-weight: 600; }

/* Choice cards */
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.choice { border: 1.5px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--white); cursor: pointer; }
.choice.on { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-l); }
.choice .t { font-weight: 600; color: var(--blue-d); display: flex; gap: 8px; align-items: center; }
.choice .t input { accent-color: var(--blue); }
.choice ul { margin: 6px 0 0; padding-left: 18px; font-size: 12px; }
.choice ul.pro li::marker { content: '+  '; color: var(--ok); font-weight: 700; }
.choice ul.con li::marker { content: '–  '; color: var(--pink); font-weight: 700; }

/* Apps picker */
.apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.app { border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--white); }
.app.on { border-color: var(--blue); background: #f8f9fd; }
.app .t { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.app .t input { accent-color: var(--blue); }
.app .s { font-size: 12px; color: var(--muted); margin: 4px 0 0 24px; }
.app .opts { display: flex; gap: 6px; margin: 8px 0 0 24px; }
.app .opts select, .app .opts input { border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; font-size: 12px; }
.app .opts input { flex: 1; }
.grp { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--pink); font-weight: 600; margin: 14px 0 6px; }

/* Intake designer */
.stage { border: 1px solid var(--line); border-radius: 10px; background: var(--white); margin-bottom: 10px; }
.stage.off { opacity: .55; }
.stage .hd { display: grid; grid-template-columns: 26px 26px 1.2fr 1fr 1.6fr 30px; gap: 8px; align-items: center; padding: 10px 12px; }
.stage .hd .num { font-weight: 700; color: var(--blue); text-align: center; }
.stage .hd input[type=text] { border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; width: 100%; }
.stage .bd { border-top: 1px dashed var(--line); padding: 8px 12px 12px 72px; }
.stage .fld { display: grid; grid-template-columns: 22px 1fr 110px 90px 30px; gap: 6px; align-items: center; padding: 2px 0; font-size: 13px; }
.stage .fld.off .lbl { text-decoration: line-through; color: var(--muted); }
.stage .fld input[type=text], .stage .fld select { border: 1px solid transparent; border-radius: 5px; padding: 4px 6px; background: transparent; width: 100%; }
.stage .fld input[type=text]:hover, .stage .fld select:hover, .stage .fld input[type=text]:focus { border-color: var(--line); background: var(--white); }
.tag { font-size: 10px; border-radius: 4px; padding: 1px 5px; background: #f1ece2; color: #7a6040; }
.arrow { text-align: center; color: var(--blue-m); font-size: 18px; line-height: 1; margin: -4px 0 6px; }

/* Runbook */
.phase { margin-bottom: 20px; }
.phase h2 { display: flex; align-items: center; gap: 10px; }
.step { display: grid; grid-template-columns: 30px 1fr; gap: 6px 10px; background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 8px; }
.step.done { background: #f7fbf8; border-color: #cfe6d7; }
.step.done .st { color: var(--ok); text-decoration: line-through; text-decoration-color: rgba(47,125,79,.4); }
.step.info { background: var(--blue-l); border-color: var(--blue-m); grid-template-columns: 1fr; }
.step input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--ok); margin-top: 2px; cursor: pointer; }
.step .st { font-weight: 600; }
.step .who { font-size: 11px; margin-left: 8px; }
.step .body p { margin: 5px 0; font-size: 13px; color: #33333d; }
.step .meta { font-size: 11px; color: var(--muted); margin-top: 6px; }
.step .note { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; font-size: 12px; margin-top: 6px; min-height: 32px; resize: vertical; }
.cmd { position: relative; margin: 8px 0 2px; }
.cmd .lab { font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.cmd pre { margin: 0; background: #1f2236; color: #e8eaf6; border-radius: 8px; padding: 10px 12px; font-size: 12px; overflow-x: auto; font-family: 'IBM Plex Mono', ui-monospace, monospace; line-height: 1.5; }
.cmd .copy { position: absolute; top: 18px; right: 6px; background: var(--white); border: 0; border-radius: 5px; font-size: 11px; padding: 3px 8px; color: var(--blue); opacity: .9; }
.tbd { background: var(--tbd); color: #6a4e00; border-radius: 4px; padding: 0 4px; font-weight: 600; }
pre .tbd { background: #6a5a10; color: #fff3c4; }

/* Outputs */
.outs { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-bottom: 18px; }
.out h3 { margin-top: 0; }
pre.preview { background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; font-size: 12px; white-space: pre-wrap; max-height: 560px; overflow: auto; font-family: 'IBM Plex Mono', ui-monospace, monospace; }
.miss li { margin: 3px 0; }

/* Login */
.login { max-width: 380px; margin: 9vh auto; background: var(--white); border: 1px solid var(--line); border-top: 4px solid var(--blue); border-radius: 12px; padding: 28px; }
.login h1 { margin-bottom: 2px; }
.login .f { margin-top: 12px; }
.err { color: var(--pink-d); font-size: 13px; margin-top: 10px; min-height: 18px; }

.modal-bg { position: fixed; inset: 0; background: rgba(27,27,34,.35); display: flex; align-items: flex-start; justify-content: center; padding-top: 12vh; z-index: 100; }
.modal { background: var(--white); border-radius: 12px; padding: 22px 24px; width: 440px; max-width: 92vw; box-shadow: 0 10px 40px rgba(0,0,0,.18); }
.empty { padding: 30px; text-align: center; color: var(--muted); }
@media (max-width: 860px) { .ws { grid-template-columns: 1fr; } .side { position: static; } .fields { grid-template-columns: 1fr; } }
