/* Diamond Turtle — palette from the logo: gem teal #00D5AC, aqua #6FF2DF, mint #A4F2CC, deep teal #297162 / #173F37.
   Dark is the default theme; [data-theme="light"] swaps the variables below. --brand comes from Admin → Settings. */
:root {
  --brand: #00d5ac;
  --brand-2: #a4f2cc;              /* mint, from the logo lettering */
  --brand-text: var(--brand);      /* brand-colored text; darkened in light mode for contrast */
  --brand-ink: #032a22;            /* text on brand-filled buttons */
  --brand-soft: color-mix(in srgb, var(--brand) 14%, transparent);
  --brand-line: color-mix(in srgb, var(--brand) 40%, transparent);
  --bg: #04100d; --bg-2: #071713; --card: #0a1a16; --card-2: #0e221d;
  --text: #e9fbf4; --text-2: #c3ddd4; --muted: #86a39a; --heading: #f4fffb;
  --tint-rgb: 190 245 222;         /* glass tints & hairlines */
  --line: rgb(var(--tint-rgb) / .08); --line-2: rgb(var(--tint-rgb) / .14);
  --green: #34d399; --green-bg: rgba(52, 211, 153, .12);
  --amber: #f5b942; --amber-bg: rgba(245, 185, 66, .12);
  --red: #f26464; --red-bg: rgba(242, 100, 100, .12);
  --blue: #7cc4ff; --blue-bg: rgba(124, 196, 255, .12);
  --gray-bg: rgb(var(--tint-rgb) / .05);
  --btn-bg: #10241f; --btn-bg-hover: #153029;
  --topbar-bg: rgba(4, 16, 13, .74); --announce-bg: #071713; --toast-bg: rgba(14, 34, 29, .94); --sticky-bg: rgba(10, 26, 22, .95);
  --placeholder: #5b7a71; --ring-inner: #0f251f; --knob: #cfe3dc;
  --grad-a: var(--brand-2); --grad-b: #f4fffb; --grad-c: color-mix(in srgb, var(--brand) 55%, #5f8a80);
  --glow-strength: 30%; --circuit-opacity: .14;
  --radius: 16px;
  --shadow: 0 1px 0 rgb(var(--tint-rgb) / .05) inset, 0 20px 50px -20px rgba(0, 0, 0, .8);
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
:root[data-theme="light"] { color-scheme: light; }
body {
  margin: 0; min-height: 100vh; position: relative; isolation: isolate;
  font: 15px/1.55 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased;
}
/* Top glow + circuit traces in the brand color */
body::before, body::after { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; }
body::before {
  background:
    radial-gradient(900px 460px at 50% -120px, color-mix(in srgb, var(--brand) var(--glow-strength), transparent), transparent 70%),
    radial-gradient(520px 260px at 50% 0, color-mix(in srgb, var(--brand) 16%, transparent), transparent 75%);
}
body::after {
  background: var(--brand); opacity: var(--circuit-opacity);
  -webkit-mask: url(/static/circuit.svg) top center / max(1600px, 100%) auto no-repeat, linear-gradient(#000 25%, transparent 80%);
  -webkit-mask-composite: source-in;
  mask: url(/static/circuit.svg) top center / max(1600px, 100%) auto no-repeat, linear-gradient(#000 25%, transparent 80%);
  mask-composite: intersect;
}
a { color: var(--brand-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -.02em; color: var(--text); }
h1 { font-size: 30px; margin: 4px 0; line-height: 1.15; }
h2 { font-size: 20px; margin: 8px 0; }
h3 { font-size: 15px; margin: 0 0 12px; color: var(--text-2); letter-spacing: -.01em; }
h4 { font-size: 15px; margin: 20px 0 6px; }
strong { color: var(--heading); font-weight: 600; }
code { background: var(--bg-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; font-size: 13px; word-break: break-all; color: var(--brand-text); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.right { margin-left: auto; }
.mt { margin-top: 10px; }
.pre { white-space: pre-wrap; }
::selection { background: var(--brand); color: var(--brand-ink); }

/* Gradient headline */
.grad {
  background: linear-gradient(100deg, var(--grad-a) 0%, var(--grad-b) 45%, var(--grad-c) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lead { color: var(--text-2); font-size: 17px; max-width: 620px; margin: 14px auto 0; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 99px; font-size: 13px; color: var(--text-2);
  background: rgb(var(--tint-rgb) / .03); border: 1px solid var(--line-2); text-decoration: none !important;
}
a.pill:hover { border-color: var(--brand-line); color: var(--text); }
.pill .arrow { color: var(--muted); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 10px var(--brand); display: inline-block; }

/* Announcement strip + top bar */
.announce { text-align: center; font-size: 12.5px; color: var(--text-2); padding: 8px 16px; background: var(--announce-bg); border-bottom: 1px solid var(--line); }
.topbar { display: flex; align-items: center; gap: 28px; padding: 14px 28px; position: sticky; top: 0; z-index: 10; flex-wrap: wrap;
  background: var(--topbar-bg); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.topbar nav { display: flex; gap: 4px; flex-wrap: wrap; }
.topbar nav a { padding: 7px 12px; border-radius: 9px; color: var(--text-2); font-size: 14px; font-weight: 500; }
.topbar nav a:hover { color: var(--heading); background: var(--gray-bg); text-decoration: none; }
.topbar nav a.active { color: var(--heading); background: rgb(var(--tint-rgb) / .07); box-shadow: inset 0 0 0 1px var(--line); }
.topbar .me { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 14px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none !important; }
.logo img { height: 32px; width: auto; display: block; }
.logo .wordmark { font-weight: 700; font-size: 17px; letter-spacing: -.01em; color: var(--heading); }
.logo .tag { font-size: 11.5px; font-weight: 500; color: var(--brand-text); background: var(--brand-soft); border: 1px solid var(--brand-line); border-radius: 99px; padding: 2px 9px; }
.logo.big { justify-content: center; margin-bottom: 18px; }
.logo.big img { height: 48px; }
.logo.big .wordmark { font-size: 22px; }

/* Layout */
.container { max-width: 1200px; margin: 0 auto; padding: 32px 20px 80px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; align-items: start; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
@media (max-width: 900px) { .grid-2, .grid-2-1, .row-2 { grid-template-columns: 1fr; } }

.card { background: linear-gradient(180deg, rgb(var(--tint-rgb) / .035), rgb(var(--tint-rgb) / .008)), var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.empty { text-align: center; padding: 44px; }

/* Hero (login + portal) */
.hero { text-align: center; padding: 36px 0 34px; }
.hero h1 { font-size: clamp(34px, 5.4vw, 58px); line-height: 1.06; letter-spacing: -.035em; margin: 18px auto 0; max-width: 900px; }
.hero .actions { display: flex; gap: 10px; justify-content: center; margin-top: 26px; flex-wrap: wrap; }

/* Stat tiles */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
@media (max-width: 1000px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .tiles { grid-template-columns: minmax(0, 1fr); } }
.stat { display: flex; flex-direction: column; gap: 2px; min-height: 140px; }
.stat-head { display: flex; justify-content: space-between; align-items: center; font-size: 13.5px; color: var(--text-2); margin-bottom: 8px; }
.stat-value { font-size: 44px; font-weight: 500; letter-spacing: -.035em; line-height: 1; color: var(--heading); }
.stat-value .unit { font-size: 18px; color: var(--muted); font-weight: 400; letter-spacing: 0; margin-left: 2px; }
.stat-sub { font-size: 13px; color: var(--muted); margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.stat.accent .stat-value { color: var(--brand-text); text-shadow: 0 0 24px color-mix(in srgb, var(--brand) 45%, transparent); }
.stat-ring { display: flex; align-items: center; gap: 16px; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; border: 0; padding: 0; margin: 0; }
.field > span, legend { font-weight: 500; font-size: 13.5px; color: var(--text-2); }
input, select, textarea { font: inherit; color: var(--text); padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--bg-2); width: 100%; transition: border-color .15s, box-shadow .15s; }
input::placeholder, textarea::placeholder { color: var(--placeholder); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
input:disabled { opacity: .55; }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--brand); }
input[type=color] { height: 42px; padding: 3px; }
input[type=time]::-webkit-calendar-picker-indicator, input[type=date]::-webkit-calendar-picker-indicator { filter: invert(1) opacity(.55); }
select option { background: var(--card); }
.check { display: flex; gap: 9px; align-items: flex-start; font-weight: 400; cursor: pointer; color: var(--text-2); }
.check input { margin-top: 4px; }
.check.inline { align-items: center; }
.check.inline input { margin-top: 0; }
.check.granted { background: var(--brand-soft); border: 1px solid var(--brand-line); padding: 12px 14px; border-radius: 12px; font-weight: 500; color: var(--text); }
.check.help { background: var(--amber-bg); border: 1px solid color-mix(in srgb, var(--amber) 30%, transparent); padding: 10px 14px; border-radius: 12px; }
.checks { display: grid; gap: 8px; }
.req { color: var(--red); font-style: normal; }
.field-heading { margin: 10px 0 -4px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); }
.field-heading:first-child { border-top: 0; padding-top: 0; }
.hours { display: grid; gap: 6px; }
.hours-row { display: grid; grid-template-columns: 90px 1fr auto 1fr auto; gap: 8px; align-items: center; }
.hours-row.closed input[type=time] { opacity: .35; }
.hours-row .day { font-weight: 500; font-size: 14px; }
@media (max-width: 520px) { .hours-row { grid-template-columns: 1fr 1fr; } .hours-row .day { grid-column: 1 / -1; } .hours-row > .muted { display: none; } }
.budget-warn { color: var(--amber); background: var(--amber-bg); padding: 6px 10px; border-radius: 8px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; border-top: 1px solid var(--line); padding-top: 16px; flex-wrap: wrap; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--btn-bg); color: var(--text); font: inherit; font-size: 14.5px; font-weight: 500;
  cursor: pointer; text-decoration: none !important; transition: all .15s; box-shadow: 0 1px 0 rgb(var(--tint-rgb) / .05) inset; }
.btn:hover { background: var(--btn-bg-hover); border-color: rgb(var(--tint-rgb) / .2); }
.btn.primary { color: var(--brand-ink); font-weight: 600; border-color: color-mix(in srgb, var(--brand) 60%, #fff);
  background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 80%, #fff), var(--brand));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand) 25%, transparent), 0 10px 34px -6px color-mix(in srgb, var(--brand) 55%, transparent); }
.btn.primary:hover { filter: brightness(1.06); box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand) 35%, transparent), 0 12px 40px -6px color-mix(in srgb, var(--brand) 70%, transparent); }
.btn.big { padding: 12px 22px; font-size: 15.5px; }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 9px; }
.btn.block { width: 100%; }
.btn.green { color: var(--green); border-color: color-mix(in srgb, var(--green) 40%, transparent); }
.btn.red { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, transparent); }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; color: var(--muted); }
button.link { background: none; border: 0; color: var(--brand-text); cursor: pointer; font: inherit; padding: 0; }
button.link.danger, .danger { color: var(--red); }
summary.btn { list-style: none; }
summary.btn::-webkit-details-marker { display: none; }

/* Badges & alerts */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; vertical-align: middle;
  border: 1px solid var(--line); background: var(--gray-bg); color: var(--text-2); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.badge.big { font-size: 13.5px; padding: 6px 14px; }
.badge.gray { color: var(--muted); }
.badge.blue { color: var(--blue); background: var(--blue-bg); border-color: color-mix(in srgb, var(--blue) 25%, transparent); }
.badge.amber { color: var(--amber); background: var(--amber-bg); border-color: color-mix(in srgb, var(--amber) 25%, transparent); }
.badge.red { color: var(--red); background: var(--red-bg); border-color: color-mix(in srgb, var(--red) 25%, transparent); }
.badge.green { color: var(--brand-text); background: var(--brand-soft); border-color: var(--brand-line); }
.alert { padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; background: var(--blue-bg); color: var(--blue); border: 1px solid color-mix(in srgb, var(--blue) 22%, transparent); }
.alert.ok { background: var(--brand-soft); color: var(--brand-text); border-color: var(--brand-line); }
.alert.err { background: var(--red-bg); color: var(--red); border-color: color-mix(in srgb, var(--red) 25%, transparent); }
.callout { background: var(--brand-soft); border: 1px solid var(--brand-line); padding: 11px 14px; border-radius: 12px; margin: 12px 0; color: var(--text-2); }
.callout.warn { background: var(--amber-bg); border-color: color-mix(in srgb, var(--amber) 30%, transparent); }

/* Auth */
.auth { display: flex; flex-direction: column; align-items: center; padding-bottom: 40px; }
.auth .hero { padding-bottom: 26px; }
.auth .hero h1 { font-size: clamp(32px, 5vw, 50px); }
.auth .card { width: 100%; max-width: 430px; padding: 28px; }

/* Invites */
.invites { margin-bottom: 20px; border-color: var(--brand-line); }
.invite-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.copyline { display: flex; gap: 6px; flex: 1; max-width: 560px; }
.copyline input { font-size: 13px; font-family: ui-monospace, monospace; }

/* Progress */
.bar { height: 6px; border-radius: 99px; background: rgb(var(--tint-rgb) / .06); overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, color-mix(in srgb, var(--brand) 50%, #fff), var(--brand)); box-shadow: 0 0 12px var(--brand); transition: width .6s; }
.progress-big { text-align: center; }
@property --p { syntax: '<number>'; inherits: true; initial-value: 0; }
@property --w { syntax: '<number>'; inherits: true; initial-value: 0; }
@property --a { syntax: '<number>'; inherits: true; initial-value: 0; }
/* Segmented ring: complete (brand) · verifying (amber) · needs attention (red) */
.ring { --p: 0; --w: 0; --a: 0; width: 112px; height: 112px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; margin: 0 auto;
  background: conic-gradient(var(--brand) 0 calc(var(--p) * 1%),
    var(--amber) 0 calc((var(--p) + var(--w)) * 1%),
    var(--red) 0 calc((var(--p) + var(--w) + var(--a)) * 1%),
    rgb(var(--tint-rgb) / .07) 0);
  transition: --p .7s, --w .7s, --a .7s; filter: drop-shadow(0 0 14px color-mix(in srgb, var(--brand) 30%, transparent)); }
.ring span { width: 88px; height: 88px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; font-weight: 500; letter-spacing: -.03em; color: var(--heading);
  background: radial-gradient(circle at 50% 30%, var(--ring-inner), var(--card)); box-shadow: inset 0 0 0 1px var(--line); }
.ring.sm { width: 92px; height: 92px; }
.ring.sm span { width: 72px; height: 72px; font-size: 20px; }
.legend { display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }

/* Dashboard */
.tabs { display: flex; gap: 4px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.tabs a { padding: 5px 12px; border-radius: 99px; color: var(--muted); font-size: 13.5px; font-weight: 500; border: 1px solid transparent; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--text); background: rgb(var(--tint-rgb) / .06); border-color: var(--line-2); }
.tabs .sep { width: 1px; height: 18px; background: var(--line-2); margin: 0 6px; }
.client-list { display: flex; flex-direction: column; gap: 10px; }
.client-row { display: flex; gap: 20px; align-items: center; color: var(--text); padding: 16px 20px; transition: border-color .15s, background .15s; }
.client-row:hover { border-color: var(--brand-line); text-decoration: none; background: linear-gradient(180deg, var(--brand-soft), transparent), var(--card); }
.cr-main { flex: 1; min-width: 0; }
.cr-title { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cr-progress { width: 190px; display: flex; flex-direction: column; gap: 6px; text-align: right; }
@media (max-width: 600px) { .client-row { flex-wrap: wrap; gap: 12px; } .cr-progress { width: 100%; text-align: left; } }
.table-scroll { overflow-x: auto; }
.queue, .activity, .people, .log { list-style: none; padding: 0; margin: 0; }
.queue li { padding: 10px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }
.activity li { padding: 9px 0; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--text-2); }
.activity { max-height: 420px; overflow: auto; }
.people li { display: flex; justify-content: space-between; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); }
.people li:first-child, .activity li:first-child, .queue li:first-child { border-top: 0; }
.people .actions { display: flex; gap: 10px; align-items: flex-start; }
.inactive { opacity: .5; }
.log li { padding: 3px 0; }
.log li.bad { color: var(--red); }
.table, .mini { width: 100%; border-collapse: collapse; }
.table th, .table td, .mini th, .mini td { text-align: left; padding: 11px 8px; border-top: 1px solid var(--line); vertical-align: top; }
.table th, .mini th { border-top: 0; font-size: 12px; color: var(--muted); font-weight: 500; }
.table .actions { display: flex; gap: 12px; }

/* Admin step cards */
details.step { padding: 0; }
details.step summary { display: flex; gap: 10px; align-items: center; padding: 14px 18px; cursor: pointer; list-style: none; }
details.step summary::-webkit-details-marker { display: none; }
details.step[open] summary { border-bottom: 1px solid var(--line); }
.step-body { padding: 16px 18px; }
.status-form { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.status-form input { flex: 1 1 100%; }
dl.data { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; gap: 7px 16px; margin: 0; font-size: 14px; }
dl.data dt { color: var(--muted); }
dl.data dd { margin: 0; }
dl.data .day { display: inline-block; width: 36px; color: var(--muted); }
@media (max-width: 520px) { dl.data { grid-template-columns: 1fr; } dl.data dd { margin-bottom: 6px; } }

/* Portal steps */
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 6px 0 12px; }
.section-title h2 { margin: 0; }
.steps { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.step-item { display: flex; gap: 14px; align-items: center; padding: 14px 18px; position: relative; transition: border-color .15s; }
.step-item:hover { border-color: var(--line-2); }
.step-item .num { width: 34px; height: 34px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line-2); display: grid; place-items: center;
  font-weight: 600; font-size: 14px; color: var(--text-2); flex-shrink: 0; }
.step-item .si-main { flex: 1; min-width: 0; }
.step-item .si-main a { color: var(--text); font-weight: 500; }
.step-item .si-main a::after { content: ""; position: absolute; inset: 0; }
.step-item .si-main a:hover { text-decoration: none; }
.step-item:hover .si-main a { color: var(--heading); }
.step-item.tone-green .num { background: var(--brand-soft); color: var(--brand-text); border-color: var(--brand-line); }
.step-item.tone-amber .num { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 35%, transparent); }
.step-item.tone-red { border-color: color-mix(in srgb, var(--red) 35%, transparent); }
.step-item.tone-red .num { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, transparent); }
.step-item.tone-blue .num { color: var(--blue); border-color: color-mix(in srgb, var(--blue) 35%, transparent); }
.step-item .callout { position: relative; z-index: 1; margin: 8px 0 0; }
.tutorial .why { background: var(--bg-2); border: 1px solid var(--line); padding: 11px 14px; border-radius: 12px; color: var(--text-2); }
.instructions { color: var(--text-2); }
.instructions ol, .instructions ul { padding-left: 22px; }
.instructions li { margin: 7px 0; }
.instructions li::marker { color: var(--brand-text); font-weight: 600; }
.instructions .copy { background: var(--brand-soft); color: var(--brand-text); padding: 1px 7px; border-radius: 6px; font-family: ui-monospace, monospace; user-select: all; }
.providers { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.provider { border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); }
.provider summary { padding: 11px 14px; cursor: pointer; font-weight: 500; color: var(--text); }
.provider summary:hover { color: var(--brand-text); }
.provider[open] { border-color: var(--brand-line); }
.provider[open] summary { border-bottom: 1px solid var(--line); color: var(--brand-text); }
.provider .instructions { padding: 4px 14px 10px; }
.step-layout .tutorial { position: sticky; top: 84px; max-height: calc(100vh - 104px); overflow: auto; }
@media (max-width: 900px) { .step-layout .tutorial { position: static; max-height: none; } }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; font-weight: 500; font-size: 14px; }

/* Live indicator + toasts */
.live { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid var(--line); border-radius: 99px; }
.live .pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); }
.live.on { color: var(--text-2); }
.live.on .pulse { background: var(--brand); box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand) 60%, transparent); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
#toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast { background: var(--toast-bg); backdrop-filter: blur(10px); color: var(--text); border: 1px solid var(--line-2); padding: 12px 16px; border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .6); transition: opacity .5s, transform .5s; max-width: 340px; font-size: 14px; }
.toast.green { border-color: var(--brand-line); }
.toast.red { border-color: color-mix(in srgb, var(--red) 45%, transparent); }
.toast.amber { border-color: color-mix(in srgb, var(--amber) 45%, transparent); }
.toast.hide { opacity: 0; transform: translateY(10px); }
.site-foot { text-align: center; color: var(--muted); font-size: 12.5px; padding: 0 16px 30px; }

/* ═══════════════════════ Motion & modules (v4) ═══════════════════════ */
:root { --ease: cubic-bezier(.2, .7, .2, 1); }
.ico { width: 1.15em; height: 1.15em; vertical-align: -.2em; flex-shrink: 0; }
.btn .ico { width: 17px; height: 17px; }
.mt-lg { margin-top: 22px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.chips.tight { margin: 6px 0 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); padding: 3px 10px; border-radius: 99px; border: 1px solid var(--line); background: rgb(var(--tint-rgb) / .03); }
.card-label { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.pill.glow { border-color: var(--brand-line); color: var(--text); box-shadow: 0 0 24px color-mix(in srgb, var(--brand) 20%, transparent); }
.big-line { font-size: 30px; font-weight: 500; letter-spacing: -.03em; color: var(--heading); line-height: 1.1; }
.big-line .unit, .metric .unit { font-size: 15px; color: var(--muted); font-weight: 400; letter-spacing: 0; }
.metric { display: block; font-size: 28px; font-weight: 500; letter-spacing: -.03em; color: var(--heading); }
.legend.row { display: flex; gap: 12px; margin-top: 6px; }
.crumb { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; margin-bottom: 14px; }
.crumb:hover { color: var(--text); text-decoration: none; }
.crumbs { display: flex; gap: 8px; align-items: center; font-size: 13.5px; color: var(--muted); margin-bottom: 14px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); } .crumbs a:hover { color: var(--text); } .crumbs .here { color: var(--text-2); }
.hero.compact { padding: 18px 0 26px; }
.hero.compact h1 { font-size: clamp(32px, 4.6vw, 50px); }
.hero.left { text-align: left; }
.hero.left h1 { margin-left: 0; }
.lead.left { margin-left: 0; }
.row-inline { display: flex; gap: 8px; }
.setup-list { padding-left: 18px; margin: 0; display: grid; gap: 6px; }
.person { display: flex; gap: 12px; align-items: flex-start; }
.avatar { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; font-size: 13px; font-weight: 600; color: var(--brand-text);
  background: var(--brand-soft); border: 1px solid var(--brand-line); text-transform: uppercase; }
.tabs .count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--amber); color: #1a1200; font-size: 11px; font-weight: 700; margin-left: 4px; }

/* Entrance: content rises in, staggered by --i */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.reveal { animation: rise .45s var(--ease) both; animation-delay: calc(min(var(--i, 0), 8) * 40ms); }
.toast-in { animation: rise .5s var(--ease) both; }
/* Rings and bars fill up on load */
@keyframes ringFill { from { --p: 0; --w: 0; --a: 0; } }
.ring { animation: ringFill 1.3s var(--ease) both; animation-delay: .25s; }
@keyframes barFill { from { width: 0; } }
.bar span { animation: barFill 1.1s var(--ease) both; animation-delay: .3s; }
/* Background glow drifts slowly; circuit traces breathe */
@keyframes drift { 0% { transform: translate3d(0, 0, 0) scale(1); } 50% { transform: translate3d(2%, 1.5%, 0) scale(1.06); } 100% { transform: translate3d(-2%, 0, 0) scale(1.02); } }
@keyframes breathe { 0%, 100% { opacity: .11; } 50% { opacity: .19; } }
body::before { animation: drift 22s ease-in-out infinite alternate; }
body::after { animation: breathe 9s ease-in-out infinite; }

/* Cursor spotlight + glowing edge on interactive cards (JS sets --mx/--my) */
.spot { position: relative; isolation: isolate; }
.spot::before, .spot::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .35s; }
.spot::before { z-index: -1; background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--brand) 11%, transparent), transparent 45%); }
.spot::after { padding: 1px; background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--brand) 70%, transparent), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.spot:hover::before, .spot:hover::after { opacity: 1; }

/* Shine sweep on primary buttons */
.shine { position: relative; overflow: hidden; }
.shine::after { content: ""; position: absolute; inset: -2px; background: linear-gradient(110deg, transparent 35%, rgb(var(--tint-rgb) / .55) 50%, transparent 65%); transform: translateX(-120%); transition: transform .8s var(--ease); }
.shine:hover::after { transform: translateX(120%); }
.btn { transition: transform .18s var(--ease), background .15s, border-color .15s, box-shadow .2s, filter .15s; }
.btn:active { transform: translateY(1px) scale(.985); }
.btn.primary:hover { transform: translateY(-1px); }

/* Icon tiles */
.mc-icon { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; flex-shrink: 0; color: var(--brand-text);
  background: linear-gradient(160deg, color-mix(in srgb, var(--brand) 22%, transparent), color-mix(in srgb, var(--brand) 4%, transparent));
  border: 1px solid var(--brand-line); box-shadow: inset 0 1px 0 rgb(var(--tint-rgb) / .12), 0 8px 24px -10px color-mix(in srgb, var(--brand) 60%, transparent); }
.mc-icon .ico { width: 22px; height: 22px; }
.mc-icon.sm { width: 32px; height: 32px; border-radius: 10px; } .mc-icon.sm .ico { width: 17px; height: 17px; }
.mc-icon.xl { width: 72px; height: 72px; border-radius: 20px; } .mc-icon.xl .ico { width: 34px; height: 34px; }

/* Journey track */
.journey-card { margin-bottom: 26px; padding: 22px 24px; }
.journey-head { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: center; }
.journey-meta { display: flex; gap: 28px; }
.journey { list-style: none; margin: 22px 0 0; padding: 0; display: flex; justify-content: space-between; position: relative; }
.journey::before { content: ""; position: absolute; left: 24px; right: 24px; top: 23px; height: 2px; background: var(--line-2); border-radius: 2px; }
.j-node { position: relative; flex: 1; display: flex; justify-content: center; z-index: 1; }
.j-node > a, .j-node > span { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--text-2); text-decoration: none !important; text-align: center; }
.j-dot { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--card-2); border: 1px solid var(--line-2); color: var(--muted);
  position: relative; transition: transform .3s var(--ease), box-shadow .3s, border-color .3s, background .3s; }
.j-node a:hover .j-dot { transform: translateY(-3px); border-color: var(--brand-line); }
.j-dot .ico { width: 20px; height: 20px; }
.j-ok { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transform: scale(.4); transition: all .4s var(--ease); }
.j-ico { transition: opacity .3s, transform .3s; }
.j-label { font-size: 12.5px; font-weight: 500; max-width: 110px; }
.j-node[data-state="in_progress"] .j-dot, .j-node[data-state="verifying"] .j-dot { color: var(--brand-text); border-color: var(--brand-line); }
.j-node[data-state="verifying"] .j-dot { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 45%, transparent); }
.j-node[data-state="attention"] .j-dot { color: var(--red); border-color: color-mix(in srgb, var(--red) 50%, transparent); animation: nudge 2.4s ease-in-out infinite; }
.j-node[data-state="complete"] .j-dot, .j-node[data-state="approved"] .j-dot, .j-node[data-state="ready"] .j-dot {
  background: var(--brand); border-color: var(--brand); color: var(--brand-ink); box-shadow: 0 0 0 5px var(--brand-soft), 0 0 26px color-mix(in srgb, var(--brand) 55%, transparent); }
.j-node[data-state="complete"] .j-ico, .j-node[data-state="approved"] .j-ico { opacity: 0; transform: scale(.5); }
.j-node[data-state="complete"] .j-ok, .j-node[data-state="approved"] .j-ok { opacity: 1; transform: none; }
.j-node[data-state="ready"] .j-dot { background: var(--amber); border-color: var(--amber); box-shadow: 0 0 0 5px var(--amber-bg), 0 0 26px color-mix(in srgb, var(--amber) 50%, transparent); color: #1a1200; }
.j-node[data-state="approved"] .j-label, .j-node[data-state="complete"] .j-label { color: var(--heading); }
@keyframes nudge { 0%, 100% { transform: none; } 50% { transform: translateY(-3px); } }
@media (max-width: 640px) { .journey { overflow-x: auto; gap: 8px; padding-bottom: 4px; } .j-node { min-width: 76px; } .j-label { font-size: 11.5px; } .journey::before { display: none; } }

/* Module cards */
.module-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 1000px) { .module-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .module-grid { grid-template-columns: 1fr; } }
.module-card { display: flex; flex-direction: column; color: var(--text); padding: 22px; min-height: 238px; overflow: hidden;
  transition: transform .35s var(--ease), border-color .3s, box-shadow .35s; text-decoration: none !important; }
a.module-card:hover { transform: translateY(-4px); border-color: var(--line-2); box-shadow: var(--shadow), 0 24px 60px -24px color-mix(in srgb, var(--brand) 45%, transparent); }
.mc-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.mc-num { font-size: 12px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.mc-title { font-size: 21px; color: var(--heading); margin: 4px 0 6px; letter-spacing: -.02em; }
.mc-blurb { color: var(--muted); font-size: 14px; margin: 0 0 16px; }
.mc-foot { margin-top: auto; display: grid; gap: 9px; }
.mc-meta { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text-2); gap: 8px; }
.mc-hint { color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.mc-check { position: absolute; top: 18px; right: 18px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand); color: var(--brand-ink); opacity: 0; transform: scale(.3) rotate(-30deg); transition: all .5s var(--ease); box-shadow: 0 0 24px var(--brand); }
.mc-check .ico { width: 17px; height: 17px; stroke-width: 2.4; }
.module-card[data-state="complete"], .module-card[data-state="approved"] { border-color: var(--brand-line);
  background: radial-gradient(500px 200px at 100% 0, var(--brand-soft), transparent 70%), linear-gradient(180deg, rgb(var(--tint-rgb) / .035), rgb(var(--tint-rgb) / .008)), var(--card); }
.module-card[data-state="complete"] .mc-check, .module-card[data-state="approved"] .mc-check { opacity: 1; transform: none; }
.module-card[data-state="complete"] .badge, .module-card[data-state="approved"] .badge { margin-right: 40px; }
.module-card[data-state="attention"] { border-color: color-mix(in srgb, var(--red) 35%, transparent); }
.module-card.just-done { animation: pop .9s var(--ease); }
@keyframes pop { 0% { transform: scale(1); } 35% { transform: scale(1.03); box-shadow: 0 0 0 1px var(--brand), 0 0 60px color-mix(in srgb, var(--brand) 55%, transparent); } 100% { transform: none; } }
.final-card { border-style: dashed; border-color: var(--line-2); background: transparent; box-shadow: none; }
.final-card .mc-icon { color: var(--muted); background: rgb(var(--tint-rgb) / .03); border-color: var(--line-2); box-shadow: none; }
.final-card[data-state="ready"] { border-style: solid; border-color: color-mix(in srgb, var(--amber) 40%, transparent); }
.final-card[data-state="ready"] .mc-icon { color: var(--amber); }
.final-card[data-state="approved"] { border-style: solid; border-color: var(--brand-line); background: radial-gradient(500px 200px at 100% 0, var(--brand-soft), transparent 70%); }
.final-card[data-state="approved"] .mc-icon { color: var(--brand-text); border-color: var(--brand-line); }

/* Module page */
.module-hero { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 28px; margin-bottom: 18px; flex-wrap: wrap;
  background: radial-gradient(700px 260px at 0 0, var(--brand-soft), transparent 65%), linear-gradient(180deg, rgb(var(--tint-rgb) / .035), rgb(var(--tint-rgb) / .008)), var(--card); }
.mh-left { display: flex; gap: 20px; align-items: flex-start; flex: 1; min-width: 260px; }
.module-hero h1 { font-size: clamp(30px, 4vw, 44px); margin: 4px 0 6px; letter-spacing: -.03em; }
.module-hero .lead { margin: 0 0 14px; font-size: 16px; }
.ring.lg { width: 140px; height: 140px; } .ring.lg span { width: 112px; height: 112px; font-size: 32px; }
.module-hero.celebrate { animation: pop 1s var(--ease) .3s both; }
.banner { display: flex; gap: 16px; align-items: center; padding: 16px 20px; border-radius: var(--radius); margin-bottom: 18px; flex-wrap: wrap; }
.banner > div { flex: 1; min-width: 200px; }
.banner.success { background: linear-gradient(90deg, var(--brand-soft), transparent); border: 1px solid var(--brand-line); }
.banner.approved { background: linear-gradient(90deg, var(--green-bg), transparent); border: 1px solid color-mix(in srgb, var(--green) 35%, transparent); }
.burst { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: var(--brand-ink); flex-shrink: 0;
  box-shadow: 0 0 0 6px var(--brand-soft), 0 0 34px color-mix(in srgb, var(--brand) 60%, transparent); animation: burstIn .8s var(--ease) .2s both; }
.banner.approved .burst { background: var(--green); box-shadow: 0 0 0 6px var(--green-bg), 0 0 30px color-mix(in srgb, var(--green) 50%, transparent); }
.burst .ico { width: 24px; height: 24px; stroke-width: 2.4; }
@keyframes burstIn { 0% { transform: scale(.2) rotate(-40deg); opacity: 0; } 60% { transform: scale(1.12); opacity: 1; } 100% { transform: none; } }
.ico.draw path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: draw .6s var(--ease) .65s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* Step timeline */
.timeline { list-style: none; padding: 0; margin: 0; position: relative; display: grid; gap: 12px; }
.timeline::before { content: ""; position: absolute; left: 19px; top: 24px; bottom: 24px; width: 2px; background: linear-gradient(var(--line-2), transparent); }
.tl-item { display: flex; gap: 16px; align-items: stretch; position: relative; }
.tl-node { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; margin-top: 14px; display: grid; place-items: center; position: relative; z-index: 1;
  background: var(--card-2); border: 1px solid var(--line-2); font-weight: 600; font-size: 14px; color: var(--text-2); transition: all .4s var(--ease); }
.tl-node .ok { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transform: scale(.4); transition: all .4s var(--ease); }
.tl-node .ok .ico { width: 19px; height: 19px; stroke-width: 2.4; }
.tl-item.is-done .tl-node { background: var(--brand); border-color: var(--brand); color: transparent; box-shadow: 0 0 0 4px var(--brand-soft), 0 0 20px color-mix(in srgb, var(--brand) 45%, transparent); }
.tl-item.is-done .tl-node .ok { opacity: 1; transform: none; color: var(--brand-ink); }
.tl-item.tone-amber .tl-node { border-color: var(--amber); color: var(--amber); }
.tl-item.tone-red .tl-node { border-color: var(--red); color: var(--red); }
.tl-item.tone-blue .tl-node { border-color: var(--brand-line); color: var(--brand-text); }
.tl-card { flex: 1; display: flex; gap: 16px; align-items: center; justify-content: space-between; color: var(--text); padding: 16px 20px; text-decoration: none !important;
  transition: transform .3s var(--ease), border-color .3s; }
.tl-card:hover { transform: translateX(4px); border-color: var(--line-2); }
.tl-main { flex: 1; min-width: 0; } .tl-main strong { font-size: 16px; }
.tl-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.tl-cta { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--brand-text); }
.tl-cta .ico { transition: transform .3s var(--ease); }
.tl-card:hover .tl-cta .ico { transform: translateX(3px); }
@media (max-width: 600px) { .tl-card { flex-direction: column; align-items: flex-start; } .tl-side { flex-direction: row; align-items: center; } }

/* Mini stepper on step pages */
.mini-steps { list-style: none; display: flex; gap: 8px; padding: 0; margin: 0 0 18px; flex-wrap: wrap; }
.mini-steps a { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 99px; border: 1px solid var(--line); background: rgb(var(--tint-rgb) / .02);
  color: var(--muted); font-size: 13px; text-decoration: none !important; transition: all .25s var(--ease); }
.mini-steps a:hover { color: var(--text); border-color: var(--line-2); }
.ms-dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11.5px; font-weight: 700; background: var(--card-2); border: 1px solid var(--line-2); }
.ms-dot .ico { width: 13px; height: 13px; stroke-width: 2.6; }
.mini-steps .tone-green .ms-dot { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.mini-steps .tone-amber .ms-dot { border-color: var(--amber); color: var(--amber); }
.mini-steps .tone-red .ms-dot { border-color: var(--red); color: var(--red); }
.mini-steps .current a { color: var(--heading); border-color: var(--brand-line); background: var(--brand-soft); box-shadow: 0 0 20px color-mix(in srgb, var(--brand) 20%, transparent); }
.ph-title { display: flex; gap: 16px; align-items: flex-start; }

/* Admin: client hero, final review panel, module blocks */
.client-hero { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: center; padding: 26px; margin-bottom: 16px;
  background: radial-gradient(700px 260px at 0 0, var(--brand-soft), transparent 65%), linear-gradient(180deg, rgb(var(--tint-rgb) / .035), rgb(var(--tint-rgb) / .008)), var(--card); }
.client-hero h1 { font-size: clamp(30px, 4vw, 42px); letter-spacing: -.03em; margin: 2px 0 4px; }
.hero-stats { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }
.metric-box { display: grid; gap: 2px; padding-left: 24px; border-left: 1px solid var(--line); }
.review-panel { margin-bottom: 20px; }
.rp-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 14px; }
.rp-modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.rp-mod { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text);
  text-decoration: none !important; transition: border-color .25s, transform .25s var(--ease); }
.rp-mod:hover { border-color: var(--line-2); transform: translateY(-2px); }
.rp-name { flex: 1; display: grid; font-size: 14px; font-weight: 500; }
.rp-mod[data-state="complete"] { border-color: color-mix(in srgb, var(--amber) 45%, transparent); box-shadow: 0 0 22px -6px color-mix(in srgb, var(--amber) 50%, transparent); }
.rp-mod[data-state="approved"] { border-color: var(--brand-line); }
.module-block { display: grid; gap: 10px; scroll-margin-top: 90px; }
.module-block + .module-block { margin-top: 14px; }
.mb-head { display: flex; gap: 14px; align-items: center; padding: 4px 2px; flex-wrap: wrap; }
.mb-title { flex: 1; display: grid; gap: 8px; min-width: 150px; }
.mb-actions { flex-wrap: wrap; }
.grid-2 > *, .grid-2-1 > * { min-width: 0; }
.people li { flex-wrap: wrap; }
.person { min-width: 0; flex: 1; }
.person .small, .person .muted { overflow-wrap: anywhere; } .mb-title h2 { margin: 0; font-size: 19px; }
.mb-actions { display: flex; gap: 8px; align-items: center; }
details.step { transition: border-color .25s; scroll-margin-top: 90px; }
details.step[open] { border-color: var(--line-2); }
details.step summary { transition: background .2s; border-radius: inherit; }
details.step summary:hover { background: rgb(var(--tint-rgb) / .02); }
.mod-dots { display: flex; gap: 5px; margin-top: 10px; }
.mod-dot { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--bg-2); border: 1px solid var(--line); color: var(--muted); }
.mod-dot .ico { width: 14px; height: 14px; }
.mod-dot[data-state="in_progress"] { color: var(--brand-text); border-color: var(--brand-line); }
.mod-dot[data-state="verifying"] { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 40%, transparent); }
.mod-dot[data-state="attention"] { color: var(--red); border-color: color-mix(in srgb, var(--red) 45%, transparent); }
.mod-dot[data-state="complete"] { background: color-mix(in srgb, var(--brand) 25%, transparent); color: var(--brand-text); border-color: var(--brand); }
.mod-dot[data-state="approved"] { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); box-shadow: 0 0 12px color-mix(in srgb, var(--brand) 50%, transparent); }

/* Intake: service tiles, https prefix, switches */
.svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.svc-tile { cursor: pointer; }
.svc-tile input { position: absolute; opacity: 0; pointer-events: none; }
.svc-body { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg-2); transition: all .25s var(--ease); position: relative; height: 100%; }
.svc-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: rgb(var(--tint-rgb) / .04); color: var(--muted); transition: all .25s; flex-shrink: 0; }
.svc-ico .ico { width: 17px; height: 17px; }
.svc-name { font-size: 13.5px; font-weight: 500; color: var(--text-2); line-height: 1.3; padding-right: 18px; }
.svc-tick { position: absolute; top: 8px; right: 8px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: var(--brand-ink);
  opacity: 0; transform: scale(.4); transition: all .3s var(--ease); }
.svc-tick .ico { width: 11px; height: 11px; stroke-width: 3; }
.svc-tile:hover .svc-body { border-color: rgb(var(--tint-rgb) / .2); }
.svc-tile input:checked + .svc-body { border-color: var(--brand-line); background: var(--brand-soft); box-shadow: 0 0 22px -8px color-mix(in srgb, var(--brand) 60%, transparent); }
.svc-tile input:checked + .svc-body .svc-ico { color: var(--brand-text); background: color-mix(in srgb, var(--brand) 16%, transparent); }
.svc-tile input:checked + .svc-body .svc-name { color: var(--heading); }
.svc-tile input:checked + .svc-body .svc-tick { opacity: 1; transform: none; }
.svc-tile input:focus-visible + .svc-body { outline: 2px solid var(--brand); outline-offset: 2px; }
.input-prefix { display: flex; align-items: stretch; border: 1px solid var(--line-2); border-radius: 10px; background: var(--bg-2); overflow: hidden; transition: border-color .15s, box-shadow .15s, opacity .2s; }
.input-prefix:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
.input-prefix .prefix { display: grid; place-items: center; padding: 0 4px 0 12px; color: var(--muted); font-size: 14px; }
.input-prefix input { border: 0; background: transparent; box-shadow: none !important; padding-left: 2px; }
.input-prefix.is-disabled { opacity: .45; }
.check.switch { align-items: center; gap: 12px; }
.check.switch input { appearance: none; -webkit-appearance: none; width: 40px; height: 23px; margin: 0; border-radius: 99px; background: rgb(var(--tint-rgb) / .1); border: 1px solid var(--line-2);
  position: relative; cursor: pointer; transition: background .25s, border-color .25s; flex-shrink: 0; padding: 0; }
.check.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%; background: var(--knob); transition: transform .3s var(--ease), background .25s; }
.check.switch input:checked { background: var(--brand); border-color: var(--brand); box-shadow: 0 0 14px color-mix(in srgb, var(--brand) 45%, transparent); }
.check.switch input:checked::after { transform: translateX(17px); background: #fff; }
.field.is-disabled { opacity: .45; }

/* Count-up numbers render instantly for reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ═══════════════════════ UX pass (v5) ═══════════════════════ */
/* Accessibility */
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--brand); color: var(--brand-ink); padding: 8px 14px; border-radius: 10px; font-weight: 600; transition: top .2s; }
.skip:focus { top: 12px; text-decoration: none; }
.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; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 6px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }
main:focus { outline: none; }

/* Labels as real <label>s */
.field > label, .label-row { font-weight: 500; font-size: 13.5px; color: var(--text-2); }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.label-row a { font-weight: 500; }

/* Password show/hide */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 64px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: transparent; border: 0; color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 600; padding: 6px 8px; border-radius: 7px; cursor: pointer; }
.pw-toggle:hover { color: var(--text); background: var(--gray-bg); }

/* Inline validation */
.has-error input, .has-error select, .has-error textarea, input.has-error { border-color: var(--red) !important; box-shadow: 0 0 0 3px var(--red-bg) !important; }
.check.has-error { outline: 1px solid var(--red); outline-offset: 4px; border-radius: 10px; }
fieldset.has-error .checks { outline: 1px solid var(--red); outline-offset: 6px; border-radius: 8px; }
.field-error { color: var(--red); font-size: 12.5px; display: flex; gap: 6px; align-items: center; animation: rise .3s var(--ease) both; }
@keyframes shake { 0%, 100% { transform: none; } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.shake { animation: shake .35s ease; }

/* Alerts: icon + text + dismiss */
.alert { display: flex; gap: 10px; align-items: flex-start; }
.alert > .ico { margin-top: 2px; }
.alert > span { flex: 1; }
.alert-x { background: none; border: 0; color: inherit; opacity: .6; font-size: 20px; line-height: 1; cursor: pointer; padding: 0 2px; }
.alert-x:hover { opacity: 1; }
.alert.hide { opacity: 0; transform: translateY(-6px); transition: opacity .4s, transform .4s; }

/* Click-to-copy */
.copy-chip { display: inline-flex; align-items: center; gap: 6px; padding: 1px 8px; border-radius: 7px; cursor: pointer; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em;
  color: var(--brand-text); background: var(--brand-soft); border: 1px dashed var(--brand-line); transition: background .2s, border-color .2s; user-select: all; word-break: break-all; }
.copy-chip::after { content: "copy"; font-family: Inter, sans-serif; font-size: 10.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; opacity: .6; }
.copy-chip:hover { background: color-mix(in srgb, var(--brand) 22%, transparent); border-style: solid; }
.copy-chip.copied::after { content: "copied ✓"; opacity: 1; }
.copy-mini { background: none; border: 0; padding: 2px 4px; margin-left: 2px; color: var(--muted); cursor: pointer; border-radius: 6px; vertical-align: middle; opacity: .55; transition: opacity .2s, color .2s; }
dd:hover .copy-mini, .copy-mini:focus-visible { opacity: 1; }
.copy-mini:hover { color: var(--brand-text); }
.copy-mini .ico { width: 14px; height: 14px; }
.copy-mini.copied { color: var(--green); opacity: 1; }

/* Step page */
.help-card { display: flex; gap: 12px; align-items: flex-start; margin-top: 18px; padding: 14px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); }
.save-state { margin-right: auto; display: inline-flex; align-items: center; gap: 6px; transition: color .3s; }
.save-state.saving::before { content: ""; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--muted); border-top-color: transparent; animation: spin .8s linear infinite; }
.save-state.saved { color: var(--brand-text); }
.provider.flash { animation: providerFlash 1.4s var(--ease); }
@keyframes providerFlash { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand) 60%, transparent); } 100% { box-shadow: 0 0 0 10px transparent; } }
.hours [data-copy-hours] { justify-self: start; margin-top: 4px; }
@media (max-width: 900px) {
  [data-step-form] .form-actions { position: sticky; bottom: 0; z-index: 5; margin: 0 -20px -20px; padding: 12px 20px; background: var(--sticky-bg);
    backdrop-filter: blur(10px); border-radius: 0 0 var(--radius) var(--radius); }
}

/* Client home: things needing attention */
.attention-panel { display: flex; gap: 16px; align-items: flex-start; padding: 16px 20px; margin-bottom: 18px; border-radius: var(--radius);
  background: linear-gradient(90deg, var(--red-bg), transparent); border: 1px solid color-mix(in srgb, var(--red) 40%, transparent); }
.attention-panel ul { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 6px; }
.attention-panel li { display: flex; flex-direction: column; }
.attention-panel a { color: var(--heading); font-weight: 500; display: inline-flex; gap: 6px; align-items: center; }
.ap-body { flex: 1; }
.burst.warn { background: var(--red); color: #fff; box-shadow: 0 0 0 6px var(--red-bg), 0 0 30px color-mix(in srgb, var(--red) 45%, transparent); }

/* Intake: stakeholder rows */
.stake-rows { display: grid; gap: 8px; }
.stake-row { display: grid; grid-template-columns: 1fr 1.3fr 1fr auto; gap: 8px; animation: rise .35s var(--ease) both; }
@media (max-width: 600px) { .stake-row { grid-template-columns: 1fr 1fr auto; } .stake-row input:nth-child(3) { grid-column: 1 / 3; } }
.icon-btn { width: 38px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--muted); font-size: 18px; cursor: pointer; }
.icon-btn:hover { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, transparent); }
.add-row { justify-self: start; margin-top: 2px; }

/* Dashboard search */
.search-box { display: flex; align-items: center; gap: 10px; padding: 0 12px; margin-bottom: 12px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--bg-2); color: var(--muted); transition: border-color .2s, box-shadow .2s; }
.search-box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.search-box input { border: 0; background: transparent; box-shadow: none !important; padding: 11px 0; }
kbd { font: 600 11px/1 ui-monospace, monospace; padding: 3px 6px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--muted); }

/* Submit buttons show progress and can't double-submit */
@keyframes spin { to { transform: rotate(360deg); } }
.btn.is-loading { pointer-events: none; opacity: .85; }
.btn.is-loading::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.btn.is-loading .ico { display: none; }

/* Mobile top bar: one compact, swipeable row */
@media (max-width: 720px) {
  .topbar { gap: 10px 14px; padding: 10px 14px; }
  .topbar .logo .tag { display: none; }
  .topbar nav { order: 3; width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -4px; }
  .topbar nav::-webkit-scrollbar { display: none; }
  .topbar nav a { white-space: nowrap; }
  .me-name, .live { display: none !important; }
  .container { padding: 20px 14px 70px; }
  .hero h1 { letter-spacing: -.025em; }
}
.mobile-only { display: none; }
@media (max-width: 900px) { .mobile-only { display: inline-flex; } }
.card-label .jump { margin-left: auto; text-transform: none; letter-spacing: 0; font-size: 12.5px; font-weight: 600; }
#details { scroll-margin-top: 80px; }

/* ═══════════════════════ Up next + client view (v6) ═══════════════════════ */
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand) 70%, transparent); } 80%, 100% { box-shadow: 0 0 0 9px transparent; } }
.un-pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); display: inline-block; flex-shrink: 0; animation: ping 1.8s ease-out infinite; }

/* The Up next spotlight */
.up-next { position: relative; overflow: hidden; padding: 26px 28px; margin-bottom: 20px; border-color: var(--brand-line);
  background: radial-gradient(600px 240px at 0% 0%, color-mix(in srgb, var(--brand) 18%, transparent), transparent 70%),
              linear-gradient(180deg, rgb(var(--tint-rgb) / .045), rgb(var(--tint-rgb) / .01)), var(--card);
  box-shadow: var(--shadow), 0 0 0 1px color-mix(in srgb, var(--brand) 18%, transparent), 0 30px 80px -40px color-mix(in srgb, var(--brand) 70%, transparent); }
.un-glow { position: absolute; right: -80px; top: -80px; width: 260px; height: 260px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--brand) 22%, transparent), transparent); animation: drift 12s ease-in-out infinite alternate; }
.un-label { display: inline-flex; align-items: center; gap: 9px; font-size: 12.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--brand-text); margin-bottom: 14px; }
.un-body { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; position: relative; }
.un-text { flex: 1; min-width: 240px; }
.un-title { font-size: clamp(22px, 2.6vw, 30px); margin: 4px 0 6px; letter-spacing: -.025em; color: var(--heading); }
.un-sub { margin: 0 0 10px; color: var(--text-2); }
.un-note { display: inline-flex; gap: 8px; align-items: flex-start; color: var(--red); }
.un-cta { flex-shrink: 0; min-width: 200px; }
.muted-chip { color: var(--muted); }
.up-next.is-flagged { border-color: color-mix(in srgb, var(--red) 45%, transparent);
  background: radial-gradient(600px 240px at 0% 0%, var(--red-bg), transparent 70%), linear-gradient(180deg, rgb(var(--tint-rgb) / .045), rgb(var(--tint-rgb) / .01)), var(--card); }
.up-next.is-flagged .un-label { color: var(--red); }
.up-next.is-flagged .un-pulse { background: var(--red); }
.up-next.done { border-color: var(--line-2); box-shadow: var(--shadow); }
.up-next.compact { padding: 18px 20px; }
.up-next.compact .un-title { font-size: 20px; }
@media (max-width: 640px) { .un-cta { width: 100%; } .up-next { padding: 20px; } .un-body .mc-icon.xl { width: 52px; height: 52px; border-radius: 15px; } }

/* "Up next" markers on modules, journey and the timeline */
.next-flag { position: absolute; top: -1px; left: 22px; display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px; border-radius: 0 0 9px 9px;
  background: var(--brand); color: var(--brand-ink); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; z-index: 2; }
.next-flag .un-pulse { background: var(--brand-ink); animation: none; }
.next-flag.inline { position: static; border-radius: 99px; margin-bottom: 8px; padding: 3px 10px; }
.module-card.is-next { border-color: var(--brand); box-shadow: var(--shadow), 0 0 0 1px var(--brand), 0 24px 60px -24px color-mix(in srgb, var(--brand) 65%, transparent); }
.module-card.is-next .mc-top { margin-top: 10px; }
.j-node.is-next .j-dot { border-color: var(--brand); color: var(--brand-text); animation: ping 1.8s ease-out infinite; }
.j-node.is-next .j-label { color: var(--brand-text); font-weight: 600; }
.tl-item.is-next .tl-card { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand), 0 18px 44px -20px color-mix(in srgb, var(--brand) 60%, transparent);
  background: radial-gradient(500px 160px at 0 0, var(--brand-soft), transparent 70%), var(--card); }
.tl-item.is-next .tl-node { border-color: var(--brand); color: var(--brand-text); animation: ping 1.8s ease-out infinite; }

/* Step page: what comes after this */
.after-this { display: flex; align-items: center; gap: 9px; margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.after-this strong { color: var(--text-2); }
.banner.pending { background: linear-gradient(90deg, var(--amber-bg), transparent); border: 1px solid color-mix(in srgb, var(--amber) 35%, transparent); }
.banner.pending .burst { background: var(--amber); color: #1a1200; box-shadow: 0 0 0 6px var(--amber-bg), 0 0 28px color-mix(in srgb, var(--amber) 45%, transparent); }
.pager-next { display: inline-flex; flex-direction: column; align-items: flex-end; text-align: right; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--brand-line); background: var(--brand-soft); }
.pager-next:hover { text-decoration: none; background: color-mix(in srgb, var(--brand) 20%, transparent); }

/* Admin: client view entry + client's next step */
.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.next-strip { display: flex; align-items: center; gap: 14px; padding: 14px 18px; margin-bottom: 16px; border-color: var(--brand-line); }
.next-strip.is-flagged { border-color: color-mix(in srgb, var(--red) 40%, transparent); }
.next-strip.is-flagged .un-pulse { background: var(--red); }
.ns-text { flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.ns-text .muted { width: 100%; }
.next-line { margin-top: 6px; display: flex; align-items: center; gap: 7px; color: var(--text-2); }
.next-line .un-pulse { width: 6px; height: 6px; }

/* Client-view banner (staff seeing a client's portal) */
.view-as-bar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; padding: 10px 20px; flex-wrap: wrap;
  background: repeating-linear-gradient(135deg, #3b2a00 0 14px, #352500 14px 28px); border-bottom: 1px solid var(--amber); color: #ffe6a8; }
.va-eye { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--amber); color: #1a1200; flex-shrink: 0; }
.va-text { flex: 1; display: grid; min-width: 220px; }
.va-text strong { color: #fff; }
.va-sub { font-size: 12.5px; color: #f2d58f; }
.va-exit { background: var(--amber); border-color: var(--amber); color: #1a1200; font-weight: 700; }
.va-exit:hover { background: #ffd36b; color: #1a1200; }
.is-view-as .topbar { top: 52px; }
@media (max-width: 720px) { .is-view-as .topbar { top: 0; position: relative; } .view-as-bar { position: relative; } .va-sub { display: none; } }

/* ═══════════════════════ Email settings (v7) ═══════════════════════ */
.email-card { padding: 26px; }
.ec-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.ec-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 26px; align-items: start; }
@media (max-width: 960px) { .ec-grid { grid-template-columns: 1fr; } }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .seg { grid-template-columns: 1fr; } }
.seg-opt { cursor: pointer; }
.seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.seg-opt > span { display: grid; gap: 3px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg-2); transition: all .25s var(--ease); height: 100%; }
.seg-opt small { color: var(--muted); font-size: 12.5px; }
.seg-opt:hover > span { border-color: rgb(var(--tint-rgb) / .2); }
.seg-opt input:checked + span { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand), 0 0 24px -8px color-mix(in srgb, var(--brand) 60%, transparent); }
.seg-opt input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.presets { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip-btn { font: inherit; font-size: 12.5px; padding: 4px 11px; border-radius: 99px; border: 1px solid var(--line-2); background: rgb(var(--tint-rgb) / .03); color: var(--text-2); cursor: pointer; }
.chip-btn:hover { border-color: var(--brand-line); color: var(--brand-text); }
.ok-note { color: var(--brand-text); display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; }
.ec-help .guide { padding: 16px 18px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); }
.ec-help ol { padding-left: 20px; margin: 0 0 12px; display: grid; gap: 8px; font-size: 13.5px; color: var(--text-2); }
.ec-help ol li::marker { color: var(--brand-text); font-weight: 700; }

/* Layout classes must never override the hidden attribute */
[hidden] { display: none !important; }

/* ═══════════════════════ Light theme (toggle; dark is default) ═══════════════════════ */
:root[data-theme="light"] {
  --brand-text: color-mix(in srgb, var(--brand) 58%, #04241d);
  --brand-ink: #032a22;
  --brand-soft: color-mix(in srgb, var(--brand) 12%, transparent);
  --brand-line: color-mix(in srgb, var(--brand) 50%, transparent);
  --brand-2: #1f5c50;
  --bg: #eef6f2; --bg-2: #ffffff; --card: #ffffff; --card-2: #f7fbf9;
  --text: #0c2621; --text-2: #2f4c45; --muted: #5d7770; --heading: #0b231e;
  --tint-rgb: 16 72 62;
  --line: rgb(var(--tint-rgb) / .11); --line-2: rgb(var(--tint-rgb) / .2);
  --green: #0f8a63; --green-bg: rgba(15, 138, 99, .1);
  --amber: #a85f00; --amber-bg: rgba(214, 140, 20, .12);
  --red: #c93434; --red-bg: rgba(201, 52, 52, .09);
  --blue: #1d67c4; --blue-bg: rgba(29, 103, 196, .09);
  --gray-bg: rgb(var(--tint-rgb) / .05);
  --btn-bg: #ffffff; --btn-bg-hover: #f0f7f3;
  --topbar-bg: rgba(238, 246, 242, .82); --announce-bg: #e2efe9; --toast-bg: rgba(255, 255, 255, .97); --sticky-bg: rgba(255, 255, 255, .96);
  --placeholder: #8ba39c; --ring-inner: #ffffff; --knob: #ffffff;
  --grad-a: #127a64; --grad-b: #0b2e27; --grad-c: color-mix(in srgb, var(--brand) 70%, #04241d);
  --glow-strength: 16%; --circuit-opacity: .07;
  --shadow: 0 1px 2px rgb(var(--tint-rgb) / .06), 0 14px 34px -18px rgb(var(--tint-rgb) / .28);
}
:root[data-theme="light"] body::after { animation: none; }
:root[data-theme="light"] .btn.primary { color: #032a22; }
:root[data-theme="light"] .ring { filter: drop-shadow(0 0 10px color-mix(in srgb, var(--brand) 22%, transparent)); }
:root[data-theme="light"] .toast { box-shadow: 0 16px 40px rgb(var(--tint-rgb) / .2); }
:root[data-theme="light"] .check.switch input { background: rgb(var(--tint-rgb) / .14); }
:root[data-theme="light"] .check.switch input:checked { background: var(--brand); }
:root[data-theme="light"] input[type=time]::-webkit-calendar-picker-indicator,
:root[data-theme="light"] input[type=date]::-webkit-calendar-picker-indicator { filter: none; opacity: .6; }
:root[data-theme="light"] .up-next { box-shadow: var(--shadow), 0 0 0 1px color-mix(in srgb, var(--brand) 30%, transparent), 0 26px 60px -34px color-mix(in srgb, var(--brand) 60%, transparent); }
/* Smooth theme switch (not on first paint) */
.theme-anim, .theme-anim * { transition: background-color .35s ease, border-color .35s ease, color .25s ease !important; }

/* Theme toggle button */
.theme-toggle { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--btn-bg);
  color: var(--text-2); cursor: pointer; transition: transform .25s var(--ease), color .2s, border-color .2s; }
.theme-toggle:hover { color: var(--brand-text); border-color: var(--brand-line); transform: rotate(-12deg); }
.theme-toggle .ico { width: 18px; height: 18px; }
.theme-toggle .when-light { display: none; }
:root[data-theme="light"] .theme-toggle .when-light { display: block; }
:root[data-theme="light"] .theme-toggle .when-dark { display: none; }
.theme-toggle.floating { position: fixed; top: 16px; right: 16px; z-index: 40; }

/* Logo (dark & light variants) */
.logo .logo-img { height: 30px; width: auto; display: block; }
.logo.big .logo-img { height: 46px; }
.logo .on-light { display: none; }
:root[data-theme="light"] .logo .on-dark { display: none; }
:root[data-theme="light"] .logo .on-light { display: block; }
@media (max-width: 720px) { .logo .logo-img { height: 24px; } .logo.big .logo-img { height: 38px; } }
.handoff textarea { min-height: 150px; }
.char-count { font-size: 12.5px; color: var(--amber); }
.char-count.ok { color: var(--brand-text); }
.handoff-view { margin-bottom: 16px; }
.handoff-view summary { display: flex; justify-content: space-between; align-items: center; cursor: pointer; list-style: none; gap: 12px; }
.handoff-view summary::-webkit-details-marker { display: none; }
.handoff-text { margin-top: 12px; padding: 14px 16px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); color: var(--text-2); font-size: 14px; }

/* ═══════════════════════ Integrations (v9) ═══════════════════════ */
.integ-card { padding: 26px; }
.integ-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 960px) { .integ-grid { grid-template-columns: 1fr; } }
.integ-group { display: grid; gap: 12px; align-content: start; padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg-2); }
.ig-head { display: flex; gap: 12px; align-items: flex-start; }
.ig-head > div { flex: 1; }
.secret-row { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.guide summary { cursor: pointer; }
.guide ol { padding-left: 20px; margin: 10px 0 0; display: grid; gap: 7px; font-size: 13.5px; color: var(--text-2); }
.guide ol li::marker { color: var(--brand-text); font-weight: 700; }
details.guide { padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2); }
.integ-list { list-style: none; padding: 0; margin: 0 0 4px; display: grid; gap: 8px; }
.integ-list li { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2); }
.il-main { flex: 1; display: grid; min-width: 0; }
.il-main .small { overflow-wrap: anywhere; }
.il-actions { display: flex; flex-wrap: wrap; gap: 6px; flex-shrink: 0; }
.il-actions .btn { white-space: nowrap; }
/* Narrow card (e.g. the side column): buttons go on their own line, lined up under the text */
.integ-list { container-type: inline-size; }
@container (max-width: 460px) {
  .integ-list li { flex-wrap: wrap; row-gap: 8px; }
  .integ-list li > .mc-icon { align-self: flex-start; }
  .il-main { flex-basis: calc(100% - 42px); }
  .il-actions { width: 100%; padding-left: 42px; }
}

/* ═══════════════════════ Scalable dashboard (v10) ═══════════════════════ */
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tiles-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1200px) { .tiles-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .tiles-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .tiles-6 .stat-value { font-size: 30px; } .tiles-6 .stat-head { flex-wrap: wrap; gap: 4px; } .tile-link { min-height: 0; } }
@media (max-width: 340px) { .tiles-6 { grid-template-columns: minmax(0, 1fr); } }
.tile-link { color: var(--text); text-decoration: none !important; min-height: 128px; }
.tile-link:hover { border-color: var(--line-2); }
.tile-link.is-on { border-color: var(--brand); box-shadow: var(--shadow), 0 0 0 1px var(--brand); }
.filter-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 12px 14px; margin-bottom: 14px; }
.filter-bar .search-box { flex: 1 1 280px; margin: 0; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.fsel select { width: auto; min-width: 140px; padding: 8px 30px 8px 10px; font-size: 13.5px; }
.list-meta { display: flex; justify-content: space-between; margin: 2px 4px 8px; gap: 10px; }
.table-card { padding: 0; overflow: hidden; overflow-x: auto; }
@media (max-width: 640px) {
  .filters { flex: 1 1 100%; min-width: 0; }
  .fsel { flex: 1 1 140px; min-width: 0; }
  .fsel select { width: 100%; min-width: 0; }
}
.client-table { font-size: 14px; }
.client-table th { padding: 12px 14px; background: rgb(var(--tint-rgb) / .03); border-bottom: 1px solid var(--line); white-space: nowrap; }
.client-table td { padding: 12px 14px; vertical-align: top; }
.client-table tbody tr { transition: background .15s; }
.client-table tbody tr:hover { background: rgb(var(--tint-rgb) / .04); }
.th-sort { color: var(--muted); display: inline-flex; align-items: center; gap: 4px; text-decoration: none !important; }
.th-sort:hover, .th-sort.on { color: var(--text); }
.th-sort .arr::after { content: "↕"; opacity: .35; font-size: 11px; }
.th-sort.on.asc .arr::after { content: "↑"; opacity: 1; color: var(--brand-text); }
.th-sort.on.desc .arr::after { content: "↓"; opacity: 1; color: var(--brand-text); }
.cell-title { font-weight: 600; color: var(--heading); }
.cell-title:hover { color: var(--brand-text); }
.cell-badges { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 5px; }
.cell-badges:empty { display: none; }
.cell-progress { min-width: 150px; }
.cell-progress .bar { margin-bottom: 5px; }
.cell-progress .mod-dots { margin-top: 6px; }
.cell-progress .mod-dot { width: 20px; height: 20px; border-radius: 6px; }
.cell-progress .mod-dot .ico { width: 11px; height: 11px; }
@media (max-width: 1100px) { .hide-md { display: none; } }
@media (max-width: 640px) { .hide-sm { display: none; } .client-table td, .client-table th { padding: 10px; } }
.pager-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.pager-bar .per, .pager-bar .pages { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.chip-btn.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 700; }
a.chip-btn { text-decoration: none !important; display: inline-block; }

/* ═══════════════════════ Reports (v10) ═══════════════════════ */
/* Chart series tokens, validated (dataviz validator) against each theme's card surface */
:root { --series-1: #00ad8d; --series-2: #3987e5; }
:root[data-theme="light"] { --series-1: #0e9e7f; --series-2: #2a78d6; }
.range-bar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.report-kpis { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(0, 3fr); gap: 14px; margin-bottom: 18px; }
@media (max-width: 1000px) { .report-kpis { grid-template-columns: minmax(0, 1fr); } }
.hero-stat { justify-content: center; }
.hero-figure { font-size: 64px; font-weight: 600; letter-spacing: -.04em; line-height: 1; color: var(--heading); margin: 6px 0; }
.kpi-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 760px) { .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .kpi-grid .stat-value { font-size: 30px; } }
@media (max-width: 340px) { .kpi-grid { grid-template-columns: minmax(0, 1fr); } }
.kpi-grid .stat { min-height: 120px; }
.kpi-grid .stat-value { font-size: 36px; }
.report-grid { gap: 18px; }
.budget-tiles { margin-top: 18px; }
/* Ranked horizontal bars: ≤24px thick, 4px rounded data-end, square at the baseline */
.hbars { display: grid; gap: 10px; }
.hbar { display: grid; grid-template-columns: minmax(130px, 38%) 1fr; gap: 12px; align-items: center; color: var(--text-2); text-decoration: none !important; border-radius: 8px; padding: 2px 4px; }
.hbar:hover, .hbar:focus-visible { background: rgb(var(--tint-rgb) / .05); color: var(--text); }
.hb-label { font-size: 13.5px; }
.hb-track { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hb-fill { display: block; height: 20px; background: var(--series-1); border-radius: 0 4px 4px 0; transition: width .8s var(--ease), filter .2s; animation: barFill 1s var(--ease) both; }
.hbar:hover .hb-fill { filter: brightness(1.12); }
.hb-val { font-size: 13px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.hbars.compact .hb-fill { height: 14px; }
@media (max-width: 560px) { .hbar { grid-template-columns: 1fr; gap: 4px; } }
/* Meter list */
.meters { display: grid; gap: 12px; }
.meter-row { display: grid; grid-template-columns: minmax(150px, 34%) 1fr auto; gap: 12px; align-items: center; border-radius: 8px; padding: 2px 4px; }
.meter-row:hover, .meter-row:focus-visible { background: rgb(var(--tint-rgb) / .05); }
.mr-name { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-2); }
.mr-bar { height: 8px; border-radius: 99px; background: color-mix(in srgb, var(--series-1) 18%, transparent); overflow: hidden; }
.mr-bar span { display: block; height: 100%; background: var(--series-1); border-radius: 99px; animation: barFill 1s var(--ease) both; }
.mr-val { white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .meter-row { grid-template-columns: minmax(0, 1fr) auto; } .mr-bar { grid-column: 1 / -1; grid-row: 2; } }
/* Line chart */
.legend-row { display: flex; gap: 16px; font-size: 12.5px; color: var(--text-2); margin-bottom: 8px; }
.legend-row .lk { display: inline-block; width: 14px; height: 2px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.line-chart { position: relative; height: 220px; }
.line-chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.line-chart .grid line { stroke: var(--line); stroke-width: 1; }
.line-chart .axis text { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.line-chart .s1 { stroke: var(--series-1); } .line-chart .s2 { stroke: var(--series-2); }
.line-chart path.line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.line-chart circle { stroke: var(--card); stroke-width: 2; }
.line-chart circle.s1 { fill: var(--series-1); } .line-chart circle.s2 { fill: var(--series-2); }
.line-chart .xhair { stroke: var(--muted); stroke-width: 1; opacity: 0; }
.line-chart.hover .xhair { opacity: .6; }
.table-view { margin-top: 10px; }
.table-view summary { cursor: pointer; color: var(--muted); }
.mini-t td, .mini-t th { padding: 6px 8px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.report-table th { white-space: nowrap; }
.report-table td { vertical-align: middle; }
.tc-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 16px 16px 6px; flex-wrap: wrap; }
.inline-meter { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.inline-meter .bar { flex: 1; height: 6px; }
/* Shared tooltip */
.viz-tip { position: fixed; z-index: 60; pointer-events: none; background: var(--toast-bg); border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 10px; font-size: 12.5px;
  color: var(--text-2); box-shadow: 0 12px 30px rgba(0,0,0,.35); max-width: 280px; opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s; }
.viz-tip.on { opacity: 1; transform: none; }
.viz-tip .tv { color: var(--heading); font-weight: 700; font-size: 14px; }
.viz-tip .row { display: flex; align-items: center; gap: 8px; }
.viz-tip .lk { width: 12px; height: 2px; border-radius: 2px; }

/* Dashboard: full-width table at scale; queue + activity side by side underneath */
.dash-grid { grid-template-columns: 1fr; }
.dash-grid > aside { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; align-items: start; }
@media (max-width: 900px) { .dash-grid > aside { grid-template-columns: 1fr; } }

/* ═══════════════════════ Lifecycle, notes, support, offboarding (v12) ═══════════════════════ */
/* Violet = Fulfillment and notes. Status meaning always comes with a label or icon, never color alone. */
:root { --violet: #b9a2ff; --violet-bg: rgba(185, 162, 255, .13); }
:root[data-theme="light"] { --violet: #6a45d1; --violet-bg: rgba(106, 69, 209, .09); }
.badge.violet { color: var(--violet); background: var(--violet-bg); border-color: color-mix(in srgb, var(--violet) 28%, transparent); }
a.badge { text-decoration: none !important; }
.badge.tiny { font-size: 11px; padding: 1px 8px; gap: 4px; }
.badge.tiny::before { display: none; }
.badge .ico { width: 13px; height: 13px; }
.badge:has(> .ico)::before { display: none; } /* the icon already marks it */
/* Side-column contact lists: actions get their own row so nothing overlaps */
aside .people li { flex-direction: column; align-items: stretch; gap: 6px; }
aside .people .actions { padding-left: 48px; }
.tone-blue { --seg: var(--blue); } .tone-violet { --seg: var(--violet); } .tone-green { --seg: var(--brand); }
.tone-gray { --seg: var(--muted); } .tone-red { --seg: var(--red); } .tone-amber { --seg: var(--amber); }

/* Journey stages: Onboarding → Fulfillment → Live */
.stages { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; container-type: inline-size; }
/* Steps size to their text and never overlap: descriptions wrap first, then hide, then only the current step keeps its label */
.stage { display: flex; align-items: center; gap: 10px; flex: 1 1 auto; }
.stage:last-child { flex: 0 1 auto; }
.stage:not(:last-child)::after { content: ""; flex: 1; min-width: 18px; height: 2px; margin: 0 12px; border-radius: 2px; background: var(--line-2); }
.stage[data-state="done"]:not(:last-child)::after { background: linear-gradient(90deg, var(--brand), color-mix(in srgb, var(--brand) 40%, transparent)); }
.stage-dot { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; color: var(--muted); background: var(--bg-2); border: 1px solid var(--line-2); transition: all .4s var(--ease); }
.stage-dot .ico { width: 17px; height: 17px; }
.stage-text { display: flex; flex-direction: column; line-height: 1.25; }
.stage-text strong { font-size: 14px; color: var(--text-2); font-weight: 600; white-space: nowrap; }
.stage-text .muted { font-size: 12px; text-wrap: balance; }
@container (max-width: 470px) {
  .stage-text .muted { display: none; }
  .stage-text strong { font-size: 12.5px; }
  .stage { gap: 7px; } .stage:not(:last-child)::after { margin: 0 7px; min-width: 8px; }
  .stage-dot { width: 28px; height: 28px; } .stage-dot .ico { width: 15px; height: 15px; }
}
@container (max-width: 360px) {
  .stage-text strong { font-size: 12px; }
  .stage { gap: 6px; } .stage:not(:last-child)::after { margin: 0 6px; min-width: 6px; }
}
@container (max-width: 290px) {
  .stage:not([aria-current]) .stage-text { display: none; }
}
.stage[data-state="done"] .stage-dot { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); box-shadow: 0 0 18px color-mix(in srgb, var(--brand) 45%, transparent); }
.stage[data-state="done"] .stage-dot .ico { stroke-width: 2.4; }
.stage[data-state="current"] .stage-dot { border-color: var(--brand); color: var(--brand-text); background: var(--brand-soft); animation: ping 2.4s infinite; }
.stage[data-state="current"] strong, .stage[data-state="done"] strong { color: var(--heading); }
.stages.compact .stage-dot { width: 26px; height: 26px; } .stages.compact .stage-dot .ico { width: 14px; height: 14px; }
.stages.compact .stage-text strong { font-size: 12.5px; }
.stages.compact .stage:not(:last-child)::after { margin: 0 8px; min-width: 12px; }
@media (max-width: 640px) {
  .stage-text .muted { display: none; }
  .stage-text strong { font-size: 12px; }
  .stage { gap: 7px; } .stage:not(:last-child)::after { margin: 0 7px; min-width: 8px; }
  .stage-dot { width: 28px; height: 28px; } .stage-dot .ico { width: 15px; height: 15px; }
}
.hero-top { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.hero-top .stages { width: min(440px, 100%); }

/* Notes: two-way threads; anything new from the other side glows violet until it's opened */
.has-new-note { border-color: color-mix(in srgb, var(--violet) 55%, transparent) !important;
  box-shadow: var(--shadow), 0 0 0 1px color-mix(in srgb, var(--violet) 38%, transparent), 0 22px 54px -30px color-mix(in srgb, var(--violet) 80%, transparent) !important; }
.has-new-note.note-pulse { animation: noteGlow 1.4s var(--ease) 2; }
@keyframes noteGlow { 50% { box-shadow: var(--shadow), 0 0 0 4px color-mix(in srgb, var(--violet) 35%, transparent), 0 0 44px color-mix(in srgb, var(--violet) 45%, transparent); } }
tr.has-new-note { box-shadow: none !important; }
tr.has-new-note td { background: color-mix(in srgb, var(--violet) 6%, transparent); }
tr.has-new-note td:first-child { box-shadow: inset 3px 0 0 var(--violet); }
.notes-title { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.notes-title > div { flex: 1; min-width: 0; }
.notes-title h3 { font-size: 17px; }
.note-list { list-style: none; margin: 0; padding: 0 2px 0 0; display: grid; gap: 12px; max-height: 440px; overflow-y: auto; overscroll-behavior: contain; }
.note { display: flex; gap: 9px; align-items: flex-end; animation: rise .35s var(--ease) both; }
.note.mine { flex-direction: row-reverse; }
.avatar.sm { width: 28px; height: 28px; border-radius: 9px; font-size: 11px; }
.note.side-team .avatar { color: var(--violet); background: var(--violet-bg); border-color: color-mix(in srgb, var(--violet) 30%, transparent); }
.note-bubble { max-width: min(86%, 560px); padding: 9px 13px 10px; border-radius: 16px; background: rgb(var(--tint-rgb) / .05); border: 1px solid var(--line); min-width: 0; }
.note.theirs .note-bubble { border-bottom-left-radius: 5px; }
.note.mine .note-bubble { border-bottom-right-radius: 5px; background: var(--brand-soft); border-color: var(--brand-line); }
.note.is-new .note-bubble { background: var(--violet-bg); border-color: color-mix(in srgb, var(--violet) 50%, transparent); }
.note-meta { font-size: 12px; margin-bottom: 3px; line-height: 1.45; }
.note-meta strong { color: var(--heading); font-weight: 600; }
.note-meta .badge { margin-left: 6px; }
.note.mine .note-meta { text-align: right; }
.note-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; line-height: 1.5; color: var(--text); }
.note-empty { margin: 0 0 4px; }
.note-form { display: grid; gap: 8px; margin-top: 14px; }
.note-form textarea { min-height: 48px; max-height: 260px; resize: vertical; line-height: 1.5; }
.note-actions { display: flex; gap: 12px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.note-actions .check { margin-right: auto; font-size: 13px; }
.note-hint { font-size: 12px; }
@media (hover: none), (max-width: 640px) { .note-hint { display: none; } }
.note-flag { display: inline-flex; gap: 6px; align-items: center; color: var(--violet); font-size: 13px; font-weight: 600; margin: 8px 0 0; }
.note-flag .ico { width: 16px; height: 16px; }
.module-card .note-flag { margin: -6px 0 14px; }
.note-count { display: inline-flex; gap: 4px; align-items: center; margin-top: 6px; }
.note-count .ico { width: 14px; height: 14px; }
summary .note-count { margin: 0; }
.step-notes { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line-2); }
.sn-label { display: flex; gap: 6px; align-items: center; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 10px; }
.sn-label .ico { width: 15px; height: 15px; }
.step-note-links { list-style: none; padding: 0; margin: -4px 0 12px; display: grid; gap: 2px; }
.step-note-links a { display: flex; gap: 7px; align-items: center; padding: 6px 8px; border-radius: 9px; color: var(--text-2); font-size: 13.5px; text-decoration: none !important; }
.step-note-links a:hover { background: rgb(var(--tint-rgb) / .05); color: var(--heading); }
.step-note-links .ico { width: 15px; height: 15px; color: var(--muted); }
.inbox-panel { display: flex; gap: 16px; align-items: flex-start; padding: 16px 20px; margin-bottom: 18px; border-radius: var(--radius); color: var(--text);
  background: linear-gradient(90deg, var(--violet-bg), transparent); border: 1px solid color-mix(in srgb, var(--violet) 40%, transparent); text-decoration: none !important; }
.inbox-panel ul { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 6px; }
.inbox-panel a { color: var(--heading); font-weight: 500; display: inline-flex; gap: 6px; align-items: center; }
.inbox-panel.staff { align-items: center; transition: transform .25s var(--ease), box-shadow .25s; }
.inbox-panel.staff:hover { transform: translateY(-2px); box-shadow: 0 18px 44px -24px color-mix(in srgb, var(--violet) 80%, transparent); }
.inbox-panel.staff .ap-body { display: flex; flex-direction: column; }
.burst.msg { background: var(--violet); color: #160b33; box-shadow: 0 0 0 6px var(--violet-bg), 0 0 30px color-mix(in srgb, var(--violet) 45%, transparent); }
.inbox-list { list-style: none; padding: 0; margin: 0; }
.inbox-list li { border-top: 1px solid var(--line); }
.inbox-list li:first-child { border-top: 0; }
.inbox-list a { display: block; padding: 9px 0; color: var(--text); text-decoration: none !important; }
.inbox-list a:hover strong { color: var(--brand-text); }
.inbox-body { display: block; color: var(--text-2); font-size: 13.5px; margin-top: 2px; overflow-wrap: anywhere; }

/* Support: Slack, call, text, notes */
.support-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.support-head strong { color: var(--heading); }
.support-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.support.compact .support-actions { grid-template-columns: 1fr; }
.sa { display: flex; gap: 11px; align-items: center; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgb(var(--tint-rgb) / .03);
  color: var(--text); text-decoration: none !important; transition: border-color .2s, background .2s, transform .2s var(--ease); min-width: 0; }
.sa:hover { border-color: var(--brand-line); background: var(--brand-soft); transform: translateY(-1px); }
.sa > span:last-child { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.sa strong { font-weight: 600; font-size: 14px; color: var(--heading); }
.sa small { font-size: 12px; overflow-wrap: anywhere; }
.sa-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; background: var(--brand-soft); color: var(--brand-text); }
.sa-ico .ico { width: 18px; height: 18px; }
.sa-ico.slack { background: rgba(224, 30, 90, .1); color: #ecb22e; }
:root[data-theme="light"] .sa-ico.slack { background: #f6ecf6; color: #611f69; }
.help-card { display: block; }
.slack-join { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin: 0 0 16px; border-radius: 12px; border: 1px solid var(--brand-line);
  background: var(--brand-soft); color: var(--text); text-decoration: none !important; transition: transform .2s var(--ease); }
.slack-join:hover { transform: translateY(-1px); }
.slack-join > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.slack-join > .ico { color: var(--brand-text); width: 18px; height: 18px; }
.compact-people { margin: 14px 0 0; padding-top: 4px; border-top: 1px solid var(--line); }
.compact-people li { padding: 8px 0; }

/* Floating Help button on every client page */
.help-fab { position: fixed; right: 20px; bottom: 20px; z-index: 60; }
.help-fab > summary { list-style: none; display: inline-flex; align-items: center; gap: 8px; padding: 11px 17px 11px 13px; border-radius: 99px; cursor: pointer;
  background: var(--brand); color: var(--brand-ink); font-weight: 600; font-size: 14.5px; user-select: none;
  box-shadow: 0 14px 34px -10px color-mix(in srgb, var(--brand) 75%, transparent), 0 2px 8px rgba(0, 0, 0, .3); transition: transform .2s var(--ease), box-shadow .2s; }
.help-fab > summary::-webkit-details-marker { display: none; }
.help-fab > summary:hover { transform: translateY(-2px); }
.help-fab > summary:focus-visible { outline: 3px solid var(--brand-line); outline-offset: 3px; }
.help-fab > summary .ico { width: 20px; height: 20px; }
.help-fab[open] > summary { box-shadow: 0 0 0 4px var(--brand-soft), 0 14px 34px -10px color-mix(in srgb, var(--brand) 75%, transparent); }
.help-panel { position: absolute; right: 0; bottom: calc(100% + 12px); width: min(330px, calc(100vw - 28px)); padding: 16px; border-radius: 18px;
  background: var(--card); border: 1px solid var(--line-2); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .65); animation: rise .25s var(--ease) both; }
.hp-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }
.hp-head strong { color: var(--heading); font-size: 16px; }
@media (max-width: 640px) { .help-fab { right: 14px; bottom: 14px; } .help-fab > summary { padding: 13px; } .help-fab > summary span { display: none; } }
@media (max-width: 900px) { body:has([data-step-form]) .help-fab { bottom: 86px; } }
@media print { .help-fab { display: none; } }

/* Dialogs */
dialog.modal, dialog.celebrate-dialog { border: 1px solid var(--line-2); border-radius: 22px; background: var(--card); color: var(--text); padding: 24px;
  width: min(520px, calc(100vw - 28px)); max-height: calc(100vh - 40px); overflow: auto; box-shadow: 0 40px 110px -24px rgba(0, 0, 0, .75); }
dialog::backdrop { background: rgba(2, 10, 8, .64); backdrop-filter: blur(5px); }
:root[data-theme="light"] dialog::backdrop { background: rgba(14, 40, 34, .32); }
dialog[open] { animation: dialogIn .38s var(--ease) both; }
@keyframes dialogIn { from { opacity: 0; transform: translateY(14px) scale(.97); } }
.modal-head { display: flex; gap: 12px; align-items: center; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 4px; }
.mc-icon.danger-ico { color: var(--red); background: var(--red-bg); border-color: color-mix(in srgb, var(--red) 30%, transparent); box-shadow: none; }
.ob-preview { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.ob-preview span { margin-left: 8px; }

/* Admin: lifecycle bar */
.lc-bar { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px; align-items: center; margin-bottom: 18px; }
@media (max-width: 1000px) { .lc-bar { grid-template-columns: minmax(0, 1fr); } }
.lc-bar[data-status="closed"] { border-color: color-mix(in srgb, var(--red) 30%, transparent); }
.lc-bar[data-status="paused"], .lc-bar[data-status="archived"] { border-style: dashed; }
.lc-bar:is([data-status="closed"], [data-status="archived"], [data-status="paused"]) .lc-track { filter: grayscale(.85); opacity: .6; }
.lc-bar:is([data-status="closed"], [data-status="archived"], [data-status="paused"]) .stage-dot { animation: none; }
.lc-side { display: grid; gap: 12px; }
.lc-state { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.lc-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.lc-actions form { margin: 0; }
.lc-auto { display: inline-flex; gap: 6px; align-items: center; flex-basis: 100%; }
.lc-auto .ico { width: 15px; height: 15px; color: var(--brand-text); }
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary .ico { width: 14px; height: 14px; transform: rotate(90deg); transition: transform .2s var(--ease); }
.menu[open] > summary .ico { transform: rotate(-90deg); }
.menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 230px; padding: 6px; border-radius: 14px; display: grid; gap: 2px;
  background: var(--card); border: 1px solid var(--line-2); box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .6); animation: rise .2s var(--ease) both; }
@media (max-width: 1000px) { .menu-list { right: auto; left: 0; } }
.menu-list form { margin: 0; }
.menu-list .btn { width: 100%; justify-content: flex-start; }
.btn.link { border-color: transparent; background: transparent; box-shadow: none; color: var(--text-2); }
.btn.link:hover { background: rgb(var(--tint-rgb) / .06); color: var(--heading); transform: none; }
.btn.link.danger { color: var(--red); }

/* Admin: offboarding checklist */
.offboard-panel { margin-bottom: 18px; border-color: color-mix(in srgb, var(--red) 28%, transparent);
  background: radial-gradient(640px 220px at 0 0, var(--red-bg), transparent 70%), linear-gradient(180deg, rgb(var(--tint-rgb) / .035), rgb(var(--tint-rgb) / .008)), var(--card); }
.ob-head { display: flex; gap: 18px; align-items: center; margin-bottom: 18px; }
.ob-head .ring { width: 86px; height: 86px; flex-shrink: 0; }
.ob-head .ring span { width: 68px; height: 68px; font-size: 18px; }
.ob-title { flex: 1; min-width: 0; }
.ob-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 800px) { .ob-groups { grid-template-columns: minmax(0, 1fr); } }
.ob-group { padding: 12px 12px 8px; border-radius: 14px; border: 1px solid var(--line); background: rgb(var(--tint-rgb) / .02); }
.ob-group h4 { margin: 2px 6px 6px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); }
.ob-item { margin: 0; }
.ob-check { all: unset; box-sizing: border-box; display: flex; gap: 11px; align-items: flex-start; width: 100%; padding: 8px 6px; border-radius: 10px; cursor: pointer; color: var(--text); }
.ob-check:hover { background: rgb(var(--tint-rgb) / .05); }
.ob-check:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.ob-box { width: 21px; height: 21px; border-radius: 7px; border: 1.5px solid var(--line-2); display: grid; place-items: center; flex-shrink: 0; margin-top: 1px; transition: all .25s var(--ease); }
.ob-box .ico { width: 14px; height: 14px; stroke-width: 2.8; opacity: 0; transform: scale(.4); transition: all .3s var(--ease); }
.ob-item.is-done .ob-box { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.ob-item.is-done .ob-box .ico { opacity: 1; transform: none; }
.ob-text { display: flex; flex-direction: column; gap: 1px; font-size: 14px; line-height: 1.4; }
.ob-item.is-done .ob-label { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 55%, transparent); }
.ob-action { margin: 0 0 8px 38px; }

/* Admin: fulfillment build tracks */
.build-panel { margin-bottom: 18px; border-color: color-mix(in srgb, var(--violet) 30%, transparent);
  background: radial-gradient(640px 220px at 0 0, var(--violet-bg), transparent 70%), linear-gradient(180deg, rgb(var(--tint-rgb) / .035), rgb(var(--tint-rgb) / .008)), var(--card); }
.bp-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 14px; }
.bp-golive[hidden] { display: none; }
.bp-undone { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--amber) 40%, transparent); background: color-mix(in srgb, var(--amber) 8%, transparent); font-size: 13.5px; }
.bp-undone .mc-icon { color: var(--amber); }
.bp-undone strong { color: var(--heading); }
.bp-golive.pop-in { animation: pop-in .45s var(--ease); }
.ask-dialog { max-width: 460px; }
.track-rows { display: grid; gap: 8px; }
.track-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgb(var(--tint-rgb) / .02); transition: border-color .3s; }
.tr-main { display: flex; flex-direction: column; min-width: 0; }
.tr-main strong { color: var(--heading); }
.track-row[data-state="done"] { border-color: var(--brand-line); }
.track-row[data-state="done"] .mc-icon { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.track-row[data-state="in_progress"] { border-color: color-mix(in srgb, var(--violet) 40%, transparent); }
.track-row[data-state="in_progress"] .mc-icon { color: var(--violet); background: var(--violet-bg); border-color: color-mix(in srgb, var(--violet) 40%, transparent); }
.track-row[data-state="skipped"] .tr-main { opacity: .55; }
.seg { display: inline-flex; gap: 2px; padding: 3px; margin: 0; border-radius: 11px; background: rgb(var(--tint-rgb) / .05); border: 1px solid var(--line); }
.seg-btn { all: unset; cursor: pointer; padding: 6px 11px; border-radius: 8px; font-size: 12.5px; font-weight: 500; color: var(--muted); transition: background .2s, color .2s; white-space: nowrap; }
.seg-btn:hover { color: var(--text); }
.seg-btn:focus-visible { outline: 2px solid var(--brand); }
.seg-btn.on { background: var(--card-2); color: var(--heading); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.track-row[data-state="done"] .seg-btn.on { background: var(--brand); color: var(--brand-ink); }
.track-row[data-state="in_progress"] .seg-btn.on { background: var(--violet); color: #170c35; }
@media (max-width: 700px) { .track-row { grid-template-columns: auto minmax(0, 1fr); } .track-row .seg { grid-column: 1 / -1; justify-self: start; } }

/* Portal: after onboarding (Fulfillment / Live) */
.done-hero { position: relative; overflow: hidden; padding: 28px; margin-bottom: 18px; border-color: var(--brand-line);
  background: radial-gradient(900px 320px at 50% -20%, var(--brand-soft), transparent 70%), linear-gradient(180deg, rgb(var(--tint-rgb) / .035), rgb(var(--tint-rgb) / .008)), var(--card); }
.done-hero.is-live { background: radial-gradient(900px 320px at 50% -20%, color-mix(in srgb, var(--brand) 22%, transparent), transparent 70%), linear-gradient(180deg, rgb(var(--tint-rgb) / .035), rgb(var(--tint-rgb) / .008)), var(--card); }
.dh-glow { position: absolute; inset: -60% -20%; pointer-events: none; opacity: .09;
  background: conic-gradient(from 0deg, transparent 0 20%, var(--brand) 26%, transparent 34% 60%, var(--violet) 66%, transparent 74%); animation: spin 26s linear infinite; }
.dh-top { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.dh-top .stages { flex: 1 1 360px; max-width: 600px; }
.dh-body { position: relative; display: flex; gap: 22px; align-items: center; }
.dh-body h1 { font-size: clamp(32px, 4.6vw, 52px); margin: 0 0 8px; letter-spacing: -.035em; line-height: 1.05; }
.dh-body .lead { margin: 0; max-width: 680px; }
.dh-burst { width: 78px; height: 78px; border-radius: 24px; display: grid; place-items: center; flex-shrink: 0; background: var(--brand); color: var(--brand-ink);
  box-shadow: 0 0 0 8px var(--brand-soft), 0 0 54px color-mix(in srgb, var(--brand) 60%, transparent); animation: burstIn .9s var(--ease) .15s both; }
.dh-burst .ico { width: 38px; height: 38px; stroke-width: 2; }
.dh-burst.big { width: 92px; height: 92px; margin: 4px auto 16px; }
@media (max-width: 640px) { .done-hero { padding: 20px; } .dh-body { flex-direction: column; align-items: flex-start; gap: 14px; } .dh-burst { width: 58px; height: 58px; border-radius: 18px; } .dh-burst .ico { width: 28px; height: 28px; } }
.build-meter { height: 8px; border-radius: 99px; background: rgb(var(--tint-rgb) / .07); overflow: hidden; margin: -2px 0 16px; }
.build-meter span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--violet), var(--brand)); animation: barFill 1.2s var(--ease) both; }
.track-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1100px) { .track-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .track-grid { grid-template-columns: minmax(0, 1fr); } }
.track-card { position: relative; display: flex; flex-direction: column; padding: 20px; min-height: 214px; overflow: hidden; transition: border-color .4s, transform .35s var(--ease); }
.tc-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.tc-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: auto; }
.tc-steps span { height: 5px; border-radius: 99px; background: rgb(var(--tint-rgb) / .08); transition: background .4s; }
.tc-steps span.on { background: var(--violet); }
.track-card[data-state="not_started"] .tc-steps span.on { background: color-mix(in srgb, var(--muted) 60%, transparent); }
.track-card[data-state="in_progress"] { border-color: color-mix(in srgb, var(--violet) 42%, transparent); }
.track-card[data-state="in_progress"] .mc-icon { color: var(--violet); background: var(--violet-bg); border-color: color-mix(in srgb, var(--violet) 40%, transparent); }
.track-card[data-state="in_progress"] .tc-steps span.on:nth-child(2) { animation: building 1.8s ease-in-out infinite; }
@keyframes building { 50% { opacity: .45; } }
.track-card[data-state="done"] { border-color: var(--brand-line);
  background: radial-gradient(500px 200px at 100% 0, var(--brand-soft), transparent 70%), linear-gradient(180deg, rgb(var(--tint-rgb) / .035), rgb(var(--tint-rgb) / .008)), var(--card); }
.track-card[data-state="done"] .tc-steps span.on { background: var(--brand); }
.track-card[data-state="done"] .mc-check { opacity: 1; transform: none; }
.track-card[data-state="done"] .badge { margin-right: 40px; }
.track-card[data-state="skipped"] { opacity: .55; }
.track-card.just-done { animation: pop .9s var(--ease); }
.mini-mods { display: grid; gap: 2px; }
.mini-mod { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 10px; color: var(--text); text-decoration: none !important; }
.mini-mod:hover { background: rgb(var(--tint-rgb) / .05); }
.mini-mod > span:nth-child(2) { flex: 1; }
.mini-mod > .ico { width: 16px; height: 16px; color: var(--brand-text); }
.paused-banner { background: linear-gradient(90deg, var(--gray-bg), transparent); border: 1px dashed var(--line-2); }
.paused-banner .burst { background: var(--muted); color: var(--bg); box-shadow: none; }
.closed-card { max-width: 660px; margin: 30px auto; padding: 36px; }
.closed-card .lead { text-align: center; }
.celebrate-dialog { text-align: center; width: min(560px, calc(100vw - 28px)) !important; }
.celebrate-dialog h2 { font-size: 28px; margin: 0 0 6px; letter-spacing: -.02em; }
.cd-list { list-style: none; padding: 0; margin: 18px 0 22px; display: grid; gap: 8px; text-align: left; }
.cd-list li { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; background: rgb(var(--tint-rgb) / .04); border: 1px solid var(--line); animation: rise .5s var(--ease) both; }
.cd-list li:nth-child(1) { animation-delay: .25s; } .cd-list li:nth-child(2) { animation-delay: .4s; } .cd-list li:nth-child(3) { animation-delay: .55s; } .cd-list li:nth-child(4) { animation-delay: .7s; }
.cd-list li > span:last-child { display: flex; flex-direction: column; line-height: 1.35; }
.cd-list strong { color: var(--heading); }
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 1000; }

/* Dashboard + reports: lifecycle strip (each segment is a filter) */
.lc-strip { display: flex; align-items: stretch; gap: 8px; margin: 0 0 16px; flex-wrap: wrap; }
.lc-seg { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--card);
  color: var(--text); text-decoration: none !important; transition: border-color .2s, transform .2s var(--ease), box-shadow .2s; flex: 1 1 150px; min-width: 0; }
.lc-seg:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--seg) 45%, transparent); }
.lc-seg.is-on { border-color: var(--seg); box-shadow: 0 0 0 1px var(--seg); }
.lc-seg.minor { flex: 0 1 auto; }
.lc-seg.minor .lc-num { font-size: 18px; }
.lc-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; background: color-mix(in srgb, var(--seg) 14%, transparent); color: var(--seg); }
.lc-ico .ico { width: 16px; height: 16px; }
.lc-num { font-size: 22px; font-weight: 600; color: var(--heading); font-variant-numeric: tabular-nums; letter-spacing: -.02em; line-height: 1; }
.lc-name { font-size: 13px; color: var(--muted); white-space: nowrap; }
.lc-arrow { display: grid; place-items: center; color: var(--muted); }
.lc-arrow .ico { width: 16px; height: 16px; }
@media (max-width: 900px) { .lc-arrow { display: none; } .lc-seg, .lc-seg.minor { flex: 1 1 140px; } }
.lc-strip.in-card { margin: 4px 0 16px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.lc-strip.in-card .lc-arrow { display: none; }
@media (max-width: 560px) { .lc-strip.in-card { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.mini-kpis .unit { font-size: 14px; margin-left: 3px; color: var(--muted); font-weight: 500; }
.lc-strip.in-card .lc-seg { flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px 12px; background: rgb(var(--tint-rgb) / .02); box-shadow: inset 0 2px 0 var(--seg); }
.lc-strip.in-card .lc-seg.minor .lc-num { font-size: 22px; }
.mini-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mini-kpis > div { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); }
.mini-kpis strong { font-size: 26px; color: var(--heading); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .mini-kpis { grid-template-columns: minmax(0, 1fr); } }
.integ-log summary { cursor: pointer; margin-top: 10px; }
.toast.violet { border-color: color-mix(in srgb, var(--violet) 50%, transparent); box-shadow: 0 16px 40px -12px color-mix(in srgb, var(--violet) 45%, transparent); }
.toast.blue { border-color: color-mix(in srgb, var(--blue) 45%, transparent); }
.celebrate-dialog::backdrop { backdrop-filter: none; background: rgba(2, 10, 8, .5); }
.home-bottom { align-items: start; }
.nowrap { white-space: nowrap; }
.bar.build span { background: linear-gradient(90deg, var(--violet), var(--brand)); }
.hero-chips { justify-content: center; margin-top: 16px; }
.hero-chips.left { justify-content: flex-start; margin-top: 12px; }
.hero-chips .chip { font-size: 13px; padding: 5px 12px; }
.hero-chips .ico { width: 15px; height: 15px; color: var(--brand-text); }
/* Room at the bottom of client pages so the floating Help button never covers content */
body.is-client main { padding-bottom: 84px; }
@media (max-width: 560px) { .section-title { flex-direction: column; align-items: flex-start; gap: 2px; } }

/* ═══════════════════════ Access levels (v13) ═══════════════════════ */
.level-chip { margin-left: 6px; vertical-align: 1px; }
.level-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
@media (max-width: 800px) { .level-grid { grid-template-columns: minmax(0, 1fr); } }
.level-card { padding: 14px 16px; box-shadow: inset 0 2px 0 var(--seg), var(--shadow); }
.role-form { margin: 0; }
.role-form select { width: auto; min-width: 110px; padding: 6px 28px 6px 10px; font-size: 13px; }
.locked-note { display: flex; gap: 12px; align-items: flex-start; }
.locked-note strong { color: var(--heading); }
.menu-note { display: flex; gap: 6px; align-items: center; padding: 8px 10px 4px; border-top: 1px solid var(--line); margin-top: 4px; }
.menu-note .ico { width: 14px; height: 14px; }
.lc-actions .muted .ico { width: 14px; height: 14px; vertical-align: -2px; }
.auto-golive { display: flex; gap: 10px; align-items: flex-start; margin: 2px 0 0; }
.auto-golive > .ico { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; color: var(--brand-text); }

/* ───────────── v14: sidebar layout, Overview, client header, quick finder ───────────── */
/* Monogram avatars: a stable hue per name (--h) */
.avatar[style*="--h"] { color: hsl(var(--h) 75% 78%); background: hsl(var(--h) 55% 50% / .16); border-color: hsl(var(--h) 60% 60% / .32); }
:root[data-theme="light"] .avatar[style*="--h"] { color: hsl(var(--h) 60% 30%); background: hsl(var(--h) 60% 50% / .12); border-color: hsl(var(--h) 50% 45% / .25); }
.avatar.sm { width: 30px; height: 30px; border-radius: 9px; font-size: 11.5px; }
.avatar.xs { width: 24px; height: 24px; border-radius: 7px; font-size: 10px; letter-spacing: .02em; }
.key-star { color: var(--amber); font-size: 15px; line-height: 1; }
.ibtn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; padding: 0; transition: background .15s, color .15s, border-color .15s; }
.ibtn:hover { color: var(--heading); background: var(--gray-bg); border-color: var(--line); }
.ibtn .ico { width: 18px; height: 18px; }

/* Shell */
.app-shell { display: grid; grid-template-columns: 268px minmax(0, 1fr); min-height: 100vh; }
.app-main { min-width: 0; display: flex; flex-direction: column; }
.app-main > .container { width: 100%; max-width: 1260px; padding-top: 28px; flex: 1; }

.mobile-bar .logo .tag { display: none; }

.sb-filter { width: 104px; padding: 4px 8px !important; font-size: 12px !important; border-radius: 7px !important; text-transform: none; letter-spacing: 0; font-weight: 400; }
.sb-list { flex: 1; overflow-y: auto; overscroll-behavior: contain; margin: 0 -4px; padding: 0 4px 8px; scrollbar-width: thin; }
.sb-skel { height: 34px; border-radius: 9px; margin: 6px 4px; background: linear-gradient(90deg, var(--gray-bg), rgb(var(--tint-rgb) / .09), var(--gray-bg)); background-size: 200% 100%; animation: skel 1.4s ease-in-out infinite; }
@keyframes skel { from { background-position: 100% 0; } to { background-position: -100% 0; } }

 

 

.mobile-bar { display: none; }
.is-staff .site-foot { padding-bottom: 20px; }

@media (max-width: 1000px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  
  
  
  
  
  .mobile-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; position: sticky; top: 0; z-index: 20; padding: 8px 12px;
    background: var(--topbar-bg); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
  .mobile-bar .logo img { height: 26px; }
  .app-main > .container { padding-top: 18px; }
}

/* Overview */
.ov-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.ov-head h1 { font-size: clamp(28px, 3.4vw, 38px); margin: 2px 0 6px; }
.eyebrow { margin: 0; text-transform: uppercase; letter-spacing: .09em; font-weight: 600; font-size: 11.5px; min-height: 1em; }
.ov-sub { margin: 0; font-size: 15px; }
.head-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.seg-toggle { display: inline-flex; padding: 3px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--bg-2); }
.seg-toggle a { padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--muted); }
.seg-toggle a:hover { color: var(--heading); text-decoration: none; }
.seg-toggle a.on { background: var(--brand-soft); color: var(--heading); box-shadow: inset 0 0 0 1px var(--brand-line); }
.ov-stages { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.ov-stage { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "ico num" "label label" "sub sub"; align-items: center; column-gap: 10px; row-gap: 2px; padding: 14px 16px; border-radius: 14px;
  background: linear-gradient(180deg, rgb(var(--tint-rgb) / .035), rgb(var(--tint-rgb) / .008)), var(--card); border: 1px solid var(--line); color: var(--text); transition: transform .2s var(--ease), border-color .2s; }
.ov-stage:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--seg) 45%, transparent); text-decoration: none; }
.ovs-ico { grid-area: ico; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: var(--seg); background: color-mix(in srgb, var(--seg) 13%, transparent); }
.ovs-ico .ico { width: 16px; height: 16px; }
.ovs-num { grid-area: num; font-size: 26px; font-weight: 600; letter-spacing: -.03em; color: var(--heading); font-variant-numeric: tabular-nums; justify-self: end; }
.ovs-label { grid-area: label; font-size: 13.5px; font-weight: 600; color: var(--text-2); margin-top: 6px; }
.ovs-sub { grid-area: sub; font-size: 12px; }
.ov-stage.is-alert { border-color: color-mix(in srgb, var(--red) 45%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--red) 20%, transparent), 0 10px 30px -18px var(--red); }
@media (max-width: 1250px) { .ov-stages { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .ov-stages { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.ov-grid { align-items: start; }
.attn-card { padding: 0; overflow: hidden; }
.attn-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 18px 20px 12px; }
.attn-head h2 { display: flex; align-items: center; gap: 9px; margin: 0; font-size: 18px; }
.attn-head h2 .ico { width: 19px; height: 19px; color: var(--amber); }
.count-pill { display: inline-grid; place-items: center; min-width: 26px; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 12.5px; font-weight: 600; color: var(--text-2); background: var(--gray-bg); border: 1px solid var(--line-2); }
.attn-list { list-style: none; margin: 0; padding: 0; }
.attn-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 12px 20px; border-top: 1px solid var(--line); color: var(--text); transition: background .15s; }
.attn-row:hover { background: rgb(var(--tint-rgb) / .035); text-decoration: none; }
.attn-row:hover .ar-go { color: var(--brand-text); transform: translateX(2px); }
.ar-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ar-name { font-weight: 600; color: var(--heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ar-sub { display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ar-reasons { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.ar-go { color: var(--muted); display: inline-grid; transition: transform .2s var(--ease), color .2s; }
.ar-go .ico { width: 16px; height: 16px; }
.reason { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 500; white-space: nowrap;
  color: var(--seg); background: color-mix(in srgb, var(--seg) 11%, transparent); border: 1px solid color-mix(in srgb, var(--seg) 24%, transparent); }
.reason.tone-gray { color: var(--text-2); }
.reason .ico { width: 13px; height: 13px; }
.attn-more { padding: 12px 20px 16px; margin: 0; border-top: 1px solid var(--line); }
.attn-empty { text-align: center; padding: 30px 20px 34px; border-top: 1px solid var(--line); }
.attn-empty .mc-icon { margin: 0 auto 12px; }
.attn-empty h3 { color: var(--heading); font-size: 17px; margin-bottom: 4px; }
@media (max-width: 720px) {
  .attn-row { grid-template-columns: auto minmax(0, 1fr) auto; row-gap: 8px; padding: 12px 14px; }
  .ar-reasons { grid-column: 2 / 4; grid-row: 2; justify-content: flex-start; }
  .ar-go { grid-column: 3; grid-row: 1; }
}
.side-card { padding: 16px 18px; }
.sc-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.sc-head h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14.5px; color: var(--heading); }
.sc-head h3 .ico { width: 16px; height: 16px; color: var(--brand-text); }
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li a { display: flex; align-items: center; gap: 10px; padding: 8px 6px; margin: 0 -6px; border-radius: 9px; color: var(--text); }
.mini-list li a:hover { background: var(--gray-bg); text-decoration: none; }
.ml-name { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ml-name .muted { font-weight: 400; font-size: 12px; }
.activity a strong { color: var(--heading); }

/* Client page: banner header */
.crumbs .sep { opacity: .5; }
.crumbs [aria-current] { color: var(--text-2); }
.crumb-action { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 8px; border: 1px solid var(--line-2); font-size: 12.5px; color: var(--text-2) !important; }
.crumb-action:hover { border-color: var(--brand-line); text-decoration: none; }
.crumb-action .ico { width: 14px; height: 14px; }
.client-hero2 { padding: 0; overflow: hidden; margin-bottom: 16px; }
.ch-banner { height: 112px; position: relative;
  background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--cb) 60%, transparent), transparent 60%),
              radial-gradient(90% 120% at 100% 0%, color-mix(in srgb, var(--brand) 32%, transparent), transparent 65%),
              linear-gradient(120deg, color-mix(in srgb, var(--cb) 22%, var(--card)), var(--card-2)); }
.ch-banner::after { content: ""; position: absolute; inset: 0; background: var(--heading); opacity: .07;
  -webkit-mask: url(/static/circuit.svg) center / 900px auto; mask: url(/static/circuit.svg) center / 900px auto; }
.ch-body { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px 20px; padding: 0 24px 20px; align-items: start; }
.ch-avatar { width: 78px; height: 78px; margin-top: -36px; border-radius: 22px; display: grid; place-items: center; font-size: 28px; font-weight: 700; letter-spacing: -.02em;
  color: #fff; background: linear-gradient(140deg, hsl(var(--h) 62% 52%), hsl(calc(var(--h) + 40) 60% 38%)); border: 4px solid var(--card); box-shadow: 0 10px 30px -10px rgba(0,0,0,.5); position: relative; z-index: 1; }
.ch-id { min-width: 0; padding-top: 12px; }
.ch-title { display: flex; align-items: center; gap: 10px; }
.ch-title h1 { font-size: clamp(24px, 3vw, 32px); margin: 0; letter-spacing: -.03em; color: var(--heading); }
.ch-title form { margin: 0; }
.star-toggle { border: 0; background: transparent; cursor: pointer; font-size: 22px; line-height: 1; padding: 4px; border-radius: 8px; color: var(--line-2); transition: color .15s, transform .2s var(--ease); }
.star-toggle:hover { color: var(--amber); transform: scale(1.12); }
.star-toggle.on { color: var(--amber); text-shadow: 0 0 14px color-mix(in srgb, var(--amber) 60%, transparent); }
.ch-badges { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 0; }
.ch-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 12px 0 0; font-size: 13.5px; color: var(--text-2); }
.ch-meta > span { display: inline-flex; align-items: center; gap: 6px; }
.ch-meta .ico { width: 15px; height: 15px; color: var(--muted); }
.ch-packages { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
.ch-label { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.pkg { padding: 3px 10px; border-radius: 8px; font-size: 12.5px; font-weight: 600; color: var(--brand-text); background: var(--brand-soft); border: 1px solid var(--brand-line); }
.ch-actions { display: flex; flex-direction: column; gap: 8px; align-items: stretch; padding-top: 16px; }
.ch-actions form { margin: 0; } .ch-actions .btn { width: 100%; }
.risk-strip { display: flex; align-items: center; gap: 12px; padding: 12px 24px; background: var(--red-bg); border-top: 1px solid color-mix(in srgb, var(--red) 30%, transparent); }
.rs-ico { color: var(--red); display: inline-grid; } .rs-ico .ico { width: 18px; height: 18px; }
.rs-text { flex: 1; min-width: 0; font-size: 14px; }
.rs-text strong { color: var(--red); margin-right: 4px; }
.risk-strip form { margin: 0; }
.client-hero2.is-risk { border-color: color-mix(in srgb, var(--red) 35%, transparent); }
@media (max-width: 900px) {
  .ch-body { grid-template-columns: auto minmax(0, 1fr); padding: 0 16px 16px; }
  .ch-actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; padding-top: 4px; }
  .ch-actions .btn { width: auto; }
  .ch-avatar { width: 64px; height: 64px; font-size: 23px; border-radius: 18px; margin-top: -30px; }
  .ch-id { padding-top: 8px; }
  .risk-strip { padding: 12px 16px; flex-wrap: wrap; }
}

/* At a glance */
.glance { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; align-items: stretch; }
@media (max-width: 1150px) { .glance { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .gl-access { grid-row: span 2; } }
@media (max-width: 700px) { .glance { grid-template-columns: minmax(0, 1fr); } .gl-access { grid-row: auto; } }
.glance-card { padding: 16px 18px; display: flex; flex-direction: column; }
/* Activity takes the third glance spot: fills the card's height (set by its neighbours) and scrolls */
.gl-feed { flex: 1 1 auto; height: 0; min-height: 200px; max-height: none; overflow-y: auto; margin-right: -8px; padding-right: 8px; overscroll-behavior: contain; }
.gl-feed li { padding: 8px 0; font-size: 13px; }

/* The team, compact, in the client's top card */
.ch-team { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 10px; }
.ct-person { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 3px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--bg-2); font-size: 12.5px; max-width: 100%; }
.ct-person .avatar.xs { width: 22px; height: 22px; font-size: 9px; }
.ct-name { font-weight: 600; color: var(--heading); }
.ct-role { color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
.ct-person .badge { margin-left: 2px; }
.ct-more { font-size: 12px; font-weight: 600; color: var(--text-2); padding: 3px 8px; border-radius: 99px; background: var(--gray-bg); }
.ct-contacts { display: inline-flex; align-items: center; gap: 5px; margin-left: 4px; padding-left: 10px; border-left: 1px solid var(--line-2); color: var(--text-2); }
.ct-contacts .ico { width: 14px; height: 14px; }
@media (max-width: 700px) { .ct-role { display: none; } .ct-contacts { margin-left: 0; } }

/* Fold-away cards (Client details, Launch automation) */
.acc-card { padding: 0; }
.acc-sum { display: flex; align-items: center; gap: 12px; padding: 16px 18px; cursor: pointer; list-style: none; border-radius: inherit; transition: background .15s; }
.acc-sum::-webkit-details-marker { display: none; }
.acc-sum:hover { background: rgb(var(--tint-rgb) / .03); }
.acc-sum:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.acc-title { flex: 1; min-width: 0; display: grid; gap: 2px; }
.acc-title h3 { margin: 0; font-size: 15px; }
.acc-title .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-chev { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: var(--muted); transition: transform .3s var(--ease), background .15s; }
.acc-chev .ico { width: 16px; height: 16px; transform: rotate(90deg); }
.acc-card[open]:not(.is-closing) .acc-chev { transform: rotate(180deg); }
.acc-sum:hover .acc-chev { background: var(--gray-bg); color: var(--heading); }
.acc-body { overflow: clip; padding: 0 18px 18px; }
.acc-card[open] .acc-sum { border-bottom: 1px solid var(--line); margin-bottom: 14px; }

/* Launch automation stays yellow until every connected automation is done */
.acc-card.is-auto-pending { border-color: color-mix(in srgb, var(--amber) 55%, transparent); background: linear-gradient(180deg, color-mix(in srgb, var(--amber) 9%, var(--card)), var(--card) 70%); box-shadow: 0 0 0 3px color-mix(in srgb, var(--amber) 12%, transparent); }
.acc-card.is-auto-pending > .acc-sum .mc-icon { color: var(--amber); background: color-mix(in srgb, var(--amber) 16%, transparent); border-color: color-mix(in srgb, var(--amber) 40%, transparent); }
/* Not done yet (including not connected): red until it's done */
.integ-list li.is-todo { border-color: color-mix(in srgb, var(--red) 45%, transparent); background: color-mix(in srgb, var(--red) 7%, var(--bg-2)); }
.integ-list li.is-todo .mc-icon { color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); border-color: color-mix(in srgb, var(--red) 35%, transparent); }
.integ-list li.is-todo .il-state { color: var(--red); font-weight: 600; }
.integ-list li:not(.is-todo) .il-state { color: var(--green); font-weight: 600; }

/* The yellow "finish setting up" bar at the top of a client's pages */
.auto-notice { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 14px; margin: 0 0 14px; border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--amber) 55%, transparent); background: color-mix(in srgb, var(--amber) 13%, var(--card)); color: var(--text); }
.an-ico { width: 30px; height: 30px; flex: none; border-radius: 9px; display: grid; place-items: center; background: var(--amber); color: #1c1400; }
.an-ico .ico { width: 17px; height: 17px; }
.an-txt { flex: 1; min-width: 0; display: grid; gap: 1px; font-size: 13.5px; }
.an-txt strong { color: var(--heading); }
.an-btn { flex: none; border-color: color-mix(in srgb, var(--amber) 60%, transparent); }
.an-btn .ico { width: 14px; height: 14px; }
@media (max-width: 600px) { .auto-notice { flex-wrap: wrap; } .an-btn { width: 100%; justify-content: center; } }
.gl-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.gl-head .card-label { margin: 0; }
.gl-big { font-size: 34px; font-weight: 600; letter-spacing: -.035em; color: var(--heading); line-height: 1.1; font-variant-numeric: tabular-nums; }
.gl-big.soon { color: var(--amber); } .gl-big.late { color: var(--red); }
.gl-launch .muted .ico { width: 14px; height: 14px; vertical-align: -2px; }
.gl-progress { display: flex; align-items: center; gap: 14px; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.gl-launch .gl-big + .muted { margin-bottom: 14px; }
.ring.xs { width: 58px; height: 58px; margin: 0; } .ring.xs span { width: 46px; height: 46px; font-size: 13.5px; font-weight: 600; }
.access-list, .team-list { list-style: none; margin: 0; padding: 0; }
.access-list a { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 6px 6px; margin: 0 -6px; border-radius: 8px; color: var(--text); font-size: 13.5px; }
.access-list a:hover { background: var(--gray-bg); text-decoration: none; }
.acc-ico { display: inline-grid; color: var(--muted); } .acc-ico .ico { width: 16px; height: 16px; }
.acc-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-missing .acc-label, .acc-na .acc-label { color: var(--muted); }
.acc-val { font: 12px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text-2); max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-state { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; color: var(--seg); white-space: nowrap; }
.acc-state.tone-gray { color: var(--muted); }
.acc-state .ico { width: 14px; height: 14px; }
.acc-ok .acc-state .ico { width: 16px; height: 16px; stroke-width: 2.2; }
.team-list li { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.tl-name { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; font-size: 13.5px; }
.tl-name strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gl-contacts { display: flex; align-items: center; gap: 9px; margin-top: auto; padding: 10px 2px 0; border-top: 1px solid var(--line); font-size: 13px; color: var(--text-2); }
.gl-contacts span { flex: 1; } .gl-contacts .ico { width: 15px; height: 15px; color: var(--muted); }
.gl-contacts:hover { color: var(--heading); text-decoration: none; }
.gl-team .team-list { margin-bottom: 12px; }

/* Sales handoff */
.handoff-card { margin-bottom: 16px; padding: 16px 18px; border-left: 3px solid var(--brand-line); }
.hc-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.hc-head .card-label .ico { width: 15px; height: 15px; }
.handoff-card .handoff-text { margin-top: 10px; }
.handoff-text.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.handoff-text.clamp.expanded { display: block; -webkit-line-clamp: unset; }
.hc-more { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; color: var(--brand-text); background: none; border: 0; padding: 0; cursor: pointer; font: inherit; font-size: 13px; font-weight: 500; }
.hc-more .ico { width: 14px; height: 14px; transition: transform .2s; }
.hc-more[aria-expanded="true"] .ico { transform: rotate(-90deg); }

/* Team roles in Client details */
.team-row { display: grid; grid-template-columns: 18px 18px minmax(0, 1fr) 140px; gap: 8px; align-items: center; padding: 4px 0; font-size: 14px; }
.team-row.ro { grid-template-columns: minmax(0, 1fr) 150px; }
.team-row select { padding: 5px 8px; font-size: 12.5px; }
.tr-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Quick finder (Ctrl+K) */
dialog.finder { width: min(640px, 94vw); max-height: 76vh; margin: 11vh auto auto; padding: 0; border-radius: 18px; border: 1px solid var(--line-2); background: var(--card); color: var(--text);
  box-shadow: 0 40px 100px -30px rgba(0,0,0,.75); overflow: hidden; }
dialog.finder[open] { animation: dialogIn .26s var(--ease) both; }
.finder-box { display: flex; flex-direction: column; max-height: 76vh; }
.finder-input { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); color: var(--muted); }
.finder-input .ico { width: 20px; height: 20px; }
.finder-input input { flex: 1; border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 4px 0 !important; font-size: 17px; color: var(--heading); }
.finder-results { list-style: none; margin: 0; padding: 6px 8px 10px; overflow-y: auto; }
.fr-head { padding: 10px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.fr-empty { padding: 14px 10px; color: var(--muted); font-size: 13.5px; }
.finder-results [role="option"] { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; cursor: pointer; }
.finder-results [role="option"][aria-selected="true"] { background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand-line); }
.fr-ico { width: 24px; height: 24px; display: grid; place-items: center; color: var(--brand-text); } .fr-ico .ico { width: 17px; height: 17px; }
.fr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.fr-name { font-weight: 500; color: var(--heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fr-hint { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.finder-foot { display: flex; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--line); }
.finder-foot kbd { margin-right: 3px; }
/* v14 refinements */
.ch-avatar { background: linear-gradient(140deg, color-mix(in srgb, var(--cb) 92%, #fff), color-mix(in srgb, var(--cb) 70%, #000)); }
.gl-next { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px 0 14px; border-top: 1px solid var(--line); }
.gl-next .un-pulse { display: inline-block; vertical-align: 1px; margin-right: 4px; }
.gn-title { font-weight: 600; color: var(--heading); font-size: 14.5px; line-height: 1.3; }
.gn-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gl-next form { margin: 6px 0 0; }
.gl-next.is-flagged .gn-title { color: var(--red); }
/* v14 responsive fixes: the sidebar takes width, so content columns adapt sooner */
.attn-card { container-type: inline-size; }
@container (max-width: 680px) {
  .attn-row { grid-template-columns: auto minmax(0, 1fr) auto; row-gap: 8px; padding: 12px 16px; }
  .ar-reasons { grid-column: 2 / 4; grid-row: 2; justify-content: flex-start; }
  .ar-go { grid-column: 3; grid-row: 1; }
}
@media (max-width: 1250px) {
  .app-main .grid-2-1.ov-grid { grid-template-columns: minmax(0, 1fr); }
  .ov-grid > aside { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
  .app-main .grid-2-1 { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
}
@media (max-width: 900px) { .app-main .grid-2-1 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 700px) { .ov-grid > aside { grid-template-columns: minmax(0, 1fr); } }

/* ───────────── v15: client logos ───────────── */
/* Logos sit on white so dark and colored logos read in both themes */
.avatar.has-logo { background: #fff; border-color: var(--line-2); padding: 3px; overflow: hidden; }
.avatar.has-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.avatar.xs.has-logo { padding: 2px; }
.ch-avatar { cursor: pointer; padding: 0; font-family: inherit; overflow: visible; transition: transform .2s var(--ease), box-shadow .2s; }
.ch-avatar:hover { transform: translateY(-2px); box-shadow: 0 14px 34px -12px rgba(0,0,0,.6); }
.ch-avatar:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.ch-avatar.has-logo { background: #fff; padding: 9px; }
.ch-avatar.has-logo img { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: 10px; }
.ch-cam { position: absolute; right: -6px; bottom: -6px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--card-2); color: var(--text-2); border: 2px solid var(--card); box-shadow: 0 4px 10px rgba(0,0,0,.35); transition: background .15s, color .15s; }
.ch-cam .ico { width: 14px; height: 14px; }
.ch-avatar:hover .ch-cam { background: var(--brand); color: var(--brand-ink); }
@media (max-width: 900px) { .ch-avatar.has-logo { padding: 7px; } }

/* Upload dialog */
dialog.logo-dialog { width: min(520px, 94vw); }
.logo-drop { display: flex; align-items: center; gap: 16px; padding: 18px; border-radius: 16px; border: 1.5px dashed var(--line-2); background: var(--bg-2); cursor: pointer; transition: border-color .15s, background .15s; }
.logo-drop:hover, .logo-drop:focus-within, .logo-drop.is-over { border-color: var(--brand); background: var(--brand-soft); }
.ld-preview { width: 96px; height: 96px; flex-shrink: 0; border-radius: 18px; display: grid; place-items: center; color: var(--muted); background: var(--gray-bg); border: 1px solid var(--line); overflow: hidden; }
.ld-preview .ico { width: 30px; height: 30px; }
.ld-preview.has-img { background: #fff; padding: 10px; }
.ld-preview img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.ld-text { display: flex; flex-direction: column; gap: 4px; }
.ld-link { color: var(--brand-text); text-decoration: underline; text-underline-offset: 3px; }
.ld-error { color: var(--red); margin: 0; }
.ld-remove { color: var(--red); margin-right: auto; }
@media (max-width: 480px) { .logo-drop { flex-direction: column; text-align: center; } }

/* Client portal: logo prompt on Brand Assets, logo on home */
.logo-cta { display: flex; align-items: center; gap: 14px; padding: 12px 14px; margin-bottom: 16px; border-radius: 14px; border: 1px solid var(--brand-line); background: var(--brand-soft); }
.lc-thumb { width: 52px; height: 52px; flex-shrink: 0; border-radius: 13px; display: grid; place-items: center; color: var(--brand-text); background: var(--bg-2); border: 1px solid var(--line); overflow: hidden; }
.lc-thumb .ico { width: 22px; height: 22px; }
.lc-thumb.has-img { background: #fff; padding: 6px; }
.lc-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lc-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.portal-logo { display: inline-grid; place-items: center; width: 64px; height: 64px; padding: 8px; margin: 14px 0 2px; border-radius: 18px; background: #fff; box-shadow: 0 10px 30px -14px rgba(0,0,0,.5); }
.portal-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* Clients list: avatar beside the name */
.cell-client { display: flex; align-items: flex-start; gap: 12px; }
.cell-client > .avatar { margin-top: 1px; }
.cc-main { min-width: 0; }

/* ───────────── v16: client hub (results, reports, approvals, requests, alerts, health) ───────────── */
/* Lead-source colors: fixed order, validated for both themes (dataviz palette slots 1–5) */
:root { --ch-1: #3987e5; --ch-2: #d95926; --ch-3: #199e70; --ch-4: #c98500; --ch-5: #d55181; }
:root[data-theme="light"] { --ch-1: #2a78d6; --ch-2: #eb6834; --ch-3: #1baf7a; --ch-4: #eda100; --ch-5: #e87ba4; }
.s1 { --c: var(--ch-1); } .s2 { --c: var(--ch-2); } .s3 { --c: var(--ch-3); } .s4 { --c: var(--ch-4); } .s5 { --c: var(--ch-5); }
.lk { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--c, var(--muted)); flex-shrink: 0; }

/* Nav badges */
.nav-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: auto; border-radius: 99px; font-size: 11px; font-weight: 700;
  color: var(--text); background: var(--gray-bg); border: 1px solid var(--line-2); }
.nav-count.is-alert { color: #fff; background: var(--red); border-color: transparent; }
.topbar nav a .nav-count { margin-left: 4px; color: var(--brand-ink); background: var(--brand); border: 0; }
.ibtn.on { color: var(--brand-text); background: var(--brand-soft); }
a.theme-toggle { color: var(--muted); }

/* Team-only markers */
.team-banner { display: flex; align-items: center; gap: 8px; padding: 9px 14px; margin-bottom: 14px; border-radius: 12px; font-size: 13.5px; color: var(--text-2);
  background: repeating-linear-gradient(135deg, var(--gray-bg) 0 8px, transparent 8px 16px); border: 1px dashed var(--line-2); }
.team-banner .ico { width: 15px; height: 15px; color: var(--muted); }
.team-lock { display: inline-grid; color: var(--muted); } .team-lock .ico { width: 12px; height: 12px; }
.badge.team-only .ico { width: 11px; height: 11px; }

/* My notifications */
.notif-form { max-width: 820px; }
.sms-setup { display: grid; gap: 12px; }
.sms-setup .field { max-width: 320px; }
.sms-consent { align-items: flex-start; }
.notif-table { padding: 8px 20px 16px; }
.nt-head, .nt-row { display: grid; grid-template-columns: minmax(0, 1fr) 56px 56px 56px; align-items: center; gap: 8px; }
.nt-head { position: sticky; top: 0; padding: 10px 0 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); text-align: center; background: var(--card); z-index: 1; }
.nt-head span:first-child { text-align: left; }
.nt-group { margin: 14px 0 2px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-text); }
.nt-row { padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.switch-cell { display: grid; place-items: center; cursor: pointer; }
.switch-cell.is-off { opacity: .35; cursor: not-allowed; }
input.switch { appearance: none; -webkit-appearance: none; width: 38px; height: 22px; border-radius: 99px; background: rgb(var(--tint-rgb) / .16); position: relative; cursor: pointer; transition: background .2s; margin: 0; border: 0; padding: 0; }
input.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--knob); transition: transform .2s var(--ease); box-shadow: 0 1px 3px rgba(0,0,0,.3); }
input.switch:checked { background: var(--brand); }
input.switch:checked::after { transform: translateX(16px); }
input.switch:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

/* Client tabs */
.client-tabs { display: flex; gap: 2px; margin: 0 0 16px; padding: 4px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.client-tabs::-webkit-scrollbar { display: none; }
.client-tabs a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 10px; color: var(--text-2); font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.client-tabs a .ico { width: 16px; height: 16px; color: var(--muted); }
.client-tabs a:hover { background: var(--gray-bg); color: var(--heading); text-decoration: none; }
.client-tabs a.on { background: var(--brand-soft); color: var(--heading); box-shadow: inset 0 0 0 1px var(--brand-line); }
.client-tabs a.on .ico { color: var(--brand-text); }
.tab-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; font-size: 11px; font-weight: 700; background: var(--gray-bg); color: var(--text); border: 1px solid var(--line-2); }
.tab-count.is-alert { background: var(--red); color: #fff; border-color: transparent; }
.client-mini { display: flex; align-items: center; gap: 14px; padding: 14px 18px; margin-bottom: 12px; }
.client-mini > .avatar { width: 48px; height: 48px; border-radius: 14px; font-size: 16px; }
.cm-id { flex: 1; min-width: 0; }
.cm-id h1 { margin: 0; font-size: 22px; color: var(--heading); }
.cm-id .ch-badges { margin-top: 4px; }
.cm-act { margin: 0; }
.hub-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin: 4px 0 14px; }
.hub-head h2 { margin: 0; font-size: 22px; }
.hub-head p { margin: 4px 0 0; max-width: 640px; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0; }
.inline-form select, .inline-form input { width: auto; }
.list-card { list-style: none; margin: 0 0 16px; padding: 4px; }
.list-card.plain { padding: 0; margin: 0; }
.list-card li + li { border-top: 1px solid var(--line); }
.lc-row { display: flex; align-items: center; gap: 12px; padding: 12px 12px; border-radius: 10px; color: var(--text); }
.lc-row:hover { background: var(--gray-bg); text-decoration: none; }
.lc-row > .ico { width: 16px; height: 16px; color: var(--muted); }
.lc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lc-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-row.needs-you { box-shadow: inset 3px 0 0 var(--amber); }

/* Results */
.results { margin-bottom: 18px; }
.res-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.res-empty { text-align: center; padding: 40px 24px; }
.res-empty .mc-icon { margin: 0 auto 14px; }
.res-empty p { max-width: 520px; margin: 6px auto 0; }
.kpis { display: grid; gap: 12px; margin-bottom: 14px; }
.kpis.k4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .kpis.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .kpis.k4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .kpis.k3 { grid-template-columns: minmax(0, 1fr); } }
.kpi { padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.kpi-label { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.kpi-label .ico { width: 15px; height: 15px; color: var(--muted); }
.kpi-num { font-size: 34px; font-weight: 600; letter-spacing: -.035em; color: var(--heading); line-height: 1.15; font-variant-numeric: tabular-nums; }
.delta { font-size: 12.5px; font-weight: 600; }
.delta.good { color: var(--green); } .delta.bad { color: var(--red); } .delta.flat { color: var(--muted); font-weight: 500; }
.delta .muted { font-weight: 400; }
.res-row2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; margin-bottom: 14px; }
.goal-card { padding: 14px 18px; display: flex; flex-direction: column; gap: 8px; }
.gc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.pace-bar { position: relative; height: 10px; border-radius: 99px; background: rgb(var(--tint-rgb) / .1); }
.pb-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: var(--brand); }
.pb-fill.spend { background: var(--ch-1); }
.pb-mark { position: absolute; top: -4px; bottom: -4px; width: 2px; border-radius: 2px; background: var(--heading); box-shadow: 0 0 0 2px var(--card); }
.res-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 12px; margin-bottom: 14px; }
@media (max-width: 1100px) { .res-grid { grid-template-columns: minmax(0, 1fr); } }
.chart-card { padding: 16px 18px; }
.cc-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.cc-head h3 { margin: 0; color: var(--heading); }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sbars { display: flex; flex-direction: column; gap: 6px; }
.sbars-plot { position: relative; height: 210px; margin-left: 28px; }
.sb-gl { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--line); }
.sb-gl span { position: absolute; right: calc(100% + 8px); top: -8px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sb-cols { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 3px; }
.sb-col { flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; border-radius: 6px; cursor: default; outline: none; }
.sb-col:hover, .sb-col:focus-visible { background: rgb(var(--tint-rgb) / .05); }
.sb-col:focus-visible { box-shadow: inset 0 0 0 2px var(--brand-line); }
.sb-stack { width: min(100%, 26px); display: flex; flex-direction: column-reverse; gap: 2px; min-height: 0; }
.sb-stack .sbs { display: block; min-height: 2px; background: var(--c); }
.sb-stack .sbs:last-child { border-radius: 4px 4px 0 0; }
.sb-x { overflow: hidden; }
.chart-card, .sources-card { min-width: 0; overflow: hidden; }
.sb-x { display: flex; gap: 3px; margin-left: 28px; font-size: 11px; color: var(--muted); }
.sb-x span { flex: 1; text-align: center; white-space: nowrap; overflow: visible; }
.table-view { margin-top: 10px; }
.table-view summary { cursor: pointer; color: var(--brand-text); }
.tv-scroll { max-height: 260px; overflow: auto; margin-top: 8px; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.sources-card { padding: 16px 18px; }
.sources-card h3 { color: var(--heading); }
.src-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.src-list li { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: 13.5px; }
.src-name { display: inline-flex; align-items: center; gap: 8px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.src-bar { height: 10px; border-radius: 0 4px 4px 0; background: transparent; }
.src-bar span { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--c); min-width: 3px; }
.src-val { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.src-note { margin: 12px 0 0; }
.plat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 900px) { .plat-grid { grid-template-columns: minmax(0, 1fr); } }
.plat { padding: 14px 18px; }
.plat.off { opacity: .7; }
.plat-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; color: var(--heading); }
.plat-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: #fff; }
.plat-ico .ico { width: 16px; height: 16px; }
.s1-bg { background: var(--ch-1); } .s2-bg { background: var(--ch-2); } .s3-bg { background: var(--ch-3); }
.plat-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin: 0; }
.plat-stats dt { font-size: 12px; color: var(--muted); }
.plat-stats dd { margin: 0; font-size: 18px; font-weight: 600; color: var(--heading); font-variant-numeric: tabular-nums; }
.goals-card { padding: 14px 18px; margin-bottom: 16px; }
.goals-card summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; cursor: pointer; list-style: none; flex-wrap: wrap; }
.goals-card summary::-webkit-details-marker { display: none; }
.goals-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-top: 14px; align-items: end; }

/* Reports */
.report-edit { align-items: start; }
.report-form textarea { font-size: 14px; }
.report-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.report-actions .btn.primary { margin-left: auto; }
.report-view { display: grid; gap: 12px; margin-bottom: 16px; }
.report-view .kpis { margin: 0; }
.rv-section { padding: 16px 18px; }
.rv-section h3 { display: flex; align-items: center; gap: 8px; color: var(--heading); margin-bottom: 8px; }
.rv-section h3 .ico { width: 16px; height: 16px; color: var(--brand-text); }
.rv-text { margin: 0; color: var(--text-2); line-height: 1.6; }

/* Approvals & requests */
.item-body { padding: 16px 18px; }
.ib-meta { margin-bottom: 8px; }
.ib-text { margin: 0 0 10px; color: var(--text); line-height: 1.6; }
.ib-link { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 9px; border: 1px solid var(--line-2); font-size: 13.5px; }
.ib-link .ico { width: 14px; height: 14px; }
.ib-files { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 12px; }
.ib-file { display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 12px; border: 1px solid var(--line); color: var(--text-2); overflow: hidden; }
.ib-file:hover { border-color: var(--brand-line); text-decoration: none; }
.ib-file img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: #fff; }
.ib-file > .ico { width: 34px; height: 34px; color: var(--muted); margin: 18px auto; }
.ib-file span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ib-attach { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.ib-attach label.btn { cursor: pointer; }
.item-thread { padding: 16px 18px; }
.item-thread h3 { color: var(--heading); }
.thread { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.te { padding: 10px 12px; border-radius: 12px; background: var(--gray-bg); border: 1px solid var(--line); }
.te.team { background: var(--brand-soft); border-color: var(--brand-line); }
.te.internal { background: repeating-linear-gradient(135deg, var(--gray-bg) 0 8px, transparent 8px 16px); border-style: dashed; }
.te.sys { background: none; border: 0; padding: 2px 4px; font-size: 13px; color: var(--text-2); }
.te-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.te-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.te-body { margin: 6px 0 0; font-size: 14px; color: var(--text); line-height: 1.55; }
.te-form textarea { font-size: 14px; }
.te-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.te-actions .check .ico { width: 13px; height: 13px; vertical-align: -2px; }
.status-seg { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 4px; }
.decide-card { padding: 18px 20px; border-color: color-mix(in srgb, var(--amber) 40%, transparent); }
.decide-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.decide-actions form { margin: 0; }
.btn.big { padding: 12px 22px; font-size: 15px; }

/* Updates feed */
.feed { list-style: none; margin: 0; padding: 4px 16px; }
.feed-item { position: relative; display: flex; gap: 12px; padding: 12px 0 12px 4px; border-top: 1px solid var(--line); }
.feed-item:first-child { border-top: 0; }
.fi-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; background: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); flex-shrink: 0; }
.feed-item.report .fi-dot { background: var(--ch-1); } .feed-item.done .fi-dot { background: var(--green); }
.fi-body { flex: 1; min-width: 0; }
.fi-body p, .fi-body a { margin: 0 0 3px; display: block; color: var(--text); }
.feed-item form { margin: 0; }

/* Account (team only) */
.acct-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
@media (max-width: 1000px) { .acct-grid { grid-template-columns: minmax(0, 1fr); } }
.acct-grid > .card { padding: 16px 18px; margin: 0; }
.acct-grid h3 { display: flex; align-items: center; gap: 8px; color: var(--heading); }
.acct-grid h3 .ico { width: 16px; height: 16px; color: var(--brand-text); }
.hc-top { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.hc-score { width: 86px; height: 86px; border-radius: 50%; display: grid; place-items: center; align-content: center; flex-shrink: 0;
  border: 5px solid var(--seg); background: color-mix(in srgb, var(--seg) 10%, transparent); }
.hc-score strong { font-size: 28px; line-height: 1; color: var(--heading); }
.hc-score span { font-size: 11px; color: var(--muted); }
.spark { width: 220px; height: 44px; margin-top: 6px; overflow: visible; }
.spark path { fill: none; stroke: var(--brand); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark circle { fill: var(--brand); stroke: var(--card); stroke-width: 2; }
.hc-parts { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.hc-parts li { display: grid; grid-template-columns: 140px minmax(60px, 1fr); grid-template-areas: "n b" "x x"; gap: 2px 10px; align-items: center; font-size: 13.5px; }
.hp-name { grid-area: n; } .hp-note { grid-area: x; }
.hp-bar { grid-area: b; height: 8px; border-radius: 99px; background: rgb(var(--tint-rgb) / .1); overflow: hidden; }
.hp-bar span { display: block; height: 100%; border-radius: 99px; }
.hp-bar .good { background: var(--green); } .hp-bar .mid { background: var(--amber); } .hp-bar .bad { background: var(--red); }
.alert-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.alert-list.big { padding: 4px 16px 16px; }
.al { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--gray-bg); }
.al.sev-critical { border-color: color-mix(in srgb, var(--red) 40%, transparent); background: var(--red-bg); }
.al-ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; color: var(--seg); background: color-mix(in srgb, var(--seg) 14%, transparent); }
.al-ico .ico { width: 16px; height: 16px; }
.al-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; color: var(--text); }
a.al-main:hover { text-decoration: none; } a.al-main:hover strong { color: var(--brand-text); }
.al form { margin: 0; }
.plain-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; font-size: 13.5px; }
.quote { margin: 4px 0 0; padding: 6px 10px; border-left: 3px solid var(--line-2); color: var(--text-2); font-style: italic; }
.contract-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.contract-form .span2 { grid-column: 1 / -1; }
@media (max-width: 560px) { .contract-form { grid-template-columns: 1fr; } }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0 0 10px; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.acc-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.acc-row form { margin: 0 0 0 auto; }
.suggest { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 8px 10px; margin: 0 0 10px; border-radius: 10px; background: var(--brand-soft); border: 1px solid var(--brand-line); }
.suggest .ico { width: 14px; height: 14px; vertical-align: -2px; color: var(--brand-text); }
.work-grid { align-items: start; }

/* Portal home hub strip */
.checkin-card { padding: 18px 20px; border-color: var(--brand-line); }
.nps { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 6px; }
.nps-opt { position: relative; }
.nps-opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.nps-opt span { display: grid; place-items: center; height: 40px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-2); font-weight: 600; color: var(--text-2); transition: all .15s; }
.nps-opt input:hover + span { border-color: var(--brand-line); }
.nps-opt input:checked + span { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.nps-opt input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.nps-ends { display: flex; justify-content: space-between; margin-top: -4px; }
@media (max-width: 520px) { .nps { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.needs-you-card { padding: 16px 18px; border-color: color-mix(in srgb, var(--amber) 40%, transparent); }
.needs-you-card h2 .ico, .snap-card h2 .ico, #updates h2 .ico { width: 18px; height: 18px; vertical-align: -3px; color: var(--brand-text); }
.snap-card { padding: 16px 18px; }
.snap { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.snap > div { display: flex; flex-direction: column; padding: 10px 12px; border-radius: 12px; background: var(--gray-bg); }
.snap strong { font-size: 26px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }

/* v16: connections */
.plat-status { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-bottom: 16px; }
.ps { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; margin: 0; }
.ps .badge { align-self: flex-start; }
.link-card { flex-direction: row; align-items: center; gap: 10px; color: var(--text-2); border-style: dashed; }
.link-card:hover { color: var(--heading); border-color: var(--brand-line); text-decoration: none; }
.link-card .ico { width: 18px; height: 18px; color: var(--brand-text); }
.acct-match { padding: 16px 18px; }
.acct-match h2 .ico { width: 18px; height: 18px; vertical-align: -3px; color: var(--brand-text); }
.match-table td { vertical-align: middle; }
.match-table select { min-width: 200px; }
.google-connect { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.google-connect > div { flex: 1; min-width: 260px; }
.google-connect code { font-size: 11.5px; }

/* ───────────── v18: profiles ───────────── */
.avatar.is-person { border-radius: 50%; }
.avatar.has-photo { padding: 0; overflow: hidden; background: var(--gray-bg); border-color: var(--line-2); }
.avatar.has-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.xl { width: 104px; height: 104px; font-size: 34px; border-width: 3px; }

.me-link { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 14px; padding: 3px 10px 3px 3px; border-radius: 99px; border: 1px solid transparent; }
.me-link:hover { background: var(--gray-bg); border-color: var(--line); color: var(--heading); text-decoration: none; }
.me-link .avatar { width: 28px; height: 28px; font-size: 11px; }
.profile-grid { display: grid; grid-template-columns: minmax(0, 280px) minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1150px) { .profile-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .profile-card { grid-column: 1 / -1; } }
@media (max-width: 700px) { .profile-grid { grid-template-columns: minmax(0, 1fr); } }
.profile-grid > .card { margin: 0; }
.profile-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 26px 18px; }
.pf-photo { position: relative; border: 0; background: none; padding: 0; cursor: pointer; border-radius: 50%; transition: transform .2s var(--ease); }
.pf-photo:hover { transform: translateY(-2px); }
.pf-photo:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; }
.pf-photo .ch-cam { right: 2px; bottom: 2px; width: 30px; height: 30px; }
.pf-photo:hover .ch-cam { background: var(--brand); color: var(--brand-ink); }
.pf-who { display: flex; flex-direction: column; gap: 2px; }
.pf-who strong { font-size: 18px; color: var(--heading); }
.ld-preview.round { border-radius: 50%; }
.ld-preview.round.has-img { padding: 0; }
.ld-preview.round img { width: 100%; height: 100%; object-fit: cover; }

/* ───────────── v19: icon rail + full-height client panel + phone tab bar ───────────── */
:root { --rail-w: 76px; --cp-w: 296px; --tab-h: 64px; }
 /* the old single sidebar */
.app-shell { grid-template-columns: var(--rail-w) var(--cp-w) minmax(0, 1fr); }
.cp-collapsed .app-shell { grid-template-columns: var(--rail-w) minmax(0, 1fr); }
.cp-collapsed .cpanel { display: none; }
.tabbar, .cp-scrim, .mobile-bar { display: none; }

/* Icon rail */
.rail { position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px 12px;
  background: var(--topbar-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-right: 1px solid var(--line); z-index: 32; }
.rail-logo { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; flex-shrink: 0; }
.rail-logo:hover { background: var(--gray-bg); }
.rail-logo img { width: 34px; height: 34px; object-fit: contain; }
.rail-new { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; flex-shrink: 0; margin: 4px 0 8px; background: var(--brand); color: var(--brand-ink);
  box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--brand) 80%, transparent); transition: transform .2s var(--ease), box-shadow .2s; }
.rail-new:hover { transform: translateY(-1px) scale(1.05); text-decoration: none; }
.rail-new.on { box-shadow: 0 0 0 3px var(--brand-line); }
.rail-new .ico { width: 21px; height: 21px; stroke-width: 2.3; }
.rail-links { flex: 1; min-height: 0; width: 100%; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.rail-links::-webkit-scrollbar { display: none; }
.rl { width: 64px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 5px 0 6px; border: 0; background: none; border-radius: 12px;
  color: var(--muted); font: inherit; font-size: 11px; font-weight: 600; cursor: pointer; text-align: center; }
.rl-ico { position: relative; width: 46px; height: 30px; border-radius: 99px; display: grid; place-items: center; transition: background .15s, color .15s, box-shadow .15s; }
.rl-ico .ico { width: 20px; height: 20px; }
.rl:hover { color: var(--heading); text-decoration: none; }
.rl:hover .rl-ico { background: var(--gray-bg); }
.rl.on { color: var(--heading); }
.rl.on .rl-ico { background: var(--brand-soft); color: var(--brand-text); box-shadow: inset 0 0 0 1px var(--brand-line); }
.rl:focus-visible { outline: none; }
.rl:focus-visible .rl-ico { outline: 2px solid var(--brand); outline-offset: 2px; }
.rl-label { line-height: 1.1; }
.rl-badge { position: absolute; top: -4px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; display: grid; place-items: center;
  font-size: 10.5px; font-weight: 700; line-height: 1; color: var(--text); background: var(--card-2); box-shadow: 0 0 0 2px var(--card), 0 0 0 3px var(--line-2); }
.rl-badge.is-alert { background: var(--red); color: #fff; box-shadow: 0 0 0 2px var(--card); }
.rail-sep { width: 30px; height: 1px; background: var(--line-2); margin: 6px 0; flex-shrink: 0; }
.rail-me { position: relative; margin-top: 8px; flex-shrink: 0; }
.rail-me > summary { cursor: pointer; position: relative; display: block; border-radius: 50%; }
.rail-me > summary .avatar { width: 40px; height: 40px; font-size: 13px; }
.rail-me > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.rail-live { position: absolute; right: -1px; bottom: -1px; width: 14px; height: 14px; padding: 0; border: 0; border-radius: 50%; background: var(--card); display: grid; place-items: center; }
.rail-live .pulse { width: 8px; height: 8px; margin: 0; }
.me-menu { left: calc(100% + 14px); right: auto; top: auto; bottom: -4px; min-width: 230px; }
.me-menu a, .me-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; background: none; border-radius: 9px; color: var(--text-2); font: inherit; font-size: 14px; cursor: pointer; text-align: left; }
.me-menu a:hover, .me-menu button:hover { background: var(--gray-bg); color: var(--heading); text-decoration: none; }
.me-menu .ico { width: 17px; height: 17px; color: var(--muted); }
.me-menu .theme-item span { align-items: center; gap: 10px; }
.me-menu .theme-item .when-dark { display: flex; }
:root[data-theme="light"] .me-menu .theme-item .when-dark { display: none; }
:root[data-theme="light"] .me-menu .theme-item .when-light { display: flex; }
.mm-who { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }

/* Client panel */
.cpanel { position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; min-width: 0; background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-right: 1px solid var(--line); z-index: 31; }
.cp-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 14px 6px 18px; }
.cp-top .logo .tag { display: none; }
.cp-top .logo img { height: 28px; }
.cp-close .cp-close-mob { display: none; }
.cp-title { display: flex; align-items: baseline; gap: 8px; padding: 8px 18px 8px; }
.cp-title > a:first-child { font-size: 19px; font-weight: 700; letter-spacing: -.02em; color: var(--heading); }
.cp-title > a:first-child:hover { text-decoration: none; color: var(--brand-text); }
.cp-total { font-size: 13px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.cp-all { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; font-size: 12.5px; font-weight: 600; }
.cp-all .ico { width: 13px; height: 13px; }
.cp-search { display: flex; align-items: center; gap: 10px; margin: 2px 14px 10px; padding: 0 12px; height: 44px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg-2);
  color: var(--muted); cursor: text; transition: border-color .15s, box-shadow .15s; }
.cp-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.cp-search .ico { width: 18px; height: 18px; flex-shrink: 0; }
.cp-search input { flex: 1; min-width: 0; border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 0 !important; font-size: 15px; color: var(--heading); height: 100%; }
.cp-search input::-webkit-search-cancel-button { cursor: pointer; }
.cp-kbd { flex-shrink: 0; }
.cp-search:focus-within .cp-kbd { display: none; }
.cp-chips { display: flex; gap: 6px; padding: 0 14px 10px; overflow-x: auto; scrollbar-width: none; flex-shrink: 0; border-bottom: 1px solid var(--line); }
.cp-chips::-webkit-scrollbar { display: none; }
.cp-chip { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; height: 32px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line-2); background: transparent;
  color: var(--text-2); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: all .15s; }
.cp-chip:hover { color: var(--heading); border-color: var(--brand-line); }
.cp-chip.on { background: var(--heading); border-color: var(--heading); color: var(--bg); }
.cp-chip .ico { width: 14px; height: 14px; }
.cpc-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--red); }
.cpc-star { color: var(--amber); }
.cp-chip.on .cpc-star { color: inherit; }
.cpc-n { font-variant-numeric: tabular-nums; opacity: .75; }
.cpc-n:empty { display: none; }
.cp-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 6px 8px 16px; scrollbar-width: thin; }
.cp-group > summary { position: sticky; top: -6px; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 10px 10px 6px; margin: 0 -8px; list-style: none; cursor: pointer;
  font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-2); user-select: none; background: var(--card); }
.cp-group > summary::-webkit-details-marker { display: none; }
.cpg-caret { display: inline-grid; color: var(--muted); transition: transform .2s var(--ease); margin-left: 8px; }
.cpg-caret .ico { width: 13px; height: 13px; }
.cp-group[open] .cpg-caret { transform: rotate(90deg); }
.cpg-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--seg); }
.cpg-label { flex: 1; }
.cpg-n { min-width: 22px; height: 20px; padding: 0 7px; border-radius: 99px; display: grid; place-items: center; font-size: 11.5px; letter-spacing: 0; background: var(--gray-bg); color: var(--text-2); margin-right: 8px; }
.cp-rows { list-style: none; margin: 2px 0 6px; padding: 0; }
.cpr { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 12px; color: var(--text); position: relative; min-height: 52px; }
.cpr:hover { background: var(--gray-bg); text-decoration: none; }
.cpr:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.cpr.is-current { background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--brand); }
.cpr > .avatar { width: 34px; height: 34px; border-radius: 10px; font-size: 12px; }
.cpr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cpr-name { font-size: 14px; font-weight: 600; color: var(--heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.25; }
.cpr-key { color: var(--amber); font-size: 12px; }
.cpr-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
.cpr-sub.late { color: var(--red); font-weight: 600; } .cpr-sub.soon { color: var(--amber); font-weight: 600; }
.cpr-bar { height: 3px; border-radius: 3px; background: rgb(var(--tint-rgb) / .1); overflow: hidden; margin-top: 1px; }
.cpr-bar span { display: block; height: 100%; border-radius: 3px; background: var(--brand); }
.cpr-flags { display: flex; gap: 5px; align-items: center; flex-shrink: 0; }
.cpf { display: inline-grid; place-items: center; }
/* New messages: red bubble + count. At risk: orange warning sign (status orange). Needs help: a small question mark. */
.cpf.msg { display: inline-flex; align-items: center; gap: 3px; height: 19px; min-width: 19px; padding: 0 6px 0 5px; border-radius: 99px; background: var(--red); color: #fff; font-size: 11px; line-height: 1; box-shadow: 0 0 0 2px var(--panel-bg, var(--card)); }
.cpf.msg svg { width: 11px; height: 11px; }
.cpf.msg b { font-weight: 700; font-variant-numeric: tabular-nums; }
.cpf.risk { width: 20px; height: 20px; border-radius: 6px; color: var(--orange, #f08a24); background: color-mix(in srgb, var(--orange, #f08a24) 16%, transparent); }
.cpf.risk svg { width: 13px; height: 13px; }
.cpf.help { width: 18px; height: 18px; color: var(--amber); }
.cpf.help svg { width: 14px; height: 14px; }
.cp-more { display: block; padding: 6px 10px 10px 55px; font-size: 12.5px; font-weight: 600; }
.cp-sub-head { padding: 12px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.cp-empty { margin: 18px 10px; color: var(--muted); font-size: 13.5px; text-align: center; }
.cp-empty.sm { margin: 4px 10px 10px 55px; text-align: left; font-size: 12.5px; }
.sb-skel { height: 46px; border-radius: 12px; margin: 8px 4px; }

/* Tablet: the panel slides over the page */
@media (max-width: 1199px) {
  .app-shell, .cp-collapsed .app-shell { grid-template-columns: var(--rail-w) minmax(0, 1fr); }
  .cpanel, .cp-collapsed .cpanel { display: flex; position: fixed; left: var(--rail-w); top: 0; bottom: 0; width: min(var(--cp-w), calc(100vw - var(--rail-w))); transform: translateX(-110%);
    visibility: hidden; transition: transform .26s var(--ease), visibility .26s; background: var(--card); box-shadow: 30px 0 60px -24px rgba(0,0,0,.55); }
  .cp-open .cpanel { transform: none; visibility: visible; }
  .cp-scrim { display: block; position: fixed; inset: 0 0 0 var(--rail-w); z-index: 30; background: rgba(2, 10, 8, .45); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .cp-open .cp-scrim { opacity: 1; pointer-events: auto; }
  .cp-close .cp-close-desk .ico { transform: none; }
}
@media (max-width: 1000px) { .mobile-bar { display: none; } .app-main > .container { padding-top: 24px; } }

/* Phones: bottom tab bar; the panel is a full-screen sheet */
@media (max-width: 699px) {
  .app-shell, .cp-collapsed .app-shell { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .mobile-bar { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 20; padding: 8px 12px 8px 16px;
    background: var(--topbar-bg); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
  .mobile-bar .logo img { height: 26px; }
  .mb-actions { display: flex; align-items: center; gap: 6px; }
  .mb-me .avatar { width: 34px; height: 34px; }
  .app-main > .container { padding-top: 16px; padding-bottom: calc(var(--tab-h) + 40px + env(safe-area-inset-bottom)); }
  .is-staff .site-foot { padding-bottom: calc(var(--tab-h) + 24px + env(safe-area-inset-bottom)); }
  .tabbar { display: grid; grid-template-columns: repeat(6, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: calc(var(--tab-h) + env(safe-area-inset-bottom));
    padding: 6px 4px env(safe-area-inset-bottom); background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    border-top: 1px solid var(--line); }
  .tb { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 11.5px; font-weight: 600;
    border-radius: 14px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .tb:hover, .tb:active { text-decoration: none; }
  .tb-ico { position: relative; width: 56px; height: 30px; border-radius: 99px; display: grid; place-items: center; transition: background .15s; }
  .tb-ico .ico { width: 22px; height: 22px; }
  .tb.on { color: var(--heading); }
  .tb.on .tb-ico { background: var(--brand-soft); color: var(--brand-text); }
  .cpanel, .cp-collapsed .cpanel { left: 0; right: 0; top: 0; bottom: 0; width: 100%; height: 100%; transform: translateY(100%); border-right: 0; z-index: 45;
    transition: transform .3s var(--ease), visibility .3s; padding-bottom: env(safe-area-inset-bottom); }
  .cp-open .cpanel { transform: none; }
  .cp-scrim { display: none; }
  .cp-top { padding: 12px 10px 4px 16px; }
  .cp-close .cp-close-desk { display: none; } .cp-close .cp-close-mob { display: inline-grid; }
  .cp-close { width: 42px; height: 42px; }
  .cp-search { height: 48px; margin: 4px 12px 10px; }
  .cp-search input { font-size: 16px; } /* 16px stops phones zooming in */
  .cp-kbd { display: none; }
  .cp-chips { padding: 0 12px 10px; }
  .cp-chip { height: 36px; padding: 0 14px; font-size: 14px; }
  .cpr { min-height: 62px; padding: 10px 10px; }
  .cpr > .avatar { width: 40px; height: 40px; }
  .cpr-name { font-size: 15.5px; }
  .cpr-sub { font-size: 13px; }
  html.no-scroll, html.no-scroll body { overflow: hidden; }
  .is-staff #toasts { bottom: calc(var(--tab-h) + 16px + env(safe-area-inset-bottom)); }
}

/* "More" sheet (phones) */
dialog.sheet { width: 100%; max-width: 560px; margin: auto auto 0; padding: 8px 16px calc(18px + env(safe-area-inset-bottom)); border: 1px solid var(--line-2); border-bottom: 0;
  border-radius: 22px 22px 0 0; background: var(--card); color: var(--text); box-shadow: 0 -30px 80px -30px rgba(0,0,0,.7); }
dialog.sheet[open] { animation: sheetUp .28s var(--ease) both; }
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-head { position: relative; display: flex; align-items: center; justify-content: space-between; padding: 14px 0 10px; }
.sheet-head h2 { margin: 0; font-size: 18px; }
.sheet-grab { position: absolute; top: 2px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 99px; background: var(--line-2); }
.sheet-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
.sheet-grid a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 84px; padding: 10px 6px; border-radius: 14px;
  background: var(--gray-bg); border: 1px solid var(--line); color: var(--text-2); font-size: 13px; font-weight: 600; text-align: center; }
.sheet-grid a:hover { color: var(--heading); border-color: var(--brand-line); text-decoration: none; }
.sheet-grid .ico { width: 22px; height: 22px; color: var(--brand-text); }
.sheet-grid .avatar { width: 26px; height: 26px; }
.sheet-row { display: flex; gap: 10px; }
.sheet-row > * { flex: 1; }
.sheet-row form { margin: 0; } .sheet-row form .btn, .sheet-row > .btn { width: 100%; }

/* v19 polish */
:root { --cp-w: 320px; }
[data-theme-toggle] .when-light { display: none; }
:root[data-theme="light"] [data-theme-toggle] .when-light { display: inline-flex; }
:root[data-theme="light"] [data-theme-toggle] .when-dark { display: none; }
.sheet-row .btn span, .me-menu .theme-item span { align-items: center; gap: 8px; }
.cp-chips { gap: 4px; padding-right: 10px; }
.cp-chip { padding: 0 9px; font-size: 12.5px; gap: 5px; }
/* Short laptop screens: tighten the rail so every page fits without scrolling */
@media (max-height: 760px) and (min-width: 700px) {
  .rail { gap: 2px; padding-top: 8px; padding-bottom: 8px; }
  .rail-logo { width: 38px; height: 38px; } .rail-logo img { width: 28px; height: 28px; }
  .rail-new { width: 38px; height: 38px; margin: 2px 0 4px; }
  .rl { padding: 3px 0 4px; gap: 2px; }
  .rl-ico { height: 27px; }
  .rail-sep { margin: 3px 0; }
  .rail-me { margin-top: 4px; }
  .rail-me > summary .avatar { width: 34px; height: 34px; }
  .cp-top { padding-top: 10px; } .cp-title { padding-top: 4px; padding-bottom: 6px; }
}

/* ── v22: two-step sign-in, devices ── */
.code-input { font: 600 1.35rem/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .18em; text-align: center; }
.code-input.sm { font-size: 1rem; letter-spacing: .1em; width: 12em; max-width: 100%; }
.tfa-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tfa-steps { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; }
.tfa-qr { width: 184px; max-width: 100%; padding: 8px; background: #fff; border-radius: 12px; border: 1px solid var(--line); }
.tfa-qr svg { display: block; width: 100%; height: auto; }
.tfa-key { word-break: break-all; font-size: .9em; }
.tfa-more > summary { cursor: pointer; color: var(--muted); }
.codes-box { display: grid; gap: 10px; padding: 14px; border-radius: 12px; border: 1px dashed var(--brand-line); background: var(--brand-soft); }
.backup-codes { margin: 0; padding-left: 1.6em; columns: 2; column-gap: 24px; font-size: .95rem; }
.backup-codes li { padding: 2px 0; break-inside: avoid; }
@media (max-width: 420px) { .backup-codes { columns: 1; } }
@media print {
  body:has(.codes-box) * { visibility: hidden; }
  .codes-box, .codes-box * { visibility: visible; }
  .codes-box { position: absolute; inset: 0 auto auto 0; border: 0; }
  .codes-box .tfa-row { display: none; }
}

/* ── v22: return on spend (booked jobs from the CRM) ── */
.roi-band { padding: 16px 18px; margin-bottom: 14px; display: grid; gap: 12px; }
.roi-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.roi-head h3 { margin: 0; font-size: 1rem; display: flex; align-items: center; gap: 8px; }
.roi-grid { display: grid; gap: 12px; }
.roi-grid > div { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 12px; background: var(--card-2); min-width: 0; }
.roi-grid.r4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .roi-grid.r2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 900px) { .roi-grid.r4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .roi-grid.r4, .roi-grid.r2 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 420px) { .nt-head, .nt-row { grid-template-columns: minmax(0, 1fr) 46px 46px 46px; gap: 4px; } }

/* ── v22: agreement e-signature ── */
.ag-card { max-width: 820px; }
.agreement-doc { display: grid; gap: 12px; }
.ag-title { margin: 0; font-size: 20px; }
.ag-body { max-height: 52vh; overflow: auto; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--card-2); line-height: 1.6; }
.ag-body p { margin: 0 0 12px; } .ag-body p:last-child { margin-bottom: 0; }
.ag-sign { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.ag-name-input { font-size: 1.1rem; max-width: 420px; }
.ag-sig { display: grid; gap: 6px; padding-top: 12px; border-top: 1px dashed var(--line-2); }
.ag-sig-name { font: italic 600 1.5rem/1.2 Georgia, "Times New Roman", serif; color: var(--heading); }
.ag-hash { font-size: 12px; }
@media print {
  body:has(.ag-card) * { visibility: hidden; }
  .ag-card, .ag-card * { visibility: visible; }
  .ag-card { position: absolute; inset: 0 auto auto 0; width: 100%; max-width: none; border: 0; box-shadow: none; }
  .ag-sign { display: none; }
  .ag-body { max-height: none; overflow: visible; border: 0; padding: 0; background: none; }
}

/* ── v22: setup checklist (Overview) ── */
.setup-card { margin-bottom: 16px; padding: 14px 18px; }
.setup-card > summary { display: flex; align-items: center; gap: 12px; cursor: pointer; list-style: none; }
.setup-card > summary::-webkit-details-marker { display: none; }
.setup-ring { width: 34px; height: 34px; border-radius: 50%; flex: none; background: conic-gradient(var(--brand) calc(var(--p) * 1%), var(--line-2) 0); -webkit-mask: radial-gradient(circle, transparent 11px, #000 12px); mask: radial-gradient(circle, transparent 11px, #000 12px); }
.setup-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 18px; }
.setup-list li { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; }
.setup-main { display: flex; flex-direction: column; min-width: 0; }
.setup-main a { font-weight: 600; }
.setup-tick { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line-2); flex: none; display: grid; place-items: center; margin-top: 1px; }
.setup-list li.is-done .setup-tick { background: var(--green); border-color: var(--green); color: #fff; }
.setup-tick svg { width: 12px; height: 12px; }
.setup-list li.is-done .setup-main > span:first-child { color: var(--muted); text-decoration: line-through; }
.setup-hide { margin-top: 8px; text-align: right; }

@media (max-width: 480px) { .todo-list .lc-row > .btn { display: none; } .todo-list .lc-row::after { content: '›'; font-size: 22px; color: var(--muted); padding-left: 6px; } }

/* ── v23: profile tabs, Security page, two-step methods ── */
.pf-tabs { margin: 0 0 16px; }
.pf-tabs a { display: inline-flex; align-items: center; gap: 6px; }
.pf-tabs svg { width: 15px; height: 15px; }
.profile-grid.pf-two { grid-template-columns: minmax(0, 280px) minmax(0, 560px); }
@media (max-width: 700px) { .profile-grid.pf-two { grid-template-columns: minmax(0, 1fr); } }
.sec-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.sec-grid > .card { margin: 0; }
.sec-grid .tfa-card { grid-column: 2; grid-row: 1 / span 2; }
@media (max-width: 900px) { .sec-grid { grid-template-columns: minmax(0, 1fr); } .sec-grid .tfa-card { grid-column: auto; grid-row: auto; } }
.tfa-status { display: flex; gap: 12px; align-items: flex-start; margin: 0; }
.mfa-options { border: 0; padding: 0; margin: 0; display: grid; gap: 10px; min-width: 0; }
.mfa-opt { border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 14px; background: var(--card-2); transition: border-color .15s, background .15s; }
.mfa-opt:has(input[type=radio]:checked) { border-color: var(--brand); background: var(--brand-soft); }
.mfa-opt.is-off { opacity: .6; }
.mfa-pick { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 12px; align-items: start; cursor: pointer; }
.mfa-opt.is-off .mfa-pick { cursor: not-allowed; }
.mfa-pick input[type=radio] { margin: 9px 0 0; width: 18px; height: 18px; accent-color: var(--brand); }
.mfa-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mfa-text strong { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mfa-phone { margin: 10px 0 0 calc(18px + 12px + 32px + 12px); max-width: 260px; }
@media (max-width: 480px) { .mfa-phone { margin-left: 0; max-width: none; } }
.code-resend { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 12px; margin-top: 12px; }

/* ── v24: onboarding module overlay (one step at a time, side table of contents) ── */
body.has-flow { overflow: hidden; }
dialog.flow { position: fixed; inset: 0; margin: auto; padding: 0; width: min(1100px, calc(100vw - 96px)); height: min(860px, calc(100dvh - 72px)); max-width: none; max-height: none;
  border: 1px solid var(--line-2); border-radius: 22px; background: var(--card); color: var(--text); overflow: hidden; box-shadow: 0 40px 120px -24px rgba(0, 0, 0, .7); }
dialog.flow:not([open]) { display: none; }
dialog.flow::backdrop { background: rgba(2, 10, 8, .62); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
dialog.flow[open]:not(:modal) { z-index: 1000; box-shadow: 0 0 0 100vmax rgba(2, 10, 8, .62), 0 40px 120px -24px rgba(0, 0, 0, .7); }
@keyframes flow-in { from { opacity: 0; transform: translateY(14px) scale(.985); } }
.flow-shell { display: grid; grid-template-columns: 280px minmax(0, 1fr); height: 100%; animation: flow-in .3s var(--ease, ease) both; }
dialog.flow.no-enter .flow-shell { animation: none; }
@media (prefers-reduced-motion: reduce) { .flow-shell { animation: none; } }
.flow .card { margin: 0; }

/* Side table of contents */
.flow-toc { display: flex; flex-direction: column; gap: 16px; padding: 20px 12px; border-right: 1px solid var(--line); background: var(--bg-2); overflow-y: auto; }
.ft-head { display: flex; gap: 12px; align-items: center; padding: 0 8px; }
.ft-title { display: block; font-size: 16px; line-height: 1.25; color: var(--heading); }
.ft-progress { display: grid; gap: 6px; padding: 0 8px; }
.ft-bar { height: 6px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.ft-bar span { display: block; height: 100%; border-radius: inherit; background: var(--brand); transition: width .4s var(--ease, ease); }
.ft-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.ft-step a { position: relative; display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; align-items: start; padding: 8px; border-radius: 10px; color: inherit; text-decoration: none; }
.ft-step a:hover { background: var(--card-2); }
.ft-step a:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.ft-steps .ft-step:not(:last-child) a::after { content: ""; position: absolute; left: 20px; top: 36px; bottom: -4px; width: 2px; border-radius: 2px; background: var(--line-2); }
.ft-steps .ft-step.is-done:not(:last-child) a::after { background: var(--green); opacity: .45; }
.ft-dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; border: 1.5px solid var(--line-2); color: var(--muted); background: var(--card); position: relative; z-index: 1; }
.ft-dot svg { width: 14px; height: 14px; }
.ft-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ft-label { font-size: 14px; line-height: 1.3; font-weight: 500; color: var(--text-2); }
.ft-state { font-size: 12px; color: var(--muted); }
.ft-step.is-upcoming a, .ft-step.is-started a { opacity: .6; }
.ft-step.is-upcoming a:hover, .ft-step.is-started a:hover { opacity: 1; }
.ft-step.is-started .ft-dot { border-color: var(--brand-line); color: var(--brand-text); }
.ft-step.is-done .ft-dot { background: var(--green); border-color: var(--green); color: #fff; }
.ft-step.is-waiting .ft-dot { border-color: var(--amber); color: var(--amber); background: var(--amber-bg); }
.ft-step.is-attention .ft-dot { border-color: var(--red); color: var(--red); background: var(--red-bg); }
.ft-step.is-attention .ft-state { color: var(--red); }
.ft-step.is-current a { background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--brand); }
.ft-step.is-current .ft-dot { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); box-shadow: 0 0 0 4px var(--brand-soft); }
.ft-step.is-current .ft-label { color: var(--heading); font-weight: 600; }
.ft-step.is-current .ft-state { color: var(--brand-text); }
.ft-others { margin-top: auto; padding: 10px 8px 0; border-top: 1px solid var(--line); }
.ft-others > summary { display: flex; flex-direction: column; gap: 2px; cursor: pointer; font-size: 13px; font-weight: 600; list-style: none; }
.ft-others > summary::-webkit-details-marker { display: none; }
.ft-others ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 2px; }
.ft-others a { display: flex; gap: 10px; align-items: center; padding: 6px; border-radius: 8px; color: inherit; text-decoration: none; font-size: 13px; }
.ft-others a > span:last-child { display: flex; flex-direction: column; }
.ft-others a:hover, .ft-others li.is-here a { background: var(--card-2); }

/* Main column: header + progress, scrolling step, pinned buttons */
.flow-main { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-width: 0; min-height: 0; }
.flow-head { padding: 16px 24px 14px; border-bottom: 1px solid var(--line); }
.fh-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.flow-x { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); border: 1px solid var(--line-2); background: var(--card-2); flex: none; }
.flow-x:hover { color: var(--heading); border-color: var(--brand-line); }
.flow-x svg { width: 18px; height: 18px; }
.fh-bar { display: flex; gap: 4px; margin-top: 12px; }
.fh-bar .seg { flex: 1; height: 6px; border-radius: 99px; background: var(--line-2); }
.fh-bar .seg.is-done { background: var(--green); }
.fh-bar .seg.is-current { background: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.fh-bar .seg.is-waiting { background: var(--amber); opacity: .7; }
.fh-bar .seg.is-attention { background: var(--red); }
.fh-bar .seg.is-started { background: var(--brand-line); }
.flow-toc-mobile { display: none; }
.flow-body { overflow-y: auto; overscroll-behavior: contain; padding: 22px 24px 28px; display: grid; gap: 14px; align-content: start; }
.flow-title h2 { margin: 0; font-size: 26px; line-height: 1.2; color: var(--heading); outline: none; }
.flow-title p { margin: 6px 0 0; }
.flow-howto, .flow-notes, .flow-help { padding: 0; }
.flow-howto > summary, .flow-notes > summary, .flow-help > summary { display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; list-style: none; }
.flow-howto > summary::-webkit-details-marker, .flow-notes > summary::-webkit-details-marker, .flow-help > summary::-webkit-details-marker { display: none; }
.flow-howto > summary > span:nth-child(2), .flow-notes > summary > span:nth-child(2), .flow-help > summary > span:nth-child(2) { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.flow-howto > summary::after, .flow-notes > summary::after, .flow-help > summary::after { content: "\25BE"; color: var(--muted); transition: transform .2s; }
.flow-howto[open] > summary::after, .flow-notes[open] > summary::after, .flow-help[open] > summary::after { transform: rotate(180deg); }
.flow-howto .fh-content, .flow-notes > :not(summary), .flow-help > :not(summary) { padding: 0 16px 16px; }
.flow-form { padding: 18px; }
.flow-foot { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 24px; border-top: 1px solid var(--line); background: var(--card); }
.ff-mid { text-align: center; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ff-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* Tablet: narrower table of contents */
@media (max-width: 980px) { .flow-shell { grid-template-columns: 230px minmax(0, 1fr); } }
/* Phones: full screen, the steps list folds into the header */
@media (max-width: 760px) {
  dialog.flow { width: 100vw; height: 100dvh; border-radius: 0; border: 0; }
  .flow-shell { grid-template-columns: minmax(0, 1fr); }
  .flow-toc { display: none; }
  .flow-head { padding: 12px 16px 10px; }
  .flow-toc-mobile { display: block; margin-top: 10px; }
  .flow-toc-mobile > summary { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); cursor: pointer; list-style: none; }
  .flow-toc-mobile > summary::-webkit-details-marker { display: none; }
  .flow-toc-mobile > summary svg { width: 15px; height: 15px; }
  .flow-toc-mobile .ft-steps { margin-top: 8px; max-height: 40dvh; overflow-y: auto; }
  .flow-body { padding: 16px 16px 24px; }
  .flow-title h2 { font-size: 22px; }
  .flow-foot { grid-template-columns: auto minmax(0, 1fr); gap: 8px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
  .ff-mid { display: none; }
  .ff-actions { flex-wrap: nowrap; }
}
@media (max-width: 400px) { .ff-actions .btn { padding-left: 12px; padding-right: 12px; } }
.ff-actions .btn { white-space: nowrap; }
@media (max-width: 480px) { .flow-foot .btn { font-size: 14px; padding-left: 12px; padding-right: 12px; } .flow-foot .btn svg { width: 15px; height: 15px; } }

/* ── v25: steps change inside the open pop-up (no reload) ── */
@keyframes flow-step-fwd { from { opacity: 0; transform: translateX(18px); } }
@keyframes flow-step-back { from { opacity: 0; transform: translateX(-18px); } }
.flow-body.swap-fwd { animation: flow-step-fwd .24s var(--ease, ease) both; }
.flow-body.swap-back { animation: flow-step-back .24s var(--ease, ease) both; }
dialog.flow.is-loading .flow-body { opacity: .5; transition: opacity .15s .12s; pointer-events: none; }
dialog.flow.is-loading .flow-foot .btn { pointer-events: none; }
@keyframes flow-loading { from { background-position: -200px 0; } to { background-position: calc(100% + 200px) 0; } }
dialog.flow.is-loading .fh-bar { background: linear-gradient(90deg, transparent, var(--brand-soft), transparent) no-repeat; background-size: 200px 100%; animation: flow-loading 1s linear infinite; }
@media (prefers-reduced-motion: reduce) { .flow-body.swap-fwd, .flow-body.swap-back, dialog.flow.is-loading .fh-bar { animation: none; } }

.check-hint { display: block; margin-top: 2px; font-weight: 400; }

/* ── v26: client menu items that unlock after onboarding ── */
.topbar nav .nav-locked { display: inline-flex; align-items: center; gap: 5px; padding: 7px 12px; border-radius: 9px; font-size: 14px; font-weight: 500;
  color: var(--muted); opacity: .55; cursor: not-allowed; white-space: nowrap; }
.topbar nav .nav-locked svg { width: 13px; height: 13px; }
.topbar nav .nav-locked:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; opacity: .8; }

/* ── v26: client hub home (after onboarding) ── */
.hub-page { display: grid; gap: 16px; }
.hub-page > :not(dialog) { margin: 0; }
.hub-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 24px; flex-wrap: wrap; padding: 24px; }
.hh-main { display: flex; gap: 18px; align-items: center; min-width: 0; flex: 1 1 420px; }
.hh-logo { width: 72px; height: 72px; border-radius: 18px; background: #fff; display: grid; place-items: center; padding: 8px; flex: none; box-shadow: var(--shadow); }
.hh-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.hh-text { min-width: 0; }
.hh-text .eyebrow { margin: 0; }
.hh-text h1 { margin: 2px 0 6px; font-size: 30px; }
.hh-text .lead { margin: 0; max-width: 620px; }
.hh-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.chip-live .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-bg); display: inline-block; }
.hub-h2 { font-size: 17px; margin: 0; display: flex; align-items: center; gap: 8px; color: var(--heading); }
.hub-h2 svg { width: 17px; height: 17px; color: var(--muted); }
.hub-allclear { margin: 0; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.hub-allclear svg { color: var(--green); width: 16px; height: 16px; }
.hub-section { display: grid; gap: 12px; }
.hub-section .sc-head { margin-bottom: 0; }
.hub-kpis { margin: 0; }
.hub-kpis .kpi { color: inherit; text-decoration: none; transition: border-color .15s, transform .15s; }
.hub-kpis .kpi:hover { border-color: var(--brand-line); transform: translateY(-1px); text-decoration: none; }
.hub-page .goal-card { margin: 0; }
.hub-empty { display: flex; gap: 14px; align-items: center; padding: 18px; margin: 0; }
.hub-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.hub-main, .hub-side { display: grid; gap: 16px; min-width: 0; }
.hub-main > *, .hub-side > * { margin: 0; }
.hub-card { padding: 18px; }
.hub-report { display: grid; gap: 4px; padding: 12px 14px; border-radius: 12px; background: var(--card-2); color: inherit; text-decoration: none; }
.hub-report:hover { text-decoration: none; box-shadow: inset 0 0 0 1px var(--brand-line); }
.hr-summary { font-size: 14px; color: var(--text-2); line-height: 1.5; margin-top: 4px; }
.hub-tracks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.hub-tracks li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.ht-main { display: flex; flex-direction: column; min-width: 0; }
.hub-feed { padding: 0; }
.hub-links { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 10px; }
.hub-links a { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 10px; color: var(--text-2); font-size: 14px; }
.hub-links a:hover { background: var(--card-2); color: var(--heading); text-decoration: none; }
.hub-links svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
@media (max-width: 1000px) { .hub-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .hub-hero { padding: 18px; }
  .hh-main { flex-basis: 100%; align-items: flex-start; }
  .hh-text h1 { font-size: 24px; }
  .hh-logo { width: 52px; height: 52px; border-radius: 14px; padding: 6px; }
  .hh-actions { width: 100%; }
  .hh-actions .btn { flex: 1; justify-content: center; }
  .hub-card { padding: 16px; }
}

/* ── v27: onboarding call, reviews, one-pager, shared steps, insights, access check ── */
.kickoff-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 18px 20px; margin-bottom: 16px;
  border-color: var(--brand-line); background: linear-gradient(135deg, var(--brand-soft), transparent 70%), var(--card); }
.kickoff-card h2 { margin: 2px 0 4px; font-size: 20px; color: var(--heading); }
.kickoff-card p { margin: 0; }
.ko-step { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-text); }
.ko-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.ko-actions form { margin: 0; }
.kickoff-card.is-booked { background: var(--card); border-color: color-mix(in srgb, var(--green) 40%, transparent); }
.kickoff-card.is-booked .mc-icon { color: var(--green); }
.kickoff-card.is-booked h2 { font-size: 16px; }
@media (max-width: 640px) { .kickoff-card { grid-template-columns: auto minmax(0, 1fr); } .ko-actions { grid-column: 1 / -1; align-items: stretch; } .ko-actions .btn { justify-content: center; } }
dialog.kickoff-dialog { width: min(900px, calc(100vw - 32px)); height: min(820px, calc(100dvh - 32px)); max-width: none; max-height: none; padding: 0;
  border: 1px solid var(--line-2); border-radius: 18px; background: var(--card); color: var(--text); overflow: hidden; }
dialog.kickoff-dialog[open] { display: flex; flex-direction: column; }
dialog.kickoff-dialog::backdrop { background: rgba(2, 10, 8, .62); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.kd-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.kd-head h2 { margin: 0; font-size: 18px; }
.kd-frame { flex: 1; width: 100%; min-height: 0; border: 0; background: #fff; }
.kd-foot { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--line); margin: 0; }
.kd-when { margin: 0; flex: 1 1 200px; max-width: 280px; }
@media (max-width: 640px) { dialog.kickoff-dialog { width: 100vw; height: 100dvh; border-radius: 0; border: 0; } }
/* Go-live date moves: who and why, on the card and in the dialog's history */
.gl-head .btn.link { padding: 4px 8px; font-size: 12.5px; }
.gl-head .btn.link svg { width: 14px; height: 14px; }
.gl-moved { display: grid; gap: 2px; width: 100%; margin-top: 8px; padding: 8px 10px; border-radius: 10px; text-align: left; font: inherit; font-size: 12.5px; cursor: pointer;
  color: var(--text-2); background: color-mix(in srgb, var(--amber) 8%, transparent); border: 1px solid color-mix(in srgb, var(--amber) 25%, transparent); }
.gl-moved:hover { border-color: color-mix(in srgb, var(--amber) 45%, transparent); }
.gl-moved .gm-who { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; } .gl-moved .gm-who svg { width: 13px; height: 13px; color: var(--amber); flex: none; }
.gl-moved .gm-why { color: var(--heading); overflow-wrap: anywhere; }
.gl-moved .gm-more { color: var(--brand-text); font-weight: 500; }
.gl-field { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); }
.gl-history { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.gl-history h3 { margin: 0 0 8px; font-size: 13px; color: var(--text-2); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.gl-history ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 240px; overflow: auto; }
.gl-history li { display: grid; gap: 2px; padding: 8px 10px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); }
.gh-dates { display: flex; align-items: center; gap: 6px; font-size: 13px; } .gh-dates svg { width: 13px; height: 13px; color: var(--muted); }
.gh-why { font-size: 13px; color: var(--heading); overflow-wrap: anywhere; }
.gl-kickoff { display: flex; gap: 6px; align-items: center; margin-top: 8px; }
.gl-kickoff svg { width: 14px; height: 14px; flex: none; }
.gl-kickoff.is-booked svg { color: var(--green); }
.gl-verify { margin: 10px 0 0; }

/* Reviews on the client hub */
.hub-rating { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.hr-score { font-size: 30px; font-weight: 600; color: var(--heading); letter-spacing: -.03em; }
.hr-stars { position: relative; display: inline-block; font-size: 18px; letter-spacing: 2px; color: var(--line-2); line-height: 1; }
.hr-stars span { position: absolute; inset: 0 auto 0 0; overflow: hidden; white-space: nowrap; color: var(--amber); }
.hub-reviews { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.hub-reviews li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; }
.hub-reviews li > span:last-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hr-quote { font-size: 14px; color: var(--text-2); }

/* Send a step to someone else */
.flow-share { padding: 0; }
.flow-share > summary { display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; list-style: none; }
.flow-share > summary::-webkit-details-marker { display: none; }
.flow-share > summary > span:nth-child(2) { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.flow-share > summary::after { content: "\25BE"; color: var(--muted); transition: transform .2s; }
.flow-share[open] > summary::after { transform: rotate(180deg); }
.fs-body { padding: 0 16px 16px; }
.fs-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.fs-list li { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--card-2); font-size: 14px; }
.fs-list form { margin: 0; flex: none; }
.fs-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.fs-form .fs-note, .fs-form .tfa-row, .fs-form .fs-result { grid-column: 1 / -1; }
.fs-form .field { margin: 0; }
@media (max-width: 560px) { .fs-form { grid-template-columns: minmax(0, 1fr); } }
.fs-result { padding: 10px 12px; border-radius: 10px; }
.fs-result.is-ok { background: var(--brand-soft); border: 1px solid var(--brand-line); }
.fs-result.is-error { background: var(--red-bg); color: var(--red); font-size: 14px; }
.fs-link { display: flex; gap: 8px; }
.fs-link input { flex: 1; min-width: 0; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }

/* The page a helper opens from a shared link */
.share-page { max-width: 1100px; margin: 0 auto; display: grid; gap: 16px; }
.share-page .hero { margin-bottom: 0; }
.share-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.share-grid > .card { margin: 0; }
@media (max-width: 900px) { .share-grid { grid-template-columns: minmax(0, 1fr); } }
.share-done { display: flex; gap: 16px; align-items: center; padding: 22px; max-width: 640px; margin: 0 auto; }
.share-done h2 { margin: 0 0 4px; }
.share-done p { margin: 0; }
.share-help { text-align: center; }
.share-help svg { width: 14px; height: 14px; vertical-align: -2px; }

/* Team one-pager */
.op-page { display: grid; gap: 14px; }
.op-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.op-card { padding: 16px 18px; margin: 0; }
.op-card h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 16px; color: var(--heading); }
.op-card h2 svg { width: 16px; height: 16px; color: var(--muted); }
.op-card h3 { margin: 12px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.op-facts dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px 18px; margin: 0; }
.op-facts dt, .op-kv dt { font-size: 12px; color: var(--muted); }
.op-facts dd, .op-kv dd { margin: 2px 0 0; font-size: 14px; color: var(--text); overflow-wrap: anywhere; }
.op-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; align-items: start; }
.op-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.op-list li { min-width: 0; overflow-wrap: anywhere; }
.op-list.op-inline { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.op-sub { display: block; font-size: 12.5px; color: var(--muted); }
.op-access li { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.op-access li svg { width: 14px; height: 14px; color: var(--muted); vertical-align: -2px; }
.op-kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; margin: 0; }
.op-kv.op-wrap { grid-template-columns: minmax(0, 1fr); }
@media print {
  .topbar, .rail, .cpanel, .tabbar, .client-tabs, .crumbs, .no-print, .help-fab, #toasts, .mb-bar { display: none !important; }
  .op-card { break-inside: avoid; box-shadow: none; }
  body { background: #fff; }
}

/* Where clients get stuck */
.ins-top { display: grid; gap: 10px; }
.ins-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.ins-card { padding: 16px; margin: 0; border-color: color-mix(in srgb, var(--amber) 35%, transparent); }
.ins-card h3 { margin: 2px 0 8px; font-size: 16px; color: var(--heading); }
.ins-tips { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 13.5px; color: var(--text-2); }
.ins-table td { vertical-align: top; }
.ins-bar { width: 120px; max-width: 100%; height: 8px; border-radius: 0 4px 4px 0; background: transparent; margin: 4px 0; }
.ins-bar span { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--ch-1, var(--brand)); min-width: 3px; }

@media (max-width: 640px) {
  .ins-table thead { display: none; }
  .ins-table, .ins-table tbody, .ins-table tr, .ins-table td { display: block; width: 100%; }
  .ins-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .ins-table td { padding: 0; border: 0; }
  .ins-table td:first-child { grid-column: 1 / -1; }
  .ins-table td[data-label]::before { content: attr(data-label); display: block; font-size: 11.5px; color: var(--muted); }
}
.hr-who { display: block; }
.fs-list li { flex-wrap: wrap; }

/* Team review: the next step to check gets a brief highlight; Review next button */
.rp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.rp-next .badge { margin-left: 2px; }
details.card.step.just-opened { animation: stepPulse 1.2s var(--ease); }
@keyframes stepPulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand) 55%, transparent); } 100% { box-shadow: 0 0 0 14px transparent; } }

/* ── v33: client hub redesign, attachments, account menu ── */

/* Client top bar: compact account menu */
.acct-menu > summary.me-link { display: inline-flex; align-items: center; gap: 8px; padding: 3px 8px 3px 3px; border-radius: 99px; border: 1px solid var(--line); cursor: pointer; color: var(--text); }
.acct-menu > summary.me-link:hover, .acct-menu[open] > summary.me-link { border-color: var(--line-2); background: var(--gray-bg); }
.acct-menu > summary .ico { width: 13px; height: 13px; color: var(--muted); }
.acct-menu .menu-list { right: 0; left: auto; min-width: 250px; }
.mm-head { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); min-width: 0; }
.mm-head strong { color: var(--heading); }
.mm-head span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-menu .menu-list a, .acct-menu .mm-out { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px; background: none; color: var(--text); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.acct-menu .menu-list a:hover, .acct-menu .mm-out:hover { background: var(--gray-bg); color: var(--heading); text-decoration: none; }
.acct-menu .menu-list .ico { width: 16px; height: 16px; color: var(--muted); }
@media (max-width: 1000px) { .acct-menu .menu-list { right: 0; left: auto; } }
@media (max-width: 1280px) { .topbar .live-txt { display: none; } .topbar .live { padding: 6px; } }

/* ── Hub ── */
.hub2 .hub-h2 { font-size: 16.5px; }
.hx { padding: 22px 24px; display: grid; gap: 18px; position: relative; overflow: hidden; }
.hx::before { content: ""; position: absolute; inset: -40% -10% auto auto; width: 520px; height: 320px; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--brand) 16%, transparent), transparent); }
.hx > * { position: relative; }
.hx-row { display: flex; justify-content: space-between; align-items: center; gap: 16px 24px; flex-wrap: wrap; }
.hx-id { display: flex; gap: 16px; align-items: center; min-width: 0; flex: 1 1 420px; }
.hx-logo { width: 64px; height: 64px; border-radius: 18px; background: #fff; display: grid; place-items: center; padding: 8px; flex: none; box-shadow: var(--shadow); }
.hx-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.hx-mono { padding: 0; font-size: 28px; font-weight: 700; color: var(--brand-ink); background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.hx-text { min-width: 0; }
.hx-eyebrow { margin: 0 0 3px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.hx-stage { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; letter-spacing: .02em; text-transform: none; border: 1px solid transparent; }
.hx-stage .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.hx-stage.tone-green { color: var(--green); background: var(--green-bg); border-color: color-mix(in srgb, var(--green) 35%, transparent); }
.hx-stage.tone-violet { color: var(--violet); background: var(--violet-bg); border-color: color-mix(in srgb, var(--violet) 35%, transparent); }
.hx-stage.tone-gray { color: var(--muted); background: var(--gray-bg); border-color: var(--line-2); }
.hx.is-live .hx-stage .dot { box-shadow: 0 0 0 0 currentColor; animation: hxPulse 2.4s ease-out infinite; }
@keyframes hxPulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 60%, transparent); } 70%, 100% { box-shadow: 0 0 0 7px transparent; } }
.hx h1 { margin: 0; font-size: 30px; line-height: 1.15; letter-spacing: -.025em; color: var(--heading); }
.hx-sub { margin: 6px 0 0; color: var(--text-2); max-width: 620px; font-size: 15px; }
.hx-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.hx-actions .nav-count { margin-left: 2px; }
.hx-journey { display: flex; align-items: center; gap: 16px 28px; padding-top: 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.jx { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); flex: 1 1 480px; }
.jx li { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.jx li:not(:last-child)::after { content: ""; position: absolute; top: 16px; left: 46px; right: 12px; height: 3px; border-radius: 3px; background: rgb(var(--tint-rgb) / .1); }
.jx li.is-done::after { background: var(--green); }
.jx li.is-now::after { background: linear-gradient(90deg, var(--brand) calc(var(--p, 0) * 1%), rgb(var(--tint-rgb) / .1) 0); }
.jx-dot { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line-2); color: var(--muted); background: var(--card); }
.jx-dot .ico { width: 16px; height: 16px; }
.jx li.is-done .jx-dot { background: var(--green); border-color: var(--green); color: #052a1d; }
.jx li.is-now .jx-dot { border-color: var(--brand); color: var(--brand-text); background: var(--brand-soft); box-shadow: 0 0 0 5px color-mix(in srgb, var(--brand) 12%, transparent); }
.jx-txt { display: flex; flex-direction: column; gap: 1px; font-size: 12.5px; color: var(--muted); }
.jx-txt strong { font-size: 14px; color: var(--heading); }
.hx-count { display: flex; flex-direction: column; padding-left: 26px; border-left: 1px solid var(--line); min-width: 120px; }
.hx-count strong { font-size: 36px; font-weight: 600; line-height: 1; letter-spacing: -.035em; color: var(--heading); font-variant-numeric: tabular-nums; }
.hx-count span { margin-top: 4px; font-size: 12.5px; color: var(--muted); }

/* Needs your attention */
.nx { display: grid; gap: 10px; }
.nx-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 4px var(--amber-bg); margin: 0 3px; }
.nx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.nx-card { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; row-gap: 10px; align-items: start; padding: 14px 16px; margin: 0; color: inherit;
  box-shadow: inset 3px 0 0 var(--amber), var(--shadow); transition: transform .15s var(--ease), border-color .15s; }
.nx-card:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--amber) 45%, transparent); text-decoration: none; }
.nx-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nx-main strong { color: var(--heading); font-size: 14.5px; line-height: 1.35; }
.nx-cta { grid-column: 2; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--brand-text); }
.nx-cta .ico { width: 14px; height: 14px; }

/* Layout */
.hub2-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.hub2-main, .hub2-side { display: grid; gap: 16px; min-width: 0; align-content: start; }
.hub2-main > *, .hub2-side > * { margin: 0; }
.hub2-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.hub2-pair > * { margin: 0; }
@media (min-width: 1001px) {
  .hub2-side { align-self: stretch; }
  .hub2-side .chat { position: sticky; top: 84px; max-height: calc(100vh - 100px); }
}
@media (max-width: 1000px) { .hub2-grid { grid-template-columns: minmax(0, 1fr); } }

/* Launch plan */
.lp-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.lp-list li { position: relative; display: grid; grid-template-columns: 22px auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px; border-radius: 12px; }
.lp-list li:not(:last-child)::after { content: ""; position: absolute; left: 20px; top: 38px; bottom: -14px; width: 2px; background: var(--line-2); }
.lp-list li[data-state="done"]::after { background: var(--green); }
.lp-dot { position: relative; z-index: 1; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line-2); background: var(--card); color: #052a1d; }
.lp-dot .ico { width: 12px; height: 12px; stroke-width: 2.6; opacity: 0; }
.lp-list li[data-state="done"] .lp-dot { background: var(--green); border-color: var(--green); }
.lp-list li[data-state="done"] .lp-dot .ico { opacity: 1; }
.lp-list li[data-state="in_progress"] { background: color-mix(in srgb, var(--violet) 8%, transparent); }
.lp-list li[data-state="in_progress"] .lp-dot { border-color: var(--violet); box-shadow: 0 0 0 4px var(--violet-bg); }
.lp-list li[data-state="in_progress"] .lp-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--violet); position: absolute; }
.lp-list li[data-state="skipped"] { opacity: .5; }
.lp-main { display: flex; flex-direction: column; min-width: 0; }
.lp-main strong { color: var(--heading); }
.lp .build-meter { margin: 0 0 12px; }

/* Requests */
.rq-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.rq-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line); color: var(--text); }
.rq-row:hover { border-color: var(--brand-line); text-decoration: none; }
.rq-row.needs-you { box-shadow: inset 3px 0 0 var(--amber); }
.rq-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.rq-main strong { color: var(--heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rq-row > .ico { width: 14px; height: 14px; color: var(--muted); flex: none; }
.rq-empty { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 12px; }
.rq-empty p { margin: 2px 0 0; }
.hr-month { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }

/* Your team + conversation */
.chat { padding: 0; display: flex; flex-direction: column; min-height: 0; }
.chat-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 16px 16px 14px; border-bottom: 1px solid var(--line); }
.cx-who { display: flex; gap: 11px; align-items: center; min-width: 0; }
.cx-txt { display: flex; flex-direction: column; min-width: 0; }
.cx-txt h2 { margin: 0; font-size: 16px; color: var(--heading); }
.cx-actions { display: flex; gap: 6px; flex: none; }
.cx-btn { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--text-2); background: var(--gray-bg); border: 1px solid var(--line); transition: color .15s, border-color .15s, background .15s; }
.cx-btn:hover { color: var(--brand-text); border-color: var(--brand-line); background: var(--brand-soft); text-decoration: none; }
.cx-btn .ico { width: 16px; height: 16px; }
.cx-team { display: flex; align-items: center; gap: 0; padding: 9px 16px; border-bottom: 1px solid var(--line); }
.cx-team > span[title] .avatar { border: 2px solid var(--card); margin-left: -6px; }
.cx-team > span[title]:first-child .avatar { margin-left: 0; }
.cx-team .muted { margin-left: 8px; }
.chat .notes { display: flex; flex-direction: column; min-height: 0; flex: 1; padding: 14px 16px 16px; }
.chat .note-list { flex: 1 1 auto; min-height: 140px; max-height: none; }
@media (max-width: 1000px) { .chat .note-list { max-height: 460px; } }
.chat .note-empty { padding: 18px 8px; text-align: center; }

/* Message composer (everywhere): one box with the text, attachments and send */
.note-form { gap: 6px; margin-top: 12px; padding: 6px 8px 8px; border: 1px solid var(--line-2); border-radius: 16px; background: var(--bg-2); transition: border-color .15s, box-shadow .15s; }
.note-form:focus-within { border-color: var(--brand-line); box-shadow: 0 0 0 3px var(--brand-soft); }
.note-form textarea, .note-form textarea:focus { border: 0; background: transparent; box-shadow: none; outline: none; padding: 8px 6px 4px; min-height: 44px; resize: none; }
.note-actions { gap: 8px; }
.note-form .note-hint { display: none; }
@media (min-width: 1200px) { .note-form .note-hint { display: inline; } }

/* Attach buttons */
.att-tools { position: relative; display: flex; gap: 2px; align-items: center; margin-right: auto; }
.att-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 9px; font-size: 13px; font-weight: 500; color: var(--text-2);
  background: transparent; border: 1px solid transparent; cursor: pointer; font-family: inherit; }
.att-btn:hover, .att-btn:focus-within, .att-btn[aria-expanded="true"] { background: var(--gray-bg); border-color: var(--line); color: var(--heading); }
.att-btn .ico { width: 16px; height: 16px; }
.drive-ico { width: 16px; height: 14px; flex: none; }
.att-drive-pop { position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 40; width: min(360px, 84vw); padding: 12px; border-radius: 14px; display: grid; gap: 8px;
  background: var(--card); border: 1px solid var(--line-2); box-shadow: var(--shadow), 0 18px 40px -16px rgba(0, 0, 0, .5); animation: rise .2s var(--ease) both; }
.att-drive-pop[hidden] { display: none; }
.att-drive-pop p { margin: 0; }
.adp-row { display: flex; gap: 6px; }
.adp-row input { min-width: 0; padding: 8px 10px; font-size: 13.5px; }
.adp-pick { justify-content: center; }
.adp-pick .drive-ico { background: #fff; border-radius: 4px; padding: 1px; width: 18px; height: 16px; }
.te-actions .att-tools, .field .att-tools { margin-right: auto; }
.field > .att-tools { margin: 0; justify-self: start; }

/* Chosen files, before sending */
.att-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.att-chips:empty { display: none; }
.att-chip { position: relative; display: flex; align-items: center; gap: 9px; padding: 6px 30px 6px 6px; max-width: 260px; border-radius: 12px; overflow: hidden;
  background: var(--card-2); border: 1px solid var(--line-2); animation: rise .25s var(--ease) both; }
.ac-ic { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; flex: none; overflow: hidden; background: rgb(var(--tint-rgb) / .07); font-size: 9.5px; font-weight: 700; letter-spacing: .03em; color: var(--muted); }
.ac-ic img { width: 100%; height: 100%; object-fit: cover; }
.ac-ic .drive-ico { width: 20px; height: 18px; }
.ac-text { display: flex; flex-direction: column; min-width: 0; }
.ac-name { font-size: 13px; font-weight: 500; color: var(--heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-sub { font-size: 11.5px; color: var(--muted); }
.ac-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; }
.ac-bar i { display: block; width: 0; height: 100%; background: var(--brand); transition: width .2s; }
.att-chip:not(.is-uploading) .ac-bar { display: none; }
.att-chip.is-uploading .ac-sub::after { content: " · uploading…"; }
.ac-x { position: absolute; top: 5px; right: 5px; width: 22px; height: 22px; padding: 0; border-radius: 50%; border: 0; background: transparent; color: var(--muted); font-size: 17px; line-height: 1; cursor: pointer; }
.ac-x:hover { background: var(--gray-bg); color: var(--heading); }
.att-chip.is-error { border-color: color-mix(in srgb, var(--red) 50%, transparent); max-width: 100%; }
.att-chip.is-error .ac-sub { color: var(--red); white-space: normal; }
form.is-dropping { outline: 2px dashed var(--brand); outline-offset: 4px; }

/* Sent attachments */
.att-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.att a { display: flex; align-items: center; gap: 10px; max-width: 280px; padding: 7px 12px 7px 7px; border-radius: 12px; border: 1px solid var(--line-2); background: rgb(var(--tint-rgb) / .04); color: var(--text); }
.att a:hover { border-color: var(--brand-line); text-decoration: none; }
.att-ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--brand-soft); color: var(--brand-text); }
.att-ic .ico { width: 18px; height: 18px; }
.kind-drive .att-ic { background: #fff; border: 1px solid var(--line); }
.att-text { display: flex; flex-direction: column; min-width: 0; }
.att-name { font-size: 13px; font-weight: 500; color: var(--heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-sub { font-size: 11.5px; color: var(--muted); }
.att.is-img a { width: 210px; padding: 0; gap: 0; flex-direction: column; align-items: stretch; overflow: hidden; }
.att.is-img img { display: block; width: 100%; height: 140px; object-fit: cover; background: rgb(var(--tint-rgb) / .05); }
.att.is-img .att-text { padding: 6px 10px 8px; }
.note-bubble .att-list { margin-top: 6px; }
.ib-text + .att-list, .item-body .att-list { margin-top: 12px; }

/* New request pop-up */
dialog.req-dialog { width: min(580px, calc(100vw - 24px)); }
.req-dialog form { gap: 14px; }
.nr-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.nr-head h2 { margin: 0; font-size: 21px; }
.nr-kinds { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.nr-kinds legend { margin-bottom: 8px; }
.nr-kind { position: relative; }
.nr-kind input { position: absolute; opacity: 0; pointer-events: none; }
.nr-kind span { display: inline-block; padding: 7px 13px; border-radius: 99px; border: 1px solid var(--line-2); font-size: 13px; cursor: pointer; color: var(--text-2); transition: background .15s, border-color .15s; }
.nr-kind span:hover { border-color: var(--brand-line); }
.nr-kind input:checked + span { background: var(--brand-soft); border-color: var(--brand-line); color: var(--heading); font-weight: 600; }
.nr-kind input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.req-dialog .modal-actions { justify-content: space-between; align-items: center; }

/* Phones */
@media (max-width: 700px) {
  .hx { padding: 18px; gap: 16px; }
  .hx-logo { width: 52px; height: 52px; border-radius: 15px; }
  .hx h1 { font-size: 24px; }
  .hx-id { flex-basis: 100%; }
  .hx-actions { width: 100%; }
  .hx-actions > * { flex: 1 1 0; justify-content: center; }
  .jx { flex-basis: 100%; }
  .jx-txt { font-size: 11.5px; }
  .hx-count { flex-direction: row; align-items: baseline; gap: 8px; padding-left: 0; border-left: 0; }
  .hx-count strong { font-size: 28px; }
  .chat-head { flex-wrap: wrap; }
  .att-btn span { display: none; }
  .att-btn { padding: 0 9px; }
}
.hub2-main-rest { display: contents; }
.hub2-grid { grid-template-columns: minmax(0, 1fr) 400px; }
@media (max-width: 1000px) { .hub2-grid { grid-template-columns: minmax(0, 1fr); } }
.chat .note-hint, .chat .note-form .note-hint { display: none; }
.cx-line { display: flex; align-items: center; gap: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-line .ico { width: 12px; height: 12px; flex: none; }
.att-drive-pop { width: min(340px, calc(100vw - 48px)); }
.hub2-stack { display: contents; }
@media (max-width: 700px) {
  .lp-list li { grid-template-columns: 22px auto minmax(0, 1fr); row-gap: 6px; }
  .lp-list li .badge { grid-column: 3; justify-self: start; }
  .lp-list li:not(:last-child)::after { top: 34px; }
  .hub-kpis.kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .hub-kpis .kpi { padding: 12px 14px; }
  .hub-kpis .kpi-num { font-size: 26px; }
  .hub-kpis .delta .muted { display: none; }
  .src-list li { grid-template-columns: minmax(0, 1fr) auto; row-gap: 4px; }
  .src-list .src-bar { grid-column: 1 / -1; order: 3; }
  .hub2 .sc-head { flex-wrap: wrap; }
}

/* ── v41: read receipts and team tools on messages ── */
.note-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0 4px; }
.note-tick { display: inline-flex; margin-left: 4px; color: var(--muted); }
.note-tick .ico { width: 15px; height: 15px; }
.note.is-seen .note-tick { color: var(--brand-text); }
.note-seen { margin-top: 4px; font-size: 11.5px; color: var(--muted); text-align: right; }
.note.is-seen .note-seen { color: var(--brand-text); }
.note-more { margin-left: auto; width: 26px; height: 22px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 17px; line-height: 1; cursor: pointer; opacity: .55; transition: opacity .15s, background .15s; }
.note:hover .note-more, .note-more:focus-visible { opacity: 1; }
.note-more:hover { background: var(--gray-bg); color: var(--heading); }
@media (hover: none) { .note-more { opacity: 1; } }
.note-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.nc-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 500; border: 1px solid var(--line-2); background: var(--gray-bg); color: var(--text-2); }
.nc-chip .ico { width: 12px; height: 12px; }
.nc-chip.asana { color: #f06a6a; border-color: color-mix(in srgb, #f06a6a 40%, transparent); background: color-mix(in srgb, #f06a6a 10%, transparent); }
.nc-chip.asana:hover { text-decoration: none; border-color: #f06a6a; }
.nc-chip.remind { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 40%, transparent); background: var(--amber-bg); }

/* The ⋯ menu (one per page, placed next to the message) */
.note-menu { position: fixed; z-index: 60; width: 270px; padding: 6px; border-radius: 14px; display: grid; gap: 2px;
  background: var(--card); border: 1px solid var(--line-2); box-shadow: var(--shadow), 0 20px 50px -18px rgba(0, 0, 0, .6); animation: rise .18s var(--ease) both; }
.note-menu[hidden] { display: none; }
.note-menu > button, .note-menu > a, .nm-off { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px; background: none; color: var(--text); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.note-menu > button:hover, .note-menu > a:hover { background: var(--gray-bg); color: var(--heading); text-decoration: none; }
.note-menu > [hidden] { display: none; }
.note-menu .ico { width: 16px; height: 16px; color: var(--muted); flex: none; }
.nm-off { cursor: default; color: var(--muted); font-size: 13px; flex-wrap: wrap; }
.nm-group { padding: 6px 4px 8px; margin: 2px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.nm-label { display: flex; align-items: center; gap: 10px; padding: 4px 6px 6px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.nm-times { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.nm-times button { padding: 7px 8px; border-radius: 9px; border: 1px solid var(--line); background: var(--card-2); color: var(--text); font: inherit; font-size: 12.5px; cursor: pointer; }
.nm-times button:hover { border-color: var(--brand-line); color: var(--heading); }
.nm-custom { display: flex; gap: 6px; margin-top: 6px; }
.nm-custom input { min-width: 0; padding: 6px 8px; font-size: 12.5px; }

/* Create an Asana task */
dialog.asana-dialog { width: min(620px, calc(100vw - 24px)); }
.asana-dialog form { gap: 14px; }
.asana-dialog textarea { min-height: 140px; }
.ad-row { display: grid; grid-template-columns: 1.2fr 1fr .8fr; gap: 10px; }
@media (max-width: 640px) { .ad-row { grid-template-columns: minmax(0, 1fr); } }
.asana-dialog .modal-actions { justify-content: space-between; align-items: center; }
.note-meta { display: block; }
.note-tick { vertical-align: -3px; }
[data-note-tools] .note-bubble { position: relative; }
[data-note-tools] .note-meta { padding-right: 24px; }
.note-more { position: absolute; top: 5px; right: 5px; margin: 0; }

/* ── v43: Settings, one section per topic with a side menu ── */
.set-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 24px; align-items: start; }
.set-nav { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 2px; max-height: calc(100vh - 40px); overflow-y: auto; padding-bottom: 12px; }
.set-search { display: flex; align-items: center; gap: 8px; padding: 0 10px; margin-bottom: 8px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--bg-2); }
.set-search:focus-within { border-color: var(--brand-line); box-shadow: 0 0 0 3px var(--brand-soft); }
.set-search .ico { width: 16px; height: 16px; color: var(--muted); flex: none; }
.set-search input { border: 0; background: transparent; padding: 9px 0; box-shadow: none; outline: none; font-size: 14px; }
.sn-group { margin: 14px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.set-nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--text-2); font-size: 14px; font-weight: 500; }
.set-nav a .ico { width: 16px; height: 16px; color: var(--muted); flex: none; }
.set-nav a span { flex: 1; min-width: 0; }
.set-nav a:hover { background: var(--gray-bg); color: var(--heading); text-decoration: none; }
.set-nav a[aria-current="true"] { background: var(--brand-soft); color: var(--heading); box-shadow: inset 2px 0 0 var(--brand); }
.set-nav a[aria-current="true"] .ico { color: var(--brand-text); }
.set-nav a.is-out { opacity: .4; }
.sn-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.sn-dot.on { background: var(--green); } .sn-dot.off { background: var(--red); }
.sn-count { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.set-main { display: grid; gap: 18px; min-width: 0; }
.set-main > * { margin: 0; }
.set-sec { padding: 0; scroll-margin-top: 20px; }
.set-sec.locked-note { padding: 18px 20px; }
.ss-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 22px 14px; border-bottom: 1px solid var(--line); }
.ss-head > div { flex: 1; min-width: 0; }
.ss-head h2 { margin: 0; font-size: 18px; color: var(--heading); }
.ss-head p { margin: 3px 0 0; }
.ss-head .badge { flex: none; margin-top: 2px; }
.ss-body { padding: 18px 22px 20px; }
.set-sec form.ss-body { gap: 14px; }
.set-sec .field.narrow { max-width: 320px; }
.set-sec .field-heading:first-of-type { margin-top: 0; }
.ss-foot { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; padding-top: 14px; margin-top: 4px; border-top: 1px solid var(--line); }
.ss-dirty { display: inline-flex; align-items: center; gap: 6px; margin-right: auto; font-size: 13px; font-weight: 600; color: var(--amber); }
.ss-dirty .ico { width: 15px; height: 15px; }
.ss-foot.sticky { position: sticky; bottom: 0; z-index: 2; margin: 14px -22px -20px; padding: 12px 22px; background: var(--sticky-bg); border-radius: 0 0 var(--radius) var(--radius); backdrop-filter: blur(8px); }
form.is-dirty .ss-foot .btn.primary { box-shadow: 0 0 0 3px var(--brand-soft); }
.set-sec .ec-grid { gap: 24px; }
.set-sec .ec-help .guide { padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg-2); }
/* Integrations: one card per tool, opened when you need it */
.ig-cat { margin: 4px 0 8px; }
.ig-cat:not(:first-child) { margin-top: 20px; }
.ig-cat h3 { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ig-cat p { margin: 2px 0 0; }
.ig-list { display: grid; gap: 8px; }
.set-sec .integ-group { display: block; padding: 0; gap: 0; }
.set-sec .integ-group > summary.ig-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; list-style: none; border-radius: 14px; }
.set-sec .integ-group > summary::-webkit-details-marker { display: none; }
.set-sec .integ-group > summary:hover { background: var(--gray-bg); }
.set-sec .integ-group > summary > .ico { width: 15px; height: 15px; color: var(--muted); transition: transform .2s var(--ease); flex: none; }
.set-sec .integ-group[open] > summary > .ico { transform: rotate(90deg); }
.ig-txt { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.ig-txt strong { color: var(--heading); }
.set-sec .integ-group[open] { border-color: var(--line-2); }
.ig-body { padding: 4px 16px 16px 58px; }
.set-sec .callout { display: flex; gap: 12px; }
/* Search */
.set-sec.is-out { display: none; }
.set-sec .is-hit { border-radius: 10px; box-shadow: 0 0 0 2px color-mix(in srgb, var(--amber) 55%, transparent); background: color-mix(in srgb, var(--amber) 8%, transparent); }
.set-empty { padding: 30px; text-align: center; }

@media (max-width: 1100px) {
  .set-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .set-nav { position: sticky; top: 0; z-index: 5; flex-direction: row; align-items: center; gap: 6px; max-height: none; overflow-x: auto; overflow-y: hidden; padding: 8px 0; margin: 0 -4px; background: var(--bg); scrollbar-width: none; }
  .set-nav::-webkit-scrollbar { display: none; }
  .sn-group { display: none; }
  .set-search { flex: 0 0 180px; margin: 0; }
  .set-nav a { flex: none; white-space: nowrap; border: 1px solid var(--line); }
  .set-nav a[aria-current="true"] { box-shadow: none; border-color: var(--brand-line); }
  .set-sec { scroll-margin-top: 70px; }
  .set-sec .ec-grid { grid-template-columns: minmax(0, 1fr); }
  .ig-body { padding: 4px 14px 14px; }
}
@media (max-width: 640px) { .ss-head, .ss-body { padding-left: 16px; padding-right: 16px; } .ss-foot.sticky { margin: 14px -16px -20px; padding: 12px 16px; } }
.set-layout > * { min-width: 0; }
@media (max-width: 1100px) { .set-nav { max-width: 100%; margin: 0; } }
.set-main > *, .set-sec .ss-body, .set-sec .ss-body > * { min-width: 0; }
.set-sec input, .set-sec select, .set-sec textarea { min-width: 0; max-width: 100%; }
.set-sec .row-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
@media (max-width: 1100px) { .set-sec { scroll-margin-top: 120px; } }

/* Undo Live (Fulfillment build panel) */
.bp-live { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--green) 35%, transparent); background: var(--green-bg); min-width: 0; flex: 1 1 360px; max-width: 620px; }
.bp-live .mc-icon { color: var(--green); }
.bp-live.is-pending { border-color: color-mix(in srgb, var(--amber) 45%, transparent); background: var(--amber-bg); }
.bp-live.is-pending .mc-icon { color: var(--amber); }
.bpl-txt { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 200px; }
.bpl-txt strong { color: var(--heading); }
.bp-live form { margin: 0; }

/* Status pill = status switcher */
.status-menu { display: inline-block; }
.status-menu > summary.status-pill { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; user-select: none; transition: box-shadow .15s; }
.status-menu > summary.status-pill:hover, .status-menu[open] > summary.status-pill { box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent); }
.status-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-menu > summary .ico { width: 12px; height: 12px; margin-left: 1px; opacity: .8; }
.status-menu .menu-list { left: 0; right: auto; min-width: 240px; }
.sm-head { display: block; padding: 6px 10px 4px; font-weight: 600; letter-spacing: .02em; }
.sm-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 10px; background: none; color: var(--text); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.sm-item:hover { background: var(--gray-bg); color: var(--heading); text-decoration: none; }
.sm-item small { margin-left: auto; font-size: 11.5px; }
.sm-item.is-current { cursor: default; font-weight: 600; color: var(--heading); background: var(--gray-bg); }
.sm-item.is-current .ico { width: 15px; height: 15px; margin-left: auto; color: var(--brand-text); }
.sm-item.danger { color: var(--red); }
.sm-item .ico { width: 15px; height: 15px; color: var(--muted); }
.sm-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--muted); }
.sm-dot.tone-blue { background: var(--blue); } .sm-dot.tone-violet { background: var(--violet); } .sm-dot.tone-green { background: var(--green); }
.sm-dot.tone-gray { background: var(--muted); } .sm-dot.tone-amber { background: var(--amber); } .sm-dot.tone-red { background: var(--red); }
.sm-sep { display: block; height: 1px; margin: 4px 6px; background: var(--line); }
.status-menu .menu-list form { margin: 0; }
.asana-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; }
.asana-legend li { display: inline-flex; align-items: center; gap: 6px; }
.asana-legend i { width: 12px; height: 12px; border-radius: 4px; }
.menu-list.is-floating { position: fixed; z-index: 70; right: auto; min-width: 240px; padding: 6px; border-radius: 14px; display: grid; gap: 2px; background: var(--card); border: 1px solid var(--line-2); box-shadow: var(--shadow), 0 20px 50px -18px rgba(0, 0, 0, .6); }

/* ── Messages inbox: conversations on the left, the open chat on the right ── */
.msg-app { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 16px; height: calc(100dvh - 64px); min-height: 520px; margin-bottom: 8px; }
.msg-app > .card { padding: 0; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.ml-head { display: flex; align-items: center; gap: 8px; padding: 16px 14px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.ml-head h1 { font-size: 20px; margin: 0; margin-right: auto; }
.ml-tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); }
.ml-tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 8px; font-size: 13px; color: var(--text-2); text-decoration: none; }
.ml-tabs a.on { background: var(--card); color: var(--heading); box-shadow: 0 1px 2px rgba(0, 0, 0, .15); }
.ml-count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; display: inline-grid; place-items: center; font-size: 11px; font-weight: 600; background: var(--violet, #8b7cf6); color: #fff; }
.ml-sound.is-off { opacity: .45; }
.ml-rows { list-style: none; margin: 0; padding: 6px; overflow-y: auto; flex: 1; overscroll-behavior: contain; }
.ml-row { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; color: var(--text); text-decoration: none !important; position: relative; }
.ml-row:hover { background: rgb(var(--tint-rgb) / .05); }
.ml-row.on { background: var(--brand-soft); }
.ml-av { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; overflow: hidden; font-weight: 700; font-size: 14px; color: var(--brand-text); background: var(--bg-2); border: 1px solid var(--line-2); }
.ml-av img { width: 100%; height: 100%; object-fit: cover; }
.ml-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.ml-top, .ml-bottom { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ml-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--heading); font-size: 14px; }
.ml-when { flex: none; font-size: 11.5px; color: var(--muted); }
.ml-preview { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--muted); }
.ml-badge { flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; display: grid; place-items: center; font-size: 11.5px; font-weight: 700; background: var(--brand); color: var(--brand-ink); }
.ml-badge[hidden] { display: none; }
.ml-row.is-unread .ml-name { color: var(--heading); } .ml-row.is-unread .ml-preview { color: var(--text); font-weight: 500; } .ml-row.is-unread .ml-when { color: var(--brand-text); font-weight: 600; }
.ml-row.is-typing .ml-preview { color: var(--brand-text); font-style: italic; }
.ml-empty { display: grid; place-items: center; gap: 6px; text-align: center; padding: 30px 16px; color: var(--muted); }
.ml-empty .ico { width: 28px; height: 28px; }
.ml-empty.big { flex: 1; } .ml-empty h2 { margin: 0; font-size: 17px; color: var(--heading); }
.mt-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.mt-id { flex: 1; min-width: 0; display: grid; gap: 2px; } .mt-id h2 { margin: 0; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-back { display: none; }
.mt-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 16px; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.mt-step { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px; font-size: 12px; border: 1px solid var(--line-2); color: var(--text-2); text-decoration: none !important; }
.mt-step .ico { width: 12px; height: 12px; } .mt-step.is-unread { border-color: color-mix(in srgb, var(--violet, #8b7cf6) 50%, transparent); color: var(--heading); }
.msg-thread .notes { display: flex; flex-direction: column; flex: 1; min-height: 0; padding: 12px 16px 14px; }
/* Messages sit at the bottom, newest last, like a chat (flex, so a short conversation doesn't stretch out) */
.msg-thread .note-list { display: flex; flex-direction: column; flex: 1 1 auto; max-height: none; min-height: 0; padding-bottom: 6px; }
.msg-thread .note-list > :first-child { margin-top: auto; }
.msg-thread .note-empty { padding: 30px 8px; text-align: center; }
@media (max-width: 860px) {
  .msg-app { grid-template-columns: minmax(0, 1fr); height: calc(100dvh - var(--tab-h) - 96px); min-height: 440px; }
  .msg-app.has-thread:not(.is-auto) .msg-list, .msg-app.is-auto .msg-thread, .msg-app:not(.has-thread) .msg-thread { display: none; }
  .mt-back { display: inline-grid; }
  .mt-head { gap: 8px; padding: 10px 12px; } .mt-head .mt-open-txt { display: none; } .mt-head .btn { padding: 6px 9px; }
  .mt-id .mt-lead { display: none; }
}

/* "…is typing" */
.note-typing { display: flex; align-items: center; gap: 8px; padding: 6px 4px 0; font-size: 12.5px; color: var(--muted); }
.note-typing[hidden] { display: none; }
.nt-dots { display: inline-flex; gap: 3px; padding: 6px 8px; border-radius: 99px; background: var(--bg-2); border: 1px solid var(--line); }
.nt-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); animation: nt-bounce 1.2s infinite ease-in-out; }
.nt-dots i:nth-child(2) { animation-delay: .15s; } .nt-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes nt-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-3px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .nt-dots i { animation: none; } }

/* A message turned into a request */
.nc-chip.request { color: var(--brand-text); border-color: var(--brand-line); background: var(--brand-soft); text-decoration: none !important; }
.nc-chip.request:hover { border-color: var(--brand); }

/* Unread messages badge (rail + tab bar) */
.rl-badge.is-msg { background: var(--red); color: #fff; box-shadow: 0 0 0 2px var(--card); }
.rl-badge[hidden] { display: none; }
.rl-badge.bump { animation: msg-bump .5s var(--ease); }
@keyframes msg-bump { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }

/* New-message pop-ups for the team (any page) */
.msg-pops { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: grid; gap: 10px; width: min(380px, calc(100vw - 24px)); }
.msg-pop { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border-radius: 16px; background: var(--card); border: 1px solid var(--brand-line);
  box-shadow: var(--shadow), 0 24px 60px -20px rgba(0, 0, 0, .65), 0 0 0 4px var(--brand-soft); animation: pop-in .35s var(--ease); }
.msg-pop.out { opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; }
.mp-main { flex: 1; min-width: 0; display: grid; gap: 3px; color: var(--text); text-decoration: none !important; }
.mp-top { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; } .mp-top strong { color: var(--heading); }
.mp-body { font-size: 13.5px; line-height: 1.4; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mp-acts { display: grid; gap: 6px; justify-items: end; }
.mp-x { border: 0; background: transparent; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; padding: 0 4px; }
.mp-x:hover { color: var(--heading); }
@keyframes pop-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@media (max-width: 860px) { .is-staff .msg-pops { right: 12px; bottom: calc(var(--tab-h) + 12px + env(safe-area-inset-bottom)); } }
.rq-asana { align-items: flex-start; } .rq-asana span { display: grid; gap: 2px; }

/* ══ Live chat (Slack-style): views/partials/chat.ejs + public/chatbox.js ══ */
.chatbox { position: relative; display: flex; min-height: 0; flex: 1; }
.cb-main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; position: relative; }
.chatbox .cb-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 8px 0 4px; display: flex; flex-direction: column; }
.cb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.cb-main .cb-list { margin-top: auto; }
.cb-state, .cb-empty { margin: auto; text-align: center; color: var(--muted); padding: 30px 16px; display: grid; justify-items: center; gap: 8px; }
.cb-state[hidden], .cb-empty[hidden] { display: none; }
.cb-empty p { margin: 0; max-width: 360px; }
.cb-empty-ico { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-text); }
.cb-empty-ico .ico { width: 24px; height: 24px; }
.cb-spinner { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.cb-day { display: flex; align-items: center; gap: 10px; margin: 14px 16px 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.cb-day::before, .cb-day::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.cb-day span { padding: 3px 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); }

/* A message: avatar gutter + content, no bubbles; continuation rows hide the name */
.chatbox .note.cb-msg { position: relative; display: flex; flex-direction: row; align-items: flex-start; gap: 10px; padding: 6px 16px 6px 14px; animation: none; border-radius: 0; transition: background .2s; }
.chatbox .note.cb-msg:hover { background: rgb(var(--tint-rgb) / .04); }
.chatbox .note.cb-msg.is-cont { padding-top: 1px; }
.chatbox .note.cb-msg.is-new { background: color-mix(in srgb, var(--violet) 9%, transparent); box-shadow: inset 3px 0 0 var(--violet); }
.cb-gutter { width: 36px; flex: none; display: flex; justify-content: center; }
.cb-gutter .avatar.sm { width: 36px; height: 36px; font-size: 13px; }
.chatbox .note.side-team .cb-gutter .avatar:not(.has-photo) { color: var(--violet); background: var(--violet-bg); }
.cb-time-hover { font-size: 10.5px; color: var(--muted); opacity: 0; padding-top: 4px; white-space: nowrap; }
.cb-msg.is-cont:hover .cb-time-hover { opacity: 1; }
.chatbox .note-bubble { flex: 1; min-width: 0; max-width: none; padding: 0; border: 0; border-radius: 0; background: none !important; }
.chatbox .note.mine .note-meta { text-align: left; }
.chatbox .note-meta { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; margin-bottom: 1px; }
.chatbox .note-meta strong { font-size: 14px; }
.chatbox .cb-msg.is-cont .note-meta { display: none; }
.cb-side { font-size: 11px; color: var(--muted); padding: 0 6px; border-radius: 99px; border: 1px solid var(--line); line-height: 16px; }
.side-client .cb-side { color: var(--brand-text); border-color: var(--brand-line); }
.cb-time { font-size: 11.5px; color: var(--muted); }
.chatbox .note-meta .note-more { margin-left: auto; }
.chatbox .note-body { font-size: 14.5px; line-height: 1.5; }
.chatbox .note-body a { color: var(--brand-text); text-decoration: underline; text-underline-offset: 2px; word-break: break-all; }
.note-body.is-jumbo { font-size: 34px; line-height: 1.2; }
.mention { padding: 0 3px; border-radius: 5px; font-weight: 600; color: var(--brand-text); background: var(--brand-soft); }
.mention.is-me { color: var(--amber); background: color-mix(in srgb, var(--amber) 16%, transparent); }
.chatbox .att-list.cb-files { margin-top: 6px; }
/* Photos and videos keep their own shape (never cropped) */
.cb-files .att.is-img a { width: auto; max-width: min(100%, 380px); background: none; border: 0; padding: 0; }
.cb-files .att.is-img img { width: auto; height: auto; max-width: 100%; max-height: 320px; object-fit: contain; border-radius: 10px; border: 1px solid var(--line); cursor: zoom-in; background: rgb(var(--tint-rgb) / .04); }
.cb-vid { position: relative; display: inline-block; max-width: min(100%, 420px); }
.cb-vid video { display: block; width: auto; height: auto; max-width: 100%; max-height: 320px; border-radius: 10px; background: #000; }
.cb-vid-open { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border-radius: 8px; border: 0; background: rgba(0, 0, 0, .55); color: #fff; font-size: 16px; cursor: pointer; opacity: 0; transition: opacity .15s; }
.cb-vid:hover .cb-vid-open, .cb-vid-open:focus { opacity: 1; }
@media (hover: none) { .cb-vid-open { opacity: 1; } }
.cb-author { border: 0; background: none; padding: 0; font: inherit; font-weight: 600; color: var(--heading); cursor: pointer; }
.cb-author:hover { text-decoration: underline; text-underline-offset: 2px; }
.lead-star { color: var(--amber); font-size: .95em; }

/* Drop files anywhere on the chat */
.chatbox { position: relative; }
.cb-drop { position: absolute; inset: 6px; z-index: 20; display: grid; place-items: center; border-radius: 14px; border: 2px dashed var(--brand); background: color-mix(in srgb, var(--card) 82%, transparent); backdrop-filter: blur(2px); pointer-events: none; }
.cb-drop[hidden] { display: none; }
.cbd-box { display: grid; gap: 4px; text-align: center; padding: 18px 24px; border-radius: 14px; background: var(--card); box-shadow: var(--shadow); }
.cbd-box strong { color: var(--brand-text); font-size: 17px; } .cbd-box span { color: var(--muted); font-size: 13px; }

/* Profile card (click a name) */
.person-pop { width: min(380px, calc(100vw - 32px)); padding: 0; }
.pp-card { position: relative; display: grid; justify-items: center; text-align: center; gap: 6px; padding: 26px 22px 20px; }
.pp-x { position: absolute; top: 10px; right: 10px; }
.pp-top .avatar.xl { width: 88px; height: 88px; font-size: 30px; }
.pp-card h2 { margin: 6px 0 0; font-size: 20px; }
.pp-line { margin: 0; }
.pp-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 2px; }
.pp-contact { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; font-size: 13.5px; }
.pp-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
.cs-person { display: flex; align-items: center; gap: 10px; width: 100%; padding: 4px 6px; margin: -4px -6px; border: 0; border-radius: 10px; background: none; font: inherit; text-align: left; color: inherit; cursor: pointer; }
.cs-person:hover { background: rgb(var(--tint-rgb) / .05); }
.cs-people li { display: block; }
.cs-person .cs-who { flex: 1; min-width: 0; }

/* Photo & video viewer */
.media-viewer { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(4, 10, 9, .94); color: #fff; }
.media-viewer::backdrop { background: rgba(0, 0, 0, .6); }
.media-viewer[open] { display: flex; flex-direction: column; }
.mv-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; flex-wrap: wrap; }
.mv-name { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-count { font-size: 13px; color: rgba(255, 255, 255, .6); }
.mv-bar .btn { color: #fff; border-color: rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .08); }
.mv-bar .btn .ico { width: 15px; height: 15px; }
.mv-x { color: #fff; font-size: 18px; }
.mv-stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 8px 56px 24px; }
.mv-media { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; min-height: 0; }
.mv-media img, .mv-media video { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 6px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.mv-stage:fullscreen { background: #000; padding: 0 56px; }
.mv-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 64px; border: 0; border-radius: 12px; background: rgba(255, 255, 255, .1); color: #fff; font-size: 30px; cursor: pointer; }
.mv-nav:hover { background: rgba(255, 255, 255, .2); }
.mv-prev { left: 8px; } .mv-next { right: 8px; } .mv-nav[hidden] { display: none; }
@media (max-width: 600px) { .mv-stage { padding: 8px 8px 16px; } .mv-nav { width: 36px; height: 52px; } .mv-bar .btn.ghost { display: none; } }

/* Search: in a conversation, and across every conversation (Messages) */
.cb-search { display: flex; align-items: center; gap: 4px; padding: 2px 8px 2px 14px; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.cb-search .cbs-count, .cb-search .ibtn { display: none; }
.chatbox.is-searching .cb-search .cbs-count, .chatbox.is-searching .cb-search .ibtn { display: inline-grid; }
.chatbox.is-searching .cb-search .cbs-count { display: inline; }
.cb-search .ibtn { width: 28px; height: 28px; }
.cb-search > .ico { width: 16px; height: 16px; color: var(--muted); flex: none; }
.cb-search input { flex: 1; min-width: 80px; border: 0; background: transparent; box-shadow: none; padding: 6px 8px; font-size: 14px; }
.cb-search input:focus { outline: none; box-shadow: none; }
.cbs-count { white-space: nowrap; margin-right: 4px; }
.chatbox .note.cb-msg.is-hit { box-shadow: inset 3px 0 0 var(--amber); background: color-mix(in srgb, var(--amber) 6%, transparent); }
.chatbox .note.cb-msg.is-found { animation: found-flash 1.6s var(--ease); }
@keyframes found-flash { 0%, 30% { background: color-mix(in srgb, var(--amber) 26%, transparent); } 100% { background: color-mix(in srgb, var(--amber) 6%, transparent); } }
.ml-search { flex-basis: 100%; display: flex; align-items: center; gap: 6px; padding: 0 6px 0 10px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--bg-2); }
.ml-search:focus-within { border-color: var(--brand-line); box-shadow: 0 0 0 3px var(--brand-soft); }
.ml-search > .ico { width: 16px; height: 16px; color: var(--muted); flex: none; }
.ml-search input { flex: 1; min-width: 0; border: 0; background: transparent; box-shadow: none; padding: 8px 4px; font-size: 13.5px; }
.ml-search input:focus { outline: none; box-shadow: none; }
.ml-results-head { padding: 8px 16px 0; }
.ml-hit .ml-main { gap: 3px; }
.ml-who { display: block; }
.ml-snip { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; color: var(--text-2); }
.ml-snip mark, .cb-msg mark { background: color-mix(in srgb, var(--amber) 35%, transparent); color: var(--heading); border-radius: 3px; padding: 0 1px; }
.tab-count.is-chat { background: var(--red); color: #fff; }

/* ── Audit log (Super Admin) ── */
.ov-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.au-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
@media (max-width: 1000px) { .au-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.au-stat { display: grid; gap: 2px; padding: 14px 16px; text-decoration: none !important; color: var(--text-2); font-size: 13px; transition: border-color .15s, transform .15s; }
.au-stat:hover { border-color: var(--brand-line); transform: translateY(-1px); }
.au-n { font-size: 26px; font-weight: 700; color: var(--heading); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.au-stat.is-red { border-color: color-mix(in srgb, var(--red) 55%, transparent); background: color-mix(in srgb, var(--red) 8%, var(--card)); } .au-stat.is-red .au-n { color: var(--red); }
.au-stat.is-amber { border-color: color-mix(in srgb, var(--amber) 55%, transparent); background: color-mix(in srgb, var(--amber) 8%, var(--card)); } .au-stat.is-amber .au-n { color: var(--amber); }
.au-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 14px; margin-bottom: 14px; }
.au-q { flex: 1 1 280px; display: flex; align-items: center; gap: 6px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--bg-2); }
.au-q:focus-within { border-color: var(--brand-line); box-shadow: 0 0 0 3px var(--brand-soft); }
.au-q .ico { width: 16px; height: 16px; color: var(--muted); flex: none; }
.au-q input { flex: 1; border: 0; background: transparent; box-shadow: none; padding: 9px 4px; }
.au-q input:focus { outline: none; box-shadow: none; }
.au-filters select { width: auto; padding: 8px 10px; }
.au-cats { flex-basis: 100%; margin: 4px 0 0; }
.au-dot { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; }
.au-list { padding: 6px 0; }
.au-rows { list-style: none; margin: 0; padding: 0; }
.au-row { display: grid; grid-template-columns: 120px 190px minmax(0, 1fr) 110px; gap: 4px 14px; align-items: start; padding: 10px 18px; border-top: 1px solid var(--line); font-size: 13.5px; }
.au-row:first-child { border-top: 0; }
.au-row:hover { background: rgb(var(--tint-rgb) / .03); }
.au-when { color: var(--muted); font-size: 12.5px; padding-top: 2px; }
.au-who { display: flex; align-items: center; gap: 7px; min-width: 0; } .au-who strong { color: var(--heading); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.au-who .avatar.xs { width: 22px; height: 22px; font-size: 9px; flex: none; }
.au-what { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; min-width: 0; }
.au-client { font-weight: 600; } .au-target { color: var(--heading); font-weight: 500; }
.au-detail { color: var(--text-2); overflow-wrap: anywhere; flex-basis: 100%; }
.au-ip { text-align: right; padding-top: 2px; }
.au-flag { grid-column: 2 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.au-row.is-flag-high { box-shadow: inset 3px 0 0 var(--red); background: color-mix(in srgb, var(--red) 6%, transparent); }
.au-row.is-flag-review { box-shadow: inset 3px 0 0 var(--amber); background: color-mix(in srgb, var(--amber) 5%, transparent); }
.au-row.is-reviewed { opacity: .75; }
.au-pager { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 12px; border-top: 1px solid var(--line); }
@media (max-width: 800px) {
  .au-row { grid-template-columns: minmax(0, 1fr) auto; }
  .au-when { grid-column: 2; grid-row: 1; text-align: right; } .au-who { grid-column: 1; grid-row: 1; }
  .au-what, .au-flag { grid-column: 1 / -1; } .au-ip { display: none; }
}

/* Chat files saved to Google Drive */
.cb-drive { display: inline-flex; align-items: center; margin: 4px 0 0 6px; padding: 1px 7px; border-radius: 99px; font-size: 11px; font-weight: 600; color: var(--green); border: 1px solid color-mix(in srgb, var(--green) 35%, transparent); background: color-mix(in srgb, var(--green) 8%, transparent); text-decoration: none !important; vertical-align: middle; }
.cb-drive:hover { border-color: var(--green); }
.cb-files .att.is-img { display: flex; flex-direction: column; align-items: flex-start; }
.drive-connect { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px; margin-top: 10px; }
.drive-connect.is-on { border-color: color-mix(in srgb, var(--green) 40%, transparent); }
.dc-txt { flex: 1 1 320px; min-width: 0; }
.dc-acts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* Presence: a dot on the avatar (online green, away amber, offline gray) and a line of text */
.pres-av { position: relative; display: inline-flex; flex: none; }
.pres { position: absolute; right: -2px; bottom: -2px; width: 11px; height: 11px; border-radius: 50%; background: var(--line-2); box-shadow: 0 0 0 2px var(--card); }
.pres.is-inline { position: static; display: inline-block; width: 9px; height: 9px; margin-right: 6px; box-shadow: none; vertical-align: 1px; }
.pres:not([data-state]) { opacity: 0; }
.pres[data-state="online"] { background: var(--green); }
.pres[data-state="away"] { background: var(--amber); }
.pres[data-state="offline"], .pres[data-state="never"] { background: color-mix(in srgb, var(--muted) 70%, transparent); }
.pres[data-state="unknown"] { display: none; }
.avatar.xs + .pres { width: 8px; height: 8px; right: -1px; bottom: -1px; }
.pres-text { display: block; color: var(--muted); }
.pres-text:empty { display: none; }
.pres-text[data-state="online"] { color: var(--green); }
.pres-text[data-state="away"] { color: var(--amber); }
.pp-pres { margin: 2px 0 0; display: inline-flex; align-items: center; }
.pp-pres .pres-text { display: inline; }

/* Team page: title + team per person */
.staff-prof { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.staff-prof input { width: 180px; padding: 5px 8px; font-size: 13px; } .staff-prof select { padding: 5px 8px; font-size: 13px; }
.cb-audio { display: inline-flex; align-items: center; gap: 8px; padding: 6px 8px 6px 10px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--bg-2); max-width: 100%; }
.cb-audio audio { height: 36px; width: 260px; max-width: 52vw; }
.cb-audio-ic { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-text); flex: none; }
.cb-audio-ic .ico, .cb-dl .ico { width: 16px; height: 16px; }
.att.is-video { display: grid; gap: 4px; } .att.is-video video { max-width: min(100%, 420px); max-height: 280px; border-radius: 10px; background: #000; }
.cb-dl { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); }
.cb-transcript { margin-top: 6px; max-width: 560px; font-size: 13.5px; }
.cb-transcript summary { cursor: pointer; display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12px; list-style: none; }
.cb-transcript summary::-webkit-details-marker { display: none; }
.cb-transcript summary .ico { width: 13px; height: 13px; }
.cb-transcript p { margin: 4px 0 0; padding: 8px 10px; border-left: 3px solid var(--brand-line); background: var(--bg-2); border-radius: 0 10px 10px 0; color: var(--text); font-style: italic; }
.chatbox .note-chips { margin-top: 6px; }
.cb-reacts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.cb-reacts:empty { display: none; }
.cb-react { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--bg-2); font: inherit; font-size: 13px; cursor: pointer; color: var(--text-2); }
.cb-react span { font-size: 12px; font-weight: 600; }
.cb-react:hover { border-color: var(--brand-line); }
.cb-react.mine { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-text); }
.cb-react-add { opacity: 0; } .cb-msg:hover .cb-react-add, .cb-react-add:focus { opacity: 1; }
.cb-react-add .ico { width: 14px; height: 14px; }
.cb-thread-sum { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 4px 10px 4px 4px; border-radius: 10px; border: 1px solid transparent; background: none; font: inherit; font-size: 12.5px; cursor: pointer; color: var(--text-2); }
.cb-thread-sum:hover { border-color: var(--line-2); background: var(--card); }
.cb-thread-sum .avatar.xs { width: 22px; height: 22px; font-size: 9px; }
.cb-thread-sum strong { color: var(--brand-text); }
.cb-thread-sum.is-new strong::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 6px; border-radius: 50%; background: var(--violet); vertical-align: middle; }
.cbts-view { display: none; color: var(--muted); } .cb-thread-sum:hover .cbts-view { display: inline; }
.cb-hover { position: absolute; top: -14px; right: 16px; display: none; gap: 2px; padding: 3px; border-radius: 10px; background: var(--card); border: 1px solid var(--line-2); box-shadow: 0 6px 20px -8px rgba(0, 0, 0, .45); z-index: 3; }
.cb-msg:hover .cb-hover, .cb-msg:focus-within .cb-hover { display: flex; }
.cb-hover button { width: 30px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 7px; background: none; cursor: pointer; font-size: 15px; color: var(--text-2); }
.cb-hover button:hover { background: var(--gray-bg); color: var(--heading); }
.cb-hover .ico { width: 16px; height: 16px; }
@media (hover: none) { .cb-hover { display: flex; position: static; margin: 4px 0 0 46px; box-shadow: none; width: max-content; } .cb-msg .cb-hover { order: 3; } .chatbox .note.cb-msg { flex-wrap: wrap; } }
.chatbox .note-seen { display: flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 11.5px; color: var(--muted); text-align: left; }
.chatbox .note-seen .ico { width: 14px; height: 14px; } .chatbox .note-seen.is-seen { color: var(--brand-text); }
.cb-jump { position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%); z-index: 4; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--brand-line); background: var(--card); color: var(--brand-text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; box-shadow: var(--shadow); }
.cb-jump .ico { width: 14px; height: 14px; transform: rotate(90deg); }
.cb-jump[hidden] { display: none; }
.cb-typing { padding: 2px 16px 0; }

/* Composer */
.cb-form { position: relative; margin: 8px 12px 12px; padding: 6px 8px 6px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--bg-2); display: grid; gap: 4px; transition: border-color .15s, box-shadow .15s; }
.cb-form:focus-within { border-color: var(--brand-line); box-shadow: 0 0 0 3px var(--brand-soft); }
.cb-form.is-dropping { border-color: var(--brand); border-style: dashed; }
.cb-input { position: relative; }
.cb-form textarea, .cb-form textarea:focus { width: 100%; border: 0; background: transparent; box-shadow: none; outline: none; padding: 8px 6px 4px; min-height: 40px; max-height: 200px; resize: none; line-height: 1.5; font-size: 14.5px; }
.cb-bar { gap: 2px; justify-content: flex-start; }
.cb-bar .att-tools { margin-right: 0; }
.cb-bar .cb-ico { width: 34px; padding: 0; justify-content: center; }
.cb-bar .cb-ico .ico { width: 18px; height: 18px; }
.cb-bar .note-hint { margin-left: auto; display: none; }
.cb-bar .cb-mail { margin: 0 0 0 8px; }
.cb-send { margin-left: auto; }
.cb-bar .note-hint + .cb-send { margin-left: 8px; }
@media (min-width: 1100px) { .cb-bar .note-hint { display: inline; } }
.cb-form.is-recording textarea, .cb-form.is-recording .cb-bar { opacity: .4; pointer-events: none; }
.cb-mentions { position: absolute; left: 0; bottom: calc(100% + 6px); z-index: 30; width: min(320px, 90vw); padding: 4px; border-radius: 12px; background: var(--card); border: 1px solid var(--line-2); box-shadow: var(--shadow), 0 20px 40px -20px rgba(0, 0, 0, .6); display: grid; }
.cb-mentions[hidden] { display: none; }
.cbm-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 0; border-radius: 8px; background: none; text-align: left; font: inherit; cursor: pointer; color: var(--text); }
.cbm-item.on, .cbm-item:hover { background: var(--brand-soft); }
.cbm-name { font-weight: 600; color: var(--heading); } .cbm-side { margin-left: auto; font-size: 11.5px; color: var(--muted); }
.cb-voice { padding: 6px 4px; }
.cb-voice[hidden] { display: none; }
.cbv-rec { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cbv-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); animation: rec-pulse 1.2s infinite; }
@keyframes rec-pulse { 50% { opacity: .3; } }
.cbv-live { flex: 1; min-width: 160px; font-size: 13px; font-style: italic; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cbv-review { display: grid; gap: 8px; } .cbv-review[hidden], .cbv-rec[hidden] { display: none; }
.cbv-review audio { width: 100%; height: 40px; }
.cbv-tr { display: grid; gap: 4px; } .cbv-tr textarea { min-height: 54px !important; border: 1px solid var(--line-2) !important; border-radius: 10px; background: var(--card) !important; padding: 8px !important; }
.cbv-acts { display: flex; justify-content: flex-end; gap: 8px; }
.cb-emoji-pop { position: fixed; z-index: 80; width: 320px; max-height: 300px; overflow-y: auto; padding: 8px; border-radius: 14px; background: var(--card); border: 1px solid var(--line-2); box-shadow: var(--shadow), 0 24px 50px -20px rgba(0, 0, 0, .6); }
.cb-emoji-pop[hidden] { display: none; }
.cep-cat { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 6px 4px 4px; }
.cep-grid { display: grid; grid-template-columns: repeat(8, 1fr); }
.cep-grid button { height: 34px; border: 0; border-radius: 8px; background: none; font-size: 20px; cursor: pointer; }
.cep-grid button:hover { background: var(--gray-bg); }

/* Thread panel */
.cb-thread { width: min(400px, 42%); flex: none; display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--line); background: var(--card); }
.cb-thread[hidden] { display: none; }
.cbt-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--line); }
.cbt-head strong { color: var(--heading); }
.cbt-parent { padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.cbt-count { margin: 8px 16px 2px; font-size: 12px; font-weight: 600; color: var(--muted); }
.cb-thread .note-hint, .chatbox.has-thread .cb-main .note-hint, .chatbox.is-compact .note-hint { display: none !important; }
.chatbox.is-compact .cb-thread { position: absolute; inset: 0; width: auto; z-index: 6; border-left: 0; border-radius: inherit; }
@media (max-width: 860px) {
  .cb-thread, .chatbox.is-compact .cb-thread { position: fixed; inset: 0; width: auto; z-index: 70; border: 0; }
  .chat-card-head .cch-txt .muted { display: none; }
  .is-staff .cb-thread { bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); }
}

/* Chat pages: the client's Chat tab, the portal Chat page */
.chat-page { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.chat-card { padding: 0; display: flex; flex-direction: column; height: calc(100dvh - 260px); min-height: 520px; overflow: hidden; }
.portal-chat .chat-card { height: calc(100dvh - 140px); }
.chat-card-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.chat-card-head h2 { margin: 0; font-size: 18px; }
.cch-txt { flex: 1; min-width: 0; display: grid; gap: 2px; }
.chat-side { display: grid; gap: 16px; }
.chat-side h3 { margin: 0 0 10px; font-size: 14px; }
.cs-people { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cs-people li { display: flex; align-items: center; gap: 10px; }
.cs-who { flex: 1; min-width: 0; display: grid; } .cs-who strong { font-size: 13.5px; color: var(--heading); }
.cs-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.cs-steps a { display: inline-flex; align-items: center; gap: 6px; } .cs-steps .ico { width: 14px; height: 14px; }
.cs-tips ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
@media (max-width: 1100px) { .chat-page { grid-template-columns: minmax(0, 1fr); } .chat-side { display: none; } }
@media (max-width: 860px) { .chat-card { height: calc(100dvh - 230px); min-height: 440px; } .portal-chat .chat-card { height: calc(100dvh - 120px); } .cch-hide { display: none; } }

/* Chat in a card (portal home), the Messages inbox and the Overview preview */
.chatbox.is-compact { min-height: 360px; max-height: 560px; }
.chat .chatbox, .notes-card .chatbox { margin: 0 -4px; }
.chat .chatbox.is-compact { flex: 1; max-height: none; min-height: 380px; }
.msg-thread .chatbox { flex: 1; }
.msg-thread .chatbox .note.cb-msg { padding-left: 10px; }
.chat-peek { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.chat-peek li { display: flex; gap: 8px; align-items: flex-start; }
.chat-peek li.is-new .cp-body { color: var(--heading); font-weight: 500; }
.cp-txt { min-width: 0; display: grid; font-size: 13px; }
.cp-body { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.btn.block { width: 100%; }
.cx-open { display: inline-flex; align-items: center; gap: 6px; margin: 0 16px 12px; color: var(--brand-text); }
.cx-open .ico { width: 14px; height: 14px; }

.nav-chat { display: inline-flex; align-items: center; gap: 6px; } .nav-chat .ico { width: 16px; height: 16px; }
.nav-count[hidden] { display: none; }

/* ── Tickets desk (Zendesk-style) ── */
.tk-desk { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 960px) { .tk-desk { grid-template-columns: minmax(0, 1fr); } }
.tk-views { padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 16px; }
.tk-views .card-label { padding: 0 8px 8px; }
.tk-view { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 10px; color: var(--text-2); text-decoration: none; font-size: 13.5px; transition: background .2s, color .2s; }
.tk-view svg { width: 16px; height: 16px; flex: none; opacity: .75; }
.tk-view:hover { background: rgb(var(--tint-rgb) / .05); color: var(--heading); }
.tk-view.on { background: var(--brand-soft); color: var(--brand-text); font-weight: 600; }
.tk-view .tv-label { flex: 1; min-width: 0; }
.tk-n { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted); min-width: 22px; text-align: right; }
.tk-view.hot .tk-n { color: var(--red); font-weight: 700; }
.tk-sep { height: 1px; background: var(--line); margin: 6px 8px; }
@media (max-width: 960px) {
  .tk-views { position: static; flex-direction: row; overflow-x: auto; padding: 8px; scrollbar-width: thin; }
  .tk-views .card-label, .tk-sep { display: none; }
  .tk-view { flex: none; white-space: nowrap; }
}
.tk-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.tk-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px; }
.tk-filters select { width: auto; min-width: 0; flex: 0 1 auto; padding-top: 8px; padding-bottom: 8px; }
.tk-search { flex: 1 1 260px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 11px; background: var(--input-bg, transparent); }
.tk-search svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.tk-search input { border: 0; background: none; padding: 9px 0; box-shadow: none; outline: none; }
.tk-table-card { padding: 0; overflow: hidden; }
.tk-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.tk-title { margin: 0; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.tk-bulk { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; animation: dialogIn .25s var(--ease) both; }
.tk-bulk[hidden] { display: none; }
.tk-bulk select { width: auto; padding-top: 6px; padding-bottom: 6px; font-size: 13px; }
.tk-scroll { overflow-x: auto; }
.tk-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tk-table th { text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tk-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tk-table tr:last-child td { border-bottom: 0; }
.tk-row { cursor: pointer; transition: background .15s; }
.tk-row:hover { background: rgb(var(--tint-rgb) / .035); }
.tk-row.is-picked { background: var(--brand-soft); }
.tk-row.is-replied .tk-subj strong { color: var(--heading); }
.tk-ck { width: 34px; padding-right: 0 !important; }
.tk-ck input { width: 16px; height: 16px; accent-color: var(--brand); }
.tk-subj { min-width: 220px; }
.tk-subj a { color: inherit; text-decoration: none; }
.tk-table td .badge, .tk-who { white-space: nowrap; }
.tk-subj a:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.tk-subj strong { font-weight: 600; }
.tk-sub { display: block; margin-top: 4px; line-height: 1.7; }
.tk-sub .avatar.xs { display: inline-grid; width: 18px; height: 18px; border-radius: 5px; font-size: 8px; vertical-align: -4px; margin-right: 2px; }
.tk-sub .badge { margin-left: 4px; vertical-align: 1px; }
.tk-num { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 500; font-size: .92em; }
.tk-num.lg { font-size: .8em; }
.tk-pri { display: inline-block; width: 9px; height: 9px; border-radius: 3px; background: var(--pc, var(--muted)); margin-right: 6px; vertical-align: 1px; }
.pr-normal .tk-pri, .pr-low .tk-pri { opacity: .45; }
.tk-who { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.tk-asana { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 3px; }
.tk-asana svg { width: 12px; height: 12px; }
.tk-empty { border-top: 0; }
@media (max-width: 760px) { .hide-sm { display: none; } }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
/* Ticket page */
.tk-props.is-saving { opacity: .6; pointer-events: none; }
.tk-facts { margin: 4px 0 0; display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.tk-facts div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px; align-items: baseline; }
.tk-facts dt { color: var(--muted); }
.tk-facts dd { margin: 0; }
.tk-status { display: flex; flex-wrap: wrap; }
.tk-status .seg-btn { flex: 1 1 auto; text-align: center; }
.tk-two { grid-template-columns: 1fr 1fr !important; }
.tk-status .seg-btn.on.st-new { background: var(--blue); color: #061423; }
.tk-status .seg-btn.on.st-in_progress { background: var(--violet); color: #170c35; }
.tk-status .seg-btn.on.st-waiting { background: var(--amber); color: #2a1a00; }
.tk-status .seg-btn.on.st-done { background: var(--brand); color: var(--brand-ink); }
.tk-mode { display: inline-flex; gap: 2px; padding: 3px; border-radius: 11px; background: rgb(var(--tint-rgb) / .05); border: 1px solid var(--line); align-self: flex-start; }
.tk-mode label { cursor: pointer; }
.tk-mode input { position: absolute; opacity: 0; pointer-events: none; }
.tk-mode span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 8px; font-size: 13px; color: var(--muted); transition: background .2s, color .2s; }
.tk-mode span svg { width: 14px; height: 14px; }
.tk-mode input:checked + span { background: var(--card-2); color: var(--heading); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.tk-mode input:focus-visible + span { outline: 2px solid var(--brand); }
.tk-compose.is-internal textarea { background: color-mix(in srgb, var(--amber) 9%, var(--card)); border-color: color-mix(in srgb, var(--amber) 45%, transparent); }
.tk-compose.is-internal .tk-mode input:checked + span { color: var(--amber); }
.tk-submit-as { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); margin-left: auto; }
.tk-submit-as select { width: auto; padding-top: 6px; padding-bottom: 6px; font-size: 13px; }

/* Activity: each entry opens a pop-up with the details */
.act-row { all: unset; box-sizing: border-box; display: flex; flex-direction: column; gap: 2px; width: 100%; cursor: pointer; border-radius: 9px; padding: 4px 8px; margin: -4px -8px; transition: background .15s; }
.act-row:hover { background: rgb(var(--tint-rgb) / .05); }
.act-row:hover .act-msg { color: var(--heading); }
.act-row:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.act-msg { color: var(--text-2); }
.act-dialog { width: min(520px, calc(100vw - 28px)); }
.act-big { font-size: 16.5px; line-height: 1.5; color: var(--heading); margin: 14px 0 16px; white-space: pre-wrap; }
.act-facts { display: grid; gap: 12px; margin: 0 0 16px; padding: 14px 0 0; border-top: 1px solid var(--line); }
.act-facts div { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; align-items: start; }
.act-facts dt { color: var(--muted); font-size: 13px; padding-top: 2px; }
.act-facts dd { margin: 0; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.act-who { display: flex; align-items: center; gap: 10px; }
.act-who > span:last-child { display: flex; flex-direction: column; }
.act-who .avatar { width: 34px; height: 34px; border-radius: 10px; font-size: 12px; flex: none; }
.act-sys { display: grid; place-items: center; background: rgb(var(--tint-rgb) / .08); color: var(--muted); }
.act-sys svg { width: 16px; height: 16px; }
.act-seen { flex-direction: row !important; flex-wrap: wrap; align-items: center; gap: 8px !important; }
.act-actions { flex-wrap: wrap; }

/* Live card: what's open with the client right now */
.live-pulse { list-style: none; margin: 12px 0 4px; padding: 0; display: grid; gap: 2px; }
.live-pulse a, .live-pulse .lp-row { display: grid; grid-template-columns: 18px auto minmax(0, 1fr); align-items: center; gap: 8px; padding: 6px 8px; margin: 0 -8px; border-radius: 9px; color: var(--text-2); text-decoration: none; font-size: 13px; transition: background .15s; }
.live-pulse a:hover { background: rgb(var(--tint-rgb) / .05); color: var(--heading); }
.live-pulse svg { width: 15px; height: 15px; color: var(--muted); }
.live-pulse .lp-label { color: var(--muted); }
.live-pulse .lp-val { text-align: right; font-weight: 600; color: var(--heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-pulse .lp-val time { font-weight: 500; }
.live-pulse .is-ok .lp-val { color: var(--text-2); font-weight: 500; }
.live-pulse .is-warn .lp-val, .live-pulse .is-warn svg { color: var(--amber); }
.live-pulse .is-bad .lp-val, .live-pulse .is-bad svg { color: var(--red); }
