/* DAOx app-factory template — deep-blue brand system */
@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@400;600;700;800&family=Source+Serif+4:ital,wght@0,400;0,600;1,400&display=swap');

:root {
  --bg: #f5f5f5;
  --card: #ffffff;
  --border: #e1dfdd;
  --ink: #242424;
  --muted: #616161;
  --brand: #5b5fc7;
  --brand-deep: #3d3e78;
  --brand-bright: #7f85f5;
  --brand-mid: #444791;
  --brand-tint: #e8ebfa;
  --gradient: linear-gradient(121deg, #3d3e78, #5b5fc7);
  --ok: #13a10e;
  --err: #c4314b;
  --radius: 16px;
  --shadow: 0 1.6px 3.6px rgba(0, 0, 0, .07), 0 6px 18px rgba(59, 61, 120, .10);
  --sans: "Source Sans 3", -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font: 16.5px/1.7 var(--serif);
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 880px; margin: 0 auto; padding: 0 24px; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { font-family: var(--sans); color: var(--ink); letter-spacing: -.2px; }

/* ---------- nav ---------- */
.nav {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
  position: sticky; top: 0; z-index: 10;
}
.nav .wrap { display: flex; justify-content: space-between; align-items: center; }
.logo { font-family: var(--sans); font-weight: 800; font-size: 20px; color: var(--ink); letter-spacing: -.3px; }
.logo em { font-style: normal; color: var(--brand-mid); }
.logo:hover { text-decoration: none; }
.nav nav { display: flex; gap: 22px; align-items: center; }
.nav nav a { font-family: var(--sans); color: var(--muted); font-weight: 600; font-size: 15px; }
.nav nav a:hover { color: var(--brand); text-decoration: none; }
.badge {
  font-family: var(--sans);
  background: var(--brand-tint); color: var(--brand);
  border: 1px solid #c3d6e5; border-radius: 999px;
  padding: 3px 14px; font-size: 13px; font-weight: 700;
}

/* ---------- hero (brand gradient band) ---------- */
.hero {
  background: var(--gradient);
  text-align: center;
  padding: 88px 24px 130px;
  color: #fff;
}
.eyebrow {
  display: inline-block; margin-bottom: 20px;
  font-family: var(--sans);
  color: #fff; background: rgba(255, 255, 255, .14);
  border: 1.5px solid rgba(255, 255, 255, .75);
  border-radius: 999px; padding: 5px 18px;
  font-size: 12.5px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
}
.hero h1 {
  font-size: clamp(34px, 5.4vw, 56px);
  line-height: 1.1; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase; color: #fff;
  max-width: 780px; margin: 0 auto;
}
.tagline {
  font-size: 20px; color: #f2fbff;
  max-width: 640px; margin: 20px auto 0;
}
.tagline em { font-style: italic; }
.sub { color: rgba(255, 255, 255, .85); margin-top: 12px; font-size: 15.5px; }

/* ---------- product card (overlaps the gradient) ---------- */
.product { padding: 0 24px 56px; margin-top: -72px; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 34px;
}
.card.center { text-align: center; }
label {
  display: block; font-family: var(--sans); font-size: 13.5px; font-weight: 700;
  color: var(--ink); margin: 18px 0 6px; letter-spacing: .2px;
}
label:first-child { margin-top: 0; }
input, textarea, select {
  width: 100%; background: #faf9f8; color: var(--ink);
  border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px; font: 15px/1.6 var(--sans);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(91, 95, 199, .18);
  background: #fff;
}
::placeholder { color: #93a8b3; }

.btn {
  display: inline-block; margin-top: 20px; cursor: pointer;
  font-family: var(--serif);
  background: var(--card); color: var(--brand);
  border: 2px solid var(--brand); border-radius: 999px;
  padding: 10px 26px; font-size: 16px; font-weight: 600;
  transition: background .15s, color .15s, box-shadow .15s;
}
.btn:hover { background: var(--brand-tint); text-decoration: none; }
.btn.primary {
  background: var(--gradient); border: none; color: #fff;
  width: 100%; padding: 15px 26px; font-size: 17.5px;
  box-shadow: 0 6px 18px rgba(11, 42, 71, .35);
}
.btn.primary:hover { filter: brightness(1.07); }
.btn:disabled { opacity: .55; cursor: wait; }

.status { margin-top: 16px; font-size: 14.5px; color: var(--muted); }
.status.err { color: var(--err); font-weight: 600; }
.status.ok { color: var(--ok); font-weight: 600; }

.result {
  margin-top: 20px; padding: 26px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 15.5px;
}

/* ---------- steps ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; padding: 20px 24px 56px; }
.step {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px 22px;
  text-align: center;
}
.step span {
  display: inline-flex; width: 38px; height: 38px;
  align-items: center; justify-content: center;
  font-family: var(--sans);
  background: var(--gradient); color: #fff;
  border-radius: 50%; font-weight: 800; font-size: 16px;
}
.step h3 { margin: 14px 0 6px; font-size: 19px; font-weight: 700; }
.step p { color: var(--muted); font-size: 15px; }

/* ---------- pricing ---------- */
.pricing { text-align: center; padding: 24px 24px 56px; }
.pricing h2 { font-size: 32px; font-weight: 700; }
.pricing .sub { color: var(--muted); }
.packs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 30px; }
.pack {
  position: relative;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 32px 20px 28px;
}
.pack.featured { border: 2px solid var(--brand-mid); }
.pack.featured::before {
  content: "Most popular";
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  font-family: var(--sans);
  background: var(--gradient); color: #fff;
  border-radius: 999px; padding: 2px 16px;
  font-size: 12.5px; font-weight: 700; letter-spacing: .4px; white-space: nowrap;
}
.pack h3 { font-size: 16px; color: var(--muted); font-weight: 600; }
.pack .price { font-family: var(--sans); font-size: 40px; font-weight: 800; letter-spacing: -1px; margin: 12px 0 2px; }
.pack .per { color: var(--muted); font-size: 13px; }
.pack .btn { padding: 8px 30px; }

/* ---------- faq ---------- */
.faq { padding: 24px 24px 72px; }
.faq h2 { text-align: center; font-size: 32px; font-weight: 700; margin-bottom: 26px; }
details {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 18px 22px; margin-bottom: 12px;
  box-shadow: var(--shadow);
}
summary { cursor: pointer; font-family: var(--sans); font-weight: 700; font-size: 16px; }
summary::marker { color: var(--brand-mid); }
details p { margin-top: 10px; color: var(--muted); font-size: 15.5px; }

/* ---------- footer ---------- */
footer {
  border-top: 1px solid var(--border);
  padding: 34px 0; color: var(--muted); font-size: 14px; text-align: center;
  background: var(--card);
  font-family: var(--sans);
}

@media (max-width: 680px) {
  .hero { padding: 56px 20px 110px; }
  .steps, .packs { grid-template-columns: 1fr; }
  .card { padding: 24px 18px; }
  
}

/* ---------- print the result ---------- */
@media print {
  body * { visibility: hidden; }
  #result, #result * { visibility: visible; }
  #result { position: absolute; left: 0; top: 0; width: 100%; border: none; box-shadow: none; background: #fff; color: #000; }
}

/* ---------- typography: no widows ---------- */
h1, h2, h3, h4, summary { text-wrap: balance; }
p, li, .tagline, .sub { text-wrap: pretty; }

/* ---------- HeadOffice ---------- */
.dept-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 4px 0 6px; }
.dept-card { background: #f7fcfe; border: 2px solid var(--border); border-radius: 12px; padding: 12px 14px; cursor: pointer; transition: border-color .15s, background .15s; }
.dept-card:hover { border-color: var(--brand-bright); }
.dept-card.selected { border-color: var(--brand); background: var(--brand-tint); }
.dept-card h4 { font-family: var(--sans); font-size: 15px; margin-bottom: 3px; }
.dept-card p { font-family: var(--sans); font-size: 12px; color: var(--muted); line-height: 1.45; }
.memo-log { margin-top: 12px; font-family: var(--sans); font-size: 13px; color: var(--muted); }
.memo-chip { display: inline-block; background: var(--brand-tint); color: var(--brand); border-radius: 999px; padding: 1px 10px; font-weight: 700; margin: 2px 2px; }
.memo-from { font-family: var(--sans); font-size: 12.5px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--brand); font-weight: 700; }
.memo-title { font-family: var(--sans); font-size: 22px; font-weight: 800; margin: 4px 0 10px; }
.memo-h { font-family: var(--sans); font-weight: 700; font-size: 15.5px; color: var(--brand-deep); margin: 16px 0 6px; }
.memo-body { white-space: pre-wrap; font-size: 15.5px; }
.memo-list { margin: 4px 0 0 20px; font-size: 15px; }
.quote { width: 100%; border-collapse: collapse; font-size: 15px; margin-top: 6px; }
.quote td { padding: 7px 4px; border-bottom: 1px solid var(--border); }
.quote td:last-child { text-align: right; font-family: var(--sans); font-weight: 700; }
.prep-tools { display: flex; gap: 12px; flex-wrap: wrap; }
.prep-tools .btn { margin-top: 0; padding: 8px 20px; font-size: 14px; }
@media print {
  body * { visibility: hidden; }
  #result, #result * { visibility: visible; }
  #result { position: absolute; left: 0; top: 0; width: 100%; border: none; box-shadow: none; background: #fff; color: #000; }
  #result .prep-tools { display: none; }
}

/* ---------- leadership channel ---------- */
.chat-card { padding: 0; overflow: hidden; }
.chat-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); background: var(--card); }
.chan-name { font-family: var(--sans); font-size: 16px; }
.chan-sub { font-family: var(--sans); font-size: 12.5px; color: var(--muted); }
.chat-scroll { height: 440px; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; background: #f5f5f5; }
.msg { display: flex; gap: 10px; max-width: 88%; }
.msg.me { align-self: flex-end; flex-direction: row-reverse; }
.avatar { flex: 0 0 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font: 800 14px var(--sans); color: #fff; background: var(--muted); }
.av-strategy { background: #6d4fc7; } .av-product { background: #0f8a6d; }
.av-marketing { background: #d06414; } .av-finance { background: #1b5a8b; }
.av-operations { background: #8a1b4d; }
.bubble { background: var(--card); border: 1px solid var(--border); border-radius: 4px 10px 10px 10px; padding: 10px 14px; font-size: 15px; white-space: pre-wrap; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.msg.me .bubble { background: var(--brand-tint); border: none; color: var(--ink); border-radius: 10px 4px 10px 10px; }
.who { display: block; font: 700 12px var(--sans); color: var(--brand); margin-bottom: 3px; }
.srcs { margin-top: 6px; }
.src { font: 600 12px var(--sans); margin-right: 8px; }
.msg.me .src { color: var(--brand-mid); }
.typing .bubble { color: var(--muted); font-style: italic; }
.chat-files { padding: 8px 18px 0; }
.fchip { display: inline-block; font: 600 12.5px var(--sans); background: var(--brand-tint); border-radius: 999px; padding: 3px 10px; margin: 2px; }
.fchip b { cursor: pointer; color: var(--err); margin-left: 4px; }
.chat-compose { display: flex; gap: 10px; align-items: flex-end; padding: 12px 18px; border-top: 1px solid var(--border); }
.chat-compose textarea { flex: 1; resize: none; }
.attach { cursor: pointer; font-size: 20px; padding: 8px 4px; }
.send-btn { width: auto !important; margin-top: 0 !important; padding: 11px 26px !important; font-size: 15px !important; }
.chat-under { display: flex; gap: 10px; padding: 0 18px 16px; flex-wrap: wrap; align-items: center; }
.chat-under input[type="email"] { flex: 2; min-width: 200px; }
.chat-under select { flex: 1; min-width: 150px; width: auto; }
.keep-btn { margin-top: 0 !important; padding: 9px 16px !important; font-size: 13.5px !important; white-space: nowrap; }
@media (max-width: 680px) { .chat-scroll { height: 380px; } }

/* day dividers + ghost button */
.day-div { align-self: center; display: flex; align-items: center; gap: 10px; width: 100%; margin: 4px 0; }
.day-div::before, .day-div::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.day-div span { font: 600 12px var(--sans); color: var(--muted); white-space: nowrap; }
.keep-btn.ghost { opacity: .75; }

/* vivid per-persona identity: tinted bubbles, colored names, accent border */
.msg.them .bubble { border-left: 3px solid var(--border); }
.msg.b-strategy .bubble { border-left-color: #6d4fc7; }
.b-strategy .who { color: #6d4fc7; }
.msg.b-product .bubble { border-left-color: #0f8a6d; }
.b-product .who { color: #0f8a6d; }
.msg.b-marketing .bubble { border-left-color: #d06414; }
.b-marketing .who { color: #d06414; }
.msg.b-finance .bubble { border-left-color: #1b5a8b; }
.b-finance .who { color: #1b5a8b; }
.msg.b-operations .bubble { border-left-color: #8a1b4d; }
.b-operations .who { color: #8a1b4d; }

/* channel picker, hire row, draft cards */
#channelPicker { display: block; margin-top: 6px; width: auto; max-width: 320px; padding: 4px 8px; font: 600 13px var(--sans); }
#hireRow input { flex: 1; min-width: 140px; }
.draft { margin-top: 8px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.draft .dk { font: 700 12.5px var(--sans); color: var(--muted); margin-bottom: 6px; }
.draft pre { white-space: pre-wrap; font: 13.5px/1.5 var(--sans); margin: 0; }
.dbtns { display: flex; gap: 8px; margin-top: 8px; }
.dbtns .btn { margin-top: 0; }

/* Kai — the customer: outsider red */
.av-customer { background: #c4314b; }
.msg.b-customer .bubble { border-left-color: #c4314b; }
.b-customer .who { color: #c4314b; }

/* ---------- mobile-first chat: most conversations happen on a phone ---------- */
@media (max-width: 680px) {
  .product.wrap { padding: 0 6px; }
  .chat-card { border-radius: 12px; }
  /* the channel owns the screen, like a real chat app */
  .chat-scroll { height: min(64dvh, 560px); padding: 12px 10px; gap: 10px; }
  .msg { max-width: 96%; gap: 7px; }
  .avatar { flex: 0 0 28px; height: 28px; font-size: 12px; }
  .bubble { font-size: 14.5px; padding: 9px 12px; }
  .who { font-size: 11.5px; }
  .chat-top { padding: 10px 12px; }
  #channelPicker { width: 100%; max-width: none; }
  .chat-compose { padding: 10px; gap: 8px; }
  /* 16px stops iOS Safari zoom-jumping on focus */
  .chat-compose textarea, .chat-under input, .chat-under select,
  #hireRow input { font-size: 16px; }
  .chat-compose textarea { padding: 10px 12px; }
  .attach { font-size: 22px; padding: 10px 2px; }
  .send-btn { padding: 11px 18px !important; }
  .chat-under { padding: 0 10px 12px; gap: 8px; }
  .chat-under input[type="email"], .chat-under select { flex: 1 1 100%; min-width: 0; width: 100%; }
  /* action buttons: two per row, comfortable thumb targets */
  .keep-btn { flex: 1 1 45%; min-width: 0; white-space: normal; padding: 11px 8px !important; font-size: 13px !important; }
  #hireRow input { flex: 1 1 100%; }
  #hireRow .keep-btn { flex: 1 1 100%; }
  .draft { padding: 9px 10px; }
  .draft pre { font-size: 13px; }
  .dbtns { flex-wrap: wrap; }
  .dbtns .btn { flex: 1 1 45%; }
  .srcs .src { display: inline-block; padding: 4px 0; }
}

/* ---------- Teams-like simplification ---------- */
.chat-top { position: relative; }
.chat-title { min-width: 0; }
#channelPicker { border: none; background: transparent; font: 700 16px var(--sans); color: var(--ink); padding: 0 22px 0 0; margin: 0; cursor: pointer; }
#channelPicker:focus { box-shadow: none; }
.chat-tools { display: flex; align-items: center; gap: 10px; }
.icon-btn { border: none; background: transparent; font: 700 22px/1 var(--sans); color: var(--muted); cursor: pointer; padding: 2px 8px; border-radius: 8px; }
.icon-btn:hover { background: var(--brand-tint); }
.chat-card { position: relative; }
.chat-menu { position: absolute; right: 12px; top: 54px; z-index: 30; background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; display: flex; flex-direction: column; min-width: 250px; }
.chat-menu button { border: none; background: transparent; text-align: left; font: 600 14.5px var(--sans); color: var(--ink); padding: 11px 12px; border-radius: 8px; cursor: pointer; }
.chat-menu button:hover { background: var(--brand-tint); }
.team-strip { display: flex; align-items: center; padding: 8px 18px; border-bottom: 1px solid var(--border); background: var(--card); }
.mini { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font: 800 10.5px var(--sans); color: #fff; border: 2px solid var(--card); margin-right: -6px; background: var(--muted); }
.strip-label { font: 600 12px var(--sans); color: var(--muted); margin-left: 14px; }
.send-btn { border-radius: 50% !important; width: 42px; height: 42px; flex: 0 0 42px; padding: 0 !important; font-size: 17px !important; display: inline-flex; align-items: center; justify-content: center; }
.chat-compose textarea { min-height: 42px; max-height: 120px; border-radius: 21px; padding: 10px 16px; }
.chat-pills { display: flex; gap: 8px; align-items: center; padding: 0 18px 10px; }
.pill-sel { width: auto; flex: 0 1 auto; border-radius: 999px; padding: 6px 12px; font: 600 13px var(--sans); background: var(--brand-tint); border-color: transparent; }
.pill-btn { border: none; border-radius: 999px; background: var(--brand-tint); color: var(--brand); font: 600 13px var(--sans); padding: 7px 14px; cursor: pointer; white-space: nowrap; }
.pill-btn:hover { filter: brightness(.97); }
#emailRow { padding-bottom: 14px; }
@media (max-width: 680px) {
  .chat-pills { padding: 0 10px 10px; overflow-x: auto; }
  .pill-sel, .pill-btn { font-size: 13px; flex-shrink: 0; }
  .team-strip { padding: 7px 12px; }
  #channelPicker { font-size: 15px; width: 100%; }
}

/* the hidden attribute always wins, even over display:flex rules */
[hidden] { display: none !important; }

.pill-hint { font: 600 12.5px var(--sans); color: var(--muted); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* who's-who panel (also the @ mention picker) */
.team-strip { cursor: pointer; }
.team-pop { position: absolute; left: 12px; right: 12px; top: 96px; z-index: 31; background: var(--card); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; max-height: 340px; overflow-y: auto; }
.tp-row { display: flex; gap: 10px; align-items: center; width: 100%; border: none; background: transparent; text-align: left; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.tp-row:hover { background: var(--brand-tint); }
.tp-row .avatar { flex: 0 0 30px; height: 30px; font-size: 13px; }
.tp-txt { display: flex; flex-direction: column; min-width: 0; }
.tp-txt b { font: 700 14px var(--sans); color: var(--ink); }
.tp-txt small { font: 500 12.5px var(--sans); color: var(--muted); }
.pill-hint { font: 500 12px var(--sans); color: var(--muted); margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 680px) { .pill-hint { display: none; } }

/* compact keep-talking: a quiet twin of the send button */
.ghost-btn { border: 1.5px solid var(--border); background: transparent; color: var(--brand); border-radius: 50%; width: 42px; height: 42px; flex: 0 0 42px; font-size: 16px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.ghost-btn:hover { background: var(--brand-tint); }
.ghost-btn:disabled { opacity: .5; }

/* on phones the chat needs every pixel — the nav can scroll away */
@media (max-width: 680px) {
  .nav { position: static; }
}
