/* Siteguide portal. Colours are tokens; light and dark both pass WCAG AA for text and for text on the accent. */
:root {
  --bg: #f7f5f2; --panel: #ffffff; --soft: #f0ece6; --fg: #1d1b19; --muted: #5c5650; --subtle: #6e6862; --line: #e2ddd5; --line-soft: #ece8e2;
  --hover: #f3efe9; --accent: #c2410c; --accent-fg: #ffffff; --accent-soft: #fde8dc; --accent-ink: #9a3412;
  --ok: #15803d; --ok-soft: #dcfce7; --warn: #92400e; --warn-soft: #fef3c7; --bad: #b91c1c; --bad-soft: #fee2e2; --info: #1d4ed8; --info-soft: #dbeafe;
  --shadow: 0 1px 2px rgba(29,27,25,.05), 0 6px 18px rgba(29,27,25,.05); --radius: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141210; --panel: #1c1a17; --soft: #26231f; --fg: #f3efe9; --muted: #bdb5ab; --subtle: #a39a8f; --line: #34302b; --line-soft: #2a2622;
    --hover: #24211d; --accent: #f2783a; --accent-fg: #1d1b19; --accent-soft: #3b2417; --accent-ink: #f8a374;
    --ok: #4ade80; --ok-soft: #12291a; --warn: #fbbf24; --warn-soft: #2e2410; --bad: #f87171; --bad-soft: #2f1414; --info: #93c5fd; --info-soft: #172338;
    --shadow: 0 1px 2px rgba(0,0,0,.4); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141210; --panel: #1c1a17; --soft: #26231f; --fg: #f3efe9; --muted: #bdb5ab; --subtle: #a39a8f; --line: #34302b; --line-soft: #2a2622;
  --hover: #24211d; --accent: #f2783a; --accent-fg: #1d1b19; --accent-soft: #3b2417; --accent-ink: #f8a374;
  --ok: #4ade80; --ok-soft: #12291a; --warn: #fbbf24; --warn-soft: #2e2410; --bad: #f87171; --bad-soft: #2f1414; --info: #93c5fd; --info-soft: #172338;
  --shadow: 0 1px 2px rgba(0,0,0,.4); color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font: 14px/1.5 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.boot { padding: 40px; color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- shell */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 9px; padding: 4px 8px 12px; font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.brand img { width: 26px; height: 26px; }
.side label.site { font-size: 11px; color: var(--subtle); padding: 0 8px; display: flex; flex-direction: column; gap: 3px; margin-bottom: 6px; }
.nav-group { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--subtle); padding: 12px 10px 3px; font-weight: 600; }
.nav a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; border-radius: 8px; color: var(--fg); font-size: 13.5px; }
.nav a:hover { background: var(--hover); text-decoration: none; }
.nav a.on { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.badge { background: var(--accent); color: var(--accent-fg); border-radius: 999px; font-size: 11px; padding: 0 7px; font-weight: 700; min-width: 20px; text-align: center; }
.side-foot { margin-top: auto; border-top: 1px solid var(--line-soft); padding: 10px 8px 0; font-size: 12.5px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.side-foot .who { display: flex; align-items: center; gap: 8px; color: var(--fg); }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--soft); display: grid; place-items: center; font-weight: 700; font-size: 11.5px; flex: none; }
.main { padding: 22px 28px 64px; min-width: 0; max-width: 1280px; }
.mbar { display: none; }
.envbar { background: var(--warn-soft); color: var(--warn); padding: 7px 16px; font-size: 13px; border-bottom: 1px solid var(--line); }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 40; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .shell.drawer .side { transform: none; }
  .shell.drawer::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 30; }
  .mbar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 20; background: var(--panel); border-bottom: 1px solid var(--line); padding: 8px 14px; }
  .mbar .brand { padding: 0; font-size: 15px; }
  .main { padding: 16px 16px 60px; }
}
.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.head h1 { font-size: 22px; margin: 0; letter-spacing: -.01em; }
.head .sub { color: var(--muted); margin-top: 2px; }
.head .acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumb { font-size: 12.5px; color: var(--subtle); margin-bottom: 2px; }
.muted { color: var(--muted); } .subtle { color: var(--subtle); font-size: 12.5px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.cols-2 { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
.cols-3 { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 980px) { .cols-2, .cols-3 { grid-template-columns: 1fr; } }

/* ---------- cards, stats, tables */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); margin-bottom: 16px; min-width: 0; }
.card h2 { font-size: 15px; margin: 0 0 10px; }
.card h3 { font-size: 13.5px; margin: 14px 0 6px; }
.card .ch { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.card .ch h2 { margin: 0; }
.stat .k { color: var(--muted); font-size: 12.5px; font-weight: 500; } .stat .v { font-size: 26px; font-weight: 650; margin-top: 2px; font-variant-numeric: tabular-nums; } .stat .s { font-size: 12px; color: var(--subtle); }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--subtle); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
th.r, td.r { text-align: right; }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--hover); }
.table-wrap { overflow-x: auto; }
td.who b { display: block; } td.who span { color: var(--muted); font-size: 12.5px; }
@media (max-width: 760px) {
  table.cards thead { display: none; }
  table.cards, table.cards tbody, table.cards tr, table.cards td { display: block; width: 100%; }
  table.cards tr { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin-bottom: 10px; }
  table.cards td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  table.cards td::before { content: attr(data-l); color: var(--subtle); font-size: 12px; text-align: left; }
  table.cards td.who { display: block; text-align: left; } table.cards td.who::before { content: none; }
}
.pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 1px 9px; font-size: 12px; font-weight: 600; background: var(--soft); color: var(--muted); white-space: nowrap; }
.pill.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.new, .pill.high, .pill.running, .pill.pending_review, .pill.inbound { background: var(--accent-soft); color: var(--accent-ink); }
.pill.contacted, .pill.medium, .pill.pending, .pill.paused, .pill.warn, .pill.fetched, .pill.out_of_office, .pill.not_now { background: var(--warn-soft); color: var(--warn); }
.pill.qualified, .pill.converted, .pill.approved, .pill.done, .pill.active, .pill.verified, .pill.ok, .pill.replied, .pill.interested, .pill.manual { background: var(--ok-soft); color: var(--ok); }
.pill.closed, .pill.rejected, .pill.failed, .pill.disabled, .pill.bounced, .pill.unsubscribed, .pill.bad, .pill.objection, .pill.unsubscribe { background: var(--bad-soft); color: var(--bad); }
.pill.info, .pill.draft, .pill.imported, .pill.import, .pill.completed { background: var(--info-soft); color: var(--info); }
.tag { display: inline-flex; font-size: 11.5px; padding: 0 7px; border-radius: 6px; background: var(--soft); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px; font-size: 12.5px; color: var(--fg); background: var(--panel); cursor: pointer; }
.chip:hover { background: var(--hover); }
.chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.bar { height: 8px; background: var(--soft); border-radius: 99px; overflow: hidden; } .bar > i { display: block; height: 100%; background: var(--accent); }
.list-plain { list-style: none; margin: 0; padding: 0; } .list-plain li { padding: 7px 0; border-bottom: 1px solid var(--line-soft); display: flex; gap: 10px; align-items: baseline; } .list-plain li:last-child { border-bottom: 0; }
.num { font-variant-numeric: tabular-nums; }
.when { display: inline-flex; flex-direction: column; align-items: flex-end; white-space: nowrap; } .when time { font-size: 11.5px; color: var(--subtle); }
.icell { display: flex; flex-direction: column; gap: 2px; } .isig { font-size: 11.5px; color: var(--muted); white-space: nowrap; }

/* chart */
.chart { display: grid; grid-template-columns: auto 1fr; gap: 6px; }
.chart .y { display: flex; flex-direction: column; justify-content: space-between; font-size: 11px; color: var(--subtle); text-align: right; height: 120px; }
.chart .plot { display: flex; align-items: flex-end; gap: 3px; height: 120px; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 0 2px; }
.chart .plot i { flex: 1; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; }
.chart .x { grid-column: 2; display: flex; justify-content: space-between; font-size: 11px; color: var(--subtle); }

/* funnel */
.funnel { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.fstep { padding: 4px 14px 4px 0; } .fstep + .fstep { padding-left: 14px; border-left: 1px solid var(--line); }
.fstep .k { font-size: 12px; color: var(--muted); } .fstep .v { font-size: 24px; font-weight: 650; font-variant-numeric: tabular-nums; }
.fstep .s { font-size: 11.5px; color: var(--subtle); } .fstep .bar { margin-top: 6px; height: 6px; }
@media (max-width: 760px) { .funnel { grid-template-columns: 1fr 1fr; row-gap: 14px; } .fstep + .fstep { border-left: 0; padding-left: 0; } }
.attn { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.attn a { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; color: var(--fg); display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); }
.attn a:hover { text-decoration: none; border-color: var(--accent); }
.attn b { font-size: 22px; font-variant-numeric: tabular-nums; } .attn span.go { color: var(--accent-ink); font-size: 12.5px; font-weight: 600; margin-top: auto; }
@media (max-width: 980px) { .attn { grid-template-columns: 1fr 1fr; } }

/* ---------- forms */
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); margin-bottom: 12px; font-weight: 500; }
label.f .hint, .hint { font-size: 12px; color: var(--subtle); font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=date], input[type=time], input[type=search], input[type=datetime-local], select, textarea {
  border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 7px 10px; width: 100%; color: var(--fg); min-width: 0; }
textarea { min-height: 80px; resize: vertical; }
textarea.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; min-height: 360px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=color] { width: 52px; height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: var(--panel); }
.check { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; margin-bottom: 10px; } .check input { margin-top: 3px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--fg); border-radius: 8px; padding: 7px 14px; cursor: pointer; font-weight: 600; font-size: 13px; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--hover); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); } .btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.danger { color: var(--bad); } .btn.small { padding: 3px 10px; font-size: 12px; } .btn:disabled { opacity: .55; cursor: default; }
.linkbtn { border: 0; background: none; padding: 0; color: var(--accent-ink); font: inherit; cursor: pointer; text-decoration: underline; }
.listed { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.listed .item { display: flex; gap: 6px; align-items: center; } .listed .item input { flex: 1; }
.err { background: var(--bad-soft); color: var(--bad); border-radius: 8px; padding: 9px 12px; margin: 8px 0; font-size: 13px; }
.note { background: var(--warn-soft); color: var(--warn); border-radius: 8px; padding: 9px 12px; margin: 8px 0; font-size: 13px; }
.okmsg { background: var(--ok-soft); color: var(--ok); border-radius: 8px; padding: 9px 12px; margin: 8px 0; font-size: 13px; }
.banner { border-radius: 10px; padding: 10px 14px; font-size: 13px; display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 12px; background: var(--info-soft); color: var(--fg); }
.banner.warn { background: var(--warn-soft); } .banner.ok { background: var(--ok-soft); }
.section-title { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--subtle); margin: 18px 0 8px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs a, .tabs button { padding: 8px 12px; color: var(--muted); border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; cursor: pointer; font-size: 13.5px; }
.tabs .on { color: var(--fg); border-bottom-color: var(--accent); font-weight: 600; } .tabs a:hover { text-decoration: none; color: var(--fg); }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; } @media (max-width: 600px) { .fgrid { grid-template-columns: 1fr; } }
details > summary { cursor: pointer; }

/* ---------- empty, loading, error */
.empty { text-align: center; padding: 40px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty .ill { width: 50px; height: 50px; border-radius: 14px; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; font-size: 22px; }
.empty h2 { margin: 0; font-size: 16px; } .empty p { max-width: 46ch; margin: 0; color: var(--muted); }
.sk { height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--soft), var(--hover), var(--soft)); background-size: 200% 100%; animation: sk 1.2s infinite linear; }
@keyframes sk { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } }

/* ---------- transcript */
.chat { display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 88%; padding: 9px 12px; border-radius: 12px; overflow-wrap: anywhere; font-size: 13.5px; }
.bubble p { margin: 0 0 6px; } .bubble p:last-of-type { margin-bottom: 0; } .bubble ul { margin: 4px 0; padding-left: 18px; }
.bubble.user { align-self: flex-end; background: var(--accent-soft); border-bottom-right-radius: 4px; }
.bubble.assistant { align-self: flex-start; background: var(--soft); border-bottom-left-radius: 4px; }
.bubble .ts { display: block; font-size: 11px; color: var(--subtle); margin-top: 4px; }
pre.log { background: var(--soft); border-radius: 8px; padding: 10px 12px; max-height: 320px; overflow: auto; font-size: 12px; white-space: pre-wrap; margin: 8px 0 0; }
dl.kv { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 6px 12px; margin: 0; font-size: 13.5px; } dl.kv dt { color: var(--muted); } dl.kv dd { margin: 0; overflow-wrap: anywhere; }
.tl { list-style: none; margin: 0; padding: 0; } .tl li { display: grid; grid-template-columns: 14px 1fr auto; gap: 8px; padding: 6px 0; font-size: 13px; }
.tl li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--line); margin: 6px 3px 0; } .tl li.k-reply::before, .tl li.k-converted::before { background: var(--ok); } .tl li.k-expert::before { background: var(--accent); }
.tl .t { color: var(--subtle); font-size: 12px; white-space: nowrap; }

/* ---------- login */
.login { max-width: 400px; margin: 12vh auto; padding: 0 16px; }
.login .card { padding: 26px 26px 12px; }
.login h1 { font-size: 20px; margin: 10px 0 4px; display: flex; align-items: center; gap: 10px; } .login h1 img { width: 30px; height: 30px; }

/* ---------- toast + modal */
.toast { position: fixed; bottom: 20px; right: 20px; background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); font-size: 13.5px; z-index: 80; max-width: 440px; }
.toast.bad { background: var(--bad); color: #fff; }
.toast a { color: inherit; text-decoration: underline; font-weight: 600; }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 70; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--panel); border-radius: 14px; padding: 20px; width: min(560px, 100%); max-height: 90vh; overflow: auto; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal h2 { margin: 0; font-size: 17px; } .modal .mfoot { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.modal.wide { width: min(820px, 100%); }
.topbar select, .row > select, .acts select { width: auto; }
.side select { width: 100%; }

/* ---------- rich text editor */
.rte { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); overflow: hidden; }
.rte:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.rtool { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; padding: 5px 6px; border-bottom: 1px solid var(--line); background: var(--soft); }
.rtb { border: 0; background: none; color: var(--fg); font-size: 12.5px; padding: 4px 8px; border-radius: 6px; cursor: pointer; }
.rtb:hover, .rtb:focus-visible { background: var(--panel); } .rts { width: auto !important; font-size: 12.5px; padding: 3px 6px !important; }
.rsep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }
.redit { min-height: 160px; padding: 10px 12px; font-size: 14px; line-height: 1.55; color: var(--fg); outline: none; overflow-wrap: anywhere; }
.redit p { margin: 0 0 8px; } .redit blockquote { border-left: 3px solid var(--line); margin: 6px 0; padding-left: 10px; color: var(--muted); }
.redit .mf { background: var(--accent-soft); color: var(--accent-ink); border-radius: 4px; padding: 0 3px; }
.redit table { border-collapse: collapse; } .redit td { border: 1px solid var(--line); padding: 4px 8px; min-width: 60px; }
.rfoot { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 6px 10px; border-top: 1px solid var(--line); font-size: 12px; color: var(--subtle); }
.mpick { display: flex; flex-direction: column; gap: 6px; } .mpick button { justify-content: flex-start; text-align: left; }

/* ---------- email preview, builder, steps */
.mail { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel); }
.mail .mh { padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 12.5px; display: flex; flex-direction: column; gap: 2px; background: var(--soft); }
.mail .mb { padding: 12px; font-size: 13.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.builder { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1080px) { .builder { grid-template-columns: 1fr; } }
.step { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--panel); margin-bottom: 8px; }
.step.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.step .sh { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.step .day { font-weight: 700; font-size: 13px; } .step .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--subtle); }
.gap { display: flex; align-items: center; gap: 8px; padding: 2px 0 10px 14px; font-size: 12.5px; color: var(--subtle); } .gap select { width: auto; }
.src { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; background: var(--soft); border-radius: 6px; padding: 1px 7px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.check-warn { color: var(--warn); font-weight: 600; }
.preview-pane { position: sticky; top: 16px; } @media (max-width: 1080px) { .preview-pane { position: static; } }
.wizard { display: flex; gap: 6px; flex-wrap: wrap; } .wizard span { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 4px; border-radius: 99px; background: var(--soft); color: var(--muted); font-size: 12.5px; }
.wizard span b { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--panel); font-size: 11.5px; } .wizard span.on { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.drop { border: 2px dashed var(--line); border-radius: 12px; padding: 30px; text-align: center; color: var(--muted); }

/* ---------- inbox */
.inbox { display: grid; grid-template-columns: minmax(240px, 340px) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 860px) { .inbox { grid-template-columns: 1fr; } }
.ilist { display: flex; flex-direction: column; gap: 6px; }
.iitem { text-align: left; border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; color: var(--fg); }
.iitem.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; } .iitem .r1 { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.iitem .r2 { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.quote { border-left: 3px solid var(--line); padding-left: 10px; color: var(--muted); font-size: 12.5px; white-space: pre-wrap; margin: 10px 0; }

/* ---------- knowledge + playbook */
.klist { list-style: none; margin: 0; padding: 0; } .klist li { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; } .klist li:first-child { border-top: 0; }
.kline { font-size: 17px; line-height: 1.45; }
.ksecs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; } @media (max-width: 560px) { .ksecs { grid-template-columns: 1fr; } }
.pflow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.pflow li { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.pflow .pn { width: 22px; height: 22px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.pflow .pstat { color: var(--muted); font-size: 12px; margin-top: auto; padding-top: 6px; }
@media (max-width: 980px) { .pflow { grid-template-columns: 1fr 1fr; } } @media (max-width: 560px) { .pflow { grid-template-columns: 1fr; } }
.ptech { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } @media (max-width: 700px) { .ptech { grid-template-columns: 1fr; } }
.ptc { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; } .ptc > span { display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.pex { font-size: 12.5px; font-style: italic; background: var(--soft); border-radius: 6px; padding: 3px 7px; align-self: flex-start; }
.ptech.off { opacity: .45; pointer-events: none; }

/* ---------- chat assistant preview */
.cwgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 16px; align-items: start; }
@media (max-width: 1080px) { .cwgrid { grid-template-columns: 1fr; } .cwp { order: -1; } }
.cwp { position: sticky; top: 16px; padding: 12px; } @media (max-width: 1080px) { .cwp { position: static; } }
.cws { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; } .cws.on { border-color: var(--accent); }
.cwh { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 14px; background: none; border: 0; color: var(--fg); text-align: left; cursor: pointer; }
.cwh > span:first-child { display: flex; flex-direction: column; gap: 1px; } .cwb { padding: 0 14px 14px; }
.site { border: 1px solid #d9d4cc; border-radius: 10px; overflow: hidden; background: #f7f5f2; color: #1d1b19; }
.site.mob { max-width: 340px; margin: 0 auto; border-radius: 22px; }
.sitebar { display: flex; gap: 5px; align-items: center; padding: 7px 10px; background: #ebe7e1; } .sdot { width: 8px; height: 8px; border-radius: 50%; background: #cfc8bd; }
.surl { margin-left: 8px; font-size: 11px; color: #6b655d; background: #fff; border-radius: 99px; padding: 2px 10px; }
.sitebody { position: relative; min-height: 540px; padding: 22px; }
.sk1 { height: 22px; width: 55%; background: #e3ded6; border-radius: 6px; margin-bottom: 14px; } .sk2 { height: 10px; width: 85%; background: #ebe7e1; border-radius: 6px; margin-bottom: 8px; } .sk3 { height: 120px; width: 60%; background: #ebe7e1; border-radius: 10px; margin-top: 16px; }
.wl { position: absolute; right: 18px; bottom: 18px; border-radius: 99px; padding: 10px 16px; font-weight: 600; font-size: 14px; box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.widget { position: absolute; right: 14px; bottom: 14px; top: 14px; max-width: calc(100% - 28px); background: #fff; color: #1d1b19; border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.22); display: flex; flex-direction: column; overflow: hidden; font-size: 13px; }
.site.mob .widget { inset: 0; max-width: none; border-radius: 0; } .widget.dk { background: #1f1d1b; color: #f3efe9; }
.wh { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid rgba(127,127,127,.2); } .wh > div { flex: 1; min-width: 0; display: flex; flex-direction: column; } .wh small { font-size: 11px; opacity: .7; }
.wcta { font-size: 11.5px; font-weight: 600; border-radius: 99px; padding: 4px 9px; white-space: nowrap; }
.wb { flex: 1; padding: 12px; display: flex; flex-direction: column; gap: 10px; overflow: auto; }
.wm { border-radius: 12px; padding: 8px 11px; max-width: 88%; line-height: 1.45; } .wm.a { background: rgba(127,127,127,.12); } .wm.u { align-self: flex-end; }
.wqs { display: flex; flex-direction: column; gap: 6px; } .wqs span, .wqr span { border: 1px solid rgba(127,127,127,.35); border-radius: 10px; padding: 6px 10px; font-size: 12.5px; }
.wqr { display: flex; flex-wrap: wrap; gap: 6px; } .wqr span { border-radius: 99px; }
.wform { border: 1px solid rgba(127,127,127,.3); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; } .wform p { margin: 0; opacity: .8; }
.wfi { border: 1px solid rgba(127,127,127,.35); border-radius: 8px; padding: 6px 9px; font-size: 12px; opacity: .6; } .wbtn { border-radius: 8px; padding: 8px; text-align: center; font-weight: 600; }
.wf { padding: 10px 12px; border-top: 1px solid rgba(127,127,127,.2); } .win { display: flex; justify-content: space-between; align-items: center; border: 1px solid rgba(127,127,127,.35); border-radius: 10px; padding: 7px 8px 7px 11px; opacity: .85; }
.wsend { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; } .wfoot { font-size: 10.5px; opacity: .6; margin-top: 6px; text-align: center; }
/* Same rules as the widget's .wordmark: natural width, left-aligned, inverted in dark mode. */
.wlogo { display: block; height: 16px; width: auto; max-width: 100%; align-self: flex-start; object-fit: contain; object-position: left center; margin: 2px 0 3px; }
.widget.dk .wlogo { filter: invert(1) brightness(1.15); }
.logoprev { display: inline-flex; gap: 8px; align-items: center; margin-left: 8px; } .logoprev span { display: inline-flex; align-items: center; border-radius: 6px; padding: 4px 8px; border: 1px solid var(--line); }
.logoprev .lp-dark { background: #1f1d1b; } .logoprev img { height: 16px; width: auto; max-width: 120px; display: block; } .logoprev .lp-dark img { filter: invert(1) brightness(1.15); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.banner.bad { background: var(--bad-soft); color: var(--bad); }
.hint.bad { color: var(--bad); }
.draftcard { border: 2px solid var(--accent); } .draftcard .ch { align-items: flex-start; gap: 12px; } .draftcard .ch h2 { margin-bottom: 2px; }
.muted-btn { opacity: .6; }
.aibox { background: var(--soft); border-radius: 10px; padding: 10px 12px; margin: 4px 0 10px; } .aibox .f { margin-bottom: 8px; }
[hidden] { display: none !important; }
.sugrow { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); cursor: pointer; } .sugrow input { margin-top: 3px; }
.pcard { min-width: 0; } .pcard .tag { white-space: normal; max-width: 100%; }
.modal > * { flex-shrink: 0; } /* tall dialogs scroll instead of squashing the editor */
.diff { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 13px; line-height: 1.7; white-space: pre-wrap; max-height: 360px; overflow: auto; }
.diff del { background: var(--bad-soft); color: var(--bad); } .diff ins { background: var(--ok-soft); color: var(--ok); text-decoration: none; }
td > span > del, td > span > ins { padding: 0 2px; border-radius: 3px; } td > span > del { background: var(--bad-soft); color: var(--bad); } td > span > ins { background: var(--ok-soft); color: var(--ok); text-decoration: none; }
a.who { text-decoration: none; border-radius: 8px; padding: 4px; margin: -4px; } a.who:hover { background: var(--hover); }
.diff del, td > span > del { margin-right: 3px; }
.rlinks { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; font-size: 12.5px; } .rlinks:empty { display: none; }
.rlink { display: grid; grid-template-columns: minmax(80px, 0.7fr) minmax(0, 1.6fr) auto auto; gap: 6px; align-items: center; } .rlink .rl-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rlink input { font-size: 12.5px; padding: 3px 7px; } .rlink.bad input { border-color: var(--bad); }
.redit a { cursor: pointer; }
.rfiles { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; } .rfiles:empty { display: none; } .rfiles .hint { flex-basis: 100%; margin: 0; }
.fchip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 2px 6px 2px 10px; font-size: 12.5px; background: var(--panel); }
.fchip .x { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 4px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; } .seg button { border: 0; background: none; font-size: 11.5px; padding: 1px 8px; color: var(--muted); cursor: pointer; } .seg button.on { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.pickcard { display: flex; flex-direction: column; gap: 6px; text-align: left; cursor: pointer; color: var(--fg); font: inherit; } .pickcard:hover { border-color: var(--accent); }

/* ---------- sent mail, contact email history, delivery check */
.mailgrid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 14px; align-items: start; }
@media (max-width: 980px) { .mailgrid { grid-template-columns: 1fr; } }
tr.sel td { background: var(--accent-soft); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--fg); font-weight: 600; cursor: pointer; text-align: left; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.linkbtn:hover { color: var(--accent-ink); }
.evlist { list-style: none; margin: 8px 0 0; padding: 0 0 0 10px; border-left: 2px solid var(--line); font-size: 12.5px; }
.evlist li { padding: 2px 0; } .evlist b { font-weight: 600; }
.reason { border-radius: 8px; padding: 7px 10px; font-size: 12.5px; margin: 8px 0; background: var(--warn-soft); color: var(--warn); }
.reason.bad { background: var(--bad-soft); color: var(--bad); }
.mailbody { border-top: 1px solid var(--line-soft); margin-top: 8px; padding-top: 8px; font-size: 13px; overflow-wrap: anywhere; }
.mailbody p { margin: 0 0 8px; }
.thread { display: flex; flex-direction: column; gap: 8px; }
.tmsg { border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; background: var(--panel); text-align: left; color: var(--fg); font: inherit; cursor: pointer; min-width: 0; }
.tmsg.out { margin-right: 36px; } .tmsg.in { margin-left: 36px; background: var(--soft); }
.tmsg .r1 { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 12.5px; }
.tmsg .meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 2px; }
.hstats { display: flex; gap: 18px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.checks .crow { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line-soft); font-size: 13px; }
.checks .crow .grow { flex: 1; min-width: 0; }
.steps { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.steps .st { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; color: var(--subtle); }
.steps .st i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); flex: none; display: grid; place-items: center; font-style: normal; font-size: 11px; margin-top: 1px; }
.steps .st.done { color: var(--fg); } .steps .st.done i { border-color: var(--ok); color: var(--ok); }
.steps .st.cur { color: var(--fg); } .steps .st.cur i { border-color: var(--accent); color: var(--accent); }
.steps .st.bad { color: var(--bad); } .steps .st.bad i { border-color: var(--bad); color: var(--bad); }
td.who .linkbtn { display: block; font-size: inherit; }

/* ---------- email threads (Replies, contact history) */
.mcard { padding: 18px 22px; }
.mtop { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; padding-bottom: 12px; }
.msubject { font-size: 17px; margin: 0 0 3px; letter-spacing: -.01em; line-height: 1.35; }
.mthread { display: flex; flex-direction: column; }
.mmsg { border-top: 1px solid var(--line-soft); padding: 12px 0; }
.mhead { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; border-radius: 8px; }
.mmsg:not(.open) .mhead:hover { background: var(--hover); }
.mav { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 11.5px; font-weight: 700; flex: none; background: var(--info-soft); color: var(--info); }
.mav.me { background: var(--accent-soft); color: var(--accent-ink); }
.mwho { flex: 1; min-width: 0; }
.mwho .r1 { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.mwho .r1 > span:last-child { white-space: nowrap; flex: none; }
.mwho .r2 { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 2px; }
.mwho .snip { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mbody { margin: 10px 0 0 40px; max-width: 640px; font-size: 14.5px; line-height: 1.65; color: var(--fg); overflow-wrap: anywhere; }
.mbody p { margin: 0 0 10px; } .mbody p:last-child { margin-bottom: 0; }
.mbody a { color: var(--accent-ink); text-decoration: none; border-bottom: 1px solid var(--accent-soft); }
.mbody a:hover { border-bottom-color: var(--accent-ink); }
.mbody ul, .mbody ol { margin: 0 0 10px; padding-left: 22px; }
.mbody img { max-width: 100%; height: auto; }
.mbody blockquote { margin: 0 0 10px; padding-left: 12px; border-left: 2px solid var(--line); color: var(--muted); }
.mdots { margin: 8px 0 0 40px; background: var(--soft); border: 1px solid var(--line); color: var(--muted); border-radius: 6px; padding: 0 8px; font-size: 12px; line-height: 16px; cursor: pointer; letter-spacing: 1px; }
.mdots:hover { color: var(--fg); }
.mquote { margin: 8px 0 0 40px; max-width: 640px; border-left: 2px solid var(--line); padding-left: 12px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.mquote p { margin: 0 0 8px; }
.macts { margin: 10px 0 0 40px; }
.mreply { border-top: 1px solid var(--line-soft); padding-top: 14px; margin-top: 2px; }
@media (max-width: 860px) { .mbody, .mdots, .mquote, .macts { margin-left: 0; } }
