/* Matilda on Basecoat: the amethyst theme (shadcn tokens), the Fraunces display face,
   and the few layouts Basecoat has no component for. Loaded after basecoat.min.css. */

@font-face {
  font-family: 'Fraunces'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url('/static/fonts/fraunces-latin.woff2') format('woff2');
}

/* Hex only: the dashboard charts read these at runtime, and Chart.js cannot parse oklch. */
:root {
  color-scheme: light;
  --radius: 0.625rem;
  --background: #F7F3FA;
  --foreground: #2B1540;
  --card: #FFFFFF;
  --card-foreground: #2B1540;
  --popover: #FFFFFF;
  --popover-foreground: #2B1540;
  --primary: #5A2E7A;
  --primary-foreground: #FFFFFF;
  --secondary: #EFE6F5;
  --secondary-foreground: #391A4C;
  --muted: #F1EAF6;
  --muted-foreground: #6E5E7A;
  --accent: #EFE6F5;
  --accent-foreground: #391A4C;
  --destructive: #B23A48;
  --border: #E3D8EC;
  --input: #E3D8EC;
  --ring: #8A3FFC;
  --chart-1: #8A3FFC;
  --chart-2: #5A2E7A;
  --chart-3: #B58BDA;
  --chart-4: #3F7D58;
  --chart-5: #B5842E;
  --chart-fill: #8A3FFC24;
  --sidebar: #F1EBF6;
  --sidebar-foreground: #2B1540;
  --sidebar-primary: #5A2E7A;
  --sidebar-primary-foreground: #FFFFFF;
  --sidebar-accent: #E5DAEE;
  --sidebar-accent-foreground: #2B1540;
  --sidebar-border: #E3D8EC;
  --sidebar-ring: #8A3FFC;
  --sidebar-width: 15rem;
  --warn: #B5842E;
  --ok: #3F7D58;
  --status-qualified: #3F7D58;
  --status-showing: #5A2E7A;
  --status-qualifying: #8A5FB0;
  --status-nurture: #8C7A99;
  --status-new: #A99BB5;
  --font-sans: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', system-ui, sans-serif;
  --font-heading: 'Fraunces', 'Iowan Old Style', Palatino, Georgia, serif;
}

.dark {
  color-scheme: dark;
  --background: #120A1C;
  --foreground: #F2EAF8;
  --card: #1B1027;
  --card-foreground: #F2EAF8;
  --popover: #1B1027;
  --popover-foreground: #F2EAF8;
  --primary: #A97BFF;
  --primary-foreground: #140B20;
  --secondary: #2A1B3C;
  --secondary-foreground: #F2EAF8;
  --muted: #221531;
  --muted-foreground: #A592B6;
  --accent: #2E1E46;
  --accent-foreground: #F2EAF8;
  --destructive: #F27D8A;
  --border: #C8A0FF24;
  --input: #C8A0FF2E;
  --ring: #A97BFF;
  --chart-1: #A97BFF;
  --chart-2: #C9A7F0;
  --chart-3: #7C3AED;
  --chart-4: #6FBF8F;
  --chart-5: #D9B45A;
  --chart-fill: #A97BFF2B;
  --sidebar: #160D21;
  --sidebar-foreground: #F2EAF8;
  --sidebar-primary: #A97BFF;
  --sidebar-primary-foreground: #140B20;
  --sidebar-accent: #2A1B3C;
  --sidebar-accent-foreground: #F2EAF8;
  --sidebar-border: #C8A0FF24;
  --sidebar-ring: #A97BFF;
  --warn: #D9B45A;
  --ok: #6FBF8F;
  --status-qualified: #6FBF8F;
  --status-showing: #C9A7F0;
  --status-qualifying: #B58BDA;
  --status-nurture: #A893B8;
  --status-new: #B8A8C6;
}

body { font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
}

/* Typography */
h1 { font-family: var(--font-heading); font-weight: 600; font-size: 28px; letter-spacing: -.01em;
  line-height: 1.15; }
h2 { font-weight: 600; font-size: 16px; letter-spacing: -.01em; }
.muted { color: var(--muted-foreground); }
.small { font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }
.none { color: var(--muted-foreground); font-style: italic; }
.mono { font-family: var(--font-mono); font-size: 12.5px; overflow-wrap: anywhere; }
.wordmark { font-family: var(--font-heading); font-weight: 600; font-size: 22px; letter-spacing: -.01em; }
pre.prompt { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; font-family: var(--font-mono);
  font-size: 12.5px; line-height: 1.65; }
a.link { color: var(--primary); font-weight: 500; }
a.link:hover { text-decoration: underline; }
.wrap { overflow-wrap: anywhere; }
.nowrap { white-space: nowrap; }

/* Layout */
.page { max-width: 1120px; margin: 0 auto; padding: 24px 32px 80px; }
.page > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; margin-bottom: 20px; }
.page > header p { margin: 4px 0 0; color: var(--muted-foreground); }
.topbar { display: none; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--border);
  background: var(--background); position: sticky; top: 0; z-index: 10; }
.stack { display: grid; gap: 20px; }
.stack-sm { display: grid; gap: 10px; }
.cluster { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cluster .grow { flex: 1; min-width: 180px; }
.end { margin-left: auto; }
.grid-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; align-items: start; }
/* Basecoat card headers are a grid; these ones lay their pieces out in a row. */
.card > header.row-head { display: flex; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 10px; }
.card > header.row-head h2 { margin: 0; }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }
.section { display: grid; gap: 10px; }
.section > h2 { margin: 0; }
form.inline { display: contents; }
.narrow { max-width: 440px; }
.pre { white-space: pre-wrap; }

/* Cards that hold a number */
.stat section { display: grid; gap: 4px; }
.stat .k { font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  color: var(--muted-foreground); }
.stat .v { font-size: 28px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere; }
.stat .v.text { font-size: 15px; letter-spacing: 0; line-height: 1.35; }
.stat .sub { color: var(--muted-foreground); font-size: 12.5px; }
.chartbox { position: relative; height: 240px; }
.chartbox.mini { height: 160px; }

/* Status badges share the pipeline palette on every surface. */
.badge[data-status] { background: transparent; border-color: currentColor; text-transform: lowercase; }
.badge[data-status=qualified] { color: var(--status-qualified); }
.badge[data-status=showing] { color: var(--status-showing); }
.badge[data-status=qualifying] { color: var(--status-qualifying); }
.badge[data-status=nurture] { color: var(--status-nurture); }
.badge[data-status=new] { color: var(--status-new); }
.badge[data-kind] { background: transparent; border-color: currentColor; }
.badge[data-kind=ok] { color: var(--ok); }
.badge[data-kind=warn] { color: var(--warn); }
.badge[data-kind=bad] { color: var(--destructive); }
.badge[data-kind=info] { color: var(--primary); }
.badge[data-kind=muted] { color: var(--muted-foreground); }
.is-ok { color: var(--ok); }
.is-bad { color: var(--destructive); }
.is-warn { color: var(--warn); }

/* Key/value profile list */
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 16px; margin: 0; }
.kv dt { color: var(--muted-foreground); font-weight: 500; }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* Feed of recent activity */
.feed { display: grid; }
.feed > div { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.feed > div:last-child { border-bottom: 0; }
.feed .who { font-weight: 600; flex: 0 0 128px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed .txt { color: var(--muted-foreground); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
.feed .when { color: var(--muted-foreground); font-size: 12px; white-space: nowrap; }

.text-end { text-align: end; }
.tabs > [role=tabpanel] { margin-top: 16px; }
.table .avatar { width: 28px; height: 28px; font-size: 11px; }
.table form { margin: 0; }
.matrix th { vertical-align: top; width: 20%; white-space: normal; }
.table .wrap { white-space: normal; }
/* A row's action menu must not be clipped by the table's scroll container. */
.table-container:has(.dropdown-menu), .card:has(.dropdown-menu) { overflow: visible; }
.matrix td.mark { text-align: center; }
.matrix td.mark .muted { opacity: .45; }
.dialog .grid-2 { gap: 12px; }

/* Clickable record rows */
.table.clickable tbody tr[data-href] { cursor: pointer; }
.table td.lead { font-weight: 600; }
.table .progress { min-width: 90px; }
.progress-row { display: flex; align-items: center; gap: 8px; }
.progress-row .num { font-size: 12px; font-weight: 600; color: var(--muted-foreground); width: 34px; text-align: right; }

/* Timeline of captured facts and milestones */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); }
.timeline li:first-child { border-top: 0; }
.timeline .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); flex: none; }
.timeline .dot.done { background: var(--ok); }
.timeline .dot.pending { background: var(--border); }
.timeline .main { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.timeline .when { margin-left: auto; color: var(--muted-foreground); font-size: 12px; white-space: nowrap; }

/* Conversation transcript (dashboard) */
.convo { display: flex; flex-direction: column; max-height: 560px; overflow-y: auto; padding: 4px 2px; }
.convo .row { display: flex; width: 100%; margin: 1px 0; }
.convo .row.lead { justify-content: flex-start; }
.convo .row.matilda { justify-content: flex-end; }
.convo .row.start { margin-top: 12px; }
.convo .msg { max-width: 76%; min-width: 0; padding: 8px 14px; border-radius: 18px; font-size: 14px;
  line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
.convo .msg.matilda { background: var(--primary); color: var(--primary-foreground); }
.convo .msg.lead { background: var(--secondary); color: var(--secondary-foreground); }
.convo .msg.evt { background: transparent; border: 1px dashed var(--border); color: var(--muted-foreground);
  font-size: 12.5px; padding: 5px 12px; }
.convo .datesep { align-self: center; font-size: 11px; font-weight: 600; color: var(--muted-foreground);
  margin: 14px 0 6px; }
.convo .stamp { font-size: 10.5px; color: var(--muted-foreground); margin: 2px 6px 0; align-self: flex-start; }
.convo .stamp.matilda { align-self: flex-end; }
.convo .pagelink { align-self: center; font-size: 12.5px; font-weight: 600; color: var(--primary); margin: 6px 0; }
.convo .quote { border-left: 2px solid currentColor; opacity: .8; padding: 2px 8px; margin: 0 0 6px; font-size: 12.5px; }
.convo .atts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.convo .att { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: #7f7f7f26; }
.convo .tag { font-size: 11px; opacity: .75; margin-top: 4px; }

/* Setup: the integration cards */
.brandtile { flex: none; width: 32px; height: 32px; border-radius: 8px; background: #fff; border: 1px solid var(--border);
  display: grid; place-items: center; }
.brandtile img, .brandtile svg { width: 18px; height: 18px; object-fit: contain; display: block; color: #2B1540; }
/* Integrations overview: borderless Basecoat items in a grid, one status dot each. */
.integrations { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 2px 12px; }
.integrations .item { text-decoration: none; color: inherit; }
.integrations .item > figure { transform: none; align-self: center; }
.integrations .brandtile { width: 40px; height: 40px; border-radius: 10px; }
.integrations .brandtile img, .integrations .brandtile svg { width: 22px; height: 22px; }
.integrations .item p { color: var(--muted-foreground); overflow-wrap: anywhere; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--border); }
.status-dot.on { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 20%, transparent); }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted-foreground); }
.svc > header .badge { margin-left: auto; }
.svc .fields { display: grid; gap: 14px; }
.svc .field > p { margin: 0; }
.svc .locked { display: flex; align-items: center; gap: 8px; }
.svc .locked .input { flex: 1; color: var(--muted-foreground); user-select: none; display: flex; align-items: center; }
.svc .result { color: var(--muted-foreground); font-size: 13px; }
.qr { background: #fff; padding: 10px; border-radius: 12px; width: 190px; }
.qr svg { display: block; width: 100%; height: auto; }
.reqlist { list-style: none; margin: 0; padding: 0; }
.reqlist li { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 8px 0;
  border-bottom: 1px solid var(--border); font-size: 13.5px; }
.reqlist li:last-child { border-bottom: 0; }

/* One theme glyph at a time; drag handles for reordering the nav */
.if-dark { display: none; } .dark .if-dark { display: inline-flex; align-items: center; gap: 8px; }
.if-light { display: inline-flex; align-items: center; gap: 8px; } .dark .if-light { display: none; }
.sidebar nav h3 { cursor: grab; }
.sidebar nav li { cursor: grab; }
.sidebar nav .dragging { opacity: .35; }

/* Sidebar branding and account */
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.sidebar nav > header.row-head { flex-direction: row; align-items: center; flex-wrap: nowrap; gap: 4px; }
/* Desktop: html[data-rail] narrows Basecoat's sidebar width variable to an icon rail. The nav
   width and the main margin both read the variable, so they slide together on one curve. */
.sidebar nav { transition: width .3s cubic-bezier(.4, 0, .2, 1), transform .3s cubic-bezier(.4, 0, .2, 1); }
.sidebar nav li > a > span:last-child, .sidebar nav h3, .sidebar .wordmark { transition: opacity .15s ease; }
.rail-toggle { margin-left: auto; flex: none; }
@media (min-width: 768px) {
  html[data-rail] { --sidebar-width: 4rem; }
  html[data-rail] .sidebar nav li > a > span:last-child, html[data-rail] .sidebar nav h3, html[data-rail] .sidebar .wordmark,
  html[data-rail] .sidebar nav > footer .text { display: none; }
  html[data-rail] .sidebar nav > header.row-head { flex-direction: column; gap: 6px; }
  html[data-rail] .sidebar .brand { padding: 8px 0; }
  html[data-rail] .rail-toggle { margin-left: 0; }
  html[data-rail] .sidebar nav li > a, html[data-rail] .sidebar nav > footer a,
  html[data-rail] .sidebar nav > footer .dropdown-menu > button { justify-content: center; padding-left: 0; padding-right: 0; }
  html[data-rail] .sidebar nav > section > [role=group] { padding-left: 0; padding-right: 0; }
  html[data-rail] .sidebar nav > section ul { align-items: center; }
}
.sidebar .brand img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.sidebar nav > footer { gap: 2px; }
.sidebar nav > footer a, .sidebar nav > footer .dropdown-menu > button { display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 8px; border-radius: 8px; text-align: left; font: inherit; }
.sidebar nav > footer a:hover, .sidebar nav > footer .dropdown-menu > button:hover { background: var(--sidebar-accent); }
.sidebar nav > footer .text { display: grid; min-width: 0; line-height: 1.25; }
.sidebar nav > footer .on { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar nav > footer .ou { font-size: 11.5px; color: var(--muted-foreground); overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
.sidebar nav > footer svg { color: var(--primary); }
.sidebar nav li > a > .brandtile { width: 20px; height: 20px; border-radius: 5px; flex: none; }
.sidebar nav li > a > .brandtile img { width: 13px; height: 13px; }
.sidebar .avatar { width: 30px; height: 30px; font-size: 12px; }
svg.lucide { width: 18px; height: 18px; flex: none; }
a.card.device { text-decoration: none; color: inherit; }
a.card.device:hover { --border: var(--primary); }
@media (max-width: 767px) {
  .topbar { display: flex; }
  .page { padding: 20px 16px 80px; }
}

/* The public lead page shares its markup with the PDF (print.html styles the same classes). */
.masthead { display: flex; align-items: baseline; justify-content: space-between; border-bottom: 1px solid var(--border);
  padding-bottom: 16px; margin-bottom: 24px; }
.lead-page h2 { margin: 24px 0 10px; }
.lead-page .card > section { padding-top: 0; }

/* Centered single-card pages: landing, sign-in, CRM connect */
.centered { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.centered .card { width: min(400px, 92vw); text-align: center; }
.centered .card > section { display: grid; gap: 12px; justify-items: center; }
.centered .card form { display: grid; gap: 10px; width: 100%; }
.centered .logo { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.centered .wordmark { font-size: 30px; }
.landing { display: grid; gap: 24px; justify-items: center; }
.landing .brand { display: flex; align-items: center; gap: 16px; }
.landing .wordmark { font-size: 40px; }

/* Web chat (installable PWA): a full-height thread between a header and the composer. */
.chat { position: fixed; left: 0; right: 0; top: var(--app-top, 0px); height: 100dvh;
  height: var(--app-height, 100dvh); display: flex; flex-direction: column; overflow: hidden;
  overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
.chat > header { flex: none; display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; border-bottom: 1px solid var(--border);
  background: var(--card); }
.chat > header .avatar { width: 50px; height: 50px; }
.chat .namebar { display: inline-flex; align-items: center; gap: 5px; font-size: 15px; font-weight: 600; }
.chat .namebar .chev { color: var(--muted-foreground); font-size: 18px; line-height: 1; }
.chat #log { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain; padding: 14px 16px 12px; display: flex; flex-direction: column; }
.chat .thread { width: 100%; max-width: 720px; margin: 0 auto; flex: 1 1 auto; display: flex; flex-direction: column; }
.chat .row { display: flex; width: 100%; margin: 1px 0; align-items: flex-end; }
.chat .row.user { justify-content: flex-end; }
.chat .row.bot { justify-content: flex-start; gap: 8px; }
.chat .row.start { margin-top: 12px; }
.chat .avatar-sm { flex: 0 0 26px; width: 26px; height: 26px; border-radius: 50%; object-fit: cover;
  align-self: flex-end; margin-bottom: 3px; }
.chat .msg { position: relative; max-width: 76%; min-width: 0; padding: 9px 15px; border-radius: 20px;
  line-height: 1.36; font-size: 16px; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat .msg.user { background: var(--primary); color: var(--primary-foreground); }
.chat .msg.bot { background: var(--secondary); color: var(--secondary-foreground); }
/* iMessage tails: a coloured fin plus a page-coloured carve, so the page background stays flat. */
.chat .msg.tail.user { border-bottom-right-radius: 4px; }
.chat .msg.tail.bot { border-bottom-left-radius: 4px; }
.chat .msg.tail::before, .chat .msg.tail::after { content: ""; position: absolute; bottom: 0; }
.chat .msg.tail.user::before { right: -7px; width: 16px; height: 17px; background: var(--primary);
  border-bottom-left-radius: 16px 15px; }
.chat .msg.tail.user::after { right: -15px; width: 15px; height: 18px; background: var(--background);
  border-bottom-left-radius: 14px; }
.chat .msg.tail.bot::before { left: -7px; width: 16px; height: 17px; background: var(--secondary);
  border-bottom-right-radius: 16px 15px; }
.chat .msg.tail.bot::after { left: -15px; width: 15px; height: 18px; background: var(--background);
  border-bottom-right-radius: 14px; }
.chat .timesep { align-self: center; font-size: 11px; color: var(--muted-foreground); margin: 16px 0 10px; }
.chat .timesep b, .chat .receipt b { font-weight: 600; }
.chat .receipt { align-self: flex-end; font-size: 11px; color: var(--muted-foreground); margin: 3px 3px 2px 0; }
.chat .typing { padding: 12px 15px; }
.chat .typing span { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted-foreground);
  animation: blink 1.3s infinite both; }
.chat .typing span:nth-child(2) { animation-delay: .2s; }
.chat .typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .35; transform: translateY(0); } 40% { opacity: .9; transform: translateY(-2px); } }
.chat > footer { flex: none; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border);
  background: var(--card); }
.chat > footer form { max-width: 720px; margin: 0 auto; }
.chat .composer { display: flex; align-items: flex-end; gap: 6px; background: var(--background);
  border: 1px solid var(--input); border-radius: 22px; padding: 5px 6px 5px 16px; }
.chat .composer:focus-within { border-color: var(--ring); box-shadow: 0 0 0 3px var(--chart-fill); }
.chat textarea { flex: 1 1 auto; resize: none; border: 0; padding: 6px 0; font: inherit; font-size: 16px;
  background: transparent; color: inherit; max-height: 140px; line-height: 1.35; outline: 0; }
.chat .send { flex: none; width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--primary);
  color: var(--primary-foreground); font-size: 18px; font-weight: 700; display: grid; place-items: center; padding: 0;
  opacity: 0; transform: scale(.7); transition: opacity .12s ease, transform .12s ease; pointer-events: none; cursor: pointer; }
.chat .send.show { opacity: 1; transform: none; pointer-events: auto; }
.chat .send:disabled { opacity: .5; cursor: default; }
.chat .none { align-self: center; margin: auto 0; text-align: center; font-style: normal; }

/* Web chat sign-in and profile */
.chat-login .card > section { display: grid; gap: 10px; justify-items: center; }
.chat-login input { text-align: center; font-size: 16px; }
.chat-login .err { color: var(--destructive); font-size: 13px; min-height: 18px; }
.profile { min-height: 100dvh; padding-bottom: calc(40px + env(safe-area-inset-bottom)); }
.profile .nav { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  padding: calc(8px + env(safe-area-inset-top)) 12px 8px; background: var(--card); border-bottom: 1px solid var(--border); }
.profile .nav a { color: var(--primary); font-size: 16px; display: inline-flex; align-items: center; gap: 3px; }
.profile .nav .done { font-weight: 600; }
.profile .wrap { max-width: 640px; margin: 0 auto; padding: 8px 16px; display: grid; gap: 24px; }
.profile .hero { display: grid; justify-items: center; gap: 6px; padding: 18px 0 0; text-align: center; }
.profile .hero .avatar { width: 92px; height: 92px; }
.profile .hero h1 { margin: 4px 0 0; }
.profile .item { align-items: center; }
.profile .item .edit { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 15px;
  color: inherit; text-align: right; padding: 6px 4px; border-radius: 8px; -webkit-appearance: none; appearance: none; }
.profile .item .edit:focus { outline: 0; background: var(--muted); }
.profile .item .edit::placeholder { color: var(--muted-foreground); }
.profile .foot { text-align: center; color: var(--muted-foreground); font-size: 12px; }

/* Live: sync runs, one card each with the five-step strip (templates/dashboard/_run.html) */
.runs { display: grid; gap: 10px; }
.run { border: 1px solid var(--border); border-radius: var(--radius, 10px); background: var(--card); padding: 12px 14px; display: grid; gap: 8px; }
.run > header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.run > header .lead { font-weight: 600; color: inherit; text-decoration: none; }
.run > header .lead:hover { text-decoration: underline; }
.run[data-outcome="running"] { border-color: var(--primary); }
.steps { list-style: none; margin: 0; padding: 0; display: flex; gap: 0; flex-wrap: wrap; }
.steps li { display: flex; align-items: center; gap: 6px; padding: 4px 10px 4px 0; font-size: 12.5px; color: var(--muted-foreground); }
.steps li + li::before { content: ""; width: 14px; height: 1px; background: var(--border); margin-right: 8px; }
.steps .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); flex: none; }
.steps li.ok .dot, .steps li.held .dot { background: var(--ok); }
.steps li.ok, .steps li.held, .steps li.nothing, .steps li.skipped { color: var(--foreground); }
.steps li.held .dot { background: var(--warn); }
.steps li.nothing .dot { background: var(--primary); }
.steps li.skipped .dot { background: var(--muted-foreground); }
.steps li.failed .dot { background: var(--destructive); }
.steps li.failed { color: var(--destructive); }
.steps .ms { color: var(--muted-foreground); }
.gate { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted-foreground); }
.gate li { display: flex; gap: 5px; }
.gate li.fired { color: var(--foreground); font-weight: 600; }
.run details > summary { list-style: none; display: inline-flex; width: auto; }
.run details > summary::-webkit-details-marker { display: none; }
.run .detail { border-top: 1px solid var(--border); padding-top: 10px; }
.run .detail h3 { margin: 0 0 6px; font-size: 13px; }
.run .lines, .run .checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.run .lines b { color: var(--muted-foreground); font-weight: 600; margin-right: 4px; }
.run .checks li { display: flex; align-items: center; gap: 6px; }
.run .checks svg { width: 14px; height: 14px; }
.run pre { margin: 0; max-height: 320px; overflow: auto; background: var(--muted); padding: 8px 10px; border-radius: 8px; }
