:root { --bg: #f4f6f8; --panel: #fff; --ink: #18202b; --muted: #5d6878; --line: #e2e6ec; --accent: #0b6e69; --accent-ink: #fff; --accent-soft: #e3f2f1;
  --warn: #9a5b00; --bad: #b3261e; --shadow: 0 1px 2px rgba(16,24,40,.05), 0 4px 16px rgba(16,24,40,.06); --radius: 12px; }
@media (prefers-color-scheme: dark) { :root { --bg: #0f1318; --panel: #181d24; --ink: #e8ebf0; --muted: #9aa4b2; --line: #2a313b; --accent: #43bdb3; --accent-ink: #0b1716; --accent-soft: #15302e;
  --warn: #e0a84a; --bad: #ef7a72; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25); } }
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, Segoe UI, sans-serif; background: var(--bg); color: var(--ink); }
.devbar { background: var(--warn); color: #fff; font-size: 12px; padding: 4px 16px; text-align: center; }
button { font: inherit; padding: 8px 14px; min-height: 38px; border-radius: 8px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); cursor: pointer; font-weight: 500; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button.ghost { background: transparent; color: var(--accent); }
button:disabled { opacity: .5; cursor: default; }
input, select, textarea { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--ink); }
.signin { max-width: 360px; margin: 10vh auto; padding: 0 16px; }
.signin form { display: grid; gap: 12px; } .signin label { display: grid; gap: 4px; }
.err { color: var(--bad); min-height: 1.4em; }
.top { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.top nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.top nav a { padding: 5px 10px; border-radius: 6px; color: var(--ink); text-decoration: none; }
.top nav a.on { background: var(--accent); color: #fff; }
.who { color: var(--muted); font-size: 13px; }
.body { display: grid; grid-template-columns: 1fr 340px; gap: 16px; padding: 16px; max-width: 1280px; margin: 0 auto; }
@media (max-width: 860px) { .body { grid-template-columns: 1fr; } }
.view, .marin { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; box-shadow: var(--shadow); }
.marin { display: flex; flex-direction: column; gap: 8px; }
.marin h2 { margin: 0; font-size: 16px; }
.marin-log { flex: 1; min-height: 240px; max-height: 60vh; overflow: auto; display: flex; flex-direction: column; gap: 6px; }
.msg { padding: 7px 10px; border-radius: 8px; max-width: 92%; overflow-wrap: anywhere; }
.msg.me { align-self: flex-end; background: var(--accent); color: #fff; } .msg.bot { background: var(--bg); }
.marin form { display: flex; gap: 6px; } .marin input { flex: 1; min-width: 0; }
.hint { color: var(--muted); font-size: 12px; margin: 0; }
h1 { font-size: 20px; margin: 0 0 12px; } h3 { margin: 16px 0 6px; font-size: 15px; }
.card { border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin: 10px 0; }
.badge { display: inline-block; font-size: 12px; padding: 1px 7px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); }
.badge.sim { color: var(--warn); border-color: var(--warn); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 8px 0; }
table { width: 100%; border-collapse: collapse; font-size: 14px; } td, th { text-align: left; padding: 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table-wrap { overflow-x: auto; }
.sev-critical { color: var(--bad); font-weight: 600; } .sev-warning { color: var(--warn); }
.muted { color: var(--muted); }
.toast { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 8px; max-width: calc(100% - 32px); }
.toast.bad { background: var(--bad); color: #fff; }
textarea { width: 100%; min-height: 60px; }
@media (max-width: 640px) { .top nav { order: 3; flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap; } .top nav a { white-space: nowrap; } .top .who { margin-left: auto; } }
/* V1: dashboard panels, lists, kanban, detail columns */
.panels { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.panel { border: 1px solid var(--line); border-radius: 8px; padding: 12px; min-width: 0; }
.panel h3 { margin-top: 0; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.stat-v { font-size: 20px; font-weight: 600; } .stat-l { color: var(--muted); font-size: 12px; }
.bars { margin-top: 10px; display: grid; gap: 4px; font-size: 13px; }
.bar-row { display: grid; grid-template-columns: 1fr 2fr auto; gap: 8px; align-items: center; }
.bar { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; } .bar i { display: block; height: 100%; background: var(--accent); }
.plist { list-style: none; margin: 0; padding: 0; } .plist li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.plist.small li { font-size: 13px; } .plist li .muted { font-size: 12px; }
.link { cursor: pointer; } .link:hover { background: var(--bg); }
.alert { color: var(--bad); font-weight: 600; }
.seg { display: inline-flex; gap: 4px; flex-wrap: wrap; } .grow { flex: 1; } .grow input { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; margin-top: 8px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } @media (max-width: 1100px) { .cols { grid-template-columns: 1fr; } }
.cols .card { margin: 0 0 12px; } .cols form.card { display: grid; gap: 8px; align-content: start; }
.opp { border-bottom: 1px solid var(--line); padding: 8px 0; }
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr); gap: 10px; overflow-x: auto; padding-bottom: 8px; }
.kanban .col { background: var(--bg); border-radius: 8px; padding: 8px; min-width: 0; } .kanban h3 { margin: 4px 0 8px; font-size: 14px; }
.kcard { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 8px; margin-bottom: 8px; font-size: 14px; }
.kcard select { width: 100%; margin-top: 6px; }
.acts { list-style: none; margin: 6px 0 0; padding: 0; font-size: 12px; } .acts li { padding: 2px 0; } .acts .a-refused, .acts .a-error { color: var(--bad); } .acts .a-pending_approval { color: var(--warn); }
.via { font-size: 11px; margin-top: 4px; }
details.card summary { cursor: pointer; font-weight: 600; }
a { color: var(--accent); }

.muted.small, div.small { font-size: 12px; }

/* V3: call desk (views-desk.js) */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
kbd { display: inline-block; min-width: 1.4em; padding: 0 4px; margin-right: 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; font: 600 11px/1.5 ui-monospace, monospace; color: var(--muted); background: var(--bg); text-align: center; }
button.big { font-size: 16px; padding: 12px 22px; min-height: 48px; border-radius: 10px; }
.desk-strip { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; align-items: center; padding: 10px 14px; background: var(--bg); border-radius: 10px; margin-bottom: 10px; font-size: 14px; }
.desk-strip .kpis, .desk-strip .queue { display: flex; gap: 14px; flex-wrap: wrap; } .desk-strip b { font-size: 17px; margin-right: 2px; }
.desk-strip .queue span { color: var(--muted); } .desk-strip .queue b { color: var(--ink); }
.appt-strip { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 10px; padding-bottom: 2px; }
.appt { flex: 0 0 auto; padding: 8px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--ink); text-decoration: none; font-size: 14px; white-space: nowrap; }
.desk-empty { text-align: center; padding: 40px 12px; } .desk-empty p { margin-top: 12px; }
.callcard { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 10px; }
.callcard header { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: flex-start; }
.callcard .biz { font-size: 21px; font-weight: 650; color: var(--ink); text-decoration: none; letter-spacing: -.01em; } .callcard .biz:hover { text-decoration: underline; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-size: 12px; padding: 2px 9px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.chip.sim { color: var(--warn); border-color: var(--warn); background: transparent; }
.dial { display: inline-flex; align-items: center; gap: 10px; justify-self: start; padding: 10px 16px; border-radius: 12px; background: var(--accent-soft); color: var(--ink); text-decoration: none; font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; }
.dial-icon { color: var(--accent); font-size: 20px; }
.note-line { margin: 0; font-size: 14px; padding: 6px 10px; border-left: 3px solid var(--line); } .note-line.warn { border-color: var(--warn); color: var(--warn); }
.wrap { display: grid; gap: 10px; margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.outcomes { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; }
.oc { background: var(--panel); color: var(--ink); border: 1px solid var(--line); text-align: left; min-height: 46px; display: flex; align-items: center; font-weight: 500; }
.oc:hover { border-color: var(--accent); } .oc.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); } .oc.on kbd { background: transparent; color: inherit; border-color: currentColor; }
.oc.danger { color: var(--bad); } .oc.danger.on { background: var(--bad); color: #fff; border-color: var(--bad); }
.oc.more-toggle { color: var(--muted); justify-content: center; }
.when { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px; background: var(--bg); border-radius: 10px; }
.days { display: flex; gap: 6px; flex-wrap: wrap; } .daychip { background: var(--panel); color: var(--ink); border: 1px solid var(--line); min-height: 36px; padding: 6px 10px; font-weight: 500; }
.daychip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); } .time { display: flex; gap: 6px; align-items: center; color: var(--muted); }
.callcard textarea { min-height: 56px; resize: vertical; }
.toggle { display: flex; gap: 8px; align-items: center; font-size: 14px; } .toggle.disabled { color: var(--muted); }
.desk-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.desk-more summary { cursor: pointer; color: var(--muted); font-size: 14px; } .ghost-link { margin-left: auto; font-size: 14px; }
@media (max-width: 640px) {
  .callcard { padding: 12px; border: none; padding-left: 0; padding-right: 0; } .callcard .biz { font-size: 19px; }
  .dial { justify-self: stretch; justify-content: center; font-size: 24px; padding: 14px; }
  .outcomes { grid-template-columns: 1fr 1fr; } .oc { min-height: 52px; font-size: 15px; } .oc kbd, .hint-keys { display: none; }
  /* Save sits directly under the note (not pinned), so nothing can cover what is being typed (Fable round 3 #10);
     the card keeps room for the Marin bar. */
  .desk-actions { padding: 8px 0; } .desk-actions .big { flex: 1; }
  .callcard { padding-bottom: 96px; } .callcard textarea { scroll-margin-bottom: 140px; } .desk-actions { scroll-margin-bottom: 110px; }
  .desk-strip { font-size: 13px; gap: 6px 14px; }
}
/* V3: Marin on a phone is a bar at the bottom of every screen; it opens as a sheet (Fable round 1, finding 9). */
.marin-head { display: flex; justify-content: space-between; align-items: center; } #marin-close { display: none; }
@media (max-width: 860px) {
  .body { padding-bottom: 92px; }
  .marin { position: fixed; left: 8px; right: 8px; bottom: 8px; z-index: 40; padding: 8px; border-radius: 16px; gap: 6px; max-height: 72vh; box-shadow: 0 8px 30px rgba(16,24,40,.22); }
  .marin .marin-head, .marin .hint { display: none; } .marin .marin-log { display: none; min-height: 0; }
  .marin.open .marin-head { display: flex; } .marin.open .marin-log { display: flex; max-height: 52vh; } .marin.open #marin-close { display: inline-flex; }
  .marin input { min-height: 44px; font-size: 16px; } .marin form button { min-height: 44px; }
}
/* The hidden attribute always wins over a component's display rule (the desk's "More…" outcomes and day chips). */
[hidden] { display: none !important; }
.dial span:nth-child(2) { white-space: nowrap; }
@media (max-width: 640px) {
  .dial { font-size: 21px; flex-wrap: wrap; row-gap: 4px; }
  .top { gap: 8px 12px; padding: 8px 12px; } .top #signout { padding: 4px 10px; min-height: 32px; font-size: 13px; } .top .who { font-size: 12px; }
}

.approval-what { font-size: 16px; font-weight: 600; margin: 0 0 4px; }
.plist li.fresh { animation: fresh 1.6s ease-out; } @keyframes fresh { from { background: var(--accent-soft); } to { background: transparent; } }
.slots { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; flex-basis: 100%; }

/* ======================================================================================================================
   V5 — TMS design direction: deep navy chrome with depth, blue→purple primary, selective orange highlights, compact
   type. Customer branding is configuration: --brand (their main colour) and --hot (their accent) replace the TMS
   defaults; everything else stays legible because text on --brand uses --brand-ink (black/white by contrast).
   ==================================================================================================================== */
:root, :root:not([data-theme="light"]) {
  --navy-0: #070b1a; --navy-1: #0b1226; --navy-2: #111a33; --navy-3: #18233f; --navy-4: #22304f;
  --bg: var(--navy-1); --panel: var(--navy-2); --panel-2: var(--navy-3); --ink: #e9eefb; --muted: #9aa7c2; --line: #263357;
  --blue: #3b82f6; --purple: #7c3aed; --brand: #4f6cf7; --brand-ink: #ffffff; --hot: #f97316;
  --accent: color-mix(in srgb, var(--brand) 65%, #ffffff); --accent-ink: var(--brand-ink); --accent-soft: color-mix(in srgb, var(--brand) 18%, var(--navy-2));
  --ok: #34d399; --warn: #fbbf24; --bad: #f87171;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 10px 30px rgba(0,0,0,.35); --radius: 14px;
  color-scheme: dark;
}
body { background: radial-gradient(1200px 600px at 85% -10%, color-mix(in srgb, var(--purple) 22%, transparent), transparent 60%),
  radial-gradient(900px 500px at -10% 10%, color-mix(in srgb, var(--blue) 16%, transparent), transparent 60%), var(--navy-0);
  background-attachment: fixed; color: var(--ink); font: 14.5px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; letter-spacing: -.003em; }
.devbar { background: linear-gradient(90deg, #92400e, #b45309); font-size: 11.5px; letter-spacing: .02em; }
h1 { font-size: 22px; letter-spacing: -.02em; font-weight: 700; } h2 { font-size: 16px; margin: 0 0 10px; letter-spacing: -.01em; } h3 { font-size: 13.5px; text-transform: none; }
a { color: var(--accent); }
button { background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 55%, var(--purple))); border: 1px solid color-mix(in srgb, var(--brand) 70%, #fff 10%); color: var(--brand-ink); border-radius: 10px; box-shadow: 0 4px 14px color-mix(in srgb, var(--brand) 35%, transparent); }
button:hover:not(:disabled) { filter: brightness(1.08); }
button.ghost { background: transparent; color: var(--accent); border-color: var(--line); box-shadow: none; } button.ghost:hover { border-color: var(--accent); }
button.tiny { min-height: 28px; padding: 2px 10px; font-size: 12.5px; }
input, select, textarea { background: var(--navy-1); border-color: var(--line); color: var(--ink); border-radius: 9px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 30%, transparent); }
.muted { color: var(--muted); }

/* Shell: sidebar on wide screens (brand, navigation, person), content, Marin. */
.app { min-height: 100vh; }
.top { background: color-mix(in srgb, var(--navy-1) 88%, transparent); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mark { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font-weight: 800; font-size: 14px; letter-spacing: .02em; color: var(--brand-ink);
  background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 50%, var(--purple))); box-shadow: 0 6px 18px color-mix(in srgb, var(--brand) 45%, transparent), 0 0 0 1px rgba(255,255,255,.08) inset; overflow: hidden; }
.mark img { width: 100%; height: 100%; object-fit: cover; }
.brand-text { display: grid; min-width: 0; line-height: 1.2; } .brand-text strong { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tagline { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top nav a { color: var(--muted); border-radius: 9px; font-weight: 500; } .top nav a:hover { color: var(--ink); background: var(--navy-3); }
.top nav a.on { background: var(--accent-soft); color: var(--ink); box-shadow: inset 3px 0 0 var(--hot); }
.me { display: flex; gap: 8px; align-items: center; }
@media (min-width: 1024px) {
  .app { display: grid; grid-template-columns: 236px 1fr; }
  .top { position: sticky; top: 0; height: 100vh; flex-direction: column; align-items: stretch; flex-wrap: nowrap; padding: 18px 12px; border-bottom: 0; border-right: 1px solid var(--line); gap: 14px; }
  .top nav { flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; } .top nav a { padding: 8px 12px; }
  .me { flex-direction: column; align-items: flex-start; border-top: 1px solid var(--line); padding-top: 12px; }
  .body { max-width: none; margin: 0; padding: 20px; grid-template-columns: minmax(0, 1fr) 340px; }
}
.view, .marin { background: color-mix(in srgb, var(--panel) 92%, transparent); border-color: var(--line); box-shadow: var(--shadow); border-radius: 16px; }
.view { padding: 20px; }
.main-col { min-width: 0; display: grid; gap: 14px; align-content: start; }
.card, .panel { background: var(--panel-2); border-color: var(--line); border-radius: 12px; }
.stat-v { font-size: 22px; letter-spacing: -.02em; }
.badge { background: var(--navy-3); border-color: var(--line); }
.toast { background: var(--navy-4); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow); z-index: 60; }
.signin { max-width: 380px; margin: 12vh auto; padding: 28px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.signin-mark { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--blue), var(--purple)); margin-bottom: 14px; }

/* Marin panel */
.marin h2 { display: flex; align-items: center; gap: 8px; } .marin h2::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--hot); box-shadow: 0 0 10px var(--hot); }
.msg.me { background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 55%, var(--purple))); color: var(--brand-ink); } .msg.bot { background: var(--navy-3); }
.marin-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-btn { background: var(--navy-3); color: var(--ink); border: 1px solid var(--line); box-shadow: none; min-height: 30px; padding: 4px 10px; font-size: 12.5px; font-weight: 500; border-radius: 999px; }
.chip-btn:hover { border-color: var(--accent); }
.marin-report { background: color-mix(in srgb, var(--panel) 95%, transparent); border: 1px solid color-mix(in srgb, var(--hot) 45%, var(--line)); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow); }
.marin-report .panel { border: 0; padding: 0; background: transparent; } .report-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.marin-badge { color: var(--hot); border-color: color-mix(in srgb, var(--hot) 50%, var(--line)); }
@media (max-width: 860px) {
  .marin { background: color-mix(in srgb, var(--navy-2) 96%, transparent); backdrop-filter: blur(12px); box-shadow: 0 -6px 30px rgba(0,0,0,.45); }
  .marin .marin-chips { display: none; } .marin.open .marin-chips { display: flex; }
}
/* Setup is a conversation with Marin itself: the side panel steps aside there. */
body[data-route="/setup"] .marin { display: none; }
@media (min-width: 1024px) { body[data-route="/setup"] .body { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 860px) { body[data-route="/setup"] .body { padding-bottom: 16px; } }

/* Pills, status */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--navy-3); border: 1px solid var(--line); color: var(--ink); }
.pill.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); background: color-mix(in srgb, var(--ok) 10%, var(--navy-2)); }
.pill.hot { color: var(--hot); border-color: color-mix(in srgb, var(--hot) 45%, var(--line)); background: color-mix(in srgb, var(--hot) 10%, var(--navy-2)); }
.pill.subtle { color: var(--muted); font-weight: 500; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: 11px; color: var(--hot); margin: 0 0 4px; font-weight: 700; }

/* Overview */
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding: 22px; margin: -4px -4px 16px; border-radius: 16px;
  background: linear-gradient(120deg, color-mix(in srgb, var(--brand) 38%, var(--navy-2)), color-mix(in srgb, var(--purple) 26%, var(--navy-2)) 60%, var(--navy-2));
  border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--line)); position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--hot) 35%, transparent), transparent 70%); }
.hero h1 { font-size: 28px; margin: 0; } .hero-sub { margin: 4px 0 10px; color: color-mix(in srgb, var(--ink) 80%, transparent); }
.hero-cta { position: relative; z-index: 1; padding: 10px 16px; border-radius: 12px; background: var(--hot); color: #1a0d02; font-weight: 700; text-decoration: none; box-shadow: 0 8px 24px color-mix(in srgb, var(--hot) 40%, transparent); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; min-width: 0; } .tile h3 { margin: 0 0 10px; color: var(--muted); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; }
.setup-row { display: flex; gap: 14px; align-items: center; } .setup-row p { margin: 0; }
.ring { --p: 0; width: 64px; height: 64px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px;
  background: radial-gradient(closest-side, var(--panel-2) 76%, transparent 78% 100%), conic-gradient(var(--hot) calc(var(--p) * 1%), var(--navy-4) 0); }
.checklist { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; font-size: 13.5px; }
.checklist li { padding-left: 22px; position: relative; } .checklist li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 700; }
.checklist li.todo::before { content: "•"; color: var(--hot); font-size: 18px; line-height: 1; top: 1px; }
.ok-line { color: var(--ok); margin: 10px 0 0; }
.rep { display: flex; gap: 10px; align-items: center; margin: 0 0 10px; } .avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--blue), var(--purple)); font-weight: 700; font-size: 13px; color: #fff; }
.help-form { display: grid; gap: 8px; } .help-form .toggle { font-size: 13px; }
.section-h { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; margin: 6px 0 10px; }
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-bottom: 18px; }
.product { background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: grid; gap: 6px; align-content: start; position: relative; }
.product header { display: flex; justify-content: space-between; align-items: center; gap: 8px; } .product h3 { margin: 0; font-size: 15px; } .product p { margin: 0; }
.product.active { border-color: color-mix(in srgb, var(--ok) 30%, var(--line)); } .product.needs_setup, .product.waiting_connection { border-color: color-mix(in srgb, var(--hot) 35%, var(--line)); }
.product.available { opacity: .78; } .product .open { font-weight: 600; text-decoration: none; margin-top: 4px; }
.conn { display: flex; align-items: center; gap: 7px; font-size: 13px; } .conn .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: 0 0 auto; }
.conn.connected .dot { background: var(--ok); } .conn.not_connected .dot { background: var(--hot); } .conn.pending .dot { background: var(--warn); }
.checklist li.conn { display: block; } .checklist li.conn::before { content: none; } .checklist li.conn .dot { display: inline-block; margin-right: 6px; }
.more-products summary { cursor: pointer; color: var(--muted); margin-bottom: 10px; }
.panels.wide { grid-template-columns: 1fr; }

/* Setup */
.setup-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 14px; } .setup-head h1 { margin: 0 0 4px; }
.setup-meter { display: flex; gap: 12px; align-items: center; font-size: 13px; }
.setup-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; } @media (max-width: 1100px) { .setup-grid { grid-template-columns: 1fr; } }
.card-lg { background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; padding: 16px; min-width: 0; }
.interview { display: flex; flex-direction: column; gap: 10px; min-height: 420px; }
.iv-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; max-height: 58vh; padding-right: 4px; }
.iv-msg { display: flex; gap: 10px; align-items: flex-start; max-width: 92%; } .iv-msg p { margin: 0; }
.iv-msg > div { background: var(--navy-3); border: 1px solid var(--line); padding: 9px 12px; border-radius: 14px 14px 14px 4px; }
.iv-msg.me { align-self: flex-end; } .iv-msg.me > div { background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 55%, var(--purple))); color: var(--brand-ink); border: 0; border-radius: 14px 14px 4px 14px; }
.iv-mark { width: 28px; height: 28px; flex: 0 0 auto; border-radius: 9px; display: grid; place-items: center; font-weight: 800; font-size: 12px; color: #fff; background: linear-gradient(135deg, var(--hot), var(--purple)); }
.iv-msg.typing p { color: var(--muted); }
.iv-quick { display: flex; gap: 6px; flex-wrap: wrap; } .iv-resume { padding-left: 38px; }
.jump { display: none; font-weight: 600; text-decoration: none; } @media (max-width: 1100px) { .jump { display: inline-block; } } .iv-form { display: flex; gap: 8px; } .iv-form input { flex: 1; min-width: 0; min-height: 44px; font-size: 15px; } .iv-form button { min-height: 44px; }
.qa { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 2px; }
.qa li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 10px; padding: 8px 10px; border-radius: 10px; border: 1px solid transparent; }
.qa li.current { border-color: color-mix(in srgb, var(--hot) 55%, var(--line)); background: color-mix(in srgb, var(--hot) 7%, transparent); }
.qa-l { display: grid; min-width: 0; flex: 1 1 200px; } .qa-l > span:first-child { font-size: 12.5px; color: var(--muted); } .qa-v { overflow-wrap: anywhere; } .qa-v.sugg { color: var(--warn); font-style: italic; }
.qa-r { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; } .req { color: var(--hot); }
.src { font-size: 11px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.src-customer { color: var(--accent); } .src-order { color: #93c5fd; } .src-brain { color: #c4b5fd; } .src.ok { color: var(--ok); } .src.bad { color: var(--bad); }
.qa-edit { flex-basis: 100%; display: flex; gap: 6px; } .qa-edit input { flex: 1; min-width: 0; }
.answers h3 { margin: 12px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); } .answers h3:first-of-type { margin-top: 0; }
.review { margin-top: 14px; } .review-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; } @media (max-width: 900px) { .review-grid { grid-template-columns: 1fr; } }
.review h3 { margin: 0 0 6px; }

/* Settings */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; } @media (max-width: 1100px) { .settings-grid { grid-template-columns: 1fr; } }
.settings-grid form.card-lg, .settings-grid section.card-lg { display: grid; gap: 10px; margin-bottom: 14px; align-content: start; } .settings-grid label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.settings-grid .row label { display: inline-grid; }
.brand-preview { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; background: var(--navy-1); border: 1px dashed var(--line); }
.big-mark { width: 44px; height: 44px; font-size: 16px; } .pv-btn { margin-left: auto; } .brand-preview .pv-btn { box-shadow: inset 0 -3px 0 var(--hot); }
input[type="color"] { width: 54px; height: 36px; padding: 2px; }

/* Schedule */
.big-line { font-size: 16px; font-weight: 600; margin: 0 0 8px; }
.hours-form { display: grid; gap: 6px; margin-top: 8px; } .hrow { display: grid; grid-template-columns: 92px 70px 1fr 1fr; gap: 6px; align-items: center; font-size: 13px; }
.edit-hours summary { cursor: pointer; color: var(--accent); }

/* Desk and lists keep their layout; colours follow the theme. */
.callcard { background: var(--panel-2); } .oc { background: var(--navy-1); } .daychip { background: var(--navy-1); } .appt { background: var(--accent-soft); }
.desk-strip { background: var(--navy-3); } .dial { background: color-mix(in srgb, var(--brand) 22%, var(--navy-2)); }
.kanban .col { background: var(--navy-1); } .kcard { background: var(--panel-2); }
.link:hover { background: var(--navy-3); } .plist li { border-color: var(--line); }

@media (max-width: 640px) {
  .view { padding: 14px; border-radius: 14px; } .body { padding: 10px 10px 100px; gap: 10px; }   /* bottom: room for the Marin bar */
  .hero { padding: 16px; } .hero h1 { font-size: 22px; } .hero-cta { width: 100%; text-align: center; }
  .brand-text .tagline { display: none; } .mark { width: 32px; height: 32px; }
  .hrow { grid-template-columns: 1fr 64px; } .hrow input[type="time"] { grid-column: span 1; }
  .interview { min-height: 0; } .iv-log { flex: none; min-height: 220px; max-height: 50vh; }
}

/* ======================================================================================================================
   V6 — premium pass: typography, grouped navigation with icons, Marin as a companion (orb, voice), the customer journey,
   "How TMS helps", list imports, and the private-preview launcher. Same tokens: customers' --brand / --hot still apply.
   ==================================================================================================================== */
:root, :root:not([data-theme="light"]) { --navy-0: #050816; --navy-1: #0a1024; --navy-2: #0f1730; --navy-3: #16203d; --navy-4: #1f2c50; --line: #233154;
  --glow: 0 0 0 1px rgba(255,255,255,.04) inset, 0 18px 40px -18px rgba(0,0,0,.65); --head: "Plus Jakarta Sans", "Inter", system-ui, sans-serif; }
body { font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; }
h1, h2, .hero h1, .l-hero h1 { font-family: var(--head); }
.devbar { background: linear-gradient(90deg, #7c2d12, #b45309 45%, #7c3aed); letter-spacing: .01em; }
.devbar b { font-weight: 700; }
.pill.tiny { font-size: 11px; padding: 1px 8px; font-weight: 600; } .pill.info { color: #93c5fd; border-color: color-mix(in srgb, #93c5fd 40%, var(--line)); }
.pill.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); } .pill.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.pill.muted { color: var(--muted); } .row.spread { justify-content: space-between; align-items: flex-start; }
.icon-btn { background: var(--navy-3); border: 1px solid var(--line); color: var(--ink); box-shadow: none; min-height: 36px; min-width: 36px; padding: 4px 8px; border-radius: 10px; font-size: 15px; line-height: 1; }
.icon-btn:hover { border-color: var(--accent); }

/* Navigation: product groups, icons, a clear active state */
.nav-group { display: grid; gap: 2px; } .nav-group + .nav-group { margin-top: 10px; }
.nav-sec { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: color-mix(in srgb, var(--muted) 80%, transparent); padding: 6px 12px 2px; font-weight: 700; }
.top nav a { display: flex; align-items: center; gap: 10px; }
.nav-ico { width: 17px; height: 17px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.top nav a.on { background: linear-gradient(90deg, color-mix(in srgb, var(--brand) 32%, transparent), color-mix(in srgb, var(--purple) 14%, transparent)); color: #fff; box-shadow: inset 3px 0 0 var(--hot); }
.top nav a.on .nav-ico { opacity: 1; color: var(--hot); }
.me-btns { display: flex; gap: 6px; flex-wrap: wrap; }
@media (min-width: 1024px) { .top { background: linear-gradient(180deg, color-mix(in srgb, var(--navy-1) 96%, transparent), color-mix(in srgb, var(--navy-0) 96%, transparent)); } }
@media (max-width: 1023px) {
  .top nav { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 4px; scrollbar-width: none; } .top nav::-webkit-scrollbar { display: none; }
  .nav-group { display: contents; } .nav-sec { display: none; } .top nav a { white-space: nowrap; padding: 6px 10px; } .top nav a .nav-ico { width: 15px; height: 15px; }
}
@media (max-width: 640px) { .devbar { font-size: 10.5px; padding: 3px 10px; } .top { position: static; } .me .who { display: none; } .me { margin-left: auto; } }

/* Marin: a companion with presence — orb, live status, voice */
.marin-head { gap: 10px; justify-content: flex-start; } .marin-head #marin-close { margin-left: 4px; } .marin-head .icon-btn { margin-left: auto; }
.marin h2::before { content: none; } .marin-id { display: grid; line-height: 1.15; } .marin-id h2 { margin: 0; font-size: 16px; }
.marin-status { font-size: 11.5px; color: var(--muted); }
.marin-orb { width: 34px; height: 34px; border-radius: 50%; position: relative; flex: 0 0 auto; background: conic-gradient(from 210deg, var(--hot), var(--purple), var(--blue), var(--hot)); box-shadow: 0 0 18px color-mix(in srgb, var(--purple) 55%, transparent); }
.marin-orb i { position: absolute; inset: 3px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0 8%, color-mix(in srgb, var(--blue) 60%, var(--navy-2)) 40%, var(--navy-2) 100%); }
.marin.live .marin-status { color: var(--ok); } .marin.thinking .marin-orb { animation: orb 1.2s linear infinite; }
@keyframes orb { to { transform: rotate(360deg); } }
.marin { border-color: color-mix(in srgb, var(--purple) 30%, var(--line)); background: linear-gradient(180deg, color-mix(in srgb, var(--navy-2) 96%, transparent), color-mix(in srgb, var(--navy-1) 96%, transparent)); }
.msg { border-radius: 14px; padding: 8px 12px; line-height: 1.45; } .msg.bot { border: 1px solid var(--line); border-top-left-radius: 4px; } .msg.me { border-top-right-radius: 4px; }
.typing-dots { display: inline-flex; gap: 4px; padding: 4px 0; } .typing-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1s infinite; }
.typing-dots i:nth-child(2) { animation-delay: .15s; } .typing-dots i:nth-child(3) { animation-delay: .3s; } @keyframes blink { 50% { opacity: .25; } }
#marin-form { align-items: center; } #marin-form .send { flex: 0 0 auto; }
.mic.rec { background: color-mix(in srgb, var(--bad) 25%, var(--navy-3)); border-color: var(--bad); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--bad) 45%, transparent); } 50% { box-shadow: 0 0 0 7px transparent; } }
.iv-form { align-items: center; } .iv-form .icon-btn { min-height: 44px; min-width: 44px; }
@media (max-width: 860px) { .marin .marin-head .icon-btn { display: none; } .marin.open .marin-head .icon-btn { display: inline-flex; } #marin-form .mic { min-height: 44px; min-width: 44px; } }

/* Overview: greeting, getting started, how TMS helps */
.hero { box-shadow: var(--glow); } .hero-greet { margin: 2px 0 12px; color: color-mix(in srgb, var(--ink) 88%, transparent); font-size: 15px; }
.journey-tile { margin-bottom: 14px; }
.journey { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; counter-reset: j; }
.journey li { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--navy-2); min-width: 0; }
.journey li > div { display: grid; gap: 3px; min-width: 0; } .journey b { font-size: 13.5px; }
.j-dot { width: 26px; height: 26px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; background: var(--navy-4); color: var(--muted); }
.journey li.done .j-dot { background: color-mix(in srgb, var(--ok) 22%, var(--navy-3)); color: var(--ok); }
.journey li.now { border-color: color-mix(in srgb, var(--hot) 60%, var(--line)); background: linear-gradient(135deg, color-mix(in srgb, var(--hot) 12%, var(--navy-2)), var(--navy-2)); }
.journey li.now .j-dot { background: var(--hot); color: #1a0d02; }
.j-cta { font-weight: 700; text-decoration: none; font-size: 13px; margin-top: 2px; } .j-note { color: var(--warn); }
@media (max-width: 1100px) { .journey { grid-template-columns: 1fr; } .journey li { padding: 8px 10px; } }
.value-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-bottom: 18px; }
.value-card { border-radius: 14px; padding: 14px 16px; border: 1px solid var(--line); background: linear-gradient(160deg, color-mix(in srgb, var(--brand) 12%, var(--navy-2)), var(--navy-2) 55%); box-shadow: var(--glow); }
.value-card.k-revenue { background: linear-gradient(160deg, color-mix(in srgb, var(--hot) 14%, var(--navy-2)), var(--navy-2) 55%); }
.value-card header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; } .value-card h3 { margin: 0; font-size: 14px; }
.v-ico { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--navy-4); font-size: 15px; }
.value-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; } .value-card li p { margin: 0 0 4px; font-size: 13.5px; }
.v-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Import lists */
.page-head { margin-bottom: 14px; } .page-head h1 { margin: 0 0 4px; } .page-head p { max-width: 820px; margin: 0; }
.import-drop { margin-bottom: 14px; background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 14%, var(--navy-3)), var(--navy-3)); }
.import-form { display: grid; grid-template-columns: minmax(220px, 1.2fr) 1fr; gap: 10px 14px; align-items: end; } .import-form label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.import-form .row { margin: 0; } .import-form .row label { flex: 1; } .import-form .big { justify-self: start; }
.file-pick { grid-row: span 2; display: flex !important; align-items: center; gap: 12px; padding: 16px; border: 1.5px dashed color-mix(in srgb, var(--accent) 55%, var(--line)); border-radius: 14px; cursor: pointer; color: var(--ink) !important; }
.file-pick input { max-width: 100%; } .file-ico { font-size: 26px; color: var(--hot); }
@media (max-width: 760px) { .import-form { grid-template-columns: 1fr; } .file-pick { grid-row: auto; flex-wrap: wrap; } }
.import-preview { margin-bottom: 14px; border-color: color-mix(in srgb, var(--hot) 40%, var(--line)); } .import-preview h2 { margin: 0; }
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; margin: 12px 0 8px; }
.kpi { background: var(--navy-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; gap: 2px; } .kpi b { font-size: 22px; font-family: var(--head); } .kpi span { font-size: 12px; color: var(--muted); }
.kpi.ok b { color: var(--ok); } .kpi.info b { color: #93c5fd; } .kpi.bad b { color: var(--bad); }
.mapping summary { cursor: pointer; color: var(--accent); margin: 8px 0; } .map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.map-grid label { display: grid; gap: 3px; font-size: 12.5px; } .map-grid label span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-actions { margin-top: 12px; } table.dense td, table.dense th { padding: 6px 8px; font-size: 13px; } table.dense th { color: var(--muted); font-weight: 600; font-size: 12px; }
.compare { margin-top: 14px; } .build-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; align-items: end; }
.build-form label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); } .build-form .toggle { display: flex; color: var(--ink); }
.done-card { margin-bottom: 14px; border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
.card-lg + .card-lg { margin-top: 14px; }

/* Private-preview launcher */
.launcher { max-width: 1120px; margin: 0 auto; padding: 36px 20px 60px; }
.l-hero { display: flex; gap: 18px; align-items: flex-start; padding: 26px; border-radius: 22px; margin-bottom: 26px; position: relative; overflow: hidden;
  background: linear-gradient(125deg, color-mix(in srgb, var(--blue) 30%, var(--navy-2)), color-mix(in srgb, var(--purple) 30%, var(--navy-2)) 60%, var(--navy-2)); border: 1px solid color-mix(in srgb, var(--purple) 35%, var(--line)); box-shadow: var(--glow); }
.l-hero::after { content: ""; position: absolute; right: -80px; top: -90px; width: 300px; height: 300px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--hot) 40%, transparent), transparent 70%); }
.l-hero > div { position: relative; z-index: 1; } .l-hero h1 { font-size: clamp(24px, 3.4vw, 36px); margin: 0 0 8px; letter-spacing: -.025em; }
.l-logo { width: 54px; height: 54px; border-radius: 16px; flex: 0 0 auto; display: grid; place-items: center; font: 800 24px var(--head); color: #fff; background: linear-gradient(135deg, var(--blue), var(--purple)); box-shadow: 0 10px 30px color-mix(in srgb, var(--purple) 50%, transparent); position: relative; z-index: 1; }
.l-lead { max-width: 760px; margin: 0 0 12px; color: color-mix(in srgb, var(--ink) 86%, transparent); font-size: 15.5px; }
.l-model { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; padding: 5px 12px; border-radius: 999px; background: color-mix(in srgb, var(--navy-0) 50%, transparent); border: 1px solid var(--line); }
.l-model .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); } .l-model .dot.on { background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.l-group { margin-bottom: 26px; } .l-group header { margin-bottom: 10px; } .l-group h2 { margin: 0; font-size: 18px; } .l-group header p { margin: 2px 0 0; font-size: 13.5px; }
.l-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.l-card { --c: var(--blue); --a: var(--purple); display: flex; gap: 14px; align-items: flex-start; text-align: left; padding: 16px; border-radius: 16px; min-height: 0;
  background: linear-gradient(150deg, color-mix(in srgb, var(--c) 16%, var(--navy-2)), var(--navy-2) 60%); border: 1px solid var(--line); color: var(--ink); box-shadow: var(--glow); font-weight: 400; transition: transform .15s ease, border-color .15s ease; }
.l-card:hover:not(:disabled) { transform: translateY(-2px); border-color: color-mix(in srgb, var(--c) 70%, var(--line)); filter: none; }
.l-card.busy { border-color: var(--hot); } .l-card:disabled:not(.busy) { opacity: .55; }
.l-mark { width: 44px; height: 44px; flex: 0 0 auto; border-radius: 13px; display: grid; place-items: center; font: 800 16px var(--head); color: #fff; background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 45%, var(--a))); box-shadow: 0 8px 20px color-mix(in srgb, var(--c) 40%, transparent); }
.l-mark.plus { background: transparent; border: 1.5px dashed color-mix(in srgb, var(--hot) 70%, var(--line)); color: var(--hot); box-shadow: none; font-size: 22px; }
.l-body { display: grid; gap: 3px; flex: 1; min-width: 0; } .l-body b { font-size: 15.5px; font-family: var(--head); } .l-who { font-size: 12.5px; color: var(--accent); font-weight: 600; }
.l-blurb { font-size: 13px; color: var(--muted); line-height: 1.4; } .l-go { color: var(--muted); font-size: 18px; align-self: center; }
.l-card.fresh { background: linear-gradient(150deg, color-mix(in srgb, var(--hot) 10%, var(--navy-2)), var(--navy-2) 60%); }
@media (max-width: 640px) { .launcher { padding: 16px 12px 40px; } .l-hero { padding: 18px; flex-direction: column; } .l-cards { grid-template-columns: 1fr; } }
@media (min-width: 1024px) { .top nav { flex-wrap: nowrap; } }
.file-pick { flex-direction: column; align-items: flex-start !important; gap: 8px !important; } .file-pick input { font-size: 12.5px; width: 100%; }
/* V7: background imports */
.running .imp-run { padding: 8px 0; border-bottom: 1px solid var(--line); } .running .imp-run:last-of-type { border-bottom: 0; }
.bar.big { height: 10px; margin: 6px 0; } .imp-run.failed .bar i { background: var(--bad); }
/* V7: the call desk's primary controls */
.callbar { display: flex; flex-wrap: wrap; gap: 8px; }
.cb { background: var(--navy-1); color: var(--ink); border: 1px solid var(--line); box-shadow: none; min-height: 42px; font-weight: 600; display: inline-flex; gap: 6px; align-items: center; }
.cb:hover { border-color: var(--accent); } .cb.on { border-color: var(--hot); color: var(--hot); }
.cb.vm { border-color: color-mix(in srgb, var(--hot) 55%, var(--line)); }
@media (max-width: 640px) { .callbar .cb { flex: 1 1 calc(50% - 8px); justify-content: center; } }

/* ======================================================================================================================
   V7 — accepted direction: midnight navy, layered rich blues, refined champagne-gold accents, cool-white type, the real
   TMS logo and Marin's established glowing identity, soft background atmosphere. Customers' own colours still apply
   (--brand / --hot come from their branding); these are TMS's defaults. The purple token now resolves to a deep blue,
   so every earlier gradient becomes blue-on-blue; orange/coral is replaced by gold.
   ==================================================================================================================== */
:root, :root:not([data-theme="light"]) {
  --navy-0: #040917; --navy-1: #081126; --navy-2: #0c1834; --navy-3: #122244; --navy-4: #1a2e58; --line: #20325c;
  --ink: #eef3fc; --muted: #9db0cf; --blue: #3a7bff; --purple: #1f4fb8; --brand: #2f6bff; --hot: #d9b46a;
  --gold: #d9b46a; --gold-2: #f0d9a6; --ok: #5fd3a8;
}
body { background:
    radial-gradient(900px 520px at 88% -8%, rgba(217, 180, 106, .10), transparent 62%),
    radial-gradient(1200px 700px at 70% 0%, rgba(47, 107, 255, .20), transparent 60%),
    radial-gradient(900px 600px at -10% 15%, rgba(31, 79, 184, .22), transparent 60%),
    radial-gradient(700px 500px at 50% 110%, rgba(58, 123, 255, .10), transparent 60%),
    linear-gradient(180deg, #050b1c, #040917 60%);
  background-attachment: fixed; }
/* a faint arc echoing the logo's sweep: atmosphere only, never over content */
body::before { content: ""; position: fixed; inset: -20vh -10vw auto auto; width: 80vw; height: 80vh; pointer-events: none; z-index: 0;
  background: radial-gradient(closest-side, transparent 72%, rgba(240, 217, 166, .07) 73%, transparent 75%); transform: rotate(-12deg); }
.app, .launcher, .signin { position: relative; z-index: 1; }
.devbar { background: linear-gradient(90deg, #0b1a3a, #16336e 55%, #6d5527); color: #f3e6c4; }
.eyebrow { color: var(--gold); }
.hero { background: linear-gradient(120deg, color-mix(in srgb, var(--brand) 34%, var(--navy-2)), color-mix(in srgb, var(--purple) 30%, var(--navy-2)) 62%, var(--navy-2)); }
.hero::after { background: radial-gradient(circle, color-mix(in srgb, var(--gold) 30%, transparent), transparent 70%); }
.hero-cta { background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: #1b1407; box-shadow: 0 10px 26px rgba(217, 180, 106, .28); }
button { background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 60%, #0c1e4d)); }
.top nav a.on { box-shadow: inset 3px 0 0 var(--gold); } .top nav a.on .nav-ico { color: var(--gold); }
.pill.hot { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 45%, var(--line)); background: color-mix(in srgb, var(--gold) 9%, var(--navy-2)); }
.journey li.now { border-color: color-mix(in srgb, var(--gold) 55%, var(--line)); background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 10%, var(--navy-2)), var(--navy-2)); }
.journey li.now .j-dot { background: var(--gold); color: #1b1407; }
.value-card.k-revenue { background: linear-gradient(160deg, color-mix(in srgb, var(--gold) 11%, var(--navy-2)), var(--navy-2) 55%); }
.l-card.fresh { background: linear-gradient(150deg, color-mix(in srgb, var(--gold) 9%, var(--navy-2)), var(--navy-2) 60%); }
.l-mark.plus { border-color: color-mix(in srgb, var(--gold) 70%, var(--line)); color: var(--gold); }
.l-hero { background: linear-gradient(125deg, rgba(47, 107, 255, .26), rgba(31, 79, 184, .30) 60%, var(--navy-2)); border-color: color-mix(in srgb, var(--blue) 30%, var(--line)); }
.l-hero::after { background: radial-gradient(circle, rgba(217, 180, 106, .30), transparent 70%); }
.l-logo-img { width: 150px; height: auto; flex: 0 0 auto; position: relative; z-index: 1; filter: drop-shadow(0 6px 20px rgba(58, 123, 255, .35)); }
.l-marin { width: 22px; height: 22px; object-fit: contain; margin-right: -2px; }
@media (max-width: 640px) { .l-logo-img { width: 120px; } }
/* Brand area: a real logo (wide or square) instead of the monogram when one exists */
.brand.has-logo .mark { width: auto; height: 38px; min-width: 38px; max-width: 150px; background: transparent; box-shadow: none; border-radius: 6px; }
.brand.has-logo .mark img { width: auto; height: 100%; max-width: 150px; object-fit: contain; }
@media (min-width: 1024px) { .brand.has-logo { flex-direction: column; align-items: flex-start; gap: 6px; } .brand.has-logo .mark { height: 46px; max-width: 190px; } .brand.has-logo .mark img { max-width: 190px; } }
/* Marin: her established nonhuman glowing identity (not a portrait, not a generic avatar) */
.marin-orb { background: radial-gradient(circle, rgba(58, 123, 255, .35), transparent 70%); box-shadow: none; width: 40px; height: 40px; display: grid; place-items: center; }
.marin-orb img { width: 40px; height: 40px; object-fit: contain; filter: drop-shadow(0 0 8px rgba(120, 170, 255, .55)); }
.marin.thinking .marin-orb { animation: none; } .marin.thinking .marin-orb img { animation: marin-pulse 1.1s ease-in-out infinite; }
@keyframes marin-pulse { 50% { filter: drop-shadow(0 0 14px rgba(217, 180, 106, .75)); transform: scale(1.04); } }
.iv-mark { background: transparent; width: 32px; height: 32px; } .iv-mark img { width: 32px; height: 32px; object-fit: contain; }
.marin { border-color: color-mix(in srgb, var(--blue) 28%, var(--line)); }
/* Platform switcher: one button per purchased product */
.platforms { display: flex; gap: 6px; flex-wrap: wrap; } .platforms:empty { display: none; }
.platforms a { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 13.5px;
  background: color-mix(in srgb, var(--navy-2) 80%, transparent); border: 1px solid var(--line); }
.platforms a:hover { color: var(--ink); border-color: color-mix(in srgb, var(--blue) 55%, var(--line)); }
.platforms a.on { color: #fff; border-color: color-mix(in srgb, var(--gold) 60%, var(--line)); background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 30%, var(--navy-2)), var(--navy-2)); }
.platforms a.on .nav-ico { color: var(--gold); }
@media (max-width: 1023px) {
  .platforms { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; } .platforms::-webkit-scrollbar { display: none; } .platforms a { white-space: nowrap; }
  /* on a phone/tablet the screens shown are the current platform's; the switcher above moves between platforms */
  .nav-group:not(.current) { display: none; } .nav-group.current { display: contents; }
}
/* V7 (round 6 #11): logos fit the compact phone/tablet header */
@media (max-width: 1023px) { .brand.has-logo .mark { height: 30px; min-width: 30px; max-width: 120px; } .brand.has-logo .mark img { height: 30px; max-width: 120px; } .brand.has-logo { flex-direction: row; } }

/* Tasks (Marin's work) */
.task .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.task .row.task-acts { justify-content: flex-start; }
.task .last { margin: 6px 0; }
.task .runs table { width: 100%; font-size: 13px; margin-top: 8px; }
.notify .note { border-top: 1px solid var(--line, #dfe4ee); padding-top: 8px; margin-top: 8px; }
.pill.ok { background: rgba(29,122,70,.14); color: #1d7a46; } .pill.done { background: rgba(31,79,184,.14); color: var(--blue, #1f4fb8); } .pill.bad { background: rgba(163,38,42,.14); color: #a3262a; } .pill.muted { opacity: .7; }

/* ---------------------------------------------------------------------------------------------------------------------
   Nov 2 2026 refinement: restrained surfaces. Charcoal-navy base, a faint contour-line artwork (abstract hills) and a
   whisper of the account's own brand colour; no glowing orbs or rings. Readability and hierarchy first. */
:root, :root:not([data-theme="light"]) {
  --navy-0: #0a0d13; --navy-1: #0e1219; --navy-2: #131822; --navy-3: #19202c; --navy-4: #232b3a; --line: #263042;
  --bg: var(--navy-1); --panel: var(--navy-2); --panel-2: var(--navy-3); --muted: #9aa5b8;
  --glow: 0 0 0 1px rgba(255,255,255,.03) inset, 0 10px 30px -16px rgba(0,0,0,.7);
}
body {
  background:
    radial-gradient(1100px 520px at 12% -10%, color-mix(in srgb, var(--brand, #3a6ea5) 9%, transparent), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1600' height='900' viewBox='0 0 1600 900'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.035' stroke-width='1.2'%3E%3Cpath d='M0 720C220 640 380 700 560 650S900 520 1120 580 1450 700 1600 640'/%3E%3Cpath d='M0 760C240 690 400 740 590 700S930 580 1140 630 1460 740 1600 690'/%3E%3Cpath d='M0 800C250 740 420 780 610 750S950 640 1160 680 1470 780 1600 740'/%3E%3Cpath d='M0 840C260 790 440 820 630 800S970 700 1180 730 1480 820 1600 790'/%3E%3Cpath d='M820 160c90-40 210-30 290 30s200 70 300 20'/%3E%3Cpath d='M860 200c80-30 190-20 260 30s190 60 280 20'/%3E%3C/g%3E%3C/svg%3E") center bottom / cover no-repeat fixed,
    linear-gradient(180deg, #0c1017, #0a0d13 60%);
}
body::before { display: none; }
.hero::after, .l-hero::after { display: none !important; }
.hero { background: linear-gradient(180deg, color-mix(in srgb, var(--brand, #3a6ea5) 9%, var(--navy-2)), var(--navy-2)); border: 1px solid var(--line); box-shadow: var(--glow); padding: 18px 20px; }
.hero h1 { font-size: 24px; letter-spacing: -.01em; }
.l-hero { background: var(--navy-2); border: 1px solid var(--line); box-shadow: var(--glow); }
.top { background: color-mix(in srgb, var(--navy-1) 94%, transparent); }

/* Workspace selection always reachable in the preview */
.platform-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ws-back { background: transparent; border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 6px 12px; font-size: 13px; box-shadow: none; min-height: 32px; white-space: nowrap; }
.ws-back:hover { color: var(--ink); border-color: var(--gold, #d9b46a); }
.l-continue { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; margin: 0 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--navy-2); }
.l-continue .btn { padding: 8px 14px; border-radius: 10px; background: linear-gradient(135deg, var(--gold-2, #f0d9a6), var(--gold, #d9b46a)); color: #1b1407; font-weight: 700; text-decoration: none; }

/* Sidebar: essentials, the open product, others folded to one line; the Calling Desk one tap away */
.nav-cta { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; font-weight: 700; text-decoration: none;
  color: #1b1407 !important; background: linear-gradient(135deg, var(--gold-2, #f0d9a6), var(--gold, #d9b46a)); }
.nav-cta .nav-ico { stroke: #1b1407; }
.nav-product { opacity: .85; } .nav-more { margin-left: auto; color: var(--muted); }
.nav-group.folded { margin-top: 2px; } .nav-group.folded .nav-sec { display: none; }
.nav-sec-ops { display: block; margin-top: 14px; }
.platforms a.crm { border-color: color-mix(in srgb, var(--gold, #d9b46a) 60%, var(--line)); }

/* At a glance: Marin, Calling Desk, what needs you, what Marin is doing */
.glance { display: grid; grid-template-columns: 1.4fr 1fr; gap: 12px; margin: 0 0 18px; }
.glance > * { background: var(--navy-2); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; box-shadow: var(--glow); }
.g-marin { grid-column: 1 / -1; }
.g-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; } .g-head h2 { margin: 0; font-size: 17px; } .g-head p { margin: 2px 0 0; }
.g-head > div { flex: 1 1 260px; }
.g-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.g-talk { padding: 10px 16px; border-radius: 12px; font-weight: 700; background: var(--brand, #2f5fb8); color: var(--brand-ink, #fff); border: 0; }
.g-ex { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; } .g-ex .chip-btn { text-align: left; white-space: normal; }
.g-desk { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink); border-color: color-mix(in srgb, var(--gold, #d9b46a) 55%, var(--line)) !important; }
.g-desk b { display: block; font-size: 17px; } .g-desk .small { color: var(--muted); } .g-desk-ico { font-size: 22px; } .g-go { margin-left: auto; font-weight: 700; color: var(--gold, #d9b46a); }
.g-col h3 { margin: 0 0 8px; font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.g-list { margin: 0 0 6px; padding-left: 18px; } .g-list li { margin: 4px 0; }
@media (max-width: 760px) { .glance { grid-template-columns: 1fr; } .g-talk { width: 100%; } .ws-back { order: -1; } }
.glance > *, .view-host, .g-head > div { min-width: 0; }
.g-ex .chip-btn { white-space: normal; max-width: 100%; overflow-wrap: anywhere; }
#switch-demo { display: none !important; }            /* one "All workspaces" control: the pill above the product bar */
.platform-bar { min-width: 0; max-width: 100%; }
.platform-bar > .platforms { flex: 1 1 0; min-width: 0; overflow-x: auto; }
@media (max-width: 760px) { .platform-bar > .platforms { flex-basis: 100%; } }

/* Applications (Nov 2 2026): launcher tiles, the current application's identity and its own screens */
.apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-bottom: 8px; }
.app-tile { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--navy-2); color: var(--ink); text-decoration: none; box-shadow: var(--glow); min-width: 0; }
.app-tile:hover { border-color: color-mix(in srgb, var(--gold, #d9b46a) 60%, var(--line)); }
.app-tile b { display: block; font-size: 15.5px; } .app-txt span { display: block; color: var(--muted); font-size: 13px; line-height: 1.35; } .app-txt { min-width: 0; }
.app-ico { font-size: 22px; line-height: 1; width: 30px; text-align: center; flex: none; } .app-ico img { width: 30px; height: 30px; border-radius: 50%; }
.app-crm { border-color: color-mix(in srgb, var(--gold, #d9b46a) 55%, var(--line)); } .app-sub { color: var(--gold, #d9b46a) !important; font-weight: 600; margin-top: 4px; }
.apps-note { margin: 4px 2px 16px; }
.app-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--navy-2); }
.app-home { color: var(--muted); text-decoration: none; font-size: 13px; white-space: nowrap; } .app-home:hover { color: var(--ink); }
.app-id { display: flex; flex-direction: column; min-width: 0; } .app-name { font-weight: 800; font-size: 16px; } .app-purpose { color: var(--muted); font-size: 12.5px; }
.app-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; } .app-tabs a { padding: 5px 10px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: 13px; }
.app-tabs a.on { background: var(--navy-3); color: var(--ink); font-weight: 600; }
@media (max-width: 760px) { .app-tabs { margin-left: 0; width: 100%; } }
@media (min-width: 761px) { .platform-bar { flex-wrap: nowrap; } .platform-bar > .platforms { flex-wrap: nowrap; scrollbar-width: thin; } .platforms a { white-space: nowrap; } }
#nav a.nav-cta, #nav a.nav-cta.on, #nav a.nav-cta:hover { background: linear-gradient(135deg, var(--gold-2, #f0d9a6), var(--gold, #d9b46a)) !important; color: #1b1407 !important; box-shadow: none; }
#nav a.nav-cta.on { outline: 2px solid color-mix(in srgb, var(--gold, #d9b46a) 50%, transparent); outline-offset: 2px; }
.chip-btn.fill { border-style: dashed; }
.brand { cursor: pointer; }
.platforms a.crm { border-color: var(--line); } .platforms a.crm.on { border-color: color-mix(in srgb, var(--gold, #d9b46a) 60%, var(--line)); }
@media (max-width: 760px) {
  body.in-app #nav, body.in-app .platform-bar > .platforms { display: none; }       /* inside an application: its header is the navigation */
  .view-host table { display: block; overflow-x: auto; max-width: 100%; }
}
.brand:hover #account-name { text-decoration: underline; text-underline-offset: 3px; }
body.preview #account-name::after { content: " ⇄"; font-size: .8em; color: var(--muted); }
@media (max-width: 760px) { .view-host { overflow-x: auto; } }

/* Nov 2 2026: the preview banner belongs to the private preview only; a production instance never shows it. */
body:not(.preview) .devbar { display: none; }
