/* SMB Lab brand — same palette and type as joinsmblab.com */
:root {
  --paper: #f2ede4;        /* cream */
  --card: #fbf8f3;
  --ink: #1e1912;          /* dark */
  --muted: #6b5f50;
  --line: #ddd5c8;
  --accent: #b5440f;       /* orange */
  --accent-dk: #8f3209;
  --accent-ink: #fbf8f3;
  --accent-soft: #f7e9de;
  --gold: #d9a441;
  --warn: #855a0c;
  --warn-soft: #f6eacf;
  --bad: #a3312b;
  --bad-soft: #fbe9e7;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(30, 25, 18, .05), 0 4px 16px rgba(30, 25, 18, .05);
  --display: 'Bebas Neue', Impact, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1e1912; --card: #28221a; --ink: #f2ede4; --muted: #b3a895; --line: #3b3328;
    --accent: #e8703a; --accent-dk: #f08a58; --accent-ink: #1e1912; --accent-soft: #3d2418;
    --warn: #e4b45a; --warn-soft: #3a2f17; --bad: #f08b84; --bad-soft: #3a1f1d;
    --shadow: none; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 15px/1.55 'DM Sans', ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
h1 { font-family: var(--display); font-weight: 400; font-size: 38px; line-height: 1; margin: 0 0 8px; letter-spacing: .02em; }
h2 { font-size: 17px; margin: 0 0 4px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { border-right: 1px solid var(--line); padding: 24px 16px; position: sticky; top: 0; height: 100vh; align-self: start; overflow-y: auto; }
/* SMB Lab wordmark, as on joinsmblab.com */
.logo { font-family: var(--display); font-weight: 400; font-size: 30px; line-height: 1; letter-spacing: .04em; color: var(--ink); text-decoration: none; display: inline-block; }
.logo span { color: var(--accent); }
.brand { padding: 0 10px 14px; }
.brand-biz { font-weight: 600; font-size: 14px; padding: 0 10px 2px; }
.brand-sub { color: var(--muted); font-size: 12px; padding: 0 10px 20px; }
.nav a { display: block; padding: 8px 10px; border-radius: 9px; color: var(--ink); text-decoration: none; margin-bottom: 2px; }
.nav a:hover { background: var(--line); }
.nav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side form { margin-top: 24px; padding: 0 10px; }
.side .who { font-size: 12px; color: var(--muted); padding: 0 10px; margin-top: 24px; word-break: break-all; }
main { padding: 32px 40px 64px; max-width: 920px; }
.lead { color: var(--muted); margin-bottom: 24px; max-width: 60ch; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.stack > * + * { margin-top: 12px; }

.banner { border-radius: 12px; padding: 12px 16px; margin-bottom: 20px; font-size: 14px; }
.banner.ok { background: var(--accent-soft); color: var(--accent); }
.banner.err { background: var(--bad-soft); color: var(--bad); }
.banner.warn { background: var(--warn-soft); color: var(--warn); display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--paper); }
.seg button { border: 0; background: transparent; padding: 7px 13px; font: inherit; font-size: 13px; color: var(--muted); cursor: pointer; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button:hover:not(:disabled) { color: var(--ink); background: var(--card); }
.seg button.on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.seg button:disabled { cursor: default; }
.mode-help { font-size: 13px; color: var(--muted); margin-top: 10px; }
.pill { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 99px; background: var(--line); color: var(--muted); }
.pill.on { background: var(--accent-soft); color: var(--accent); }

label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=url], select {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper);
  color: var(--ink); font: inherit;
}
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btn { display: inline-block; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); padding: 9px 16px;
  border-radius: 6px; font: inherit; font-weight: 600; letter-spacing: .01em; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s; }
.btn:hover:not([disabled]):not(.quiet):not(.danger) { background: var(--accent-dk); border-color: var(--accent-dk); }
.btn.quiet { background: transparent; color: var(--ink); border-color: var(--line); font-weight: 500; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.danger { background: transparent; color: var(--bad); border-color: var(--line); }
.linkish { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 8px 8px 8px 0; border-bottom: 1px solid var(--line); }
td { padding: 10px 8px 10px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat b { display: block; font-family: var(--display); font-weight: 400; font-size: 36px; line-height: 1; letter-spacing: .02em; }
.stat span { color: var(--muted); font-size: 13px; }

a.plain { color: inherit; text-decoration: none; }
a.plain:hover { text-decoration: underline; }
.card-foot { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14px; }
.card-foot a { text-decoration: none; font-weight: 600; }
textarea { width: 100%; min-height: 110px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--paper); color: var(--ink); font: inherit; line-height: 1.45; resize: vertical; }
textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.crumb { font-size: 13px; margin-bottom: 8px; display: inline-block; text-decoration: none; }
.blanks { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
button.blank { border: 0; background: none; padding: 0; cursor: pointer; }
.blanks code { font-size: 12px; background: var(--accent-soft); color: var(--accent); border-radius: 6px; padding: 2px 6px; cursor: pointer; border: 0; }
.rule { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.rule:last-of-type { border-bottom: 0; }
.rule small { color: var(--muted); display: block; }
.toggle { display: flex; gap: 8px; align-items: center; font-weight: 500; }
details.tmpl { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
details.tmpl + details.tmpl { margin-top: 10px; }
details.tmpl summary { cursor: pointer; font-weight: 600; display: flex; justify-content: space-between; gap: 8px; list-style: none; }
details.tmpl summary::-webkit-details-marker { display: none; }
details.tmpl[open] summary { margin-bottom: 12px; }
.preview-out { margin-top: 14px; }
.msg { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-top: 10px; white-space: pre-wrap; }
.msg .meta { font-size: 12px; color: var(--muted); margin-bottom: 6px; white-space: normal; }
.bubble { background: var(--accent-soft); border-color: transparent; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }
.meter { padding: 12px 0; border-bottom: 1px solid var(--line); }
.meter:last-child { border-bottom: 0; padding-bottom: 0; }
.meter-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.meter-label { font-weight: 600; }
.meter-num b { font-size: 18px; font-variant-numeric: tabular-nums; }
.bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: 99px; background: var(--accent); min-width: 2px; }
.meter-near .bar span { background: var(--warn); }
.meter-over .bar span { background: var(--bad); }
.meter-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 6px; flex-wrap: wrap; }
.meter-note { margin-top: 6px; color: var(--warn); }
.meter-over .meter-note { color: var(--bad); }
.copy { display: flex; gap: 8px; align-items: center; min-width: 0; }
table.fixed { table-layout: fixed; }
.copy code { flex: 1; font-size: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; overflow-x: auto; white-space: nowrap; }
.feed li { padding: 8px 0; border-bottom: 1px solid var(--line); list-style: none; display: flex; gap: 12px; }
.feed { padding: 0; margin: 0; }
.feed li:last-child { border-bottom: 0; }
.feed time { color: var(--muted); font-size: 13px; min-width: 120px; }

.solo { max-width: 420px; margin: 12vh auto; padding: 0 16px; }

@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 14px 16px; }
  .brand-sub, .brand-biz, .side .who { display: none; }
  .brand { padding: 0 0 10px; }
  .brand .logo { font-size: 26px; }
  .nav { display: flex; gap: 4px; overflow-x: auto; }
  .nav a { white-space: nowrap; margin: 0; }
  .side form { display: none; }
  main { padding: 20px 16px 48px; }
  .row, .stats { grid-template-columns: 1fr; }
  .card-head > form { width: 100%; }
  .seg { display: flex; width: 100%; }
  .seg button { flex: 1; padding: 8px 4px; }
}

/* Your business page */
.group-title { margin: 28px 0 10px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.swatch i { width: 18px; height: 18px; border-radius: 5px; border: 1px solid var(--line); display: inline-block; }
.logo-preview { background: #ffffff; border: 1px solid var(--line); border-radius: 10px; padding: 16px; display: inline-block; }
.logo-preview img { display: block; max-width: 260px; max-height: 120px; }
input[type=file] { font: inherit; max-width: 100%; }

/* Sign-up, sign-in and Get started */
.solo.wide { max-width: 620px; margin-top: 6vh; margin-bottom: 6vh; }
.solo-brand { margin: 0 0 18px 4px; }
.solo-brand .logo { font-size: 36px; }
.plan { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: var(--paper); }
.plan ul { margin: 8px 0 0; padding-left: 18px; }
.plan li { margin: 2px 0; }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.progress { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; margin-bottom: 6px; max-width: 520px; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.steps { list-style: none; margin: 16px 0 0; padding: 0; }
.step { display: flex; gap: 14px; align-items: flex-start; }
.step-mark { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; font-size: 13px; font-weight: 600; color: var(--muted); }
.step.done .step-mark { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.step-body { flex: 1; min-width: 0; }
.step-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.step-actions form { margin: 0; }
input[type=number] { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); color: var(--ink); font: inherit; }

/* Chat */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
main.wide { max-width: none; padding: 0; }
.chat { display: grid; grid-template-columns: 260px 1fr; height: 100vh; height: 100dvh; }
.chat-list { border-right: 1px solid var(--line); padding: 20px 12px; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.new-chat { text-align: center; }
.threads { flex: 1; overflow-y: auto; min-height: 0; }
.threads a { display: block; padding: 8px 10px; border-radius: 9px; color: var(--ink); text-decoration: none; font-size: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; }
.threads a:hover { background: var(--line); }
.threads a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.empty-list { padding: 8px 10px; }
.soon { border: 1px dashed var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-bar { display: none; }
.chat-log { flex: 1; overflow-y: auto; padding: 28px 32px 12px; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.chat-log > * { max-width: 720px; width: 100%; margin-left: auto; margin-right: auto; }
.chat-empty { margin-top: 12vh; }
.starters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.starter { text-align: left; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 12px; padding: 12px 14px; font: inherit; font-size: 14px; cursor: pointer; }
.starter:hover { border-color: var(--accent); }
.item { display: flex; }
.item.user { justify-content: flex-end; }
.item .text { border-radius: 16px; padding: 10px 14px; max-width: 85%; line-height: 1.5; overflow-wrap: anywhere; }
.item.user .text { background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 6px; white-space: pre-wrap; }
.item.assistant .text { background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.item.assistant .text p { margin: 0 0 8px; }
.item.assistant .text p:last-child, .item.assistant .text ul:last-child { margin-bottom: 0; }
.item.assistant .text ul { margin: 0 0 8px; padding-left: 20px; }
.item.assistant .text code { font-size: 13px; background: var(--paper); border-radius: 5px; padding: 1px 5px; }
.item.note { justify-content: center; font-size: 13px; color: var(--muted); text-align: center; }
.item.error .text { background: var(--bad-soft); color: var(--bad); }
.item > .dcard { flex: 1; min-width: 0; }
.dcard { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow); }
.dcard .meta { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.dcard .head { font-weight: 600; margin-bottom: 8px; }
.dcard blockquote { margin: 0 0 10px; padding: 10px 12px; background: var(--paper); border-radius: 10px; white-space: pre-wrap; font-size: 14px; border-left: 3px solid var(--accent); }
.dcard .foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.dcard .foot .btn { font-size: 14px; padding: 7px 14px; }
.dcard.done { box-shadow: none; }
.typing { padding: 0 32px 6px; font-size: 13px; color: var(--muted); max-width: 784px; width: 100%; margin: 0 auto; }
.dots { display: inline-flex; gap: 3px; margin-right: 6px; vertical-align: middle; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .2s; } .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.composer { display: flex; gap: 8px; align-items: flex-end; padding: 12px 32px calc(16px + env(safe-area-inset-bottom)); max-width: 784px; width: 100%; margin: 0 auto; }
.composer textarea { min-height: 46px; max-height: 200px; resize: none; border-radius: 14px; padding: 12px 14px; background: var(--card); }
.composer .btn { border-radius: 12px; padding: 11px 18px; }
.composer.busy .btn { opacity: .5; }

@media (max-width: 760px) {
  .shell:has(main.wide) .side { display: none; }
  .chat { grid-template-columns: 1fr; height: 100dvh; }
  .chat-list { display: none; border-right: 0; padding: 14px 16px; padding-top: calc(14px + env(safe-area-inset-top)); }
  .chat.show-list .chat-list { display: flex; }
  .chat.show-list .chat-main { display: none; }
  .chat-bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; padding-top: calc(10px + env(safe-area-inset-top));
    border-bottom: 1px solid var(--line); background: var(--paper); }
  .chat-title { flex: 1; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
  .chat-log { padding: 16px 12px 8px; }
  .chat-empty { margin-top: 4vh; }
  .chat-empty h1 { font-size: 32px; }
  .starters { grid-template-columns: 1fr; }
  .item .text { max-width: 92%; }
  .typing { padding: 0 12px 6px; }
  .composer { padding: 8px 12px calc(10px + env(safe-area-inset-bottom)); }
  .composer textarea { font-size: 16px; } /* stops iOS zooming in on focus */
}
.mobile-links { display: none; }
@media (max-width: 760px) {
  .chat-list .mobile-links { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
  .chat-list .mobile-links a { color: var(--muted); text-decoration: none; }
}
@media (display-mode: standalone) {
  .side { padding-top: calc(24px + env(safe-area-inset-top)); }
}

/* Follow-up plan sliders */
.plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.plan-ch { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 0; min-width: 0; }
.plan-ch.off .slider, .plan-ch.off .plan-sum { opacity: .45; }
.plan-head { padding: 0 6px; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 650; margin: 0; }
.switch input { width: 18px; height: 18px; accent-color: var(--accent); }
.slider { margin-top: 12px; }
.slider-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.slider-top label { margin: 0; }
.slider-top output { font-size: 13px; font-weight: 600; color: var(--accent); }
.slider input[type=range] { width: 100%; accent-color: var(--accent); margin: 6px 0 2px; }
.slider-ends { display: flex; justify-content: space-between; }
.plan-sum { margin: 12px 0 0; font-size: 13px; background: var(--paper); border-radius: 8px; padding: 8px 10px; }
@media (max-width: 720px) { .plan-grid { grid-template-columns: 1fr; } }
