/* ── The project card in Mythril (Nick, 11/13/26) ────────────────────────────
   A full rebuild of the card, approved on the live demo ("This is good"), for
   every card that opens a project: the operations card (EV and HES-IE), the
   sales card and Finance's. The parts are drawn by js/card-mythril.js; the
   cards add .mc-card to opt in, so the client and organization cards that
   borrow the same classes keep their own look.

   The rules it follows:
   - A compact navy head: the address and its town and utility, the status as
     a tile, then the ladder with the step and whose move beside it, and only
     what needs a look. The client sits in Project info, one press away.
   - Folder tabs on the navy. The open one is the body's own colour, and in
     the dark theme the head goes deeper and the body lifts, so the open tab
     stands clear of the head (Nick: "too difficult to even see the tab").
   - Leo's tab is his lion in his turning rim, no word; it is the card's hub.
   - No boxes, no wells, no divider lines: grouping by spacing. Facts are
     label and value rows that light on hover, each with a copy button.
   - Tables are THE TABLE. One gold fill per view at most.
   - Light and dark both. */

.crm-drawer.mc-card {
  --mc-night: #1f2533;
  --mc-cream: #f4f1e8;
  --mc-cream-80: rgb(244 241 232 / .84);
  --mc-cream-60: rgb(244 241 232 / .64);
  --mc-cream-25: rgb(244 241 232 / .24);
  --mc-cream-12: rgb(244 241 232 / .12);
  --mc-gold-n: #e8d29a;
  --mc-red-n: #f4b4ab;
  --mc-green-n: #a6dbbd;
  --mc-surface: #ffffff;
  --mc-well: #f4f5f8;
  --mc-hover: #f0f2f6;
  --mc-rule: #e4e7ee;
  --mc-ink: #1b2130;
  --mc-ink-2: #4d5467;
  --mc-ink-3: #666d80;
  --mc-royal: #2b4a8c;
  --mc-green: #1f7a49;
  --mc-red: #c0392b;
  --mc-amber: #8a5a11;
  --mc-gold: #c9a03f;
  --mc-gold-dark: #b08a2e;
  --mc-pop: 0 22px 44px -18px rgba(15, 19, 30, .4), 0 2px 6px rgba(15, 19, 30, .08), 0 0 0 .5px rgba(15, 19, 30, .1);
  --mc-sheet: 0 14px 34px -18px rgba(43, 48, 64, .34), 0 6px 18px -12px rgba(201, 160, 63, .3), 0 0 0 1px rgba(27, 33, 48, .06);
  --mc-disp: var(--font-serif, 'Space Grotesk', Inter, sans-serif);
  --mc-spring: cubic-bezier(.34, 1.5, .64, 1);
  --mc-out: cubic-bezier(.22, 1, .36, 1);
  /* the older card layers read these */
  --pc-night: var(--mc-night);
  --pc-well: transparent;
  background: var(--mc-surface);
  border-radius: 22px;
  box-shadow: var(--mc-pop);
}
[data-theme="dark"] .crm-drawer.mc-card {
  --mc-night: #0a0e19;
  --mc-surface: #1a2238;
  --mc-well: #222b45;
  --mc-hover: #26304d;
  --mc-rule: #2c3653;
  --mc-ink: #eef0f6;
  --mc-ink-2: #c0c6d6;
  --mc-ink-3: #9aa1b6;
  --mc-royal: #a9bcff;
  --mc-green: #46b074;
  --mc-red: #f08a8a;
  --mc-amber: #dba24a;
  --mc-gold: #d4ac44;
  --mc-gold-dark: #e2c27a;
  --mc-pop: 0 22px 44px -18px rgba(0, 0, 0, .85), 0 0 0 .5px rgba(255, 255, 255, .12);
  --mc-sheet: 0 14px 34px -18px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .07);
  /* the body lifts off the head; everything inside reads the same paper */
  --surface: var(--mc-surface);
  --crm-paper: var(--mc-surface);
  --crm-grid: var(--mc-rule);
  background: var(--mc-surface);
  box-shadow: var(--mc-pop);
}

/* ── the head ─────────────────────────────────────────────────────────────── */
.crm-drawer.mc-card > .crm-drawer-head.mc-head {
  display: block; background: var(--mc-night); color: var(--mc-cream);
  padding-top: 24px; padding-left: 30px; padding-bottom: 4px; border: 0;
}
.mc-card .mc-row1 { display: flex; align-items: flex-start; gap: 12px 18px; min-width: 0; }
.mc-card .mc-head .crm-drawer-heading { display: block; min-width: 0; flex: 0 1 auto; }
.mc-card .mc-head .crm-heading-row { display: flex; align-items: center; gap: 4px; min-width: 0; }
.mc-card .mc-head h2 {
  margin: 0; font: 600 26px/1.15 var(--mc-disp); letter-spacing: -.015em; color: var(--mc-cream);
  overflow-wrap: anywhere;
}
.mc-card .mc-head .crm-card-place {
  display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 3px; font-size: 14px; color: var(--mc-cream-80);
}
.mc-card .mc-head .crm-copy {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; opacity: 1;
  color: var(--mc-cream-60); background: none;
}
.mc-card .mc-head .crm-copy:hover, .mc-card .mc-head .crm-copy:focus-visible { background: var(--mc-cream-12); color: var(--mc-cream); }
.mc-card .mc-tiles { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-top: 6px; }
.mc-card .mc-tiles:empty { display: none; }
.mc-card .crm-archived { display: inline-block; margin-top: 6px; }

/* the right of the head: Project info, the map, the close */
.mc-card .mc-head .crm-head-right {
  margin-left: auto; display: flex; flex-wrap: nowrap; align-items: center; justify-content: flex-end; gap: 10px;
}
.mc-card .mc-head .crm-head-right .crm-quick {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border: 0; border-radius: 11px;
  font-size: 14px; font-weight: 600; white-space: nowrap; color: var(--mc-night); background: var(--mc-cream);
  text-decoration: none; transition: background .15s ease-out;
}
.mc-card .mc-head .crm-head-right .crm-quick:hover { background: #fff; }
.mc-card .mc-head .crm-head-right .crm-quick-quiet {
  color: var(--mc-cream); background: none; box-shadow: inset 0 0 0 1px var(--mc-cream-25); font-weight: 500;
}
.mc-card .mc-head .crm-head-right .crm-quick-quiet:hover { background: var(--mc-cream-12); }
.mc-card .mc-head .crm-head-right .crm-quick svg { width: 15px; height: 15px; }
.mc-card .mc-head .crm-close {
  display: inline-grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 11px;
  color: var(--mc-cream); background: none; box-shadow: inset 0 0 0 1px var(--mc-cream-25); font-size: 14px;
}
.mc-card .mc-head .crm-close:hover { background: var(--mc-cream-12); }
.mc-hinfo {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border: 0; border-radius: 11px;
  font: inherit; font-size: 14px; font-weight: 500; white-space: nowrap; cursor: pointer;
  color: var(--mc-cream); background: none; box-shadow: inset 0 0 0 1px var(--mc-cream-25);
  transition: background .15s ease-out;
}
.mc-hinfo:hover, .mc-hinfo[aria-expanded="true"] { background: var(--mc-cream-12); }
.mc-hinfo:focus-visible, .mc-card .mc-head :focus-visible { outline: 2px solid var(--mc-gold-n); outline-offset: 2px; }
.mc-ico { width: 15px; height: 15px; flex: 0 0 auto; }

/* the status: a tile of its own colour, lifted on the navy so it reads */
.mc-tile {
  --c: #8a8f99;
  display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 7px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
  background: color-mix(in oklab, var(--c) 16%, transparent); color: color-mix(in oklab, var(--c) 72%, var(--mc-ink, #1b2130));
}
.mc-head .mc-tile { background: color-mix(in oklab, var(--c) 30%, var(--mc-night)); color: color-mix(in oklab, var(--c) 22%, #fff); }

/* the ladder, with the step and whose move beside it */
.mc-card .mc-row2 {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 30px; align-items: end; margin-top: 18px;
}
.mc-card .mc-row2 .crm-lad {
  grid-column: auto; grid-row: auto; display: grid; grid-template-columns: repeat(17, minmax(0, 1fr));
  column-gap: 4px; row-gap: 0; margin: 0; padding: 0; min-width: 0;
}
.mc-card .mc-row2 .crm-lad-gate {
  grid-row: 1; display: flex; align-items: baseline; justify-content: flex-end; gap: 6px; min-width: 0; overflow: hidden;
  padding: 0 0 7px; font-size: 12.5px; color: var(--mc-cream-60); white-space: nowrap;
}
.mc-card .mc-row2 .crm-lad-gate svg { display: none; }
.mc-card .mc-row2 .crm-lad-rn { font: 600 11.5px/1 var(--mc-disp); color: inherit; }
.mc-card .mc-row2 .crm-lad-gw { overflow: hidden; text-overflow: ellipsis; }
.mc-card .mc-row2 .crm-lad-stuck { color: var(--mc-cream); font-weight: 600; }
.mc-card .mc-row2 .crm-lad-stuck .crm-lad-rn { color: var(--mc-gold-n); }
.mc-card .mc-row2 .crm-lad-stuck .crm-lad-gw { color: var(--mc-cream); font-weight: 600; }
.mc-card .mc-row2 .crm-lad-clear .crm-lad-rn { color: var(--mc-green-n); }
.mc-card .mc-row2 .crm-lad-tick {
  grid-row: 2; align-self: end; height: 4px; margin: 0; border-radius: 2px; background: var(--mc-cream-25);
}
.mc-card .mc-row2 .crm-lad-done { background: var(--mc-cream-80); }
.mc-card .mc-row2 .crm-lad-now { height: 6px; margin-bottom: -1px; border-radius: 3px; background: var(--mc-gold-n); }
.mc-card .mc-row2 .crm-lad-gap { margin-left: 0; }
.mc-now {
  display: flex; flex-direction: column; align-items: flex-end; gap: 1px; text-align: right; white-space: nowrap; min-width: 0;
}
.mc-now b { font: 600 15px/1.3 var(--mc-disp); color: var(--mc-cream); }
.mc-now .mc-who { font-size: 13px; color: var(--mc-cream-80); }
.mc-now .mc-who.late { color: var(--mc-red-n); font-weight: 600; }
.mc-now .mc-flag {
  padding: 0; border: 0; background: none; font: inherit; font-size: 13px; font-weight: 500; color: var(--mc-cream-80);
  text-decoration: underline; text-decoration-color: var(--mc-cream-25); text-underline-offset: 3px; cursor: pointer;
}
.mc-now span.mc-flag { text-decoration: none; cursor: default; font-weight: 400; }
.mc-now .mc-flag.mc-tone-quiet { color: var(--mc-cream-80); }
.mc-now .mc-flag.mc-tone-soon { color: var(--mc-gold-n); }
.mc-now .mc-flag.mc-tone-flag { color: var(--mc-red-n); }
.mc-now button.mc-flag:hover { text-decoration-color: currentColor; }
.mc-card .mc-row2.mc-solo { display: block; margin-top: 12px; }
.mc-solo .mc-now { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 4px 22px; text-align: left; white-space: normal; }

/* ── folder tabs on the navy ──────────────────────────────────────────────── */
.mc-card > .crm-drawer-body { background: var(--mc-surface); }
.mc-card .crm-tabs2 {
  display: flex; align-items: flex-end; justify-content: flex-start; gap: 2px; flex-wrap: nowrap;
  padding: 16px 30px 0; margin: 0; overflow-x: auto; scrollbar-width: none;
  background: var(--mc-night); border: 0; box-shadow: 0 -2px 0 var(--mc-night);
}
.mc-card .crm-tabs2::-webkit-scrollbar { display: none; }
.mc-card .crm-tabs2 .crm-tab2 {
  position: relative; display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto;
  height: 44px; padding: 0 15px; margin: 0; border: 0; border-radius: 12px 12px 0 0;
  font-size: 14.5px; font-weight: 500; letter-spacing: 0; text-transform: none; white-space: nowrap;
  color: var(--mc-cream-60); background: none; transition: color .15s ease-out, background .15s ease-out;
}
.mc-card .crm-tabs2 .crm-tab2::before, .mc-card .crm-tabs2 .crm-tab2::after { content: none; }
.mc-card .crm-tabs2 .crm-tab2:hover { color: var(--mc-cream); background: var(--mc-cream-12); }
.mc-card .crm-tabs2 .crm-tab2.crm-tab2-on, .mc-card .crm-tabs2 .crm-tab2.crm-tab2-on:hover {
  background: var(--mc-surface); color: var(--mc-ink); font-weight: 600;
}
.mc-card .crm-tabs2 .crm-tab2 .crm-sec-count { background: none; padding: 0; font-size: 12px; font-weight: 500; color: var(--mc-cream-60); }
.mc-card .crm-tabs2 .crm-tab2.crm-tab2-on .crm-sec-count { color: var(--mc-ink-3); }
.mc-card .crm-tabs2 .crm-tab2:focus-visible { outline: 2px solid var(--mc-gold-n); outline-offset: -3px; }
/* Leo's tab: his lion alone in his turning rim (css/leo.css's rim and light) */
.mc-card .crm-tabs2 .crm-tab2.mc-tab-leo {
  --leo-glow-a: .25;
  width: 54px; padding: 0; margin-right: 4px; justify-content: center;
  border: 1.5px solid transparent; border-bottom: 0;
  background: linear-gradient(var(--mc-night), var(--mc-night)) padding-box, conic-gradient(from var(--leo-angle), var(--leo-rim-stops)) border-box;
  animation: leo-orbit var(--leo-sweep-idle, 18s) linear infinite;
  transition: --leo-glow-a .26s;
}
.mc-card .crm-tabs2 .crm-tab2.mc-tab-leo:hover { --leo-glow-a: .55; background: linear-gradient(var(--mc-night), var(--mc-night)) padding-box, conic-gradient(from var(--leo-angle), var(--leo-rim-stops)) border-box; }
.mc-card .crm-tabs2 .crm-tab2.mc-tab-leo.crm-tab2-on, .mc-card .crm-tabs2 .crm-tab2.mc-tab-leo.crm-tab2-on:hover {
  --leo-glow-a: .35;
  background: linear-gradient(var(--mc-surface), var(--mc-surface)) padding-box, conic-gradient(from var(--leo-angle), var(--leo-rim-stops)) border-box;
}
.mc-card .mc-tab-leo .leo-mk { --s: 26px; }
.mc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ── the body ─────────────────────────────────────────────────────────────── */
.mc-card .crm-drawer-scroll { padding: 28px 30px 40px; color: var(--mc-ink); }
.mc-card .crm-drawer-scroll > * + * { margin-top: 34px; }
.mc-card .crm-drawer-scroll > :is(#crmBillSuggest:empty, .crm-stage-walk:empty) + *,
.mc-card .crm-drawer-scroll > .mc-sh + .crm-fields,
.mc-card .crm-drawer-scroll > .crm-fold-note + * { margin-top: 0; }
.mc-card .crm-drawer-scroll .crm-sec + .crm-sec,
.mc-card .crm-drawer-scroll .crm-dsub + .crm-dsub,
.mc-card .crm-drawer-scroll .crm-fields + .crm-dsub,
.mc-card .crm-drawer-scroll .crm-fields + .crm-sec,
.mc-card .crm-drawer-scroll .crm-dsub + .crm-sec,
.mc-card .crm-drawer-scroll .crm-sec + .crm-fields,
.mc-card .crm-drawer-scroll .crm-rail-sec + .crm-fields,
.mc-card .crm-drawer-scroll .crm-fields + .crm-rail-sec,
.mc-card .crm-drawer-scroll .crm-fields + .crm-stage-walk { margin-top: 34px; border-top: 0; padding-top: 0; }
.mc-sh { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; min-width: 0; }
.mc-sh h3 { margin: 0; font: 600 17px/1.3 var(--mc-disp); letter-spacing: -.005em; color: var(--mc-ink, var(--text-head)); }
.mc-sh .mc-n { font-size: 13px; color: var(--mc-ink-3, var(--text-muted)); font-variant-numeric: tabular-nums; }
.mc-grow { flex: 1; }
.mc-card .crm-sec-title, .mc-card .crm-rail-t {
  margin: 0 0 12px; font: 600 17px/1.3 var(--mc-disp); letter-spacing: -.005em; text-transform: none; color: var(--mc-ink);
}
.mc-card .crm-sec-title .crm-sec-count, .mc-card .crm-rail-t .crm-sec-count { font: 400 13px/1 var(--font-sans, Inter, sans-serif); color: var(--mc-ink-3); background: none; padding: 0; }
.mc-card .crm-fold-note { margin: 0 0 16px; font-size: 13.5px; color: var(--mc-ink-2); max-width: 78ch; }

/* facts: label and value rows, two columns, no well, each lights on hover */
.mc-card .crm-drawer-scroll .crm-fields {
  display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 56px; row-gap: 0;
  background: none; border-radius: 0; padding: 0;
}
@container (min-width: 720px) {
  .mc-card .crm-drawer-scroll .crm-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.mc-card .crm-drawer-scroll .crm-field {
  display: grid; grid-template-columns: minmax(110px, 150px) minmax(0, 1fr); column-gap: 12px; align-items: center;
  min-height: 40px; padding: 4px 10px; margin: 0 -10px; border-radius: 10px; transition: background .15s ease-out;
}
.mc-card .crm-drawer-scroll .crm-field:hover { background: var(--mc-hover); }
.mc-card .crm-drawer-scroll .crm-field-label { font-size: 13.5px; color: var(--mc-ink-3); }
.mc-card .crm-drawer-scroll .crm-field-value { font-size: 14px; color: var(--mc-ink); }
.mc-card .crm-drawer-scroll .crm-field.mc-dl-field .crm-loa { margin: 0; padding: 0; border: 0; background: none; }
.mc-card .crm-drawer-scroll .crm-field.mc-dl-field .crm-due-basis { font-size: 13px; color: var(--mc-ink-3); }
.mc-card .crm-drawer-scroll .crm-field.mc-dl-field .crm-due-empty .crm-due-basis { font-size: 14px; color: var(--mc-ink); }
.mc-card .crm-drawer-scroll .crm-field.mc-dl-field .crm-due-act { color: var(--mc-royal); font-weight: 500; }
.mc-card .crm-drawer-scroll .crm-field.mc-dl-field .crm-due-over .crm-due-line { color: var(--mc-red); }
.mc-card .crm-drawer-scroll .crm-field.mc-dl-field:has(.crm-due-edit) { grid-column: 1 / -1; }
.mc-card .crm-drawer-scroll .crm-copy { opacity: 0; transition: opacity .15s ease-out; }
.mc-card .crm-drawer-scroll .crm-field:hover .crm-copy, .mc-card .crm-drawer-scroll .crm-fact:hover .crm-copy,
.mc-card .crm-drawer-scroll .crm-contact-line:hover .crm-copy, .mc-card .crm-drawer-scroll .crm-contact-name:hover .crm-copy,
.mc-card .crm-drawer-scroll .crm-copy:focus-visible { opacity: 1; }
/* a status in the body is the pale pair: a tint of its colour, ink of its hue */
.mc-card .crm-drawer-scroll span.crm-stchip, .mc-pop span.crm-stchip {
  min-height: 24px; padding: 2px 9px; border: 0; border-radius: 7px; font-size: 12.5px; font-weight: 600; text-shadow: none !important;
  background: color-mix(in oklab, var(--chip, #8a8f99) 16%, transparent) !important;
  color: color-mix(in oklab, var(--chip, #8a8f99) 72%, var(--mc-ink)) !important;
}
[data-theme="dark"] .mc-card .crm-drawer-scroll span.crm-stchip, [data-theme="dark"] .mc-pop span.crm-stchip {
  background: color-mix(in oklab, var(--chip, #8a8f99) 26%, var(--mc-surface)) !important;
  color: color-mix(in oklab, var(--chip, #8a8f99) 45%, #fff) !important;
}

/* the numbers and the people: rows on the page, not wells */
.mc-card .crm-drawer-scroll .crm-rail-sec { margin: 0; padding: 0; border: 0; }
.mc-card .crm-drawer-scroll .crm-rail-sec .crm-fact,
.mc-card .crm-drawer-scroll .crm-rail-sec .crm-fact:first-of-type,
.mc-card .crm-drawer-scroll .crm-rail-sec .crm-fact:last-of-type,
.mc-card .crm-drawer-scroll .crm-rail-sec .crm-fact:only-of-type {
  background: none; border-radius: 10px; padding: 4px 10px; margin: 0 -10px; min-height: 40px;
}
.mc-card .crm-drawer-scroll .crm-rail-sec .crm-fact:hover { background: var(--mc-hover); }
.mc-card .crm-drawer-scroll .crm-contact { background: none; padding: 0; border-radius: 0; }
.mc-card .crm-drawer-scroll .crm-rail-sec:has(.crm-contact) { gap: 26px 56px; }
.mc-card .crm-drawer-scroll .crm-contact-role { font-size: 13px; color: var(--mc-ink-3); }
.mc-card .crm-drawer-scroll .crm-contact-name { font: 600 15px/1.3 var(--mc-disp); color: var(--mc-ink); }
.mc-card .crm-drawer-scroll .crm-contact-line { min-height: 32px; font-size: 14px; }
.mc-card .crm-drawer-scroll a:not(.crm-quick):not(.crm-btn) { color: var(--mc-royal); }

/* updates: posts on the page, no bubbles; the composer is the one well */
.mc-card .crm-drawer-scroll .crm-composer { border: 0; border-radius: 14px; background: var(--mc-well); box-shadow: none; }
.mc-card .crm-drawer-scroll .crm-composer:focus-within { box-shadow: inset 0 0 0 1.5px color-mix(in oklab, var(--mc-royal) 40%, transparent); }
.mc-card .crm-drawer-scroll .crm-composer-input { background: none; color: var(--mc-ink); }
.mc-card .crm-drawer-scroll .crm-composer-post:not(:disabled) { background: var(--mc-gold); color: #1f2533; border-color: var(--mc-gold); }
.mc-card .crm-drawer-scroll .crm-update, .mc-card .crm-drawer-scroll .crm-update-me {
  margin: 22px 0 0; padding: 0; max-width: 84ch; border: 0; border-radius: 0; background: none; box-shadow: none;
  margin-left: 0; margin-right: 0; align-self: auto;
}
.mc-card .crm-drawer-scroll .crm-update-meta { font-size: 13px; color: var(--mc-ink-3); }
.mc-card .crm-drawer-scroll .crm-update-body { margin-top: 3px; font-size: 14.5px; color: var(--mc-ink); }

/* ── Project info ─────────────────────────────────────────────────────────── */
.mc-info .mc-btn { flex: none; }
.mc-icols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 40px; row-gap: 14px; }
.mc-icols.mc-more { margin-top: 14px; animation: mc-in .3s var(--mc-out, ease-out) both; }
.mc-icols.mc-more[hidden] { display: none; }
.mc-ig { min-width: 0; }
.mc-ig h4 { margin: 0 0 2px; font: 600 14px/1.3 var(--mc-disp, 'Space Grotesk', sans-serif); color: var(--mc-ink-2, var(--text-body)); }
.mc-ig dl { margin: 0; }
.mc-kv {
  display: grid; grid-template-columns: 100px minmax(0, 1fr) 28px; align-items: start; column-gap: 12px;
  min-height: 38px; margin: 0 -10px; padding: 6px 0 6px 10px; border-radius: 10px; transition: background .15s ease-out;
}
.mc-kv:hover { background: var(--mc-hover, var(--hover)); }
.mc-kv dt { margin: 0; padding-top: 4px; font-size: 13.5px; line-height: 1.3; color: var(--mc-ink-3, var(--text-muted)); }
.mc-kv dd { margin: 0; min-width: 0; font-size: 14.5px; line-height: 1.45; color: var(--mc-ink, var(--text-strong)); }
.mc-kv .mc-t { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; padding: 2px 0; }
.mc-kv .mc-t .mc-sub { display: block; font-size: 12.5px; color: var(--mc-ink-3); overflow: hidden; text-overflow: ellipsis; }
.mc-kv dd a { color: var(--mc-royal, var(--royal-ink)); text-decoration: none; }
.mc-kv dd a:hover { text-decoration: underline; text-underline-offset: 3px; }
.mc-unset { color: var(--mc-ink-3, var(--text-muted)); }
.mc-ok { color: var(--mc-green); }
.mc-flag { color: var(--mc-red); }
.mc-soon { color: var(--mc-amber); }
.mc-quiet { color: inherit; }
.mc-cp {
  display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 8px;
  color: var(--mc-ink-3, var(--text-muted)); background: none; cursor: pointer; opacity: 0; transition: opacity .15s ease-out, background .15s ease-out;
}
.mc-kv:hover .mc-cp, .mc-cp:focus-visible, .mc-cp[data-copied] { opacity: 1; }
.mc-cp:hover { color: var(--mc-ink); background: color-mix(in oklab, var(--mc-ink, #1b2130) 7%, transparent); }
.mc-cp:focus-visible, .mc-btn:focus-visible { outline: 2px solid var(--mc-gold, var(--gold)); outline-offset: 2px; }
.mc-cp .mc-ico-ok, .mc-btn .mc-ico-ok, .mc-head .crm-copy .mc-ico-ok { display: none; color: var(--mc-green); }
.mc-head .crm-copy .mc-ico-ok { color: var(--mc-green-n); }
.mc-cp[data-copied] .mc-ico-copy, .mc-btn[data-copied] .mc-ico-copy, .mc-head .crm-copy[data-copied] .mc-ico-copy { display: none; }
.mc-cp[data-copied] .mc-ico-ok, .mc-btn[data-copied] .mc-ico-ok, .mc-head .crm-copy[data-copied] .mc-ico-ok { display: block; }

/* buttons: quiet, line, gold (one per view) */
.mc-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 13px; border: 0; border-radius: 10px;
  font: inherit; font-size: 13.5px; font-weight: 500; white-space: nowrap; cursor: pointer;
  color: var(--mc-ink, var(--text-strong)); background: none; transition: background .15s ease-out, box-shadow .15s ease-out;
}
.mc-btn:hover { background: color-mix(in oklab, var(--mc-ink, #1b2130) 7%, transparent); }
.mc-btn.mc-line { box-shadow: inset 0 0 0 1px var(--mc-rule, var(--rule)); }
.mc-btn.mc-line:hover { box-shadow: inset 0 0 0 1.5px var(--mc-gold, var(--gold)); background: none; }
.mc-btn.mc-gold { background: var(--mc-gold); color: #1f2533; font-weight: 600; padding: 0 16px; }
.mc-btn.mc-gold:hover { background: var(--mc-gold-dark); }
.mc-btn.mc-sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.mc-btn svg { width: 14px; height: 14px; flex: none; }
.mc-btn:disabled { opacity: .5; cursor: default; }

/* the head button's card: solid, like every Mythril hover card */
.mc-pop {
  position: absolute; z-index: 30; top: 0; left: 0; width: min(1080px, calc(100% - 24px));
  padding: 18px 20px 12px; border-radius: 18px; background: var(--mc-surface); color: var(--mc-ink); box-shadow: var(--mc-pop);
  overflow-y: auto; overscroll-behavior: contain;
  opacity: 0; transform: translateY(-4px) scale(.97); transform-origin: top right; pointer-events: none; visibility: hidden;
  transition: opacity .16s ease-out, transform .32s var(--mc-spring), visibility 0s .32s;
}
[data-theme="dark"] .mc-pop { background: #1e2745; }
.mc-pop.on { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition: opacity .16s ease-out, transform .32s var(--mc-spring), visibility 0s; }
.mc-pop .mc-sh { margin-bottom: 8px; }
.mc-pop .mc-icols { column-gap: 28px; }
.mc-pop .mc-kv { grid-template-columns: 82px minmax(0, 1fr) 26px; }
.mc-pop .mc-kv .mc-t { display: block; overflow: visible; overflow-wrap: anywhere; }

/* ── Leo's tab: the hub ───────────────────────────────────────────────────── */
.mc-hubpane > * + * { margin-top: 34px; }
.mc-hubpane > .mc-hub + .crm-leo-ask { margin-top: 24px; }
.mc-hubpane > .mc-info { margin-top: 46px; }
.mc-hub { display: grid; justify-items: center; text-align: center; max-width: 780px; margin: 6px auto 0; }
.mc-hub .leo-mk { margin-bottom: 16px; }
.mc-hub-h { margin: 0; font: 600 24px/1.25 var(--mc-disp); letter-spacing: -.012em; text-wrap: balance; color: var(--mc-ink); }
.mc-hub-why { margin: 8px 0 0; max-width: 60ch; font-size: 15px; color: var(--mc-ink-2); text-wrap: balance; }
.mc-card .crm-leo-ask.mc-askwrap {
  display: block; max-width: 780px; margin-left: auto; margin-right: auto; padding: 0; border: 0; background: none; box-shadow: none;
}
.mc-card .crm-leo-ask.mc-askwrap::before, .mc-card .crm-leo-ask.mc-askwrap::after { content: none; }
.mc-ask {
  --leo-glow-a: 0;
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 6px 6px 16px; border-radius: 16px;
  border: 1.5px solid transparent;
  background: linear-gradient(var(--mc-surface), var(--mc-surface)) padding-box, conic-gradient(from var(--leo-angle), var(--leo-rim-stops)) border-box;
  animation: leo-orbit var(--leo-sweep-idle, 18s) linear infinite; transition: --leo-glow-a .26s;
}
.mc-ask:hover { --leo-glow-a: .3; }
.mc-ask:focus-within { --leo-glow-a: .62; }
.mc-leo-thinking .mc-ask, .leo-thinking .mc-ask { --leo-glow-a: .7; }
.mc-card .mc-ask .crm-leo-q {
  flex: 1; min-width: 0; height: 40px; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none;
  color: var(--mc-ink); font: inherit; font-size: 15px; outline: none; animation: none;
}
.mc-card .mc-ask .crm-leo-q::placeholder { color: var(--mc-ink-3); }
.mc-card .mc-ask .crm-leo-go {
  display: grid; place-items: center; width: 40px; height: 40px; min-width: 40px; padding: 0; border: 0; border-radius: 11px;
  background: color-mix(in oklab, var(--mc-ink) 8%, transparent); color: var(--mc-ink); cursor: pointer;
}
.mc-card .mc-ask .crm-leo-go:hover:not(:disabled) { background: color-mix(in oklab, var(--mc-ink) 14%, transparent); }
.mc-card .mc-ask .crm-leo-go:disabled { opacity: .45; cursor: default; }
.mc-card .mc-ask .crm-leo-reset { flex: none; height: 32px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--mc-ink-2); font: inherit; font-size: 13px; cursor: pointer; }
.mc-card .mc-ask .crm-leo-reset:hover { background: color-mix(in oklab, var(--mc-ink) 7%, transparent); color: var(--mc-ink); }
.mc-ans { margin: 0 0 16px; text-align: left; font-size: 15px; }
.mc-ans .crm-leo-u { margin: 0 0 4px; font-weight: 600; color: var(--mc-ink); background: none; padding: 0; }
.mc-ans .crm-leo-a { margin: 0 0 12px; color: var(--mc-ink); background: none; padding: 0; }
/* the box to ask at the foot of every other tab */
.mc-pin {
  position: sticky; bottom: -40px; z-index: 3; margin: 32px -30px -40px; padding: 14px 30px 18px;
  background: linear-gradient(180deg, color-mix(in oklab, var(--mc-surface) 0%, transparent), var(--mc-surface) 30%);
}
.mc-card .mc-pin .crm-leo-ask.mc-askwrap { max-width: none; }

/* ── Project stages: the phases, and the chosen phase's steps ─────────────── */
.mc-stages { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 8px 36px; align-items: start; }
.mc-sg-list { display: grid; gap: 2px; }
.mc-sg {
  display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 12px; border: 0; border-radius: 10px;
  font: inherit; font-size: 13.5px; text-align: left; color: var(--mc-ink); background: none; cursor: pointer; transition: background .15s ease-out;
}
.mc-sg:hover { background: var(--mc-hover); }
.mc-sg.on {
  background: linear-gradient(180deg, color-mix(in oklab, var(--mc-royal) 12%, transparent), color-mix(in oklab, var(--mc-royal) 7%, transparent));
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--mc-royal) 22%, transparent);
}
.mc-sg:focus-visible { outline: 2px solid var(--mc-gold); outline-offset: -2px; }
.mc-sg b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-pd { flex: none; width: 10px; height: 10px; margin: 0 2px; border-radius: 2px; transform: rotate(45deg); box-shadow: inset 0 0 0 1.5px var(--pc); }
.mc-pd.f { background: var(--pc); }
.mc-sg-g { display: inline-flex; flex: none; }
.mc-sg-seg { display: inline-flex; gap: 3px; margin-left: auto; flex: none; }
.mc-sg-seg i { width: 12px; height: 4px; border-radius: 2px; background: color-mix(in oklab, var(--mc-ink) 12%, transparent); }
.mc-sg-seg i.d { background: var(--pc); }
.mc-sg-seg i.c { background: var(--mc-gold); }
.mc-sg-n { flex: none; width: 56px; text-align: right; font-size: 12.5px; color: var(--mc-ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.mc-sg-n.ok { color: var(--mc-green); }
.mc-sg-dets { min-width: 0; }
.mc-sg-det[hidden] { display: none; }
.mc-sg-det { animation: mc-in .26s var(--mc-out) both; }
.mc-sg-h { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 2px; }
.mc-sg-h b { font: 600 15px/1 var(--mc-disp); color: var(--mc-ink); }
.mc-sg-h span { font-size: 13px; color: var(--mc-ink-3); }
.mc-st { display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 6px 10px; margin: 0 -10px; border-radius: 12px; }
.mc-st.is-now { background: color-mix(in oklab, var(--mc-royal) 7%, transparent); }
.mc-no {
  display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 7px;
  font: 600 12px/1 var(--mc-disp); background: color-mix(in oklab, var(--mc-ink) 8%, transparent); color: var(--mc-ink-2);
}
.mc-no svg { width: 13px; height: 13px; }
.mc-st.is-now .mc-no { background: var(--mc-royal); color: #fff; }
[data-theme="dark"] .mc-st.is-now .mc-no { color: #0d1220; }
.mc-st.is-done .mc-no { background: color-mix(in oklab, var(--mc-green) 16%, transparent); color: var(--mc-green); }
.mc-st-t { flex: 1; min-width: 0; }
.mc-st-t b { display: block; font-size: 14px; font-weight: 600; color: var(--mc-ink); }
.mc-st.is-done .mc-st-t b { color: var(--mc-ink-2); font-weight: 500; }
.mc-st-t span { font-size: 12.5px; color: var(--mc-ink-3); }
.mc-st-a { display: flex; flex-wrap: wrap; gap: 6px; flex: none; }
.mc-st.mc-gt .mc-dia { width: 24px; height: 24px; }
.mc-st.mc-gt.is-stuck .mc-st-t span { color: var(--mc-amber); font-weight: 500; }

/* Mythril's gate: a numeral in a small gold diamond */
.mc-dia {
  position: relative; flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px;
  font: 700 9.5px/1 var(--mc-disp, 'Space Grotesk', sans-serif); font-style: normal; letter-spacing: .02em;
  color: var(--dia-ink, #7d5f14); isolation: isolate;
}
.mc-dia::before {
  content: ""; position: absolute; inset: 3.5px; border-radius: 3.5px; rotate: 45deg; z-index: -1;
  background: var(--dia-bg, var(--mc-surface, #fff)); box-shadow: inset 0 0 0 1.5px var(--dia-ring, #c9a03f);
}
.mc-dia.ok { --dia-ink: #fff; --dia-ring: var(--mc-green); --dia-bg: var(--mc-green); }
.mc-dia.sm { width: 18px; height: 18px; font-size: 8px; }
.mc-dia.sm::before { inset: 3px; border-radius: 3px; }
[data-theme="dark"] .mc-dia { --dia-ink: #ecd49a; --dia-ring: #c9a85a; --dia-bg: #1d2540; }
[data-theme="dark"] .mc-dia.ok { --dia-ink: #0d1220; --dia-ring: var(--mc-green); --dia-bg: var(--mc-green); }

/* the foot: show empty fields, merge, delete */
.mc-card .crm-card-foot { margin-top: 34px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 16px; font-size: 13.5px; }

@keyframes mc-in { from { opacity: 0; transform: translateY(6px); } }

/* ── narrower ─────────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .mc-icols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .mc-stages { grid-template-columns: minmax(0, 1fr); }
  .mc-st { flex-wrap: wrap; }
  .mc-st-a { margin-left: 36px; }
}
@media (max-width: 760px) {
  .crm-drawer.mc-card > .crm-drawer-head.mc-head { padding: 18px 16px 0; }
  .mc-card .mc-row1 { flex-wrap: wrap; }
  .mc-card .mc-head .crm-drawer-heading { flex: 1 1 100%; padding-right: 52px; }
  .mc-card .mc-head h2 { font-size: 22px; }
  .mc-card .mc-head .crm-head-right { margin-left: 0; flex-wrap: wrap; justify-content: flex-start; }
  .mc-card .mc-head .crm-head-right .crm-quick, .mc-hinfo { height: 34px; padding: 0 10px; font-size: 13px; }
  /* Sales lays its actions out as one row that scrolls sideways (page-sales-crm.css); here it runs to the head's own edges. */
  #salesScreen .sales-crm .mc-card .mc-head .crm-head-right:has(> .crm-quick) { flex: 1 1 100%; margin: 0 -16px; padding: 2px 16px; }
  #salesScreen .sales-crm .mc-card .mc-head .crm-head-right > :is(.crm-quick, .mc-hinfo) { flex: 0 0 auto; height: 40px; }
  .mc-card .mc-row2 { grid-template-columns: minmax(0, 1fr); }
  .mc-now { order: -1; align-items: flex-start; text-align: left; white-space: normal; flex-direction: row; flex-wrap: wrap; column-gap: 12px; }
  .mc-card .mc-row2 .crm-lad-gw { display: none; }
  .mc-card .crm-tabs2 { padding: 12px var(--pc-tabs-end, 64px) 0 8px; }
  .mc-card .crm-tabs2 .crm-tab2 { padding: 0 12px; font-size: 14px; }
  .mc-card .crm-tabs2 .crm-tab2.mc-tab-leo { width: 50px; padding: 0; }
  .mc-card .crm-drawer-scroll { padding: 22px 16px 28px; }
  .mc-pin { bottom: -28px; margin: 28px -16px -28px; padding: 12px 16px 14px; }
  .mc-hub-h { font-size: 20px; }
  .mc-icols { grid-template-columns: minmax(0, 1fr); }
  .mc-kv { grid-template-columns: 100px minmax(0, 1fr) 28px; }
  .mc-cp, .mc-card .crm-drawer-scroll .crm-copy { opacity: 1; }
  .mc-card .crm-drawer-scroll .crm-field { grid-template-columns: minmax(96px, 110px) minmax(0, 1fr); }
}
@media (hover: none) {
  .mc-cp, .mc-card .crm-drawer-scroll .crm-copy { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .mc-card .crm-tabs2 .crm-tab2.mc-tab-leo, .mc-ask { animation: none; }
  .mc-pop, .mc-pop.on, .mc-sg-det, .mc-icols.mc-more { transition: none; animation: none; }
}
html.my-calm .mc-pop, html.my-calm .mc-sg-det, html.my-calm .mc-icols.mc-more { transition: none; animation: none; }

/* ── Finance on the card (js/finance/finance.js) ─────────────────────────────
   The site and agent cards on the same head and tabs; the amounts, payments
   and policy read as sections by space, not boxes, and no rules between rows. */
.fin-root .mc-card :is(.fin-amtblock, .fin-asite, .fin-policy) { padding: 0; border: 0; border-radius: 0; background: none; }
.fin-root .mc-card .fin-amtgrid { gap: 34px; }
.fin-root .mc-card .fin-amtblock { column-gap: 40px; }
.fin-root .mc-card .fin-amttitle, .fin-root .mc-card .fin-asite-title { font: 600 17px/1.3 var(--mc-disp); color: var(--mc-ink); }
.fin-root .mc-card .fin-amtval { margin: 6px 0; font: 600 30px/1.1 var(--mc-disp); color: var(--mc-ink); }
.fin-root .mc-card .fin-amtval:is(.fin-unknown, .fin-none) { font-size: 22px; color: var(--mc-ink-2); }
.fin-root .mc-card .fin-amtwhat, .fin-root .mc-card .fin-pay-basis { color: var(--mc-ink-3); }
.fin-root .mc-card :is(.fin-kv, .fin-defpop-dl) > div, .fin-root .mc-card .fin-amtblock > .fin-kv > div:first-child { border-top: 0; padding: 5px 0; }
.fin-root .mc-card .fin-kv dt { color: var(--mc-ink-3); }
.fin-root .mc-card .fin-kv dd { color: var(--mc-ink); }
.fin-root .mc-card .fin-asite { margin: 0; scroll-margin-top: 12px; }
.fin-root .mc-card .fin-asite + .fin-asite, .fin-root .mc-card .fin-policy + .fin-policy { margin-top: 40px; }
.fin-root .mc-card .fin-asite-head { padding: 0 0 6px; }
.fin-root .mc-card .fin-pay, .fin-root .mc-card .fin-pay-none { border-top: 0; padding: 12px 0 4px; }
.fin-root .mc-card .fin-pay-title, .fin-root .mc-card .fin-pay-amt { color: var(--mc-ink); }
.fin-root .mc-card .fin-target { box-shadow: none; }
.fin-root .mc-card .fin-target { animation: mc-fin-target 2.4s ease-out both; border-radius: 14px; }
@keyframes mc-fin-target { 0%, 40% { background: var(--mc-well); box-shadow: 0 0 0 16px var(--mc-well); } 100% { background: transparent; box-shadow: 0 0 0 16px transparent; } }
.fin-root .mc-card .fin-audit-item { border-bottom: 0; padding: 0 0 22px; }
.fin-root .mc-card .fin-tabn { margin-left: 6px; font-size: 12px; font-weight: 500; opacity: .62; }
.fin-root .mc-card .fin-lede { margin: 0; color: var(--mc-ink-2); }
.fin-root .mc-card .crm-drawer-scroll > .fin-lede + * { margin-top: 22px; }
.fin-root .mc-card .fin-ro { border: 0; border-radius: 12px; background: var(--mc-well); }
.fin-root .mc-card .fin-empty { padding: 4px 0 0; text-align: left; border: 0; border-radius: 0; background: none; box-shadow: none; }
.fin-root .mc-card .crm-drawer-scroll > .dp-delete-link { display: inline-block; }
@media (prefers-reduced-motion: reduce) { .fin-root .mc-card .fin-target { animation: none; } }
@media (max-width: 760px) {
  .fin-root .mc-card .fin-amtblock { column-gap: 0; }
}
