/* ==========================================================================
   Magnum · design pass r3 (2026-10-21) · app layer
   Class names follow 04-app-source where a component already exists
   (df-*, dk-*, mg-*, rpt-tile*, dtile*, dash-*); new parts are r3-only.
   Tokens map onto app-tokens.css: --mg-* values below replace or extend it.
   Rules kept: one warm surface (sidebar), stone floor, white tiles, gold is a
   signal, no uppercase, weights 400/500/600, nothing under 12px, nothing
   lighter than #555 on light grounds.
   ========================================================================== */

:root {
  /* Surfaces */
  --mg-paper: #fffef2;          /* sidebar only */
  --mg-floor: #ffffff;          /* everything right of the sidebar */
  --mg-floor-deep: #ebeae4;     /* wells cut into a tile */
  --mg-tile: #ffffff;
  --mg-tint: #fafaf7;           /* table heads, quiet bands inside a tile */
  /* Ink */
  --mg-ink: #191918;
  --mg-ink-2: #33322f;
  --mg-ink-3: #555550;          /* lightest text allowed */
  --mg-on-ink: #fffef2;
  /* Lines */
  --mg-hair: rgba(25, 25, 24, 0.08);
  --mg-edge: rgba(25, 25, 24, 0.14);      /* controls */
  --mg-tile-line: rgba(25, 25, 24, 0.08);
  --mg-hover: rgba(25, 25, 24, 0.04);
  /* Signal */
  --mg-gold: #fcaa2d;
  --mg-gold-text: #8a5e08;
  --mg-graph: #2b2a27;
  --mg-green: #16a34a;
  --mg-green-text: #15803d;
  --mg-red: #dc2626;
  --mg-red-text: #b91c1c;
  --mg-red-wash: #fdf2f1;
  --mg-grey: #9a9890;
  --mg-neutral-dot: #7e8a9a;
  /* Type */
  --mg-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --mg-serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  /* Shape and depth (r3: tiles 12px, one step on the 4/6/8/12 scale) */
  --mg-r-tile: 12px;
  --mg-r-ctl: 6px;
  --mg-r-md: 8px;
  --mg-shadow-tile: 0 1px 1px rgba(25, 25, 24, 0.03), 0 2px 6px -2px rgba(25, 25, 24, 0.06), 0 14px 28px -18px rgba(25, 25, 24, 0.16);
  --mg-shadow-lift: 0 2px 4px rgba(25, 25, 24, 0.04), 0 20px 40px -18px rgba(25, 25, 24, 0.26);
  --mg-shadow-pop: 0 0 0 1px rgba(25, 25, 24, 0.06), 0 16px 36px -10px rgba(25, 25, 24, 0.26);
  --mg-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 400 14px/1.5 var(--mg-sans);
  color: var(--mg-ink);
  background: var(--mg-floor);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'cv11', 'ss01';
}
button { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
.num, .tnum { font-variant-numeric: tabular-nums; }
.sr { font-weight: 400; position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Line icons (Lucide, ISC): 1.6 stroke at 16px reads as a 1px line */
.ic { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ic--14 { width: 14px; height: 14px; }
.ic--18 { width: 18px; height: 18px; }
.ic--20 { width: 20px; height: 20px; }

/* ── Shell ──────────────────────────────────────────────────────────────── */
.df-app { display: flex; flex-wrap: wrap; align-items: stretch; min-height: 100vh; background: var(--mg-floor); }
.df-sidebar {
  flex: 0 0 250px; width: 250px;
  background: var(--mg-paper);
  border-right: 1px solid var(--mg-hair);
  display: flex; flex-direction: column;
  padding: 14px 12px 0;
}
.df-sidebar--rail { flex-basis: 64px; width: 64px; padding: 14px 10px 0; align-items: center; }
.df-main { flex: 999 1 560px; min-width: 0; background: var(--mg-floor); display: flex; flex-direction: column; }

.sb-brand { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 2px 0 6px; }
.sb-mark { width: 26px; height: 26px; flex: none; display: block; }
.sb-lockup { display: flex; flex-direction: column; min-width: 0; }
.sb-lockup b { font: 600 15px/1.15 var(--mg-sans); letter-spacing: -0.01em; color: var(--mg-ink); }
.sb-lockup span { font: 500 12px/1.3 var(--mg-sans); color: var(--mg-ink-3); }
.sb-brand .iconbtn { margin-left: auto; }

.sb-firm {
  display: flex; align-items: center; gap: 10px; width: 100%;
  margin: 14px 0 6px; padding: 8px 10px 8px 8px;
  background: #fff; border: 1px solid var(--mg-tile-line); border-radius: var(--mg-r-md);
  box-shadow: 0 1px 2px rgba(25, 25, 24, 0.04);
  text-align: left; cursor: pointer;
}
.sb-firm__text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sb-firm__text b { font: 600 13px/1.3 var(--mg-sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-firm__text span { font: 500 12px/1.35 var(--mg-sans); color: var(--mg-ink-3); }
.sb-firm .ic { color: var(--mg-ink-3); }

.sb-nav { display: flex; flex-direction: column; flex: 1; padding-bottom: 16px; }
.sb-group { display: flex; flex-direction: column; gap: 2px; margin-top: 18px; }
.sb-group__label { display: flex; align-items: center; gap: 8px; font: 600 12px/1 var(--mg-sans); color: var(--mg-ink-3); padding: 0 10px 8px; }
.sb-item {
  display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px;
  border-radius: var(--mg-r-md);
  font: 500 14px/1 var(--mg-sans); color: var(--mg-ink-2); text-decoration: none;
}
.sb-item .ic { width: 16px; height: 16px; color: var(--mg-ink-3); }
.sb-item:hover { background: var(--mg-hover); color: var(--mg-ink); }
.sb-item.is-active {
  background: #fff; color: var(--mg-ink); font-weight: 600;
  box-shadow: 0 0 0 1px var(--mg-tile-line), 0 1px 2px rgba(25, 25, 24, 0.06);
}
.sb-item.is-active .ic { color: var(--mg-gold); stroke-width: 2; }
.sb-rail-item { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--mg-r-md); color: var(--mg-ink-3); }
.sb-rail-item.is-active { background: #fff; color: var(--mg-gold); box-shadow: 0 0 0 1px var(--mg-tile-line), 0 1px 2px rgba(25, 25, 24, 0.06); }
.sb-rail-item .ic { width: 16px; height: 16px; }
.sb-rail-sep { width: 24px; height: 1px; background: var(--mg-hair); margin: 8px 0; }

.sb-user {
  display: flex; align-items: center; gap: 10px;
  margin: 0 -12px; padding: 12px 14px 14px 16px;
  border-top: 1px solid var(--mg-hair);
}
.sb-user__text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sb-user__text b { font: 600 13px/1.3 var(--mg-sans); }
.sb-user__text span { font: 400 12px/1.35 var(--mg-sans); color: var(--mg-ink-3); }

.df-topbar {
  display: flex; align-items: center; gap: 16px;
  height: 56px; padding: 0 40px; flex: none;
  border-bottom: 1px solid var(--mg-hair); background: var(--mg-floor);
}
.crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; font: 500 14px/1 var(--mg-sans); color: var(--mg-ink-3); white-space: nowrap; }
.crumbs a { color: var(--mg-ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--mg-ink); }
.crumbs .sep { color: var(--mg-ink-3); }
.crumbs [aria-current] { color: var(--mg-ink); font-weight: 600; }
.tb-search {
  margin-left: auto; display: flex; align-items: center; gap: 10px;
  width: 300px; height: 36px; padding: 0 6px 0 12px;
  background: #fff; border: 1px solid var(--mg-edge); border-radius: var(--mg-r-ctl);
  color: var(--mg-ink-3); font: 400 14px/1 var(--mg-sans); cursor: pointer;
}
.kbd { margin-left: auto; font: 500 12px/1 var(--mg-sans); color: var(--mg-ink-2); background: var(--mg-floor); border: 1px solid var(--mg-hair); border-radius: 4px; padding: 4px 6px; }

.df-content { padding: 36px 40px 80px; min-width: 0; flex: 1; }

/* ── Page header (on the floor; type does the work) ─────────────────────── */
.pg-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; margin-bottom: 28px; }
.pg-head__main { min-width: 0; flex: 1 1 320px; }
.pg-head > .pg-actions { flex: none; }
.pg-title {
  font: 400 38px/1.08 var(--mg-serif); letter-spacing: -0.018em; color: var(--mg-ink);
  font-optical-sizing: auto;
}
.pg-title--lg { font-size: 44px; }
.pg-sub { margin-top: 8px; font: 400 16px/1.45 var(--mg-sans); color: var(--mg-ink-2); text-wrap: pretty; }
.pg-meta { display: flex; flex-wrap: wrap; align-items: center; margin-top: 10px; font: 400 14px/1.5 var(--mg-sans); color: var(--mg-ink-3); }
.pg-meta > span:not(:last-child)::after { content: '·'; margin: 0 9px; }
.pg-actions { display: flex; gap: 8px; align-items: center; padding-top: 6px; flex-wrap: wrap; }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 34px; padding: 0 14px; border-radius: var(--mg-r-ctl); border: 1px solid transparent;
  font: 500 14px/1 var(--mg-sans); letter-spacing: -0.005em; white-space: nowrap;
  text-decoration: none; cursor: pointer;
  transition: background-color 150ms var(--mg-ease), box-shadow 150ms var(--mg-ease);
}
.btn--primary { background: var(--mg-ink); color: var(--mg-on-ink); box-shadow: 0 1px 2px rgba(25, 25, 24, 0.2); }
.btn--primary .ic { color: var(--mg-gold); }
.btn--primary:hover { background: #2c2b29; }
.btn--secondary { background: #fff; color: var(--mg-ink); border-color: var(--mg-edge); box-shadow: 0 1px 2px rgba(25, 25, 24, 0.05); }
.btn--secondary .ic { color: var(--mg-ink-2); }
.btn--secondary:hover { background: var(--mg-tint); }
.btn--danger { background: var(--mg-red-wash); color: var(--mg-red-text); border-color: rgba(220, 38, 38, 0.2); }
.btn--sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn--lg { height: 40px; padding: 0 18px; }
.btn--block { width: 100%; }
.btn[disabled] { background: var(--mg-tint); color: var(--mg-ink-3); border-color: var(--mg-hair); box-shadow: none; cursor: not-allowed; }
.btn[disabled] .ic { color: var(--mg-ink-3); }
.lnk { display: inline-flex; align-items: center; gap: 6px; font: 500 14px/1 var(--mg-sans); color: var(--mg-ink); text-decoration: none; white-space: nowrap; }
.lnk .ic { width: 14px; height: 14px; }
.lnk--sm { font-size: 13px; }
.iconbtn {
  display: inline-grid; place-items: center; width: 28px; height: 28px; flex: none;
  border-radius: var(--mg-r-ctl); border: 0; background: transparent; color: var(--mg-ink-3); cursor: pointer;
}
.iconbtn:hover { background: var(--mg-hover); color: var(--mg-ink); }
.iconbtn--32 { width: 32px; height: 32px; }
/* Any button whose only content is an icon centres it, whatever its own class: the UA default
   (inline-block, text baseline) leaves a 1em svg sitting low and left of centre. The rule lives in a
   cascade layer so every unlayered author rule still wins over it (a `display: none` that hides the
   button on phones, a grid button), and it only replaces the UA default. */
/* Icon-only controls are marked by app-shell.js (`data-mg-icon-only`): an svg.ic and no text. */
@layer mg-icon-centre {
  .mg-app-ui [data-mg-icon-only] { display: inline-flex; align-items: center; justify-content: center; }
}

/* ── Tiles ──────────────────────────────────────────────────────────────── */
.mg-tile {
  background: var(--mg-tile); border: 1px solid var(--mg-tile-line); border-radius: var(--mg-r-tile);
  box-shadow: var(--mg-shadow-tile); min-width: 0; position: relative;
}
a.mg-tile { display: block; color: inherit; text-decoration: none; transition: transform 300ms var(--mg-ease), box-shadow 300ms var(--mg-ease); }
a.mg-tile:hover { transform: translateY(-2px); box-shadow: var(--mg-shadow-lift); }
/* Whole tile clickable with one menu: a stretched link under the menu button */
.mg-tile--click { transition: transform 300ms var(--mg-ease), box-shadow 300ms var(--mg-ease); }
.mg-tile--click:hover { transform: translateY(-2px); box-shadow: var(--mg-shadow-lift); }
.tile-link-over { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.mg-tile--click .iconbtn, .mg-tile--click .lnk, .mg-tile--click .btn { position: relative; z-index: 2; }
.tile-head { display: flex; align-items: baseline; gap: 10px; padding: 20px 24px 0; }
.tile-title { font: 600 15px/1.3 var(--mg-sans); letter-spacing: -0.01em; color: var(--mg-ink); }
.tile-note { font: 400 13px/1.3 var(--mg-sans); color: var(--mg-ink-3); }
.tile-head .lnk { margin-left: auto; }
.well { background: var(--mg-floor-deep); border-radius: var(--mg-r-md); }

/* Sections on the floor */
.sec { margin-top: 44px; }
.sec-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 16px; }
.sec-title { font: 600 17px/1.3 var(--mg-sans); letter-spacing: -0.012em; }
.sec-note { font: 400 14px/1.3 var(--mg-sans); color: var(--mg-ink-3); }
.sec-head .lnk { margin-left: auto; }

/* ── Status: a dot and an ink word ──────────────────────────────────────── */
.st { display: inline-flex; align-items: center; gap: 7px; font: 500 13px/1.2 var(--mg-sans); color: var(--mg-ink); white-space: nowrap; }
.st::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--mg-grey); flex: none; }
.st--final::before, .st--live::before { background: var(--mg-green); }
.st--review::before, .st--progress::before { background: var(--mg-gold); }
.st--draft::before { background: var(--mg-grey); }
.st--neutral::before { background: var(--mg-neutral-dot); }
.st--failed { color: var(--mg-red-text); }
.st--failed::before { background: var(--mg-red); }
.st--plain::before { display: none; }

/* People and monograms */
.av {
  display: inline-grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 50%;
  background: #f1f0ea; box-shadow: inset 0 0 0 1px rgba(25, 25, 24, 0.1);
  font: 600 12px/1 var(--mg-sans); color: var(--mg-ink); letter-spacing: 0.01em;
}
.av--32 { width: 32px; height: 32px; }
.av-stack { display: flex; gap: 4px; }
.av-stack .av { width: 26px; height: 26px; }
.mono {
  display: inline-grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: var(--mg-r-ctl);
  background: var(--mg-floor); box-shadow: inset 0 0 0 1px var(--mg-hair);
  font: 600 12px/1 var(--mg-sans); color: var(--mg-ink);
}
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; background: #f1f0ea; font: 500 12px/1 var(--mg-sans); color: var(--mg-ink-2); white-space: nowrap; }
.chip--sm { height: 20px; padding: 0 8px; }   /* small tags: You, Internal, Ask */

/* Filters and segmented controls */
.pills { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pill {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 13px;
  border-radius: 999px; background: #fff; border: 1px solid var(--mg-edge);
  font: 500 13px/1 var(--mg-sans); color: var(--mg-ink-2); white-space: nowrap; cursor: pointer;
}
.pill__n { color: var(--mg-ink-3); font-variant-numeric: tabular-nums; }
.pill.is-active { background: var(--mg-ink); border-color: var(--mg-ink); color: var(--mg-on-ink); }
.pill.is-active .pill__n { color: rgba(255, 254, 242, 0.8); }
.seg { display: inline-flex; gap: 2px; padding: 3px; background: #ecebe4; border-radius: var(--mg-r-md); }
.seg__btn { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border: 0; border-radius: var(--mg-r-ctl); background: transparent; font: 500 13px/1 var(--mg-sans); color: var(--mg-ink-2); cursor: pointer; }
.seg__btn.is-on { background: #fff; color: var(--mg-ink); box-shadow: 0 0 0 1px rgba(25, 25, 24, 0.06), 0 1px 2px rgba(25, 25, 24, 0.1); }
.seg--icons .seg__btn { width: 32px; padding: 0; justify-content: center; }

/* Fields */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field__label { font: 500 13px/1.3 var(--mg-sans); color: var(--mg-ink-2); }
.input, .select, .search {
  display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px;
  background: #fff; border: 1px solid var(--mg-edge); border-radius: var(--mg-r-ctl);
  font: 400 14px/1 var(--mg-sans); color: var(--mg-ink); min-width: 0;
}
.input--ro { background: var(--mg-tint); color: var(--mg-ink-2); }
.select { justify-content: space-between; font-weight: 500; cursor: pointer; }
.select .ic, .search .ic { color: var(--mg-ink-3); }
.search { color: var(--mg-ink-3); height: 34px; }
.select--sm { height: 34px; font-size: 13px; }

/* Tables (inside a tile) */
.tbl { width: 100%; border-collapse: collapse; font: 400 14px/1.4 var(--mg-sans); font-variant-numeric: tabular-nums; }
.tbl th {
  font: 600 12px/1.2 var(--mg-sans); color: var(--mg-ink-3); text-align: left;
  padding: 10px 16px; background: var(--mg-tint); border-bottom: 1px solid var(--mg-hair); white-space: nowrap;
}
.tbl td { padding: 12px 16px; border-bottom: 1px solid var(--mg-hair); vertical-align: middle; color: var(--mg-ink); }
.tbl tr:last-child td { border-bottom: 1px solid transparent; }   /* keeps the last row as tall as the others */
.tbl td > .st { display: flex; line-height: 1; }   /* a status alone in a cell sits on the row's centre line */
.tbl .cb { display: block; }
.tbl th.num, .tbl td.num { text-align: right; }
.tbl tbody tr:hover td { background: #fbfbf8; }
.tbl .sub { display: block; font-size: 13px; color: var(--mg-ink-3); margin-top: 2px; }
.tbl .strong { font-weight: 600; }
.tbl-scroll { overflow-x: auto; position: relative; }

/* Figures */
.fig__label { font: 500 13px/1.3 var(--mg-sans); color: var(--mg-ink-3); }
.fig__value { display: flex; align-items: baseline; gap: 2px; margin-top: 10px; font: 600 48px/1 var(--mg-sans); letter-spacing: -0.035em; color: var(--mg-ink); font-variant-numeric: tabular-nums; }
.fig__value--md { font-size: 30px; letter-spacing: -0.03em; margin-top: 8px; }
.fig__unit { font: 600 22px/1 var(--mg-sans); letter-spacing: -0.02em; color: var(--mg-ink-2); }
.fig__value--md .fig__unit { font-size: 16px; letter-spacing: 0; }
.fig__note { margin-top: 8px; font: 400 13px/1.4 var(--mg-sans); color: var(--mg-ink-3); }

/* ── Dashboard: pipeline and ledger ─────────────────────────────────────── */
.dash-top { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 24px; align-items: stretch; }
.pipe { display: flex; flex-direction: column; }
.pipe__body { display: grid; grid-template-columns: 208px minmax(0, 1fr); flex: 1; }
.pipe__figs { display: flex; flex-direction: column; gap: 28px; padding: 22px 24px 24px; border-right: 1px solid var(--mg-hair); }
.pipe__stages { padding: 14px 24px 18px 24px; display: flex; flex-direction: column; }
.stg { display: grid; grid-template-columns: 128px minmax(0, 1fr) 60px 40px 48px; column-gap: 14px; align-items: center; min-height: 31px; }
.stg--head { min-height: 26px; font: 500 12px/1 var(--mg-sans); color: var(--mg-ink-3); border-bottom: 1px solid var(--mg-hair); margin-bottom: 6px; padding-bottom: 6px; }
.stg--head > :nth-child(n+3) { text-align: right; }
.stg__name { font: 500 13px/1.25 var(--mg-sans); color: var(--mg-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stg__track { position: relative; height: 8px; }
.stg__bar { position: absolute; inset: 0 auto 0 0; background: var(--mg-graph); border-radius: 2px; min-width: 3px; }
.stg__ev, .stg__n, .stg__pct { text-align: right; font: 600 13px/1 var(--mg-sans); font-variant-numeric: tabular-nums; color: var(--mg-ink); }
.stg__n, .stg__pct { font-weight: 400; color: var(--mg-ink-2); }
.stg--empty .stg__name { color: var(--mg-ink-3); }
.stg__none { grid-column: 2 / -1; font: 400 13px/1 var(--mg-sans); color: var(--mg-ink-3); }
.stg.is-hover .stg__bar { background: var(--mg-gold); }

.ledger { display: flex; flex-direction: column; }
.ledger__rows { display: flex; flex-direction: column; flex: 1; padding: 6px 0 4px; }
.ledger__row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 24px; flex: 1; }
.ledger__row + .ledger__row { border-top: 1px solid var(--mg-hair); }
.ledger__label { font: 600 14px/1.3 var(--mg-sans); }
.ledger__note { margin-top: 3px; font: 400 13px/1.3 var(--mg-sans); color: var(--mg-ink-3); }
.ledger__value { font: 600 28px/1 var(--mg-sans); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }

/* ── Deal tile ──────────────────────────────────────────────────────────── */
.dtile-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.dtile { display: flex; flex-direction: column; padding: 20px 20px 16px; height: 100%; }
.dtile__name { font: 400 22px/1.12 var(--mg-serif); letter-spacing: -0.012em; color: var(--mg-ink); font-optical-sizing: auto; }
.dtile__target { margin-top: 5px; font: 400 13px/1.35 var(--mg-sans); color: var(--mg-ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dtile__ev { display: flex; align-items: baseline; gap: 1px; margin-top: 22px; font: 600 28px/1 var(--mg-sans); letter-spacing: -0.035em; font-variant-numeric: tabular-nums; }
.dtile__ev small { font: 600 15px/1 var(--mg-sans); letter-spacing: -0.01em; color: var(--mg-ink-2); }
.dtile__evlabel { margin-top: 6px; font: 400 12px/1.3 var(--mg-sans); color: var(--mg-ink-3); }
.dtile__meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; }
.dtile__type { font: 400 13px/1.2 var(--mg-sans); color: var(--mg-ink-3); white-space: nowrap; }
.dtile__stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--mg-hair); }
.kv__k { font: 400 12px/1.3 var(--mg-sans); color: var(--mg-ink-3); white-space: nowrap; }
.kv__v { margin-top: 4px; font: 600 14px/1.2 var(--mg-sans); font-variant-numeric: tabular-nums; white-space: nowrap; }
.kv__v small { font: 400 12px/1 var(--mg-sans); color: var(--mg-ink-3); margin-left: 3px; }
.dtile__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 16px; }
.dtile__ind { font: 400 12px/1.2 var(--mg-sans); color: var(--mg-ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Document tile and cover ────────────────────────────────────────────── */
.rpt-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 1240px) { .rpt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }   /* three columns need about 290px per tile for the type + status line */
.rpt-tile { display: flex; flex-direction: column; overflow: hidden; height: 100%; }
/* Tray: the well that shows the top of a document. The page picture inside is sized in cqw of the sheet,
   so a fixed tray height would cut it through a line of text at most widths. The tray therefore keeps a
   fixed proportion to the sheet instead: its content box has the aspect ratio 100 : --tray-cut, i.e. it
   reaches --tray-cut % of the sheet width down the page. --tray-pt / --tray-px are the padding, --tray-gap
   is extra depth below the content box (the gap between two pages). Screens only set these variables.
   Cover (default): 34.65 = just below the company line, above the short rule under it.
   Library: 87.67 + 14px = the whole first page, the gap, and page two down to just below its masthead
   rule and above its first heading. Measured on 1024 to 1920: the cut keeps at least 2% (cover) or 1.2% (library)
   of the sheet width clear of text on both sides. The tray, not the tile, is the query container, so the
   tiles keep their own layout (subgrid, @container rules). */
.rpt-tile__cover {
  --tray-pt: 20px; --tray-px: 22px; --tray-gap: 0px; --tray-cut: 34.65;
  position: relative; box-sizing: content-box; height: auto; aspect-ratio: 100 / var(--tray-cut);
  padding: var(--tray-pt) var(--tray-px) var(--tray-gap);
  container-type: inline-size;   /* 100cqw below = the sheet width */
  background: var(--mg-floor-deep); overflow: hidden; flex: none;
}
.rpt-tile__cover .pages { --view: calc(var(--tray-cut) * 1cqw + var(--tray-gap)); }   /* depth shown, for the hover scroll */
.rpt-tile__body { display: flex; flex-direction: column; padding: 16px 20px 0; flex: 1; }
.rpt-tile__meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rpt-tile__type { font: 500 13px/1.2 var(--mg-sans); color: var(--mg-ink-3); white-space: nowrap; }
.rpt-tile__title {
  margin-top: 9px; font: 600 15px/1.38 var(--mg-sans); letter-spacing: -0.01em; color: var(--mg-ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.76em;
}
.rpt-tile__deal { margin-top: 6px; font: 400 13px/1.35 var(--mg-sans); color: var(--mg-ink-3); overflow-wrap: break-word; }
.rpt-tile__foot { display: flex; align-items: center; gap: 10px; margin-top: 16px; height: 48px; padding: 0 10px 0 20px; border-top: 1px solid var(--mg-hair); font: 400 13px/1.2 var(--mg-sans); color: var(--mg-ink-3); }
/* author and date wrap onto a second line when the tile is narrow; they are never cut */
.rpt-tile__by { flex: 1; min-width: 0; line-height: 1.25; overflow-wrap: break-word; }
.rpt-tile__ver { flex: none; padding: 3px 7px; border-radius: 999px; background: #f1f0ea; box-shadow: inset 0 0 0 1px rgba(25, 25, 24, 0.06); font: 600 13px/1 var(--mg-sans); color: var(--mg-ink-2); font-variant-numeric: tabular-nums; }
/* Library grid (Deal Documents, Templates): a tall tray; the pages scroll on hover */
.rpt-grid .rpt-tile__cover { --tray-pt: 22px; --tray-cut: 87.67; --tray-gap: 14px; }
.rpt-grid .rpt-tile__body { padding: 18px 22px 0; }
.rpt-grid .rpt-tile__title { margin-top: 10px; font-size: 16px; line-height: 1.36; letter-spacing: -0.012em; }
.rpt-grid .rpt-tile__deal { margin-top: 7px; }
.rpt-grid .rpt-tile__foot { margin-top: 18px; padding: 0 10px 0 22px; gap: 8px; }

/* Cover: a picture of the first page set into the tray. Sizes are in cqw so
   the page scales with the tile; it is a thumbnail, not UI text. */
.sheet {
  container-type: inline-size; position: relative; width: 100%; aspect-ratio: 11 / 8.5;
  background: #fff; color: #191918;
  box-shadow: 0 0 0 1px rgba(25, 25, 24, 0.06), 0 1px 2px rgba(25, 25, 24, 0.06), 0 10px 22px -10px rgba(25, 25, 24, 0.28);
  overflow: hidden;
}
.sheet--ink { background: #1c1b19; color: #fffef2; }
.cv { position: absolute; inset: 0; padding: 6.5cqw 7cqw 5cqw; display: flex; flex-direction: column; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; }
.cv__mast { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 1.6cqw; border-bottom: 0.18cqw solid currentColor; }
.cv__firm { font: 700 2.2cqw/1 Georgia, 'Times New Roman', serif; letter-spacing: 0.02em; }
.cv__firm span { font-weight: 400; }
.cv__legend { font-size: 1.35cqw; letter-spacing: 0.14em; opacity: 0.75; }  /* literal caps in the markup, matching the document; no CSS uppercase in the app */
.cv__title { margin-top: 9cqw; font: 400 7.6cqw/1 Georgia, 'Times New Roman', serif; letter-spacing: -0.01em; }
.cv__target { margin-top: 1.8cqw; font-size: 2.4cqw; opacity: 0.8; }
.cv__rule { width: 9cqw; height: 0.18cqw; background: currentColor; margin-top: 4.2cqw; opacity: 0.9; }
.cv__kind { margin-top: 2.8cqw; font-size: 2.5cqw; font-weight: 700; }
.cv__date { margin-top: 1cqw; font-size: 2cqw; opacity: 0.75; }
.cv__foot { margin-top: auto; display: flex; justify-content: space-between; padding-top: 1.6cqw; border-top: 0.12cqw solid currentColor; font-size: 1.5cqw; opacity: 0.8; }
.cv--blank .cv__title { opacity: 0.92; }

/* Pending and failed covers */
.cv-pending { position: absolute; inset: 0; padding: 7cqw; display: flex; flex-direction: column; gap: 2.4cqw; }
.cv-pending i { display: block; height: 2.2cqw; border-radius: 1cqw; background: #ecebe4; }
.cv-note {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px;
  background: #fff; box-shadow: 0 0 0 1px var(--mg-hair), 0 4px 12px -4px rgba(25, 25, 24, 0.2);
  font: 500 13px/1 var(--mg-sans); color: var(--mg-ink); white-space: nowrap;
}

/* Template tile footer */
.tpl-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; height: 48px; padding: 0 20px; border-top: 1px solid var(--mg-hair); }
.rpt-tile__desc { margin-top: 6px; font: 400 13px/1.45 var(--mg-sans); color: var(--mg-ink-2); }   /* wraps in full; only titles are clamped */

/* ── Skeleton (loading) ─────────────────────────────────────────────────── */
.sk { display: block; background: #eeede7; border-radius: 4px; }
/* Static on purpose: the brief allows nothing that loops or flashes. The waiting copy
   ("Reading the data room…") carries the progress; the blocks only hold the layout. */

/* ── Phone shell (390) ──────────────────────────────────────────────────── */
/* Fluid column: fills a 375 to 430 window, never wider than 430 (centred on a desktop window) */
.m-app { width: 100%; max-width: 430px; margin: 0 auto; min-height: 100%; background: var(--mg-floor); }
@media (min-width: 431px) { .m-app { min-height: 100vh; border-inline: 1px solid var(--mg-hair); } }   /* on a desktop window the column shows its edges */
.m-top {
  display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 8px 0 8px;
  background: var(--mg-floor); border-bottom: 1px solid var(--mg-hair);
}
.m-top .iconbtn { width: 44px; height: 44px; }
.m-top .ic { width: 20px; height: 20px; color: var(--mg-ink); }
.m-top__brand { display: flex; align-items: center; gap: 8px; font: 600 15px/1 var(--mg-sans); }
.m-content { padding: 20px 16px 48px; }
.m-content .pg-title { font-size: 32px; }


/* ==========================================================================
   r4 · refinement layer (2026-10-25)
   Fewer, better tiles: zones divided by hairlines, a tint band for footers,
   wells cut into tiles, serif figures for what matters, documents shown as
   pages that scroll on hover. Palette unchanged.
   ========================================================================== */
:root {
  --mg-well-in: inset 0 1px 2px rgba(25, 25, 24, 0.08), inset 0 0 0 1px rgba(25, 25, 24, 0.04);
  --mg-track: #efeee8;          /* empty part of a meter on white */
}

/* Serif figures: lining, tabular, set like a printed statement */
.serif { font-family: var(--mg-serif); font-optical-sizing: auto; }
.sfig { font-family: var(--mg-serif); font-weight: 400; font-variant-numeric: lining-nums tabular-nums; letter-spacing: -0.015em; font-optical-sizing: auto; color: var(--mg-ink); }
.sfig--hero { font-size: 68px; line-height: 0.92; letter-spacing: -0.025em; }
.sfig--xl { font-size: 48px; line-height: 1; letter-spacing: -0.02em; }
.sfig--lg { font-size: 36px; line-height: 1; }
.sfig--md { font-size: 30px; line-height: 1; }
.sfig--sm { font-size: 24px; line-height: 1; letter-spacing: -0.01em; }
.sfig .u { font-size: max(12px, 0.5em); letter-spacing: 0; color: var(--mg-ink-2); margin-left: 0.06em; }
.lbl { font: 500 12px/1.3 var(--mg-sans); color: var(--mg-ink-3); letter-spacing: 0.005em; }

/* Tile anatomy */
.tile-foot {
  display: flex; align-items: center; gap: 10px; margin-top: auto;
  padding: 12px 20px; background: var(--mg-tint); border-top: 1px solid var(--mg-hair);
  border-radius: 0 0 calc(var(--mg-r-tile) - 1px) calc(var(--mg-r-tile) - 1px);
  font: 400 13px/1.35 var(--mg-sans); color: var(--mg-ink-2); min-width: 0;
}
.zone + .zone { border-left: 1px solid var(--mg-hair); }
.panel { background: var(--mg-tint); border-radius: var(--mg-r-md); box-shadow: inset 0 0 0 1px var(--mg-hair); }

/* Meter: a share of something real, in graph ink (gold only for work in flight) */
.meter { position: relative; height: 4px; border-radius: 2px; background: var(--mg-track); overflow: hidden; }
.meter > i { position: absolute; inset: 0 auto 0 0; border-radius: 2px; background: var(--mg-graph); }
.meter--gold > i { background: var(--mg-gold); }
.meter--6 { height: 6px; border-radius: 3px; }

/* Activity: who did what, when */
.act { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.act .av { width: 26px; height: 26px; background: #fff; }
.act__text { display: flex; flex-direction: column; min-width: 0; }
.act__what { font: 500 13px/1.3 var(--mg-sans); color: var(--mg-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act__who { font: 400 12px/1.35 var(--mg-sans); color: var(--mg-ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Document tray: a well cut into the tile; the pages scroll on hover, once, then stop */
.rpt-tile__cover { box-shadow: var(--mg-well-in); }
.pages { position: relative; display: flex; flex-direction: column; gap: 14px; padding-bottom: 22px; transition: transform 900ms var(--mg-ease); will-change: transform; }
.rpt-tile:hover .pages, .doc-hover:hover .pages {
  transform: translateY(calc(-100% + var(--view, 188px)));
  transition: transform var(--dur, 6s) linear 300ms;
}
@media (prefers-reduced-motion: reduce) {
  .pages, .rpt-tile:hover .pages, .doc-hover:hover .pages { transform: none !important; transition: none !important; }
}
.pages .sheet { flex: none; }

/* Inside pages, house style (Georgia titles, Arial text, ink only). Sizes in cqw: a picture. */
.pg { position: absolute; inset: 0; padding: 5.2cqw 6.4cqw 4cqw; display: flex; flex-direction: column; font-family: Arial, Helvetica, sans-serif; color: #191918; }
.pg__mast { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 1.3cqw; border-bottom: 0.16cqw solid currentColor; }
.pg__mast b { font: 700 1.9cqw/1 Georgia, 'Times New Roman', serif; }
.pg__mast b span { font-weight: 400; }
.pg__mast em { font-style: normal; font-size: 1.1cqw; letter-spacing: 0.12em; opacity: 0.7; }
.pg__kick { display: flex; align-items: baseline; gap: 1.2cqw; margin-top: 3.2cqw; font-size: 1.55cqw; font-weight: 700; }
.pg__kick i { font: 400 1.75cqw/1 Georgia, serif; font-style: normal; }
.pg__h { margin-top: 1.3cqw; font: 400 3.5cqw/1.12 Georgia, 'Times New Roman', serif; letter-spacing: -0.005em; }
.pg__lede { margin-top: 1.8cqw; font-size: 1.45cqw; line-height: 1.45; color: #33322f; max-width: 82%; }
.pg__lines { display: grid; gap: 1.05cqw; margin-top: 2cqw; }
.pg__lines i { display: block; height: 0.85cqw; border-radius: 0.3cqw; background: #dcdbd5; }
.pg__kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 2.6cqw; border-top: 0.22cqw solid #191918; border-bottom: 0.1cqw solid #dfded8; }
.pg__kpis > div { padding: 1.5cqw 1.4cqw 1.4cqw 0; }
.pg__kpis > div + div { padding-left: 1.6cqw; border-left: 0.1cqw solid #dfded8; }
.pg__kpis b { display: block; font: 700 3.1cqw/1 Arial, Helvetica, sans-serif; letter-spacing: -0.01em; }
.pg__kpis span { display: block; margin-top: 0.8cqw; font-size: 1.2cqw; color: #555550; }
.pg__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 3cqw; margin-top: 2.6cqw; }
.pg__item { display: grid; grid-template-columns: 9cqw 1fr; gap: 1.6cqw; padding-bottom: 1.6cqw; border-bottom: 0.1cqw solid #dfded8; }
.pg__item b { font: 700 2.6cqw/1 Arial, sans-serif; }
.pg__item u { display: block; text-decoration: none; font-size: 1.35cqw; font-weight: 700; margin-bottom: 0.9cqw; }
.pg__charts { display: grid; grid-template-columns: 1fr 1fr; gap: 3.4cqw; margin-top: 2.6cqw; }
.pg__chart { display: flex; flex-direction: column; }
.pg__chart u { text-decoration: none; font-size: 1.3cqw; font-weight: 700; margin-bottom: 1.2cqw; }
.pg__bars { display: flex; align-items: flex-end; gap: 1.3cqw; height: 13cqw; border-bottom: 0.15cqw solid #191918; }
.pg__bars i { flex: 1; background: #2b2a27; }
.pg__bars i.e { background: #fff; box-shadow: inset 0 0 0 0.22cqw #2b2a27; }
.pg__axis { display: flex; gap: 1.3cqw; margin-top: 0.8cqw; font-size: 1.05cqw; color: #555550; }
.pg__axis span { flex: 1; text-align: center; }
.pg__tbl { margin-top: 2.4cqw; font-size: 1.25cqw; }
.pg__tr { display: grid; grid-template-columns: 2.2fr repeat(5, 1fr); align-items: center; padding: 0.95cqw 0; border-bottom: 0.1cqw solid #e2e1db; }
.pg__tr > span { text-align: right; }
.pg__tr > span:first-child { text-align: left; }
.pg__tr--h { border-bottom: 0.18cqw solid #191918; font-weight: 700; }
.pg__tr--b { font-weight: 700; }
.pg__shade { background: #f1f0eb; }
.pg__range { position: relative; height: 3.6cqw; border-bottom: 0.1cqw solid #e2e1db; display: grid; grid-template-columns: 26% 1fr; align-items: center; font-size: 1.25cqw; }
.pg__range s { position: absolute; top: 1cqw; height: 1.6cqw; background: #2b2a27; text-decoration: none; }
.pg__band { position: absolute; top: 0; bottom: 0; background: #f1f0eb; border-left: 0.1cqw dashed #77756e; border-right: 0.1cqw dashed #77756e; }
.pg__letter { margin-top: 3cqw; font-size: 1.35cqw; line-height: 1.5; color: #33322f; }
.pg__letter p { margin: 0 0 1.4cqw; }
.pg__sig { margin-top: 2cqw; font: 400 2.2cqw/1 Georgia, serif; font-style: italic; }
.pg__ph { display: grid; place-items: center; border: 0.14cqw dashed #b9b7ae; color: #77756e; font-size: 1.3cqw; border-radius: 0.6cqw; }
.pg__foot { margin-top: auto; display: flex; justify-content: space-between; padding-top: 1.1cqw; border-top: 0.1cqw solid #dfded8; font-size: 1.15cqw; color: #555550; }
.sheet--ink .pg { color: #fffef2; }

/* ── Dashboard r4 ───────────────────────────────────────────────────────── */
/* Overview tile (dashboard): hero figure, pipeline table, document counts.
   <div class="stmt-host"><section class="mg-tile stmt"> with three zones: .stmt__hero,
   .stmt__stages, .stmt__docs. The hero and documents zones hold, in this order:
   .stmt__lbl (label), .stmt__fig (figure), .stmt__note, .stmt__body (mix or status rows)
   and .stmt__pair (two small figures, each a .stmt__pc: label above figure).
   The host is a size container, so the layout follows the tile's own width, not the window:
     under 720px    everything stacks; the documents zone is two columns, its pair below
     from 720px     hero beside the pipeline table, documents as a full-width band
     from 1020px    three columns; hero and documents zones share rows, so labels, figure
                    baselines, notes and the two pairs line up across them. */
.stmt-host { container-type: inline-size; }
.stmt { display: grid; grid-template-columns: minmax(0, 1fr); }
.stmt__hero { display: flex; flex-direction: column; min-width: 0; padding: 24px 28px; background: var(--mg-tint); border-bottom: 1px solid var(--mg-hair); border-radius: calc(var(--mg-r-tile) - 1px) calc(var(--mg-r-tile) - 1px) 0 0; }
.stmt__hero > .stmt__body { margin-bottom: 22px; }
.stmt__fig { display: block; margin-top: 14px; }
.stmt__note { margin-top: 12px; font: 400 13px/1.45 var(--mg-sans); color: var(--mg-ink-2); }
.stmt__pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto; margin-top: auto; padding-top: 18px; border-top: 1px solid var(--mg-hair); }
.stmt__pc { display: grid; grid-template-rows: subgrid; grid-row: 1 / span 2; min-width: 0; }
.stmt__pc + .stmt__pc { padding-left: 18px; border-left: 1px solid var(--mg-hair); }
.stmt__pc .sfig { display: block; margin-top: 6px; align-self: baseline; }
.stmt__stages { display: flex; flex-direction: column; min-width: 0; padding: 21px 28px 18px; }   /* 21px puts the Pipeline title on the baseline of the zone labels */
.stmt__docs { display: grid; grid-template-columns: 180px minmax(0, 1fr); grid-template-rows: auto auto auto 1fr auto; column-gap: 28px; min-width: 0; padding: 24px 28px; border-top: 1px solid var(--mg-hair); }
.stmt__docs > .stmt__lbl { grid-column: 1; grid-row: 1; }
.stmt__docs > .stmt__fig { grid-column: 1; grid-row: 2; align-self: baseline; }
.stmt__docs > .stmt__note { grid-column: 1; grid-row: 3; }
.stmt__docs > .stmt__body { grid-column: 2; grid-row: 1 / span 4; margin-top: 0; border-top: 0; }
.stmt__docs > .stmt__pair { grid-column: 1 / -1; grid-row: 5; margin-top: 22px; }
@container (min-width: 720px) {
  .stmt { grid-template-columns: 264px minmax(0, 1fr); }
  .stmt__hero { border-bottom: 0; border-right: 1px solid var(--mg-hair); border-radius: calc(var(--mg-r-tile) - 1px) 0 0 0; }
  .stmt__docs { grid-column: 1 / -1; grid-template-columns: 190px minmax(0, 1fr) auto; grid-template-rows: auto auto auto 1fr; column-gap: 32px; }
  .stmt__docs > .stmt__pair { grid-column: 3; grid-row: 1 / span 4; display: grid; grid-template-columns: auto auto; grid-template-rows: subgrid; margin-top: 0; padding-top: 0; border-top: 0; }
  .stmt__docs > .stmt__pair .stmt__pc:first-child { padding-right: 24px; }
}
@container (min-width: 1020px) {
  .stmt { grid-template-columns: 300px minmax(0, 1fr) 272px; grid-template-rows: auto auto auto 1fr auto auto; }
  .stmt__hero, .stmt__docs { grid-row: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: subgrid; column-gap: 0; padding: 24px 28px; }
  .stmt__hero { grid-column: 1; border-radius: calc(var(--mg-r-tile) - 1px) 0 0 calc(var(--mg-r-tile) - 1px); }
  .stmt__stages { grid-column: 2; grid-row: 1 / -1; }
  .stmt__docs { grid-column: 3; border-top: 0; border-left: 1px solid var(--mg-hair); padding: 24px; }
  .stmt__hero > .stmt__lbl, .stmt__docs > .stmt__lbl { grid-column: 1; grid-row: 1; }
  .stmt__hero > .stmt__fig, .stmt__docs > .stmt__fig { grid-column: 1; grid-row: 2; align-self: baseline; }
  .stmt__hero > .stmt__note, .stmt__docs > .stmt__note { grid-column: 1; grid-row: 3; }
  .stmt__hero > .stmt__body, .stmt__docs > .stmt__body { grid-column: 1; grid-row: 4; align-self: start; margin-bottom: 0; }
  .stmt__docs > .stmt__body { margin-top: 22px; border-top: 1px solid var(--mg-hair); }
  .stmt__hero > .stmt__pair, .stmt__docs > .stmt__pair { grid-column: 1; grid-row: 5 / span 2; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: subgrid; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--mg-hair); }
  .stmt__docs > .stmt__pair .stmt__pc:first-child { padding-right: 0; }
}
.dstrip { display: flex; gap: 2px; height: 10px; margin-top: 18px; }
.dstrip i { flex: 1; background: var(--mg-grey); }
.dstrip i:first-child { border-radius: 2px 0 0 2px; }
.dstrip i:last-child { border-radius: 0 2px 2px 0; }
.dstrip .dstrip--progress, .dstrip .dstrip--review { background: var(--mg-gold); }
.dstrip .dstrip--final { background: var(--mg-green); }
.dstrip .dstrip--failed { background: var(--mg-red); }
.dsts { display: flex; flex-direction: column; margin-top: 22px; border-top: 1px solid var(--mg-hair); }
.dst { display: grid; grid-template-columns: 104px minmax(0, 1fr) 16px; align-items: center; column-gap: 12px; min-height: 34px; text-decoration: none; color: inherit; }
.dst__track { position: relative; height: 6px; border-radius: 3px; background: var(--mg-track); }
.dst__track i { position: absolute; inset: 0 auto 0 0; border-radius: 3px; background: var(--mg-graph); min-width: 4px; transition: background-color 200ms var(--mg-ease); }
.dst:hover .dst__track i { background: var(--mg-gold); }
.dst b { text-align: right; }
.dst + .dst { border-top: 1px solid rgba(25, 25, 24, 0.045); }
.dst .st { font: 500 13px/1.2 var(--mg-sans); }
.dst b { font: 600 13px/1 var(--mg-sans); font-variant-numeric: tabular-nums; color: var(--mg-ink); }

.stmt .tile-head { padding: 0; }


.stg4 { display: grid; grid-template-columns: 132px minmax(0, 1fr) 62px 34px 46px; column-gap: 14px; align-items: center; min-height: 34px; }
.stg4--head { min-height: 28px; margin-top: 14px; padding-bottom: 7px; border-bottom: 1px solid var(--mg-hair); font: 500 12px/1 var(--mg-sans); color: var(--mg-ink-3); }
.stg4--head > :nth-child(n+3) { text-align: right; }
.stg4 + .stg4:not(.stg4--head) { border-top: 1px solid rgba(25, 25, 24, 0.045); }
.stg4__name { display: flex; flex-direction: column; min-width: 0; padding: 7px 0; }
.stg4__name b { font: 500 13px/1.25 var(--mg-sans); color: var(--mg-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stg4__name span { font: 400 12px/1.3 var(--mg-sans); color: var(--mg-ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stg4__track { position: relative; height: 6px; border-radius: 3px; background: var(--mg-track); }
.stg4__bar { position: absolute; inset: 0 auto 0 0; border-radius: 3px; background: var(--mg-graph); min-width: 4px; transition: background-color 200ms var(--mg-ease); }
.stg4:hover .stg4__bar, .stg4.is-hover .stg4__bar { background: var(--mg-gold); }
.stg4__ev { text-align: right; font: 600 13px/1 var(--mg-sans); font-variant-numeric: tabular-nums; color: var(--mg-ink); }
.stg4__n, .stg4__pct { text-align: right; font: 400 13px/1 var(--mg-sans); font-variant-numeric: tabular-nums; color: var(--mg-ink-2); }
.stg4--empty .stg4__name b { color: var(--mg-ink-3); font-weight: 400; }
.stg4__none { grid-column: 2 / -1; font: 400 13px/1 var(--mg-sans); color: var(--mg-ink-3); }

.ldg { display: flex; flex-direction: column; flex: 1; padding: 8px 0 6px; }
.ldg__row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 24px; flex: 1; text-decoration: none; color: inherit; transition: background-color 150ms var(--mg-ease); }
.ldg__row + .ldg__row { border-top: 1px solid var(--mg-hair); }
.ldg__row:hover { background: #fcfcfa; }
.ldg__label { display: block; font: 500 14px/1.3 var(--mg-sans); color: var(--mg-ink); }
.ldg__note { display: flex; align-items: center; gap: 6px; margin-top: 3px; font: 400 12px/1.3 var(--mg-sans); color: var(--mg-ink-3); }
.ldg__note .st { font: 500 12px/1.2 var(--mg-sans); }

/* Deal tile r4: identity · figure · data room and documents · latest activity */
.dtile-grid { gap: 20px; }
.dtile { display: flex; flex-direction: column; height: 100%; padding: 0; }
.dtile__top { padding: 20px 20px 0; }
.dtile__name { font: 400 23px/1.1 var(--mg-serif); letter-spacing: -0.012em; }
.dtile__target { margin-top: 6px; }
.dtile__fig { display: flex; align-items: flex-end; align-items: last baseline; justify-content: space-between; gap: 12px; margin-top: 22px; }
.dtile__fig .sfig { display: block; margin-top: 6px; }
.dtile__stage { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; text-align: right; min-width: 0; padding-bottom: 2px; }
.dtile__stage b { font: 500 13px/1.25 var(--mg-sans); color: var(--mg-ink); white-space: nowrap; }
.dtile__stage span { font: 400 12px/1.25 var(--mg-sans); color: var(--mg-ink-3); white-space: nowrap; }
.dtile__data { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.06fr); gap: 16px 12px; margin: 18px 20px 0; padding: 14px 0 16px; border-top: 1px solid var(--mg-hair); }
.dtile__k { display: flex; align-items: baseline; justify-content: space-between; gap: 4px; white-space: nowrap; font: 400 12px/1.3 var(--mg-sans); color: var(--mg-ink-3); }
.dtile__k b { font: 600 13px/1 var(--mg-sans); color: var(--mg-ink); font-variant-numeric: tabular-nums; }
.dtile__k b small { font: 400 12px/1 var(--mg-sans); color: var(--mg-ink-3); }
.dtile__data .meter { margin-top: 9px; }
.dtile__doc { margin-top: 7px; }
.dtile__doc .st { font: 500 12px/1.2 var(--mg-sans); white-space: normal; }
.dtile .tile-foot { padding: 11px 20px 12px; }


.mix { margin-top: 26px; }
.mix__strip { display: flex; gap: 2px; height: 10px; margin-top: 10px; }
.mix__strip i { display: block; min-width: 2px; background: var(--mg-graph); }
.mix__strip i:first-child { border-radius: 2px 0 0 2px; }
.mix__strip i:last-child { border-radius: 0 2px 2px 0; }
.mix__note { margin-top: 10px; font: 400 12px/1.5 var(--mg-sans); color: var(--mg-ink-2); }
.mix__note b { font-weight: 600; color: var(--mg-ink); }
.cv-fail { position: absolute; inset: 0; background: #f7f6f1; }
.rpt-tile__shared { display: inline-flex; align-items: center; gap: 5px; font: 500 13px/1 var(--mg-sans); color: var(--mg-ink-2); }
.rpt-tile__shared .ic { width: 14px; height: 14px; color: var(--mg-ink-3); }
/* Shelf: recent documents as covers */
.shelf { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.shelf .rpt-tile__cover { --tray-pt: 18px; --tray-px: 20px; }
/* Four tiles to a row (1440 and up): the narrow tile shows the whole first page, cut in the middle of the
   14px gap before page two (77.27 = the page's height as a share of its width) */
@media (min-width: 1440px) { .shelf .rpt-tile__cover { --tray-cut: 77.27; --tray-gap: 7px; } }
.shelf .rpt-tile__body { padding: 14px 18px 0; }
.shelf .rpt-tile__title { font-size: 16px; }
.shelf .rpt-tile__foot { padding: 0 4px 0 18px; gap: 6px; }
/* Four tiles to a row (1440 and up): type above status and a 14px title fit the narrower tile */
@media (min-width: 1440px) {
  .shelf .rpt-tile__meta { min-width: 0; flex-direction: column; align-items: flex-start; gap: 7px; }
  .shelf .rpt-tile__type { min-width: 0; }
  .shelf .rpt-tile__meta .st { flex: none; }
  .shelf .rpt-tile__title { font-size: 14px; }
}

/* Four columns only while a deal tile stays at least 260px wide (activity lines and stage names never cut) */
@media (max-width: 1439px) {
  .dtile-grid, .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .dtile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rpt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-top { grid-template-columns: minmax(0, 1fr); }
  .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .df-sidebar { display: none; }
  .df-topbar { padding: 0 16px; }
  .tb-search { width: auto; }
  .df-content { padding: 20px 16px 48px; }
  .dtile-grid, .rpt-grid, .shelf { grid-template-columns: minmax(0, 1fr); }
  .pipe__body { grid-template-columns: minmax(0, 1fr); }
  .pipe__figs { border-right: 0; border-bottom: 1px solid var(--mg-hair); flex-direction: row; }
}


/* ==========================================================================
   r4 · info tips (2026-10-25)
   A label that is abbreviated (a deal's latest activity) or derived (a
   coverage figure) gets a small "i" button right after it. Hover or keyboard
   focus shows the full explanation in a white card above it. Nothing else
   in this file changes for it.

   <span class="has-tip tip-host">Label text
     <button type="button" class="info" aria-label="About …" aria-describedby="tip-x">
       <svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"><circle cx="12" cy="12" r="10"></circle><path d="M12 16v-4"></path><path d="M12 8h.01"></path></svg>
     </button>
     <span class="tip" role="tooltip" id="tip-x"><span class="tip__lead">…</span><span class="tip__sub">…</span></span>
   </span>

   The card lines up with the nearest positioned ancestor, marked .tip-host:
   · on a label (.has-tip.tip-host) it sits above the label with its text
     aligned to the label's text; .tip--end aligns its right edge with the
     icon instead (labels near a right edge);
   · in a footer band or activity strip (.tip-host on the band, .tip--band on
     the card) it keeps a 12px inset from the band's sides and rises from just
     inside the band's top edge, so it never leaves the tile.
   A button cannot sit inside a link: whole-clickable tiles that carry an info
   button are <article class="mg-tile mg-tile--click"> with a stretched
   .tile-link-over first child; .info and .tip sit above that link.
   ========================================================================== */
.has-tip { display: inline-flex; align-items: center; gap: 4px; min-width: 0; max-width: 100%; }
.has-tip > span:first-child, .has-tip > b:first-child { min-width: 0; }
.tip-host { position: relative; }

.info {
  position: relative; z-index: 2; flex: none;
  display: inline-grid; place-items: center; width: 16px; height: 16px;
  margin: -4px -1px;            /* never grows a line: lays out as 14 x 8 */
  padding: 0; border: 0; border-radius: 50%; background: none;
  color: var(--mg-ink-3); cursor: default; -webkit-tap-highlight-color: transparent;
  transition: color 120ms var(--mg-ease);
}
.info svg { display: block; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.info::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; }   /* 24px target */
.m-app .info::after, .info--touch::after { inset: -14px; }                              /* 44px target in phone boards */
.info:hover, .info:focus-visible { color: var(--mg-ink); }
.info:focus { outline: none; }
.info:focus-visible { outline: 2px solid var(--mg-ink); outline-offset: 0; }

.tip {
  position: absolute; z-index: 3; left: -13px; bottom: calc(100% + 6px);
  width: max-content; max-width: 260px; padding: 10px 12px;
  background: #fff; border: 1px solid rgba(25, 25, 24, 0.12); border-radius: var(--mg-r-md);
  box-shadow: 0 1px 2px rgba(25, 25, 24, 0.06), 0 12px 28px -12px rgba(25, 25, 24, 0.32);
  font: 400 13px/1.45 var(--mg-sans); letter-spacing: 0; color: var(--mg-ink);
  font-variant-numeric: normal; text-align: left; text-transform: none; white-space: normal; overflow-wrap: break-word; text-wrap: pretty;
  pointer-events: none; visibility: hidden; opacity: 0; transform: translateY(2px);
  transition: opacity 120ms var(--mg-ease), transform 120ms var(--mg-ease), visibility 0s linear 120ms;
}
.info:hover + .tip, .info:focus-visible + .tip { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }
.tip__lead { display: block; font-weight: 500; }
.tip__sub { display: block; margin-top: 2px; color: var(--mg-ink-2); }
.tip__note { display: block; margin-top: 6px; color: var(--mg-ink-2); }
.tip--end { left: auto; right: -13px; }
.tip--band { left: 12px; right: auto; bottom: calc(100% - 6px); max-width: min(260px, calc(100% - 24px)); }
@media (prefers-reduced-motion: reduce) {
  .tip, .info:hover + .tip, .info:focus-visible + .tip { transition: none; transform: none; }
}

/* Deal tiles as <article>: the body stays in .dtile, the activity band is the
   tile's own footer (outside .dtile), spaced exactly as .dtile .tile-foot was. */
.mg-tile--deal { display: flex; flex-direction: column; }
.mg-tile--deal > .dtile { flex: 1 1 auto; height: auto; }
.mg-tile--deal > .tile-foot { padding: 11px 20px 12px; }

@media (min-width: 761px) {
  .df-sidebar { position: sticky; top: 0; height: 100vh; align-self: flex-start; overflow-y: auto; }
  .df-topbar { position: sticky; top: 0; z-index: 20; }
}

/* ── Summary tile ────────────────────────────────────────────────────────────
   One look for the figures at the top of every page (Deals, Deal Documents,
   Deal Data Room, Firm Library, Settings, Audit Trail ...). Groups sit side by
   side and every cell shares the tile's rows, so labels, figures, bars and
   notes line up across the whole tile at any width: if one label wraps, every
   figure in the row moves with it. Notes wrap instead of being cut off. Under
   760px of tile width the groups stack; a group's cells still share rows.

   <section class="mg-tile sumt" aria-label="…">
     <div class="sumt__grid">
       <div class="sumt__group" style="--n: 2">              n = cells in the group
         <div class="sumt__head"><h2 class="tile-title">Pipeline</h2><span class="tile-note">6 deal types</span></div>
         <div class="sumt__cell">
           <div class="lbl sumt__label">Active deals</div>
           <div class="sumt__fig"><span class="sfig sfig--md">8</span></div>
           <div class="sumt__bar"><div class="meter"><i style="width: 40%"></i></div></div>   optional
           <p class="sumt__note">1 archived</p>
         </div>
       </div>
     </div>
   </section>
   A tile without group titles simply leaves out .sumt__head.               */
.sumt { container-type: inline-size; }
.sumt__grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto auto auto;
}
.sumt__group {
  grid-column: span var(--n, 1);
  grid-row: 1 / span 5;
  display: grid;
  grid-template-columns: subgrid;
  grid-template-rows: subgrid;
  min-width: 0;
}
.sumt__group + .sumt__group { border-left: 1px solid var(--mg-hair); }
.sumt__head {
  grid-column: 1 / -1;
  grid-row: 1;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 10px;
  padding: 20px 24px 0;
  min-width: 0;
}
.sumt__cell {
  grid-row: 2 / span 4;
  display: grid;
  grid-template-rows: subgrid;
  padding: 16px 24px 22px;
  min-width: 0;
}
.sumt__group:not(:has(.sumt__head)) .sumt__cell { padding-top: 22px; }
.sumt__cell + .sumt__cell { border-left: 1px solid var(--mg-hair); }
.sumt__cell--2 { grid-column: span 2; }   /* a cell that carries a small chart (count it as 2 in --n) */
.sumt__label { grid-row: 1; align-self: start; display: flex; align-items: flex-start; gap: 6px; min-width: 0; }
.sumt__fig { grid-row: 2; margin-top: 8px; min-width: 0; }
.sumt__fig .sfig { display: block; }
.sumt__bar { grid-row: 3; margin-top: 12px; max-width: 160px; }
.sumt__note {
  grid-row: 4;
  margin-top: 10px;
  font: 400 12px/1.45 var(--mg-sans);
  color: var(--mg-ink-3);
  min-width: 0;
  overflow-wrap: break-word;
}
.sumt__note .st { font: 500 12px/1.45 var(--mg-sans); white-space: normal; align-items: baseline; }
.sumt__note > .st { display: flex; }   /* a status in a note always has its own line, whatever the width */
.sumt__note .st::before { transform: translateY(-1px); }
/* Clickable cells (status filters on Deal Documents) */
.sumt__cell--btn { text-align: left; background: none; border: 0; border-radius: 0; font: inherit; color: inherit; cursor: pointer; position: relative; }
.sumt__cell--btn + .sumt__cell--btn { border-left: 1px solid var(--mg-hair); }
.sumt__cell--btn:hover { background: var(--mg-hover); }
.sumt__cell--btn.is-on::after { content: ''; position: absolute; left: 24px; right: 24px; bottom: 0; height: 2px; background: var(--mg-ink); }
.sumt__cell--split { cursor: default; }
.sumt__hit { grid-row: 1 / 3; display: grid; grid-template-rows: auto auto; align-content: start; text-align: left; background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; min-width: 0; }
.sumt__hit::before { content: ''; position: absolute; inset: 0; }   /* the whole cell opens Working drafts… */
.sumt__note:has(.sumt__notebtn) { position: relative; z-index: 1; }   /* …except the in-review note, its own filter */
.sumt__notebtn { background: none; border: 0; padding: 0; cursor: pointer; text-align: left; text-decoration: underline; text-decoration-color: var(--mg-hair); text-underline-offset: 3px; }
.sumt__notebtn:hover, .sumt__notebtn.is-on { text-decoration-color: currentColor; }

/* 24px side padding like every other tile, so text edges line up with the tiles below; 20px only
   where cells get tight: tiles with three groups or five and more cells under 1040px, any tile under 900px */
@container (max-width: 1040px) {
  .sumt:has(.sumt__group:nth-child(3), .sumt__cell:nth-child(5 of .sumt__cell)) :is(.sumt__head, .sumt__cell) { padding-inline: 20px; }
  .sumt:has(.sumt__group:nth-child(3), .sumt__cell:nth-child(5 of .sumt__cell)) .sumt__cell--btn.is-on::after { left: 20px; right: 20px; }
}
@container (max-width: 899px) {
  .sumt__head, .sumt__cell { padding-inline: 20px; }
  .sumt__cell--btn.is-on::after { left: 20px; right: 20px; }
}
@container (max-width: 760px) {
  .sumt__grid { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: none; }
  .sumt__group { grid-column: 1 / -1; grid-row: auto; grid-template-rows: auto; grid-auto-rows: auto; }
  .sumt__group + .sumt__group { border-left: 0; border-top: 1px solid var(--mg-hair); }
  .sumt__head { grid-row: auto; }
  .sumt__cell { grid-row: auto / span 4; padding-bottom: 18px; }
  .sumt__cell + .sumt__cell { border-left: 0; }
  .sumt__cell:nth-child(even of .sumt__cell) { border-left: 1px solid var(--mg-hair); }
  .sumt__cell:nth-child(n+3 of .sumt__cell) { border-top: 1px solid var(--mg-hair); }
  .sumt__cell:last-child:nth-child(odd of .sumt__cell),
  .sumt__cell--2 { grid-column: 1 / -1; border-left: 0; }
}

/* ── Phone fold of an overview tile (.sumt on Deals, .stmt on the Dashboard) ───
   DealList.foldHtml() puts the button first inside the tile; folded, only the button shows. */
.ovw-fold { display: none; }
@media (max-width: 640px) {
  .ovw-fold { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 0 20px; background: none; border: 0;
    border-radius: 0; font: 600 14px/1.3 var(--mg-sans); color: var(--mg-ink); text-align: left; cursor: pointer; }
  .ovw-fold__sum { flex: 1 1 auto; min-width: 0; font-weight: 400; color: var(--mg-ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ovw-fold .ic { flex: none; width: 16px; height: 16px; color: var(--mg-ink-3); transition: transform .15s; }
  .ovw-fold[aria-expanded="true"] .ic { transform: rotate(180deg); }
  .mg-tile.is-folded > :not(.ovw-fold) { display: none; }
  .mg-tile:not(.is-folded) > .ovw-fold { border-bottom: 1px solid var(--mg-hair); }
}

/* ── Filter bar ──────────────────────────────────────────────────────────────
   Two rows, the same on every list page: filter pills first (they wrap), then
   the tools: search and selects on the left, the count and the view switch
   held to the right. Nothing is cut off at any width.
   <div class="fbar">
     <div class="pills fbar__pills" role="group" aria-label="…">…pills…</div>
     <div class="fbar__tools">
       <label class="search">…</label> <button class="select">…</button>
       <div class="fbar__end"><span class="fbar__count">8 deals · latest activity first</span><div class="seg seg--icons">…</div></div>
     </div>
   </div>                                                                   */
.fbar { display: grid; gap: 12px; min-width: 0; }
.fbar__pills { min-width: 0; }
.fbar__pills .pill .ic { width: 14px; height: 14px; color: var(--mg-ink-3); }
.fbar__sep { width: 1px; height: 20px; margin: 0 4px; background: rgba(25, 25, 24, 0.14); }
.fbar__tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.fbar__tools .search { flex: 1 1 272px; width: auto; min-width: 272px; max-width: 300px; height: 36px; }   /* never narrower than its placeholder */
.fbar__tools .search > span { white-space: nowrap; }
.fbar__tools .select { flex: 0 1 150px; height: 36px; min-width: 140px; gap: 12px; font-size: 14px; }
.fbar__end { display: flex; align-items: center; gap: 12px; margin-left: auto; min-width: 0; }
.fbar__count { font: 400 13px/1 var(--mg-sans); color: var(--mg-ink-3); white-space: nowrap; }
@media (max-width: 760px) { .fbar__tools .search { width: 100%; } .fbar__tools .select { flex: 1 1 140px; min-width: 0; } }

/* ── Top bar: the current crumb is never cut; the search box gives way ───── */
.df-topbar .crumbs { flex: none; }
.df-topbar .tb-search { flex: 0 1 300px; width: auto; min-width: 224px; }

/* ── Tables: first and last columns line up with the tile's 24px padding ── */
.tbl th:first-child, .tbl td:first-child { padding-left: 24px; }
.tbl th:last-child, .tbl td:last-child { padding-right: 24px; }

/* ── Tabs (Template Detail, Settings) ─────────────────────────────────────── */
.tabs { display: flex; gap: 28px; border-bottom: 1px solid rgba(25, 25, 24, 0.1); margin: 0 0 20px; }
.tab { display: inline-flex; align-items: center; gap: 7px; height: 42px; padding: 0; margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent; background: none; font: 500 14px/1 var(--mg-sans); color: var(--mg-ink-3); cursor: pointer; white-space: nowrap; }
.tab.is-on { color: var(--mg-ink); font-weight: 600; border-bottom-color: var(--mg-ink); }
.tab__n { font-weight: 500; color: var(--mg-ink-3); font-variant-numeric: tabular-nums; }

/* ── Summary tile, additions ──────────────────────────────────────────────── */
/* A label with an info button: the button stays with the last word when the label wraps.
   Markup: Diligence <span class="nw">coverage<button class="info" …>…</button><span class="tip" …>…</span></span> */
.nw { white-space: nowrap; }
.lbl .has-tip { display: block; }
.lbl .has-tip .info { display: inline-grid; vertical-align: middle; margin: -4px -1px -4px 5px; }
/* A second line under a note (Deal Data Room, Firm Library) */
.sumt__note .sub { display: block; margin-top: 6px; text-wrap: pretty; }

/* Six figures in one group, three to a band when the tile is under 1000px (ModelIQ).
   <section class="mg-tile sumt sumt--bands"> … one .sumt__group style="--n: 6" … */
.sumt--bands .sumt__grid { overflow: hidden; }
@container (max-width: 999px) {
  .sumt--bands .sumt__grid { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: none; }
  .sumt--bands .sumt__group { grid-column: 1 / -1; grid-row: auto; grid-template-rows: auto; grid-auto-rows: auto; }
  .sumt--bands .sumt__cell { grid-row: auto / span 4; padding-bottom: 18px; box-shadow: -1px 0 0 var(--mg-hair), 0 -1px 0 var(--mg-hair); }
  .sumt--bands .sumt__grid .sumt__cell:nth-child(n of .sumt__cell) { border-left: 0; border-top: 0; grid-column: auto; }
}
@container (max-width: 479px) {
  .sumt--bands .sumt__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Coverage band inside a summary tile, under its figures (Deal Data Room, Firm Library): the legend
   on the left, the coverage list (one row per section: number, name, one square per category) on the
   right. Scoped to .sumt because the Deal Hub has its own, different .cov list.
   <div class="cov"><div class="cov__side">…<div class="cov__keys">…</div></div>
     <div class="cov__plot"><div class="covlist" role="list"><a class="covlist__row" href="#"><span class="covlist__n">1</span>
       <span class="covlist__t">Name</span><span class="covlist__sq"><i class="sq"></i>…</span></a>…</div></div></div> */
.sumt .cov { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); border-top: 1px solid var(--mg-hair); }
.sumt .cov__side { min-width: 0; padding: 22px 24px 24px; }
.sumt .cov__head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; }
.sumt .cov__keys { display: grid; gap: 8px; margin-top: 18px; font: 400 13px/1.2 var(--mg-sans); color: var(--mg-ink-2); }
.sumt .cov__keys span { display: grid; grid-template-columns: 12px 22px minmax(0, 1fr); align-items: center; column-gap: 8px; }
.sumt .cov__keys b { font-weight: 600; color: var(--mg-ink); font-variant-numeric: tabular-nums; text-align: right; }
.sumt .cov__plot { min-width: 0; padding: 24px; border-left: 1px solid var(--mg-hair); }
.sumt .cov__plot { container: covplot / inline-size; }
/* Coverage legend swatches and the coverage list: one row per section (number, name, one square per category) */
.key { display: inline-block; flex: none; width: 12px; height: 12px; border-radius: 4px; background: var(--mg-graph); }
.key--p { background: var(--mg-gold); }
.key--e { background: transparent; box-shadow: inset 0 0 0 1.5px rgba(25, 25, 24, 0.38); }
.covlist { --rows: 4; --col: 264px; display: grid; grid-template-rows: repeat(var(--rows), auto); grid-auto-flow: column; grid-auto-columns: minmax(0, var(--col)); gap: 4px 24px; align-content: start; margin-top: -8px; }
.covlist__row { display: grid; grid-template-columns: 16px minmax(0, 1fr) 68px; align-items: center; column-gap: 6px; min-height: 32px; padding: 0 4px; border-radius: 6px; text-decoration: none; color: inherit; }
.covlist__row:hover { background: var(--mg-hover); }
.covlist__n { font: 500 12px/1 var(--mg-sans); color: var(--mg-ink-3); font-variant-numeric: tabular-nums; }
.covlist__t { font: 500 13px/1.25 var(--mg-sans); color: var(--mg-ink); overflow-wrap: anywhere; text-wrap: balance; }
.covlist__sq { display: flex; gap: 4px; }
.covlist .sq { display: block; width: 14px; height: 14px; border-radius: 4px; background: var(--mg-graph); }
.covlist .sq--p { background: var(--mg-gold); }
.covlist .sq--e { background: transparent; box-shadow: inset 0 0 0 1.5px rgba(25, 25, 24, 0.38); }
@container (max-width: 899px) { .sumt .cov__side, .sumt .cov__plot { padding-inline: 20px; } }
@container (max-width: 760px) {
  .sumt .cov { grid-template-columns: minmax(0, 1fr); }
  .sumt .cov__side { padding-bottom: 6px; }
  .sumt .cov__plot { border-left: 0; padding-block: 14px 22px; }
  .sumt .cov__keys { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 14px; }
}

/* ── Filter bar, additions ────────────────────────────────────────────────── */
.fbar { container-type: inline-size; }
.fbar__pills { gap: 6px; }
.fbar__pills .pill { padding: 0 11px; gap: 6px; }
/* When the count and view switch wrap under the search and selects, they take the whole row:
   count on the left, switch on the right */
/* When search, selects and the end group cannot share one row (about 1010px), the end group takes
   a row of its own: a toggle on the left, the count and view switch on the right */
@container (max-width: 1010px) {
  .fbar__tools:has(.select) > .fbar__end { flex: 1 1 100%; justify-content: space-between; margin-left: 0; }
}
/* A toggle that is not one of the pills' kind (Archived on Deals) sits in .fbar__end before the
   count and view switch, which are grouped in .fbar__view so the toggle can stand apart */
.fbar__view { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.fbar__end > .pill .ic { width: 14px; height: 14px; color: var(--mg-ink-3); }
.fbar__tools .pill { height: 36px; padding: 0 11px; gap: 6px; }
.fbar__tools .seg__btn { height: 30px; }   /* the switch is 3 + 30 + 3 = 36px, like the search and selects */

/* ── Development tile (DealScout, Buyer Q&A, ModelIQ) ────────────────────────
   What the module will do (left), where its output will land (a well, right),
   and what to use today (a tinted footer band).
   <section class="mg-tile dev"><div class="dev__grid"><div class="dev__what">…<ol class="plan">…</ol></div>
     <figure class="where">…</figure></div><div class="today">…<a class="dev-file">…</a></div></section> */
.dev-title { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.dev-chip { display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 11px; border-radius: 999px; background: #fff; box-shadow: inset 0 0 0 1px rgba(25, 25, 24, 0.14); font: 500 12px/1 var(--mg-sans); color: var(--mg-ink-2); white-space: nowrap; }
.dev-chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--mg-neutral-dot); }
.dev { overflow: hidden; display: flex; flex-direction: column; container-type: inline-size; }
.dev__grid { display: grid; grid-template-columns: 412px minmax(0, 1fr); align-items: stretch; }
.dev__what { display: flex; flex-direction: column; padding: 24px; min-width: 0; }
.dev__lede { margin-top: 12px; max-width: 760px; font: 400 16px/1.6 var(--mg-sans); color: var(--mg-ink-2); }
.dev .plan { list-style: none; margin: 22px 0 0; padding: 0; display: flex; flex-direction: column; flex: 1; }
.dev .plan > li { display: grid; grid-template-columns: 42px minmax(0, 1fr); padding: 17px 0 18px; border-top: 1px solid var(--mg-hair); }
.dev .plan > li:last-child { padding-bottom: 0; }
.dev .plan__n { font: 400 22px/1 var(--mg-serif); font-variant-numeric: lining-nums; color: var(--mg-ink-2); padding-top: 1px; }
.dev .plan h3 { font: 600 15px/1.35 var(--mg-sans); letter-spacing: -0.005em; }
.dev .plan p { margin-top: 6px; font: 400 14px/1.55 var(--mg-sans); color: var(--mg-ink-2); }
.dev .plan p em { font-style: normal; font-weight: 500; color: var(--mg-ink); }
.where { margin: 0; display: flex; flex-direction: column; gap: 16px; padding: 24px; background: var(--mg-floor-deep); box-shadow: inset 0 1px 2px rgba(25, 25, 24, 0.08), inset 1px 0 0 rgba(25, 25, 24, 0.06); }
.where > * { width: 100%; max-width: 660px; align-self: center; }
.where__cap { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 2px 16px; }
.where__note { margin-top: auto; display: flex; gap: 9px; align-items: flex-start; font: 400 13px/1.5 var(--mg-sans); color: var(--mg-ink-2); }
.where__note .ic { width: 14px; height: 14px; margin-top: 3px; color: var(--mg-ink-3); }
.where__note--cap { margin-top: -2px; }
.where__note--cap + .dist { margin-top: auto; }
.today { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 18px 20px; padding: 18px 24px; background: var(--mg-tint); border-top: 1px solid var(--mg-hair); }
.today p { margin-top: 3px; font: 400 14px/1.5 var(--mg-sans); color: var(--mg-ink-2); }
.dev-file { display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 10px; background: #fff; border: 1px solid var(--mg-edge); border-radius: var(--mg-r-ctl); box-shadow: 0 1px 2px rgba(25, 25, 24, 0.05); text-decoration: none; color: var(--mg-ink); min-width: 0; }
.dev-file__ic { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: var(--mg-r-ctl); background: var(--mg-tint); box-shadow: inset 0 0 0 1px rgba(25, 25, 24, 0.1); color: var(--mg-ink-2); }
.dev-file__t { display: flex; flex-direction: column; min-width: 0; }
.dev-file__t b { font: 500 13px/1.3 var(--mg-sans); overflow-wrap: anywhere; }
.dev-file__t span { font: 400 12px/1.35 var(--mg-sans); color: var(--mg-ink-3); }
@container (max-width: 1099px) {
  .dev__grid { grid-template-columns: minmax(0, 1fr); }
  .where { box-shadow: inset 0 1px 2px rgba(25, 25, 24, 0.08), inset 0 1px 0 rgba(25, 25, 24, 0.06); }
  .today { grid-template-columns: minmax(0, 1fr) auto; }
  .today > div { grid-column: 1 / -1; }
  .dev-file { justify-self: start; }
}
@container (min-width: 880px) and (max-width: 1099px) {
  .dev .plan { flex-direction: row; flex: none; }
  .dev .plan > li { display: block; flex: 1 1 0; min-width: 0; padding: 17px 28px 0 0; }
  .dev .plan > li + li { padding-left: 28px; border-left: 1px solid var(--mg-hair); }
  .dev .plan > li:last-child { padding-right: 0; }
  .dev .plan__n { display: block; margin-bottom: 10px; padding-top: 0; }
}

/* ── File name cell (Deal Data Room, Firm Library, error states) ─────────────
   One line per file. When the name does not fit, the middle is cut and the end
   (date, version, extension) stays readable: ABC_Audited_Financial_St…FY2023.pdf.
   The full name is in the title attribute.
   <div class="fname"><span class="fname__ic">…</span><span class="fname__t">
     <b title="ABC_Audited_Financial_Statements_FY2023.pdf"><span class="fname__stem">ABC_Audited_Financial_Statements_</span><span class="fname__tail">FY2023.pdf</span></b>
     <span>2.1 Audited financial statements</span></span></div>                 */
.fname { display: flex; align-items: center; gap: 10px; min-width: 0; }
.fname__ic { display: grid; place-items: center; width: 32px; height: 36px; flex: none; border-radius: var(--mg-r-ctl); background: #fff; box-shadow: inset 0 0 0 1px rgba(25, 25, 24, 0.12), 0 1px 2px rgba(25, 25, 24, 0.05); color: var(--mg-ink-2); }
.fname__ic .ic { width: 16px; height: 16px; }
.fname__t { min-width: 0; flex: 1; }
.fname__t b { display: flex; min-width: 0; font: 500 14px/1.3 var(--mg-sans); color: var(--mg-ink); white-space: nowrap; }
.fname__stem { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.fname__tail { flex: none; }
.fname__t > span { display: block; margin-top: 3px; font: 400 12px/1.35 var(--mg-sans); color: var(--mg-ink-3); }

/* ── Summary tile: one row of up to three short cells, even under 760px ─────
   (Audit Trail event band, the data room summary inside Buyer Q&A's well)
   <section class="mg-tile sumt sumt--row"> … */
@container (max-width: 760px) {
  .sumt--row .sumt__grid { grid-auto-flow: column; grid-template-columns: none; grid-template-rows: auto auto auto auto auto; }
  .sumt--row .sumt__group { grid-column: span var(--n, 1); grid-row: 1 / span 5; grid-template-rows: subgrid; }
  .sumt--row .sumt__cell { grid-row: 2 / span 4; padding-bottom: 22px; }
  .sumt--row .sumt__cell + .sumt__cell { border-left: 1px solid var(--mg-hair); }
  .sumt--row .sumt__cell:nth-child(n+3 of .sumt__cell) { border-top: 0; }
  .sumt--row .sumt__cell:last-child:nth-child(odd of .sumt__cell) { grid-column: auto; border-left: 1px solid var(--mg-hair); }
  .sumt--row .sumt__cell--2:last-child:nth-child(odd of .sumt__cell) { grid-column: span 2; }
}

/* ── Typesetting: no lone last words ────────────────────────────────────────
   Headings break into lines of similar length; running text avoids a single
   word on its last line. */
h1, h2, h3, h4 { text-wrap: balance; }
p, li, dd, td, th, figcaption { text-wrap: pretty; }

/* ── Dot-separated list (notes, footers): a wrapped line never starts or ends
   with a dot. <span class="dotlist"><span>6&nbsp;working</span> <span><span class="dot">·</span> 4&nbsp;final</span> …</span> */
.dotlist { display: inline-flex; flex-wrap: wrap; column-gap: 12px; clip-path: inset(0); }
.dotlist > span { position: relative; white-space: nowrap; }
.dotlist .dot { position: absolute; top: 0; left: -8px; }

/* Document tile titles break into lines of similar length; table heads keep tabular figures
   (the font shorthand on .tbl th resets them) */
.rpt-tile__title { text-wrap: balance; }
.tbl th { font-variant-numeric: tabular-nums; }

/* ==========================================================================
   Magnum app additions (not part of the handoff stylesheet above)
   Self-hosted faces for the --mg-sans / --mg-serif families, then the
   round-1 body.mg-app-ui layer that keeps not-yet-rebuilt pages on the
   same palette. Rebuilt pages use the handoff classes above; drop the
   matching legacy rules here as each page is rebuilt.
   ========================================================================== */
@font-face { font-family: 'Inter'; src: url('/fonts/inter-variable.ttf') format('truetype'); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Newsreader'; src: url('/fonts/newsreader-variable.ttf') format('truetype'); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: 'Newsreader'; src: url('/fonts/newsreader-italic-variable.ttf') format('truetype'); font-weight: 200 800; font-style: italic; font-display: swap; }

body.mg-app-ui {
  --mg-quiet: #555550;
  --mg-tint: #fafaf7;
  --mg-line: rgba(25,25,24,.10);
  --mg-shadow: 0 1px 1px rgba(25,25,24,.03), 0 2px 6px -2px rgba(25,25,24,.06), 0 14px 28px -18px rgba(25,25,24,.16);
  --df-bg-deepest: #ffffff;
  --df-bg-base: #ffffff;
  --df-bg-surface: #ffffff;
  --df-bg-elevated: #fafaf7;
  --df-bg-hover: #f1f1ec;
  --df-bg-light: #fafaf7;
  --df-bg-white: #ffffff;
  --df-bg-light-warm: #f1f1ec;
  --df-bg-cream: #fafaf7;
  --df-text-primary: #191918;
  --df-text-secondary: #33322f;
  --df-text-tertiary: #555550;
  --df-text-muted: #555550;
  --df-border: rgba(25,25,24,.14);
  --df-border-light: rgba(25,25,24,.08);
  --df-border-2: rgba(25,25,24,.14);
  --df-border-3: rgba(25,25,24,.22);
  --df-accent-text: #8a5e08;
  --df-accent-dim: #8a5e08;
  --df-blue-dim: #8a5e08;
  --df-blue-deep: #8a5e08;
  --df-font-body: var(--mg-sans);
  --df-font-display: var(--mg-sans);
  --df-font-headline: var(--mg-serif);
  --df-text-nano: 12px;
  --df-text-micro: 12px;
  --df-text-small: 14px;
  --df-sidebar-width: 250px;
  --df-topbar-height: 56px;
  --df-radius: 6px;
  --df-radius-sm: 4px;
  --df-radius-md: 12px;
  color: #191918;
  background: #fff;
  font-family: var(--mg-sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
/* Reset local palette copies on the shell, retaining the legacy layout engine. */
.mg-app-ui :is(.df-main, .df-topbar) {
  --df-bg-deepest: #fff;
  --df-bg-base: #fff;
  --df-bg-surface: #fff;
  --df-bg-elevated: #fafaf7;
  --df-bg-hover: #f1f1ec;
  --df-bg-light: #fafaf7;
  --df-bg-white: #fff;
  background: #fff;
}
.mg-app-ui .df-main { min-width: 0; }
.mg-app-ui .df-content { min-width: 0; padding: 32px 40px 56px; }
.mg-app-ui .df-sidebar { background: var(--mg-paper); border-color: var(--mg-line); }
.mg-app-ui :is(.df-user-menu__avatar, .df-org-avatar, .df-org-item__avatar) { background: #555550; color: #fff; }
.mg-app-ui .df-topbar { padding-inline: 40px; border-color: var(--mg-line); }
.mg-app-ui .df-topbar__left { min-width: 0; }
.mg-app-ui .df-topbar__breadcrumb { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mg-app-ui .df-page-header { margin-bottom: 28px; }
.mg-app-ui :is(.df-page-header__title, .cs-title) { font-family: var(--mg-serif); font-size: 38px; font-weight: 400; letter-spacing: -.018em; line-height: 1.12; }
.mg-app-ui .df-page-header__subtitle { margin-top: 8px; font-size: 14px; line-height: 1.5; }
.mg-app-ui :is(.df-btn, .dc-btn, .dash-action, .mg-tb-btn, .dtile-pill, .td-tab, .s-tab, .vdr-tab) { font-family: var(--mg-sans); }
.mg-app-ui :is(.df-btn, .dc-btn, .dash-action) { min-height: 34px; border-radius: 6px; font-size: 14px; font-weight: 500; }
.mg-app-ui :is(.df-btn--primary, .dc-btn--primary, .dash-action--primary, .gen-run-btn) { background: #191918; border-color: #191918; color: #fffef2; box-shadow: 0 1px 2px rgba(25,25,24,.15); }
.mg-app-ui :is(.df-btn--primary, .dc-btn--primary, .dash-action--primary, .gen-run-btn):hover:not(:disabled) { background: #33322f; border-color: #33322f; color: #fffef2; }
.mg-app-ui :is(.df-btn--primary, .dc-btn--primary, .dash-action--primary) > i { color: #fcaa2d; }
.mg-app-ui :is(button, input, select, textarea):focus-visible { outline: 2px solid #8a5e08; outline-offset: 3px; }
.mg-app-ui :is(.df-btn, .dc-btn, .dash-action):disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.mg-app-ui :is(.df-input, .df-select, .cs__trigger, .dtile-search, .mg-select__btn) { min-height: 36px; border-radius: 6px; font-size: 14px; }
.mg-app-ui :is(.df-card, .dash-kpi, .dh-artifact, .dh-summary, .cs-card, .s-panel, .org-lib-stat, .tpl-card) { background: #fff; border: 1px solid var(--mg-line); border-radius: 12px; box-shadow: var(--mg-shadow); min-width: 0; }
.mg-app-ui .dash-kpi { padding: 22px 24px; }
.mg-app-ui :is(.dash-kpi__label, .dash-kpi__sub, .org-lib-stat__label, .dh-kpi__label) { font-size: 12px; text-transform: none; letter-spacing: 0; }
.mg-app-ui :is(.dash-kpi__val, .org-lib-stat__val, .dh-kpi__val) { font: 400 38px/1.15 var(--mg-serif); font-variant-numeric: tabular-nums; }
.mg-app-ui .dash-actions { flex-wrap: wrap; }
.mg-app-ui :is(.dash-head__title, .dh-summary__title) { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }

/* Shared deal cards retain all progress, shortcuts, team and creator metadata. */
.mg-app-ui .dtile-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 24px; }
.mg-app-ui .dtile { border: 1px solid var(--mg-line); border-radius: 12px; box-shadow: var(--mg-shadow); }
.mg-app-ui .dtile:hover { transform: translateY(-2px); border-color: rgba(25,25,24,.2); box-shadow: 0 2px 4px rgba(25,25,24,.04), 0 20px 40px -18px rgba(25,25,24,.22); }
.mg-app-ui .dtile-accent { display: none; }
.mg-app-ui .dtile-body { padding: 22px 24px 18px; }
.mg-app-ui .dtile-header { gap: 10px; margin-bottom: 16px; }
.mg-app-ui .dtile-avatar { width: 36px; height: 36px; border: 1px solid var(--mg-line); border-radius: 8px; background: #f1f1ec !important; color: #555550; font-size: 12px; font-weight: 500; }
.mg-app-ui .dtile--doc .dtile-avatar i { color: #555550; }
.mg-app-ui .dtile:not(.dtile--doc) .dtile-name { font: 400 27px/1.1 var(--mg-serif); letter-spacing: -.015em; }
.mg-app-ui .dtile-title-block { min-width: 0; }
.mg-app-ui .dtile-subtitle { font-size: 12px; color: #555550; }
.mg-app-ui .dtile-status-tag { background: #f5f5f1 !important; color: #555550 !important; border: 1px solid var(--mg-line); font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; padding: 3px 8px; }
.mg-app-ui .dtile:not(.dtile--doc) .dtile-status-tag { margin-left: 46px; }
.mg-app-ui .dtile-ev { font: 400 32px/1.2 var(--mg-serif); font-variant-numeric: tabular-nums; }
.mg-app-ui :is(.dtile-ev-range, .dtile-metric__label, .dtile-detail-header span:first-child, .dtile-detail-badge, .dtile-team-name, .dtile-foot-tag, .dtile-meta, .dtile-link, .dtile-context-strip__author, .dtile-context-strip__chip, .dtile-style-tag, .dtile-layout-tag) { font-size: 12px; text-transform: none; letter-spacing: 0; }
.mg-app-ui .dtile-metric { padding: 10px 8px; background: #fafaf7; }
.mg-app-ui .dtile-metric__label { line-height: 1.4; }
.mg-app-ui .dtile-metric__value { font-size: 15px; font-weight: 600; }
.mg-app-ui .dtile-detail-header { background: #fafaf7; }
.mg-app-ui .dtile-team-avatar { background: #555550 !important; color: #fff; font-size: 12px; font-weight: 500; }
.mg-app-ui .dtile-team-avatar--more { background: #f5f5f1 !important; color: #555550; }
.mg-app-ui .dtile-foot { background: #fafaf7; flex-wrap: wrap; gap: 8px 12px; padding: 12px 24px; }
.mg-app-ui .dtile-link { color: #8a5e08; }
.mg-app-ui .dtile--doc .dtile-name { font-family: var(--mg-sans); font-weight: 600; }
.mg-app-ui .dtile--doc .dtile-foot__actions { opacity: 1; }
.mg-app-ui .dtile-foot__action { min-height: 28px; font-size: 12px; }
.mg-app-ui .dtile-filter-label { font-size: 12px; text-transform: none; letter-spacing: 0; }
.mg-app-ui .dtile-pill { min-height: 36px; font-size: 12px; border-radius: 6px; color: #555550 !important; border-color: var(--df-border) !important; background: #fff !important; }
.mg-app-ui .dtile-pill.is-active { background: #191918 !important; border-color: #191918 !important; color: #fffef2 !important; }
.mg-app-ui .dtile-pill__count { font-size: 12px; opacity: 1; }
.mg-app-ui .dtile-stage-header { border-color: var(--mg-line); }

/* Deal hub: code first, company second; edit and team controls remain in place. */
.mg-app-ui .dh-hero { padding-top: 0; }
.mg-app-ui .dh-hero__top { gap: 24px; flex-wrap: wrap; }
.mg-app-ui .dh-hero__info { min-width: 0; }
.mg-app-ui .dh-hero__code { font: 400 44px/1.1 var(--mg-serif); letter-spacing: -.02em; text-transform: none; color: #191918; margin-bottom: 8px; overflow-wrap: anywhere; }
.mg-app-ui .dh-hero__target { font: 400 18px/1.4 var(--mg-sans); margin-bottom: 14px; overflow-wrap: anywhere; }
.mg-app-ui .dh-hero__meta { flex-wrap: wrap; gap: 10px 16px; font-size: 13px; }
.mg-app-ui :is(.dh-hero__audit, .dh-hero__tag, .dh-artifact__type, .dh-artifact__meta) { font-size: 12px; letter-spacing: 0; text-transform: none; }
.mg-app-ui .dh-hero__tag--stage { background: #f5f5f1; color: #555550; border: 1px solid var(--mg-line); }
.mg-app-ui .dh-hero__avatar { background: #555550 !important; color: #fff; font-size: 12px; }
.mg-app-ui .dh-artifacts { gap: 20px; }
.mg-app-ui .dh-artifact { padding: 22px; }
.mg-app-ui .dh-artifact__icon { background: #fafaf7; color: #555550; border: 1px solid var(--mg-line); border-radius: 8px; }
.mg-app-ui .dh-artifact__title { font-size: 16px; font-weight: 600; }
.mg-app-ui :is(.dh-summary, .dh-artifact):hover { border-color: var(--df-border); box-shadow: var(--mg-shadow); }

/* Detail reader chrome only. No selector enters report frames, slides or source HTML. */
.mg-app-ui .df-editor-toolbar { background: #fff; min-height: 56px; border-color: var(--mg-line); gap: 12px; padding-inline: 24px; }
.mg-app-ui .df-editor-toolbar__doc-name { font-family: var(--mg-serif); font-size: 23px; font-weight: 400; }
.mg-app-ui .df-editor-toolbar__doc-sub { font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; color: #555550; }
.mg-app-ui .mg-tb-group { height: 34px; border-radius: 6px; background: #fff; }
.mg-app-ui .mg-tb-group > .is-first { border-top-left-radius: 6px; border-bottom-left-radius: 6px; }
.mg-app-ui .mg-tb-group > .is-last { border-top-right-radius: 6px; border-bottom-right-radius: 6px; }
.mg-app-ui .mg-tb-group :is(.mg-tb-btn, .df-editor-toolbar__export) { font-size: 12px; padding-inline: 11px; }
.mg-app-ui .mg-tb-group .mg-tb-btn--primary { background: #191918; color: #fffef2; }
.mg-app-ui :is(.dk-memo-savestate, .mg-layout-chip, .mg-version-menu__head, .mg-slides-head, .df-editor-sidebar__title) { font-size: 12px; text-transform: none; letter-spacing: 0; }
.mg-app-ui .df-editor-sidebar { background: #fafaf7; border-color: var(--mg-line); }
.mg-app-ui :is(.df-editor-section, .df-editor-section__title) { font-size: 12px; }
.mg-app-ui :is(.dk-memo-history, .dk-memo-ai) { background: #fff; border-color: var(--mg-line); }
.mg-app-ui :is(.dk-memo-ai__head, .dk-memo-history__head) { background: #fff; border-color: var(--mg-line); }
.mg-app-ui :is(.dk-memo-ai__title, .dk-memo-history__title) { font-size: 14px; font-weight: 600; }
.mg-app-ui :is(.dk-memo-ai__input, .dk-src-panel__title-text, .mg-drawer-tabs button, .dk-memo-history__item) { font-size: 12px; }
.mg-app-ui .dk-memo-ai__composer { border-radius: 8px; }
.mg-app-ui :is(.mg-more-menu, .mg-version-menu) { border-radius: 8px; box-shadow: var(--mg-shadow); }

/* Template details keep panel height/scroll ownership with the existing controllers. */
.mg-app-ui .td-header { gap: 20px; flex-wrap: wrap; }
.mg-app-ui .td-tabs { gap: 12px; }
.mg-app-ui .td-tab { font-size: 14px; font-weight: 500; padding: 12px 14px; }
.mg-app-ui :is(.td-chip, .td-tab__count, .td-viewer__mod, .td-seg button, .td-slides__meta) { font-size: 12px; letter-spacing: 0; text-transform: none; }
.mg-app-ui .td-viewer { border-radius: 12px; box-shadow: var(--mg-shadow); }
.mg-app-ui .td-viewer__bar { background: #fafaf7; min-height: 44px; }
.mg-app-ui .td-seg { border-radius: 6px; }
.mg-app-ui .td-seg button { min-height: 32px; }
.mg-app-ui .td-seg button.active { background: #191918; color: #fffef2; font-weight: 500; }
.mg-app-ui .td-slides__row { border-radius: 8px; background: #fff; padding: 12px; }
.mg-app-ui .td-viewer__text { font-size: 12px; }

/* Current compose, data room, library, settings and dense admin surfaces. */
.mg-app-ui :is(.cs-eyebrow, .cs-deal-pick__label, .cs-card__meta, .cs-card__title, .cs-card__note, .cs-scope, .cs-stepper__label) { font-size: 12px; letter-spacing: 0; text-transform: none; }
.mg-app-ui .cs-card__head { background: #fafaf7; }
.mg-app-ui :is(.cs-card, .cs-tray) { border-color: var(--mg-line); border-radius: 12px; }
.mg-app-ui :is(.vdr-dd-bar, .vdr-tree, .vdr-files, .dc-tree) { border-color: var(--mg-line); border-radius: 12px; background: #fff; }
.mg-app-ui :is(.vdr-folder__header, .vdr-file) { font-size: 12px; }
.mg-app-ui :is(.vdr-dd-bar__pct, .vdr-dd-bar__stat .stat-pending) { color: #8a5e08; }
.mg-app-ui :is(.vdr-tab__badge, .dc-tab__badge, .dc-row__id, .dc-row__code) { font-size: 12px; }
.mg-app-ui :is(.dc-row--top, .vdr-files__header, .s-table th) { text-transform: none; letter-spacing: 0; font-size: 12px; background: #fafaf7; }
.mg-app-ui :is(.s-tab, .vdr-tab, .dc-tab) { min-height: 44px; font-size: 14px; font-weight: 500; }
.mg-app-ui :is(.s-section-badge, .s-tab-badge, .s-member-role, .s-member-meta) { font-size: 12px; text-transform: none; letter-spacing: 0; }
.mg-app-ui :is(.avatar-circle, .wiz-team-avatar, .s-member-avatar) { background: #555550 !important; color: #fff; }
.mg-app-ui .s-panel { padding: 24px; }
.mg-app-ui :is(.df-user-menu, .df-org-popup, .df-cmd-palette, .df-modal, .share-modal) { background: #fff; border-color: var(--mg-line); border-radius: 12px; }
.mg-app-ui .at-root { --at-muted: #555550; --at-accent-deep: #8a5e08; }
.mg-app-ui :is(.at-orgs-group, .at-card .label, .at-card .err, .at-members-hdr, .at-orow .c, .at-hdr small) { font-size: 12px; text-transform: none; letter-spacing: 0; }
.mg-app-ui .at-card { border-radius: 8px; box-shadow: 0 1px 2px rgba(25,25,24,.03); }
.mg-app-ui .at-col { min-width: 0; }
.mg-app-ui .dc-tree { overflow-x: auto; }
.mg-app-ui .dc-row { min-width: 700px; }

/* Standalone account and authorized-share gates use explicit opt-in links. */
body.mg-auth-ui { --bg: #fff; --bg-warm: #fffef2; --bg-deep: #f1f1ec; --white: #fff; --text-4: #555550; --accent-deep: #8a5e08; --font-body: var(--mg-sans); --font-headline: var(--mg-serif); background: #fff; }
.mg-auth-ui :is(.brand, .brand-panel) { background: #fffef2; }
.mg-auth-ui .card { background: #fff; border: 1px solid var(--mg-line); border-radius: 12px; box-shadow: var(--mg-shadow); }
.mg-auth-ui :is(.headline, .bp-h1, .form-title, .ttl) { font-family: var(--mg-serif); font-weight: 400; letter-spacing: -.02em; }
.mg-auth-ui :is(.form-title, .ttl) { font-size: 30px; }
.mg-auth-ui :is(.eyebrow, .bp-kicker, .field-label, .badge, .brand-powered, .feature-info p, .demo-ctx-label, .bp-powered) { font-size: 12px; text-transform: none; letter-spacing: 0; }
.mg-auth-ui :is(.eyebrow, .bp-kicker) { color: #8a5e08; }
.mg-auth-ui :is(.field-input, .field input, .btn-primary) { min-height: 44px; border-radius: 6px; font-size: 14px; }
.mg-auth-ui .btn-primary { background: #191918; border-color: #191918; color: #fffef2; }
.mg-auth-ui :is(.brand-deco, .brand-deco-2, .decor-c, .brand-glow) { display: none; }
.mg-auth-ui :is(.brand, .brand-panel)::before, .mg-auth-ui :is(.brand, .brand-panel)::after { background: none; }

@media (max-width: 1280px) {
  .mg-app-ui .df-content { padding: 28px 28px 48px; }
  .mg-app-ui .df-topbar { padding-inline: 28px; }
  .mg-app-ui .dtile-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .mg-app-ui .dh-artifacts { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 1100px) and (min-width: 761px) {
  .mg-app-ui .dash-kpis { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .mg-app-ui .at-layout { grid-template-columns: 210px 350px minmax(300px,1fr); }
  .mg-app-ui .at-root { overflow-x: auto; }
}
@media (max-width: 760px) {
  .mg-app-ui .df-sidebar:not(.mg-mobile-open) { display: none !important; }
  .mg-app-ui .df-app > .df-main { margin-left: 0 !important; width: 100%; }
  .mg-app-ui .df-content { padding: 24px 18px 40px; }
  .mg-app-ui .df-topbar { min-height: 56px; padding-inline: 8px 16px; gap: 8px; }
  .mg-app-ui .df-topbar__left { gap: 4px; }
  .mg-app-ui .df-topbar__right { gap: 8px; }
  .mg-app-ui :is(.df-page-header__title, .cs-title) { font-size: 32px; }
  .mg-app-ui :is(.df-page-header, .dash-head, .dh-hero__top, .td-header) { flex-wrap: wrap; gap: 16px; }
  .mg-app-ui .df-page-header__main { flex-basis: 100%; }
  .mg-app-ui .dtile-grid { grid-template-columns: minmax(0,1fr); gap: 18px; }
  .mg-app-ui .dash-kpis { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
  .mg-app-ui .dash-kpi { padding: 16px; }
  .mg-app-ui .dash-kpi__val { font-size: 32px; }
  .mg-app-ui :is(.df-btn, .dc-btn, .dash-action, .dtile-pill, .df-topbar__icon-btn, .dtile-foot__action) { min-height: 44px; }
  .mg-app-ui .dtile-filter-bar { align-items: stretch; }
  .mg-app-ui .dtile-search { width: 100%; max-width: none; min-height: 44px; }
  .mg-app-ui .dtile-body { padding: 20px; }
  .mg-app-ui .dtile-foot { padding-inline: 20px; }
  .mg-app-ui .dtile-context-strip { flex-wrap: wrap; }
  .mg-app-ui .dtile-context-strip__chips { flex-wrap: wrap; }
  .mg-app-ui .dh-hero__code { font-size: 38px; }
  .mg-app-ui .dh-artifacts, .mg-app-ui .dh-summaries { grid-template-columns: minmax(0,1fr); }
  .mg-app-ui .dh-summary--wide { grid-column: auto; }
  .mg-app-ui .dh-hero__top-right { flex-wrap: wrap; max-width: 100%; }
  .mg-app-ui :is(.s-tabs, .td-tabs, .vdr-tabs, .dc-tabs) { overflow-x: auto; flex-shrink: 0; }
  .mg-app-ui :is(.s-tab, .td-tab, .vdr-tab, .dc-tab) { flex-shrink: 0; white-space: nowrap; }
  .mg-app-ui .s-panel { padding: 18px; }
  .mg-app-ui .form-grid-2 { grid-template-columns: minmax(0,1fr); }
  .mg-app-ui .org-lib-stats { flex-wrap: wrap; }
  .mg-app-ui .org-lib-stat { flex-basis: 40%; min-width: 0; }
  .mg-app-ui .vdr-dd-bar { flex-wrap: wrap; gap: 12px; }
  .mg-app-ui .vdr-dd-bar__track { min-width: 80px; }
  .mg-app-ui .at-root { overflow: auto; }
  .mg-app-ui .at-layout { grid-template-columns: 210px 350px 360px; }
  .mg-app-ui .df-editor-toolbar { height: auto; min-height: 56px; padding: 6px 8px; flex-wrap: wrap; gap: 6px; }
  .mg-app-ui .df-editor-toolbar__right { min-width: 0; max-width: 100%; margin-left: auto; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
  .mg-app-ui .df-editor-toolbar__doc { display: none; }
  .mg-app-ui .mg-tb-group { height: 44px; max-width: 100%; }
  .mg-app-ui .mg-tb-group :is(.mg-tb-btn, .df-editor-toolbar__export) { padding-inline: 9px; min-width: 36px; }
  .mg-app-ui .dk-memo-fmtbar { flex-wrap: wrap; }
  .mg-app-ui .dk-memo-fmtbar .df-editor-toolbar__btn { min-height: 44px; min-width: 36px; }
  .mg-app-ui .td-slides__row { flex-wrap: wrap; }
  .mg-app-ui .td-slides__thumb { flex-basis: 120px; }
  .mg-auth-ui .page { grid-template-columns: minmax(0,1fr); }
  .mg-auth-ui .card { padding: 28px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .mg-app-ui *, .mg-app-ui *::before, .mg-app-ui *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Application labels and controls; miniature document covers remain untouched. */
.mg-app-ui :is(.dtile-stat__label, .dtile-section-title, .dtile-section-count, .dtile-empty-menu__hint,
  .wiz-section-label, .wiz-review-card__title, .cs-scope__k, .cs-tpl__type, .cs-tpl__tag,
  .cs-field__label, .cs-grp__name, .cs-phase__st, .cs-chip-draft, .cs-inside__h,
  .gen-bottom__context, .mg-dcard__type, .tpl-card__badge, .tpl-card__source, .tpl-engine,
  .tpl-edit-modal__label, .create-stat__label, .review-section, .mg-slides-head__title) {
  font-size: 12px; text-transform: none; letter-spacing: 0;
}
.mg-app-ui .dtile-stat__value { font: 400 32px/1.15 var(--mg-serif); color: #191918 !important; }
.mg-app-ui .dtile-stat { background: #fafaf7; padding: 18px; }
.mg-app-ui .dtile-filter-label { text-transform: none !important; }
.mg-app-ui .dtile:not(.dtile--doc) .dtile-name { font-size: 24px; }
.mg-app-ui :is(.dtile-section-dot, .dtile-stage-dot) { background: #555550 !important; }
.mg-app-ui :is(.dh-summary__link, .dash-head__link) { color: #8a5e08; }
.mg-app-ui .dh-artifact__btn { min-height: 34px; font-size: 12px; border-radius: 6px; font-weight: 500; }
.mg-app-ui .dh-artifact__btn--primary { background: #191918; color: #fffef2; }
.mg-app-ui .dh-artifact__btn--primary:hover { background: #33322f; }
.mg-app-ui .cs-tray { background: #fafaf7; }
.mg-app-ui .cs-card__title { font-size: 16px; }
.mg-app-ui :is(.cs-tpl__meta, .cs-tpl__desc, .cs-card__hint, .cs-phase__desc, .cs-tpl--ghost span, .gen-cat-pill__n) { font-size: 12px; }
.mg-app-ui .gen-cat-pill { font-size: 12px; border-radius: 6px; min-height: 32px; }
.mg-app-ui .gen-bottom__back, .mg-app-ui .gen-run-btn { border-radius: 6px; min-height: 34px; }
.mg-app-ui .sm-modal { background: #fff; border-color: var(--mg-line); border-radius: 12px; box-shadow: 0 16px 40px rgba(25,25,24,.16); max-height: calc(100dvh - 32px); overflow-y: auto; }
.mg-app-ui .sm-header { padding: 20px 24px; }
.mg-app-ui .sm-header h3 { font: 400 27px/1.2 var(--mg-serif); }
.mg-app-ui :is(.sm-dd-section, .sm-section-label, .sm-dd-tag, .sm-dd-org, .sm-dd-email, .sm-chip-ext-badge) { font-size: 12px; text-transform: none; letter-spacing: 0; }
.mg-app-ui .sm-chip-input, .mg-app-ui .sm-ls-select { border-radius: 6px; min-height: 36px; }
.mg-app-ui .sm-dd-avatar { background: #555550; font-size: 12px; }
.mg-app-ui .sm-invite-btn { background: #191918; color: #fffef2; border-radius: 6px; min-height: 34px; }
.mg-app-ui .sm-invite-btn:hover:not(:disabled) { background: #33322f; }
.mg-app-ui .sm-link-url { min-width: 0; }
@media (max-width: 760px) {
  .mg-app-ui :is(.sm-invite-btn, .sm-copy-btn, .sm-ls-select, .sm-close-btn, .dh-artifact__btn, .gen-cat-pill) { min-height: 44px; }
  .mg-app-ui .sm-action-row { flex-wrap: wrap; }
  .mg-app-ui .sm-body { padding: 20px; }
  .mg-app-ui .df-app.mg-is-deck .df-editor-layout { grid-template-columns: minmax(0,1fr); grid-template-rows: 142px minmax(0,1fr); }
  /* History and Sources hide the rail; their remaining document/drawer split
     occupies the full height until the existing controller closes the drawer. */
  .mg-app-ui .df-app.mg-is-deck.mg-history-open .df-editor-layout { grid-template-rows: minmax(0,1fr); }
  .mg-app-ui .df-app.mg-is-deck .df-editor-sidebar { max-height: 142px; border-bottom: 1px solid var(--mg-line); }
  .mg-app-ui .df-app.mg-is-deck #slidesList { flex-direction: row; gap: 12px; overflow: auto hidden; padding: 8px 12px; }
  .mg-app-ui .df-app.mg-is-deck .mg-slides-head { padding: 6px 14px; }
  .mg-app-ui .df-app.mg-is-deck .mg-deck-thumb { flex: 0 0 140px; grid-template-columns: 18px minmax(0,1fr); }
}
.mg-app-ui .mg-page-head { gap: 20px; flex-wrap: wrap; }
.mg-app-ui .mg-page-head > .df-page-header { min-width: 0; flex: 1 1 300px; }
.mg-app-ui .mg-page-head > :last-child { flex-shrink: 0; flex-wrap: wrap; }
.mg-app-ui :is(.dtile-style-tag, .dtile-layout-tag, .dtile-shared-tag, .dtile-versions-tag) { font-size: 12px !important; text-transform: none !important; letter-spacing: 0 !important; }
.mg-app-ui .dtile-context-strip__author .ini { background: #555550 !important; font-size: 12px; }
.mg-app-ui .dtile-section-title { color: #33322f !important; font-weight: 600; }
.mg-app-ui :is(.vdr-file__status, .vdr-file__badge, .vdr-file__date, .vdr-folder__count, .vdr-file__size, .mem-avatar, .chip, .product-card__tag, .of-table th) { font-size: 12px; text-transform: none; letter-spacing: 0; }
.mg-app-ui .mem-avatar { background: #555550 !important; color: #fff; }
.mg-app-ui .cs-page .cs-icon { background: #fafaf7; color: #555550; border: 1px solid var(--mg-line); }
.mg-auth-ui :is(.forgot-link, .signup-link a, .form-footer a, .headline em) { color: #8a5e08; }
@media (max-width: 760px) {
  .mg-app-ui .mg-page-head > .df-page-header { flex-basis: 100%; }
  .mg-app-ui .td-header > :first-child { flex-basis: 100%; }
  .mg-app-ui .org-lib-stat__val { font-size: 30px; }
}
@media (max-width: 760px) {
  /* Wrap the real deck tools onto another row instead of dropping zoom,
     Present or focus controls on phones. Visibility still follows [hidden]. */
  .mg-app-ui .df-editor-toolbar__right { flex: 1 1 260px; }
  .mg-app-ui #deckZoom:not([hidden]) { display: inline-flex !important; flex-wrap: wrap; }
  .mg-app-ui #fullscreenToggleBtn { display: flex !important; min-width: 44px; min-height: 44px; }
  .mg-app-ui :is(.mg-deck-zoom__btn, .mg-deck-nav__btn) { min-width: 34px; min-height: 44px; }
}

/* Functional document states stay distinct from neutral deal stages. */
.mg-app-ui .dtile--doc .dtile-status-tag[data-status="final"] { background: #f0f9f2 !important; color: #15803d !important; }
.mg-app-ui .dtile--doc .dtile-status-tag[data-status="error"] { background: #fdf2f1 !important; color: #b91c1c !important; }
.mg-app-ui .dtile--doc .dtile-status-tag:is([data-status="generating"], [data-status="in-review"]) { background: #fff8eb !important; color: #8a5e08 !important; }
.mg-app-ui :is(.vdr-view-toggle__btn, .vdr-status--extracted, .vdr-status--pending, .vdr-status--error, .vdr-status--stalled) { font-size: 12px; }
@media (max-width: 760px) {
  .mg-app-ui .vdr-view-toggle__btn { min-height: 44px; }
}
@media (max-width: 760px) {
  /* The organization chooser lives on body to escape sidebar clipping. On
     phones it must also clear the navigation backdrop and stay in the viewport;
     the controller's right-of-sidebar inline coordinates remain desktop-only. */
  .mg-app-ui .df-org-popover {
    z-index: 1110;
    left: 16px !important;
    right: auto;
    width: min(360px, calc(100vw - 32px));
    max-height: calc(100dvh - 108px);
    overflow-y: auto;
  }
}

/* ==========================================================================
   Application shell (handoff screens 01 to 27, README sections 3 and 5)
   sidebar.js renders the `sb-*` markup above; app-shell.js owns the topbar
   (crumbs, page actions, search), the phone drawer and the palette. The
   `body.mg-app-ui` prefix outranks the legacy app-shell.css layout rules.
   ========================================================================== */
body.mg-app-ui .df-app { flex-wrap: nowrap; }
.sb-home { display: flex; align-items: center; gap: 10px; min-width: 0; color: inherit; text-decoration: none; }
.sb-collapse__open { display: none; }
.sb-firm { color: var(--mg-ink); }
.sb-firm:hover { border-color: var(--mg-edge); }
.sb-item__label { min-width: 0; }
.sb-user { position: relative; cursor: pointer; }
.sb-logo { overflow: hidden; padding: 0; background: #fff; }
.sb-logo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.av.sb-logo img { object-fit: cover; }
body.mg-app-ui .df-sidebar :is(a, button):focus-visible { outline: 2px solid var(--mg-ink); outline-offset: 2px; }

/* Desktop: the sidebar is sticky beside the main column; only the content
   inside .df-main scrolls (the page itself never does). */
@media (min-width: 761px) {
  body.mg-app-ui .df-app > .df-sidebar {
    position: sticky; top: 0; left: auto; height: 100vh; z-index: 30;
    flex: 0 0 250px; width: 250px; overflow: hidden auto; transition: none;
  }
  body.mg-app-ui .df-app > .df-main,
  body.mg-app-ui .df-app > .df-sidebar.is-collapsed ~ .df-main { margin-left: 0; transition: none; }   /* no slide when the shell styles arrive */

  /* Collapsed rail (handoff 07, 08, 26): 64px, icons only, a hairline between groups. */
  body.mg-app-ui .df-app > .df-sidebar.is-collapsed { flex-basis: 64px; width: 64px; padding: 14px 10px 0; align-items: center; }
  .df-sidebar.is-collapsed .sb-brand { flex-direction: column; height: auto; gap: 6px; padding: 0; }
  .df-sidebar.is-collapsed .sb-home { display: grid; place-items: center; width: 40px; height: 40px; }
  .df-sidebar.is-collapsed .sb-lockup { display: none; }
  .df-sidebar.is-collapsed .sb-brand .iconbtn { margin-left: 0; width: 32px; height: 32px; }
  .df-sidebar.is-collapsed .sb-collapse__close { display: none; }
  .df-sidebar.is-collapsed .sb-collapse__open { display: block; }
  .df-sidebar.is-collapsed .sb-firm { width: auto; margin: 10px 0 0; padding: 0; border: 0; background: none; box-shadow: none; }
  .df-sidebar.is-collapsed .sb-firm :is(.sb-firm__text, .sb-firm__text + .ic) { display: none; }
  .df-sidebar.is-collapsed .sb-nav { align-items: center; margin-top: 10px; }
  .df-sidebar.is-collapsed .sb-group { margin-top: 0; gap: 4px; align-items: center; }
  .df-sidebar.is-collapsed .sb-group + .sb-group::before { content: ''; width: 24px; height: 1px; margin: 8px 0; background: var(--mg-hair); }
  .df-sidebar.is-collapsed .sb-group__label { display: none; }
  .df-sidebar.is-collapsed .sb-item { justify-content: center; width: 40px; height: 40px; padding: 0; gap: 0; }
  .df-sidebar.is-collapsed .sb-item__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .df-sidebar.is-collapsed .sb-user { justify-content: center; width: calc(100% + 20px); margin: 0 -10px; padding: 12px 0 14px; }
  .df-sidebar.is-collapsed .sb-user :is(.sb-user__text, #sidebarMenuBtn) { display: none; }
  body.mg-app-ui .df-sidebar.is-collapsed .df-user-menu { position: fixed; left: 70px; right: auto; top: auto; bottom: 16px; width: 260px; margin: 0; }
}

/* Account menu (the ⋯ on the user card) and the organization list. */
body.mg-app-ui .df-user-menu {
  left: 12px; right: 12px; bottom: calc(100% + 6px); margin: 0; padding: 6px;
  border-radius: var(--mg-r-md); box-shadow: 0 1px 2px rgba(25,25,24,.06), 0 16px 32px -16px rgba(25,25,24,.3);
}
body.mg-app-ui .df-user-menu__label { padding: 8px 10px 4px; font: 500 12px/1.3 var(--mg-sans); color: var(--mg-ink-3); text-transform: none; letter-spacing: 0; }
body.mg-app-ui .df-user-menu__item { min-height: 36px; padding: 0 10px; border-radius: var(--mg-r-ctl); font: 500 14px/1 var(--mg-sans); color: var(--mg-ink-2); }
body.mg-app-ui .df-user-menu__item:hover { background: var(--mg-hover); color: var(--mg-ink); }
body.mg-app-ui .df-user-menu__item--active { color: var(--mg-ink); }
body.mg-app-ui .df-user-menu__item--active .df-user-menu__check { margin-left: auto; color: var(--mg-gold-text, #8a5e08); }
body.mg-app-ui .df-user-menu__item--danger { color: #b91c1c; }
body.mg-app-ui .df-org-popover { background: #fff; border: 1px solid var(--mg-line); border-radius: var(--mg-r-md); }
body.mg-app-ui .df-org-popover__search { height: 36px; border-radius: var(--mg-r-ctl); border-color: var(--mg-edge); font: 400 14px/1 var(--mg-sans); }
body.mg-app-ui .df-org-popover__search:focus { border-color: var(--mg-ink); box-shadow: none; }
body.mg-app-ui .df-org-popover__item { min-height: 44px; border-radius: var(--mg-r-ctl); }
body.mg-app-ui .df-org-popover__item:hover, body.mg-app-ui .df-org-popover__item:focus-visible { background: var(--mg-hover); outline: none; }
body.mg-app-ui .df-org-popover__item-avatar { width: 28px; height: 28px; font: 600 12px/1 var(--mg-sans); color: var(--mg-ink); }
body.mg-app-ui .df-org-popover__item-name { font: 500 14px/1.3 var(--mg-sans); color: var(--mg-ink); }
body.mg-app-ui .df-org-popover__item-check { color: #8a5e08; }
.df-org-popover__empty { padding: 16px 10px; text-align: center; font: 400 13px/1.4 var(--mg-sans); color: var(--mg-ink-3); }

/* Collapsed-rail tooltip */
body.mg-app-ui .df-sidebar-tooltip { background: var(--mg-ink); color: #fffef2; font: 500 12px/1 var(--mg-sans); border-radius: var(--mg-r-ctl); }

/* Topbar: crumbs on the left, then page actions and the search box. */
body.mg-app-ui .df-topbar { height: 56px; gap: 16px; }
body.mg-app-ui .df-topbar__left { min-width: 0; }
body.mg-app-ui .df-topbar__right { display: flex; align-items: center; gap: 12px; margin-left: auto; min-width: 0; }
body.mg-app-ui .df-topbar .crumbs a { text-decoration: none; }
.tb-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.tb-actions[hidden] { display: none; }
.tb-actions + .tb-search, .df-topbar__right .tb-search { margin-left: 0; }
body.mg-app-ui .df-topbar .tb-search {
  flex: 0 1 300px; width: auto; min-width: 224px; height: 36px; padding: 0 6px 0 12px; gap: 10px;
  background: #fff; border: 1px solid var(--mg-edge); border-radius: var(--mg-r-ctl);
  font: 400 14px/1 var(--mg-sans); color: var(--mg-ink-3);
}
body.mg-app-ui .df-topbar .tb-search .kbd { margin-left: auto; padding: 4px 6px; font: 500 12px/1 var(--mg-sans); color: var(--mg-ink-2); }
body.mg-app-ui .tb-search:hover { border-color: var(--mg-ink-3); color: var(--mg-ink-2); }
body.mg-app-ui .tb-search:focus-visible { outline: 2px solid var(--mg-ink); outline-offset: 2px; }
.tb-search__text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-top__brand { display: none; color: var(--mg-ink); text-decoration: none; }
.m-top__brand .sb-mark { width: 22px; height: 22px; }
.mg-app-ui .mg-mobile-menu, .mg-app-ui .mg-mobile-backdrop { display: none; }

/* Command palette */
body.mg-app-ui .df-cmd-overlay { background: rgba(25,25,24,.32); backdrop-filter: none; padding: 16vh 16px 0; }
body.mg-app-ui .df-cmd-palette { width: 560px; max-width: 100%; border-radius: var(--mg-r-tile); box-shadow: 0 24px 48px -16px rgba(25,25,24,.32); }
body.mg-app-ui .df-cmd-palette__input-wrap { padding: 14px 16px; border-color: var(--mg-hair); color: var(--mg-ink-3); }
body.mg-app-ui .df-cmd-palette__input { font: 400 15px/1.3 var(--mg-sans); color: var(--mg-ink); }
body.mg-app-ui .df-cmd-palette__input-wrap kbd { padding: 3px 6px; border: 1px solid var(--mg-hair); border-radius: 4px; background: var(--mg-tint, #fafaf7); font: 500 12px/1 var(--mg-sans); color: var(--mg-ink-2); }
body.mg-app-ui .df-cmd-palette__group-label { padding: 10px 12px 6px; font: 500 12px/1.3 var(--mg-sans); color: var(--mg-ink-3); text-transform: none; letter-spacing: 0; }
body.mg-app-ui .df-cmd-palette__item { min-height: 36px; border-radius: var(--mg-r-ctl); font: 400 14px/1.3 var(--mg-sans); color: var(--mg-ink-2); text-decoration: none; }
body.mg-app-ui .df-cmd-palette__item .ic { color: var(--mg-ink-3); }
body.mg-app-ui :is(.df-cmd-palette__item:hover, .df-cmd-palette__item.is-active) { background: var(--mg-hover); color: var(--mg-ink); }
body.mg-app-ui .df-cmd-palette__item strong { font-weight: 600; color: var(--mg-ink); }
body.mg-app-ui .df-cmd-palette__item--sub { min-height: 32px; padding-left: 38px; font-size: 13px; color: var(--mg-ink-3); }
body.mg-app-ui .df-cmd-palette__item--sub .ic { width: 14px; height: 14px; }
.df-cmd-palette__empty { padding: 16px; text-align: center; font: 400 14px/1.4 var(--mg-sans); color: var(--mg-ink-3); }

/* Read-only and AI Support banners sit above the whole shell. */
body.mg-app-ui:is(.impersonating, .support-mode) .df-app { margin-top: 36px; height: calc(100vh - 36px); }
body.mg-app-ui:is(.impersonating, .support-mode) .df-app > :is(.df-main, .df-sidebar) { height: calc(100vh - 36px); }

/* Phone (handoff 27): menu button, brand, search icon; the sidebar is a drawer. */
@keyframes mg-drawer-in { from { transform: translateX(-100%); } to { transform: none; } }
@media (max-width: 760px) {
  body.mg-app-ui .df-app > .df-main { height: 100dvh; }
  body.mg-app-ui .df-sidebar.mg-mobile-open {
    display: flex !important; position: fixed; top: 0; left: 0; bottom: 0; height: auto;
    width: min(320px, calc(100vw - 48px)); z-index: 1100; overflow: hidden;
    box-shadow: 12px 0 36px rgba(25,25,24,.15); animation: mg-drawer-in 180ms var(--mg-ease, ease-out);
  }
  body.mg-app-ui:is(.impersonating, .support-mode) .df-sidebar.mg-mobile-open { top: 36px; }
  body.mg-app-ui .df-sidebar.mg-mobile-open :is(.sb-item, .sb-firm, .df-user-menu__item) { min-height: 44px; }
  body.mg-app-ui .df-sidebar.mg-mobile-open .sb-nav { min-height: 0; overflow-y: auto; }   /* the user card stays in view */
  body.mg-app-ui .df-sidebar.mg-mobile-open .sb-brand .iconbtn { width: 44px; height: 44px; }
  body.mg-app-ui .df-sidebar.mg-mobile-open .sb-user .iconbtn { width: 44px; height: 44px; }
  body.mg-app-ui .df-topbar { padding: 0 8px; gap: 4px; }
  body.mg-app-ui .df-topbar.mg-has-crumbs .crumbs { display: none; }
  body.mg-app-ui .df-topbar.mg-has-crumbs .m-top__brand { display: flex; align-items: center; gap: 8px; font: 600 15px/1 var(--mg-sans); white-space: nowrap; }
  body.mg-app-ui .mg-mobile-menu { display: inline-grid; place-items: center; width: 44px; height: 44px; color: var(--mg-ink); }
  body.mg-app-ui .mg-mobile-menu .ic { width: 20px; height: 20px; }
  body.mg-app-ui .mg-mobile-backdrop:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 1090; border: 0; padding: 0; background: rgba(25,25,24,.3); }
  body.mg-app-ui .df-topbar .tb-search { flex: 0 0 44px; width: 44px; min-width: 0; height: 44px; padding: 0; justify-content: center; border-color: transparent; background: transparent; color: var(--mg-ink); }
  body.mg-app-ui .df-topbar .tb-search .ic { width: 20px; height: 20px; }
  body.mg-app-ui .df-topbar .tb-search :is(.tb-search__text, .kbd) { display: none; }
  body.mg-app-ui .df-org-popover { z-index: 1110; }
}

/* ── Deal card (dtile.js; handoff 01 / 02 / 28) ─────────────────────────────
   The card is the <article class="mg-tile … mg-tile--deal">; .dtile inside it is
   only the body, so the legacy dtile.css frame (border, shadow, hover lift) is
   switched off there. Secondary actions sit in the ⋯ at the right end of the
   activity band; the menu opens upward over the card (downward near the top of
   the window) and the open card is lifted above its neighbours. */
.mg-tile--deal > .dtile,
.mg-app-ui .mg-tile--deal > .dtile,
.mg-app-ui .mg-tile--deal > .dtile:hover {
  border: 0; border-radius: 0; box-shadow: none; background: transparent; overflow: visible; cursor: auto; transform: none;
}
.mg-tile.is-menu-open { z-index: 5; }
/* The activity band keeps two lines (handoff 01/02), so cards in a row stay the same height: the summary
   is one line, cut with an ellipsis before the i (the i tip carries the full text); the who/when line
   wraps only when a name and date cannot share a line (it has no tip to hold a cut part). */
.mg-tile--deal .act__text { min-width: 0; }
.mg-tile--deal .act .has-tip { display: flex; align-items: center; min-width: 0; }
.mg-tile--deal .act .has-tip .act__what { flex: 0 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mg-tile--deal .act .has-tip .info { flex: none; margin: -4px -1px -4px 5px; }
.mg-tile--deal .act__who { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: break-word; }
.dtile-more { position: relative; z-index: 3; flex: none; margin-left: auto; }
.tile-foot .dtile-more .iconbtn { margin: -6px -10px -6px 0; }
.dtile-menu {
  position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 6; min-width: 208px;
  margin: 0; padding: 4px; list-style: none;
  background: #fff; border: 1px solid rgba(25, 25, 24, 0.12); border-radius: var(--mg-r-md);
  box-shadow: 0 1px 2px rgba(25, 25, 24, 0.06), 0 12px 28px -12px rgba(25, 25, 24, 0.32);
}
.dtile-menu--down { bottom: auto; top: calc(100% + 6px); }
.dtile-menu[hidden] { display: none; }
.dtile-menu__item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 0 10px;
  border: 0; border-radius: var(--mg-r-ctl); background: none; cursor: pointer;
  font: 500 14px/1 var(--mg-sans); color: var(--mg-ink-2); text-align: left; text-decoration: none; white-space: nowrap;
}
.dtile-menu__item:hover, .dtile-menu__item:focus-visible { background: var(--mg-hover); color: var(--mg-ink); outline: none; }
.dtile-menu__item .ic { width: 16px; height: 16px; flex: none; color: var(--mg-ink-3); }
.dtile-menu__item--danger, .dtile-menu__item--danger:hover, .dtile-menu__item--danger .ic { color: var(--mg-red-text); }
.dtile-menu__sep { height: 1px; margin: 4px 6px; background: var(--mg-hair); }

/* Cover on top (handoff 02) */
.dk { display: flex; flex-direction: column; }
.dk .dk__tray { --tray-pt: 16px; --tray-px: 18px; border-radius: 11px 11px 0 0; }
@media (min-width: 1440px) { .dk .dk__tray { --tray-cut: 77.27; --tray-gap: 7px; } }
.dk .cv-note { bottom: 14px; }
.dk > .dtile { flex: 1; height: auto; }
.dk .dtile__top { padding-top: 18px; }
.dk-ghost { background: transparent; box-shadow: none; border: 1.5px dashed rgba(25, 25, 24, 0.2); border-bottom: 0; }

/* Phone row (handoff 28) */
.m-card { display: flex; flex-direction: column; color: var(--mg-ink); }
.m-card__body { display: grid; grid-template-columns: 78px minmax(0, 1fr); column-gap: 14px; align-items: start; padding: 16px 18px; }
.m-thumb { position: relative; height: 66px; padding: 8px 8px 0; overflow: hidden; border-radius: 6px; background: #ebeae4; box-shadow: inset 0 1px 2px rgba(25, 25, 24, 0.08), inset 0 0 0 1px rgba(25, 25, 24, 0.04); }
.m-thumb .sheet { box-shadow: 0 0 0 1px rgba(25, 25, 24, 0.06), 0 4px 10px -6px rgba(25, 25, 24, 0.3); }
.m-thumb--none { display: grid; place-items: center; padding: 0; }
.m-thumb--none i { display: block; width: 40px; height: 34px; border: 1.5px dashed rgba(25, 25, 24, 0.24); border-radius: 4px; }
.m-card__id { min-width: 0; }
.m-deal { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.m-deal__name { min-width: 0; font: 400 21px/1.1 var(--mg-serif); letter-spacing: -0.012em; font-optical-sizing: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-deal__ev { font-size: 24px; line-height: 1; white-space: nowrap; }
.m-deal__target, .m-deal__stage { font: 400 13px/1.3 var(--mg-sans); color: var(--mg-ink-2); overflow-wrap: break-word; }
.m-deal__target { margin-top: 6px; }
.m-deal__stage { margin-top: 2px; }
.m-deal__stage b { font-weight: 500; color: var(--mg-ink); }
.m-deal__data { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; grid-column: 1 / -1; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--mg-hair); }
.m-deal__data .meter { margin-top: 9px; }
.m-deal__act { display: flex; align-items: center; gap: 10px; min-height: 44px; margin-top: auto; padding: 8px 18px; background: var(--mg-tint); border-top: 1px solid rgba(25, 25, 24, 0.06); border-radius: 0 0 calc(var(--mg-r-tile) - 1px) calc(var(--mg-r-tile) - 1px); }
.m-deal__act .av { width: 26px; height: 26px; background: #fff; }
.m-deal__act > .has-tip { display: block; flex: 1; min-width: 0; text-wrap: balance; }
.m-deal__act .info { display: inline-grid; vertical-align: middle; margin: -4px -1px -4px 5px; }
.m-deal__what { font: 500 13px/1.3 var(--mg-sans); }
.m-deal__when { font: 400 12px/1.3 var(--mg-sans); color: var(--mg-ink-2); white-space: nowrap; }
.m-deal__act .dtile-more .iconbtn { width: 44px; height: 44px; margin: -8px -12px -8px 0; }

/* Empty and error blocks of the dashboard and the deals page (handoff 19, states 02 and 04) */
:is(.dash, .dkp) .empty4 { overflow: hidden; display: flex; flex-direction: column; }
:is(.dash, .dkp) .empty4__tray { position: relative; height: 150px; padding: 20px 0 0; background: #ebeae4; box-shadow: inset 0 1px 2px rgba(25, 25, 24, 0.08), inset 0 0 0 1px rgba(25, 25, 24, 0.04); display: flex; justify-content: center; overflow: hidden; }
:is(.dash, .dkp) .ghost { position: relative; width: 220px; aspect-ratio: 11 / 8.5; border: 1.5px dashed rgba(25, 25, 24, 0.24); border-radius: 2px; background: rgba(255, 255, 255, 0.55); padding: 20px 22px; display: flex; flex-direction: column; gap: 8px; }
:is(.dash, .dkp) .ghost i { display: block; height: 7px; border-radius: 3px; background: #e2e1db; }
:is(.dash, .dkp) .ghost i.t { height: 14px; width: 58%; margin: 10px 0 4px; background: #dcdbd5; }
:is(.dash, .dkp) .empty4__body { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 20px 24px 24px; }
:is(.dash, .dkp) .empty__t { font: 600 16px/1.35 var(--mg-sans); color: var(--mg-ink); }
:is(.dash, .dkp) .empty__p { margin-top: 6px; font: 400 14px/1.5 var(--mg-sans); color: var(--mg-ink-3); max-width: 40ch; }
:is(.dash, .dkp) .empty__actions { display: flex; gap: 16px; align-items: center; margin-top: 18px; }
:is(.dash, .dkp) .err { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 16px 24px 22px; }
:is(.dash, .dkp) .err__ic { width: 20px; height: 20px; color: #b91c1c; margin-bottom: 6px; }
:is(.dash, .dkp) .err__t { font: 600 14px/1.4 var(--mg-sans); color: var(--mg-ink); }
:is(.dash, .dkp) .err__p { font: 400 13px/1.5 var(--mg-sans); color: var(--mg-ink-3); margin-bottom: 10px; }

/* Template gallery (round-1 page, rebuilt in phase 3): at most three columns, as the handoff's .rpt-grid
   draws them; fewer when a column would fall under 259px. */
body.mg-app-ui .tpl-grid { grid-template-columns: repeat(auto-fill, minmax(max(min(100%, 259px), calc((100% - 48px) / 3)), 1fr)); }

/* ==== track:w1-documents ==== */
/* Screen-level rules from handoff 19 (states), 06 (Deal Documents) and 29 (phone Deal Documents). */
.sk-line{display:block;height:12px;border-radius:4px;background:#eeede7}
.sk-fig{display:block;border-radius:6px;background:#eeede7}
.sk-on-tint{background:#ebeae4}
.sk-av{display:block;width:26px;height:26px;border-radius:50%;background:#eeede7;flex:none}
.sk-deal{height:300px}
.sk-deal .dtile__k{white-space:nowrap}
.sk-deal .dtile__k .sk-line{height:10px;flex:none}
.sk-shelf .rpt-tile__body{min-height:106.3px}
.sk-sheet{height:100%;background:#fff;box-shadow:0 0 0 1px rgba(25,25,24,.06),0 1px 2px rgba(25,25,24,.06);padding:18px 20px;display:flex;flex-direction:column;gap:9px}
.sk-sheet .sk-line{height:8px;background:#f1f0eb}
.err-well{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:6px;flex:1;margin:14px 24px 24px;padding:22px 18px;background:#fafaf7;border-radius:8px;box-shadow:inset 0 0 0 1px rgba(25,25,24,.08)}
.err-well .btn{margin-top:14px}
.dlg{position:relative;width:min(468px,100%);margin:0 auto;background:#fff;border-radius:12px;box-shadow:0 0 0 1px rgba(25,25,24,.06),0 28px 64px -18px rgba(25,25,24,.45);overflow:hidden}
.dlg__body{padding:22px 24px 22px}
.dlg__t{font:400 28px/1.1 'Newsreader',Georgia,serif;letter-spacing:-.014em;color:#191918}
.dlg__p{margin-top:12px;font:400 14px/1.55 'Inter',sans-serif;color:#33322f}
.dlg__facts{display:grid;grid-template-columns:92px minmax(0,1fr);gap:8px 12px;margin:16px 0 0;padding:14px 16px;background:#fafaf7;border-radius:8px;box-shadow:inset 0 0 0 1px rgba(25,25,24,.08)}
.dlg__facts dt{font:400 13px/1.45 'Inter',sans-serif;color:#555550}
.dlg__facts dd{margin:0;font:500 13px/1.45 'Inter',sans-serif;color:#191918}
.dlg__foot{display:flex;justify-content:flex-end;align-items:center;gap:8px;padding:14px 24px;border-top:1px solid rgba(25,25,24,.08);background:#fafaf7}
.toast{position:absolute;left:50%;bottom:28px;transform:translateX(-50%);display:flex;align-items:center;gap:10px;padding:10px 8px 10px 14px;border-radius:8px;background:#191918;color:#fffef2;box-shadow:0 16px 36px -10px rgba(25,25,24,.45);font:500 14px/1.3 'Inter',sans-serif;white-space:nowrap}
.toast .ok{color:#22c55e;width:18px;height:18px}
.toast .iconbtn{color:rgba(255,254,242,.82)}
.toast .iconbtn:hover{background:rgba(255,254,242,.08);color:#fffef2}
.sumt--tabs .sumt__label .st{gap:6px;font:500 12px/1.3 var(--mg-sans);color:var(--mg-ink-3)}
.sumt--tabs .sumt__label .st--failed{color:var(--mg-red-text)}
.sumt--tabs .sumt__cell--btn:first-child{border-radius:11px 0 0 11px}
.sumt--tabs .sumt__cell--btn:last-child{border-radius:0 11px 11px 0}
.sumt--tabs .sumt__cell--btn:focus-visible{outline:2px solid var(--mg-ink);outline-offset:-2px}
@container (max-width:760px){
  /* two by two: dividers between the columns and between the rows */
  .sumt--tabs .sumt__cell--btn:nth-child(even){border-left:1px solid var(--mg-hair)}
  .sumt--tabs .sumt__cell--btn:nth-child(n+3){border-top:1px solid var(--mg-hair)}
  .sumt--tabs .sumt__cell--btn:nth-child(1){border-radius:11px 0 0 0}
  .sumt--tabs .sumt__cell--btn:nth-child(2){border-radius:0 11px 0 0}
  .sumt--tabs .sumt__cell--btn:nth-child(3){border-radius:0 0 0 11px}
  .sumt--tabs .sumt__cell--btn:nth-child(4){border-radius:0 0 11px 0}
}
/* Same rhythm as Deals: 28px above the filter bar, 20px above the tiles */
.doc-filters{margin-top:28px}
/* Type pills: all eight fit on one line from 940px of bar width. Below that (the query leaves 40px of slack) they
   wrap five and three, so a single pill is never left alone on the second line */
@container (max-width:980px){ .doc-filters .fbar__pills{max-width:520px} }
.rpt-grid{margin-top:20px}
/* Pager */
.pager{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:28px;padding-top:18px;border-top:1px solid rgba(25,25,24,.08);font:400 13px/1 'Inter',sans-serif;color:#555550}
.pager b{font-weight:600;color:#191918;font-variant-numeric:tabular-nums}
.pager__btns{display:flex;align-items:center;gap:6px}
.pager__n{display:inline-grid;place-items:center;min-width:32px;height:32px;padding:0 8px;border-radius:6px;font:500 13px/1 'Inter',sans-serif;color:#33322f;text-decoration:none;font-variant-numeric:tabular-nums}
.pager__n:hover{background:rgba(25,25,24,.05);color:#191918}
.pager__n.is-on{background:#fff;color:#191918;box-shadow:0 0 0 1px rgba(25,25,24,.12),0 1px 2px rgba(25,25,24,.06)}
.pager .iconbtn[disabled]{opacity:1;color:#555550;cursor:default;background:transparent}
/* Items joined by a middle dot that never starts or ends a line. Each dot is still a character in the text; it hangs
   in the gap before its item, so the item that starts a line pushes its dot outside the box, where the clip hides it.
   Items that stack show no dots. */
.dotlist{display:flex;flex-wrap:wrap;column-gap:12px;clip-path:inset(0)}
.dotlist > span{position:relative;white-space:nowrap}
.dotlist .dot{position:absolute;top:0;left:-8px}
.m-sum3{margin-top:20px}
.m-sum3 a.sumt__cell{color:inherit;text-decoration:none}
.m-gen{height:44px;margin-top:16px}
.m-pills{display:flex;gap:8px;overflow-x:auto;margin:20px -16px 0;padding:4px 16px;scrollbar-width:none}
.m-pills::-webkit-scrollbar{display:none}
.m-pills .pill{flex:none;height:36px;position:relative}
.m-pills .pill::after{content:'';position:absolute;inset:-4px 0}
.m-filters{display:grid;grid-template-columns:minmax(0,1fr) 136px;gap:8px;margin-top:12px}
.m-filters .search,.m-filters .select{height:44px}
.m-docs{display:flex;flex-direction:column;gap:16px;margin-top:20px}
.m-docs .rpt-tile__cover{--tray-pt:18px;--tray-px:20px}
.m-docs .rpt-tile__foot{padding:0 2px 0 20px}
.m-docs .iconbtn{width:44px;height:44px}
.m-pager{display:flex;align-items:center;justify-content:space-between;margin-top:20px;font:400 14px/1 'Inter',sans-serif;color:#555550}
.m-pager .btn{height:44px}
/* Runtime placement for the states module (fixed overlay and toast stack). */
.mg-dlg-back{position:fixed;inset:0;z-index:1200;display:flex;align-items:center;justify-content:center;padding:16px;background:rgba(25,25,24,.32)}
.mg-toasts{position:fixed;left:50%;bottom:28px;transform:translateX(-50%);z-index:1300;display:flex;flex-direction:column;align-items:center;gap:8px;max-width:calc(100vw - 32px)}
.mg-toasts .toast{position:static;transform:none;white-space:normal}
.toast--error .toast__m::before{content:'';display:inline-block;width:8px;height:8px;margin-right:8px;border-radius:50%;background:#ef4444}
.toast--warn .toast__m::before{content:'';display:inline-block;width:8px;height:8px;margin-right:8px;border-radius:50%;background:#f59e0b}
.mg-toasts .toast .ok{flex:none}
.mg-empty{display:flex;flex-direction:column;align-items:center;gap:8px;padding:40px 16px;text-align:center}
.mg-empty__t{font:400 22px/1.2 'Newsreader',Georgia,serif;color:#191918}
.mg-empty__p{margin:0;font:400 14px/1.5 'Inter',sans-serif;color:#555550;max-width:420px}
.mg-empty .btn{margin-top:10px}
.err-well .err__t{font:500 15px/1.3 'Inter',sans-serif;color:#191918}
.err-well .err__p{margin:0;font:400 13px/1.5 'Inter',sans-serif;color:#555550}
.rpt-list{display:flex;flex-direction:column;margin-top:20px}
.rpt-row{display:grid;grid-template-columns:minmax(0,1fr) auto auto auto;gap:16px;align-items:center;padding:12px 4px;border-top:1px solid rgba(25,25,24,.08);font:400 13px/1.4 'Inter',sans-serif;color:#555550}
.rpt-row__t{font:500 14px/1.35 'Inter',sans-serif;color:#191918;text-decoration:none;overflow-wrap:anywhere}
@media (max-width:640px){.rpt-row{grid-template-columns:minmax(0,1fr) auto}.rpt-row__by{display:none}}
/* ==== /track:w1-documents ==== */
/* ==== track:w4-admin ==== */
/* Audit trail: columns stack instead of scrolling sideways on narrow screens. */
@media (max-width: 900px) {
  .mg-app-ui .at-root { overflow: visible; height: auto; }
  .mg-app-ui .at-layout { grid-template-columns: minmax(0,1fr); height: auto; }
  .mg-app-ui .at-layout > .at-col { min-width: 0; max-height: none; }
}
/* ==== /track:w4-admin ==== */
/* ==== track:w5-auth ==== */
/* Auth gate (handoff 20 / 21): standalone pages, no shell. */
.gate { display: grid; grid-template-columns: minmax(0, 760px) minmax(520px, 1fr); min-height: 100vh; background: #fff; font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; color: #191918; }
.gate a { color: #191918; }
.gate__story { position: relative; display: flex; flex-direction: column; container-type: inline-size; padding: 44px clamp(32px, 4.4vw, 56px) 36px; background: #fffef2; border-right: 1px solid rgba(25,25,24,.08); min-width: 0; }
.gate__lockup { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; align-self: flex-start; }
.gate__lockup img { width: 28px; height: 28px; }
.gate__lockup b { font: 600 17px/1 'Inter', sans-serif; letter-spacing: -.012em; }
.gate__lockup span { font: 500 13px/1 'Inter', sans-serif; color: #555550; }
.gate__copy { margin-top: 52px; }
.gate__cat { display: flex; align-items: center; gap: 10px; margin: 0; font: 500 13px/1.3 'Inter', sans-serif; color: #33322f; }
.gate__cat::before { content: ''; width: 24px; height: 1px; background: #191918; }
.gate__h { margin: 16px 0 0; font: 400 clamp(32px, 4vw, 52px)/1.04 var(--mg-serif); letter-spacing: -.022em; }
.gate__h em { font-style: italic; }
.gate__lede { margin: 18px 0 0; max-width: 470px; font: 400 16px/1.55 'Inter', sans-serif; color: #33322f; }
.gate__facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: auto 0 0; padding: 0; list-style: none; border-top: 1px solid rgba(25,25,24,.1); }
.gate__facts li { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px 0 0; min-width: 0; }
.gate__facts li + li { padding-left: 20px; border-left: 1px solid rgba(25,25,24,.08); }
.gate__facts .chip-ic { display: inline-grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 8px; background: #fff; box-shadow: 0 0 0 1px rgba(25,25,24,.1), 0 1px 2px rgba(25,25,24,.05); }
.gate__facts p { margin: 0; font: 400 13px/1.5 'Inter', sans-serif; color: #33322f; }
.gate__facts b { display: block; margin-bottom: 2px; font-weight: 600; color: #191918; }
.gate__trust { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 22px 0 0; font: 500 12px/1.3 'Inter', sans-serif; color: #33322f; }
.gate__trust span { display: inline-flex; align-items: center; gap: 7px; }
.gate__trust .ic { width: 14px; height: 14px; color: #555550; }
.gate__side { display: flex; flex-direction: column; padding: 44px clamp(32px, 4.4vw, 56px) 32px; min-width: 0; }
.gate__top { display: flex; justify-content: flex-end; align-items: center; gap: 8px; font: 400 13px/1.3 'Inter', sans-serif; color: #555550; }
.gate__top a { font-weight: 500; }
.auth { width: 100%; max-width: 420px; margin: auto; padding: 32px 0; }
.auth--wide { max-width: 520px; }
.auth__title { margin: 0; font: 400 40px/1.08 var(--mg-serif); letter-spacing: -.018em; }
.auth__sub { margin: 10px 0 0; font: 400 16px/1.5 'Inter', sans-serif; color: #33322f; }
.auth__form { display: flex; flex-direction: column; gap: 18px; margin-top: 30px; }
.auth__err { display: none; margin-top: 18px; padding: 10px 12px; border-radius: 8px; background: #fdf2f1; color: #8c2b1f; font: 400 14px/1.4 'Inter', sans-serif; }
.auth__err::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: #c0392b; vertical-align: 1px; }
.f { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.f__label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font: 500 13px/1.2 'Inter', sans-serif; }
.f__req { color: #555550; font-weight: 400; }
.f__box { position: relative; display: flex; align-items: center; }
.f__box > .ic { position: absolute; left: 14px; color: #555550; pointer-events: none; }
.f__in { width: 100%; height: 40px; padding: 0 14px 0 42px; border: 1px solid rgba(25,25,24,.16); border-radius: 8px; background: #fff; font: 400 15px/1 'Inter', sans-serif; color: #191918; box-shadow: 0 1px 2px rgba(25,25,24,.04); box-sizing: border-box; }
.f__in--plain { padding-left: 14px; }
.f__in--eye { padding-right: 46px; }
.f__in::placeholder { color: #6b6a64; opacity: 1; }
.f__in:focus, .f__in:focus-visible { outline: none; border-color: #191918; box-shadow: 0 0 0 3px rgba(25,25,24,.08); }
.f__eye { position: absolute; right: 6px; display: inline-grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 6px; background: transparent; color: #555550; cursor: pointer; }
.f__eye:hover { background: rgba(25,25,24,.05); color: #191918; }
.f__help { font: 400 12px/1.4 'Inter', sans-serif; color: #555550; }
.f-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.auth__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cbx-row { display: inline-flex; align-items: center; gap: 9px; font: 400 14px/1.3 'Inter', sans-serif; color: #33322f; cursor: pointer; }
.cbx-row input { width: 16px; height: 16px; margin: 0; accent-color: #191918; }
.ulink { font: 500 14px/1.3 'Inter', sans-serif; color: #191918; text-decoration: underline; text-decoration-color: rgba(25,25,24,.3); text-underline-offset: 3px; }
.ulink:hover { text-decoration-color: #191918; }
.btn--xl { height: 40px; font-size: 15px; border-radius: 8px; }
.auth__alt { margin: 26px 0 0; padding-top: 22px; border-top: 1px solid rgba(25,25,24,.08); font: 400 14px/1.4 'Inter', sans-serif; color: #33322f; text-align: center; }
.gate__foot { display: flex; justify-content: center; gap: 18px; font: 400 12px/1.3 'Inter', sans-serif; color: #555550; }
.gate__foot a { color: #33322f; text-decoration: none; }
.desk { position: relative; aspect-ratio: 647/262; margin: 28px 0 26px; border-radius: 12px; background: #ebeae4; box-shadow: inset 0 1px 2px rgba(25,25,24,.08), inset 0 0 0 1px rgba(25,25,24,.04); overflow: hidden; }
.desk .sheet { position: absolute; width: 45.1%; }
.desk__a { left: 4.6%; top: 19.8%; }
.desk__b { left: 26.6%; top: 12.2%; }
.desk__c { left: 48.5%; top: 4.6%; box-shadow: 0 0 0 1px rgba(25,25,24,.06), 0 2px 4px rgba(25,25,24,.06), 0 22px 40px -18px rgba(25,25,24,.38) !important; }
.pg__ph { display: inline-block; width: 46%; margin: 1.2cqw 2% 0 0; padding: 3cqw 0; border-radius: .5cqw; background: #efeee8; font-size: 1.3cqw; text-align: center; color: #6b6a64; }
@container (max-width: 599px) {
  .gate__facts { grid-template-columns: minmax(0, 1fr); }
  .gate__facts li { flex-direction: row; align-items: flex-start; gap: 14px; padding: 14px 0; }
  .gate__facts li + li { padding-left: 0; border-left: 0; border-top: 1px solid rgba(25,25,24,.08); }
}
@media (max-width: 760px) {
  .gate { grid-template-columns: minmax(0, 1fr); }
  .gate__side { order: -1; padding: 24px 16px 28px; }
  .gate__story { padding: 28px 16px; border-right: 0; border-top: 1px solid rgba(25,25,24,.08); }
  .gate__copy { margin-top: 28px; }
  .auth__title { font-size: 32px; }
  .f-row { grid-template-columns: minmax(0, 1fr); }
  .gate__facts { margin-top: 8px; }
}
/* ==== /track:w5-auth ==== */
/* ==== track:w5-auth (dev pages) ==== */
.dev-pane { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.dev-pane__msg { margin: 0; font: 400 14px/1.5 var(--mg-sans); color: var(--mg-ink-2); display: flex; align-items: center; gap: 8px; }
.dev-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mg-neutral-dot); flex: none; }
.dev-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.dev-stats > div { padding: 12px 14px; background: #fff; border: 1px solid var(--mg-edge); border-radius: var(--mg-r-ctl); min-width: 0; }
.dev-stats b { display: block; font: 400 24px/1.1 var(--mg-serif); font-variant-numeric: lining-nums tabular-nums; }
.dev-stats span { font: 400 12px/1.35 var(--mg-sans); color: var(--mg-ink-3); }
.dev-today { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.dev .dev-file { max-width: 100%; text-decoration: none; color: var(--mg-ink); }
@media (max-width: 560px) { .dev-stats { grid-template-columns: minmax(0, 1fr); } .today { grid-template-columns: minmax(0, 1fr) !important; } }
/* ==== /track:w5-auth (dev pages) ==== */
/* ==== track:w2-dataroom ==== */
/* Data room (handoff 13 / 15 / 31): index + file table, built by js/data-room-page.js. */
.dr { min-width: 0; }
.dr-loading { padding: 32px 0; font: 400 13px/1.5 var(--mg-sans); color: var(--mg-ink-3); }
.dr .pg-sub { margin: 6px 0 0; font: 400 14px/1.5 var(--mg-sans); color: var(--mg-ink-2); max-width: 70ch; }
.dr .src { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0 0; font: 400 12px/1.5 var(--mg-sans); color: var(--mg-ink-3); }
.dr .src .ic { flex: none; margin-top: 2px; }
.dr .m-back { display: none; }
.dr .sumt__sub { margin-top: 6px; font: 400 12px/1.4 var(--mg-sans); color: var(--mg-ink-3); }
.dr .sumt__sub .meter { margin-top: 8px; }
.dr .cov { display: grid; grid-template-columns: minmax(200px, 260px) minmax(0, 1fr); gap: 16px 32px; padding: 20px 24px; border-top: 1px solid var(--mg-hair); }
.dr .cov__keys { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; font: 400 13px/1.3 var(--mg-sans); color: var(--mg-ink-2); }
.dr .cov__keys span { display: flex; align-items: center; gap: 8px; }
.dr .covlist--13 { columns: 2; column-gap: 32px; }
.dr .covlist__row { break-inside: avoid; }
.dr .sq { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--mg-graph); }
.dr .sq--p { background: var(--mg-gold); }
.dr .sq--e { background: transparent; box-shadow: inset 0 0 0 1.5px rgba(25, 25, 24, 0.38); }
.dr .cov__none { padding: 16px 24px; font: 400 13px/1.5 var(--mg-sans); color: var(--mg-ink-3); }
.pane { display: grid; grid-template-columns: clamp(280px, 21vw, 332px) minmax(0, 1fr); gap: 20px; margin-top: 20px; align-items: stretch; }
.idx { display: flex; flex-direction: column; padding: 16px 12px 12px; min-width: 0; }
.idx__head { display: flex; flex-direction: column; align-items: stretch; gap: 12px; padding: 4px 6px 12px; }
.idx__head .seg { display: grid; grid-template-columns: 1fr 1fr; }
.idx__head .seg__btn { justify-content: center; }
.idx-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; column-gap: 4px; width: 100%; min-height: 36px; padding: 4px 10px 4px 6px; border: 0; border-radius: 6px; background: none; font: 500 13px/1.25 var(--mg-sans); color: var(--mg-ink); text-align: left; cursor: pointer; }
.idx-row:hover { background: var(--mg-hover); }
.idx-row.is-on { background: var(--mg-ink); color: var(--mg-on-ink); }
.idx-row.is-on .idx-n, .idx-row.is-on .idx-i { color: rgba(255, 254, 242, 0.82); }
.idx-t { min-width: 0; overflow-wrap: anywhere; }
.idx-i, .idx-n { color: var(--mg-ink-3); font-variant-numeric: tabular-nums; font-weight: 500; }
.idx-row--cat { font-weight: 400; color: var(--mg-ink-2); min-height: 32px; padding-left: 20px; }
.idx-row--cat .idx-i { font-size: 12px; }
.idx-st { font-size: 12px; }
.idx-empty { font: 500 12px/1 var(--mg-sans); color: var(--mg-ink-3); }
.idx-sep { height: 1px; background: var(--mg-hair); margin: 6px; }
.idx-gap { flex: 1 1 0; min-height: 0; }
.idx-note { display: flex; gap: 9px; align-items: flex-start; margin: 16px 6px 4px; padding: 12px 14px; border-radius: 8px; background: var(--mg-tint); box-shadow: inset 0 0 0 1px var(--mg-hair); font: 400 12px/1.5 var(--mg-sans); color: var(--mg-ink-2); }
.idx-note .ic { flex: none; color: var(--mg-ink-3); margin-top: 2px; }
.ft { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.ft-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 14px 24px 16px; border-bottom: 1px solid var(--mg-hair); }
.ft .dr-search { flex: 1 1 220px; max-width: 360px; margin-left: auto; }
.ft .dr-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: none; font: 400 13px/1.3 var(--mg-sans); color: var(--mg-ink); }
.dr-scope { font: 400 12px/1.3 var(--mg-sans); color: var(--mg-ink-3); }
.ft .tbl { table-layout: fixed; width: 100%; }
.col-cb { width: 56px; } .col-added { width: 140px; } .col-status { width: 110px; } .col-used { width: 102px; } .col-act { width: 88px; }
.ft .tbl .c-act { text-align: right; white-space: nowrap; }
.ft .tbl .c-added, .ft .tbl .c-status, .ft .tbl .c-used { white-space: nowrap; }
.ft .tbl .c-added .sub, .ft .tbl .c-status .sub { display: block; margin-top: 4px; font: 400 12px/1.2 var(--mg-sans); color: var(--mg-ink-3); }
.ft .tbl .c-used.muted { color: var(--mg-ink-3); font: 500 13px/1 var(--mg-sans); }
.ft .tbl tr.is-failed td { background: rgba(178, 59, 44, 0.04); }
.ft .fname { display: flex; gap: 10px; align-items: flex-start; width: 100%; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; color: inherit; font: inherit; }
.ft .fname__ic { flex: none; color: var(--mg-ink-3); }
.ft .fname__t { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ft .fname__n { font: 500 13px/1.3 var(--mg-sans); color: var(--mg-ink); overflow-wrap: anywhere; }
.ft .fname__c { font: 400 12px/1.3 var(--mg-sans); color: var(--mg-ink-3); }
.ft .bad { font: 400 12px/1.4 var(--mg-sans); color: var(--mg-red, #b23b2c); }
.dr-empty { padding: 32px 24px; text-align: center; color: var(--mg-ink-3); }
.ft-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; padding: 12px 24px; border-top: 1px solid var(--mg-hair); background: var(--mg-tint); font: 400 13px/1.3 var(--mg-sans); color: var(--mg-ink-3); }
.ft-foot .pager__btns { display: flex; gap: 8px; }
/* ==== track:card-cap ==== */
/* A file card never grows past the browser: the index list and the file table scroll inside their
   card (head, tools and footer stay put). 116 px = topbar + content padding. Phones keep one scroll. */
.mg-app-ui { --mg-card-cap: calc(100vh - 116px); }
@media (min-width: 641px) {
  .mg-app-ui .ft { max-height: var(--mg-card-cap); }
  .mg-app-ui .ft .tbl-scroll { flex: 1 1 auto; min-height: 0; overflow: auto; }
  .mg-app-ui .ft .ft-tools, .mg-app-ui .ft .ft-foot { flex: none; }
  .mg-app-ui .idx { max-height: var(--mg-card-cap); }
  .mg-app-ui .idx__head, .mg-app-ui .idx-note { flex: none; }
  .mg-app-ui .idx__list { flex: 1 1 auto; min-height: 0; overflow: auto; }
}
.dr-batch { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 24px; border-bottom: 1px solid var(--mg-hair); background: var(--mg-tint); }
.dr-batch__n { font: 600 13px/1 var(--mg-sans); margin-right: 8px; }
.dr.is-dragging .dr-drop { box-shadow: inset 0 0 0 2px var(--mg-gold); }
.dr-menu { position: absolute; z-index: 60; display: flex; flex-direction: column; min-width: 200px; padding: 6px; border-radius: 8px; background: var(--mg-paper, #fff); box-shadow: 0 8px 24px rgba(25, 25, 24, 0.16), 0 0 0 1px var(--mg-hair); }
.dr-menu > * { padding: 8px 10px; border: 0; border-radius: 6px; background: none; text-align: left; font: 400 13px/1.3 var(--mg-sans); color: var(--mg-ink); text-decoration: none; cursor: pointer; }
.dr-menu > *:hover { background: var(--mg-hover); }
.dr-menu .is-danger { color: var(--mg-red, #b23b2c); }
.dr-modal { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(25, 25, 24, 0.32); }
.dr-modal .dlg { width: min(480px, 100%); max-height: 80vh; display: flex; flex-direction: column; gap: 12px; padding: 20px; border-radius: 12px; background: var(--mg-paper, #fff); }
.dr-modal .dlg__t { margin: 0; font: 600 16px/1.3 var(--mg-sans); }
.dr-catlist { overflow: auto; display: flex; flex-direction: column; gap: 6px; font: 400 13px/1.4 var(--mg-sans); }
.dr-modal .dlg__actions { display: flex; justify-content: flex-end; gap: 8px; }
.dr-none { padding: 32px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.dr-phone { display: none; }
@media (max-width: 1099px) { .pane { grid-template-columns: minmax(0, 1fr); } .dr .covlist--13 { columns: 1; } }
@media (max-width: 640px) {
  .dr .m-back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 8px; }
  .dr .pg-head { flex-direction: column; align-items: stretch; gap: 12px; }
  .dr .m-actions { display: flex; flex-wrap: wrap; gap: 8px; }
  .dr .m-actions .btn { flex: 1 1 auto; justify-content: center; }
  .dr .cov { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .dr-desk { display: none; }
  .dr-phone { display: block; margin-top: 16px; }
  .m-label { display: block; margin-bottom: 6px; font: 500 12px/1.3 var(--mg-sans); color: var(--mg-ink-3); }
  .m-select { width: 100%; }
  .m-files { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
  .m-file { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 10px; background: var(--mg-paper, #fff); box-shadow: inset 0 0 0 1px var(--mg-hair); text-decoration: none; color: inherit; min-width: 0; }
  .m-file__name { font: 500 14px/1.35 var(--mg-sans); overflow-wrap: anywhere; }
  .m-file__cat, .m-file__meta { font: 400 12px/1.3 var(--mg-sans); color: var(--mg-ink-3); }
  .m-more { width: 100%; margin-top: 12px; justify-content: center; }
}
/* File preview sidebar (handoff 14): Filed under chips, facts, Used in drafts cards. */
.fp-cats { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.fp-cat { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; background: var(--mg-tint); box-shadow: inset 0 0 0 1px var(--mg-hair); font: 500 12px/1.3 var(--mg-sans); color: var(--mg-ink); }
.fp-dl .st { display: inline-flex; }
.fp-doc { display: flex; gap: 12px; align-items: flex-start; padding: 12px; margin-top: 8px; text-decoration: none; color: inherit; min-width: 0; }
.fp-doc__cover { flex: none; width: 56px; height: 72px; overflow: hidden; border-radius: 4px; box-shadow: inset 0 0 0 1px var(--mg-hair); }
.fp-doc__cover img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.fp-doc__body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fp-doc__t { font: 500 13px/1.3 var(--mg-sans); overflow-wrap: anywhere; }
.fp-cite { margin: 0; font: 400 12px/1.4 var(--mg-sans); color: var(--mg-ink-2); }
.fp-foot { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--mg-hair); }
/* ==== /track:w2-dataroom ==== */
/* ==== track:w3-dealdraft ==== */
body.mg-app-ui .hs-card[hidden] { display: none; }
body.mg-app-ui .hs-card { margin: 0 0 20px; padding: 16px 18px; background: var(--mg-paper, #fff); border: 1px solid var(--mg-line, rgba(0,0,0,.1)); border-radius: 12px; min-width: 0; }
body.mg-app-ui .hs-card__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 10px; }
body.mg-app-ui .hs-card__title { font: 600 15px/1.3 var(--mg-sans, inherit); color: var(--mg-ink, #1a1a1a); }
body.mg-app-ui .hs-card__firm { font-size: 13px; color: var(--mg-ink-3, #6b6b6b); overflow-wrap: anywhere; }
body.mg-app-ui .hs-card__rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 10px 20px; margin: 0; }
body.mg-app-ui .hs-card__row { min-width: 0; }
body.mg-app-ui .hs-card__row dt { font-size: 12px; color: var(--mg-ink-3, #6b6b6b); }
body.mg-app-ui .hs-card__row dd { margin: 2px 0 0; font-size: 13px; color: var(--mg-ink, #1a1a1a); overflow-wrap: anywhere; }
body.mg-app-ui .hs-card__pal { display: flex; flex-wrap: wrap; gap: 6px; }
body.mg-app-ui .hs-card__sw { width: 20px; height: 20px; border-radius: 4px; border: 1px solid var(--mg-line, rgba(0,0,0,.1)); }
/* ==== /track:w3-dealdraft ==== */
/* ==== track:y4-polish ==== */
/* Native controls inside the styled .search / .select shells carry no border of their own. */
.search input, .select select { border: 0; outline: 0; background: transparent; box-shadow: none; font: inherit; color: var(--mg-ink); min-width: 0; flex: 1 1 auto; padding: 0; }
.search input { -webkit-appearance: none; appearance: none; }
.search input::-webkit-search-decoration { -webkit-appearance: none; }
.search:focus-within, .select:focus-within, .input:focus-within { outline: none; border-color: var(--mg-ink); box-shadow: 0 0 0 3px rgba(25,25,24,.08); }
/* The shell carries the focus ring (handoff 04 `.in--focus`); the native control inside draws none. */
.mg-app-ui :is(.search, .select, .input) :is(input, select, textarea):focus-visible { outline: none; box-shadow: none; }
.dev-shares { margin: 16px 0; font: 400 14px/1.5 var(--mg-sans); color: var(--mg-ink); }
.dev-shares ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.dev-shares li { min-width: 0; overflow-wrap: anywhere; }
.dev-shares__meta { color: var(--mg-ink-3); font-size: 13px; }
/* Phone data room: .pg-head turns into a column there, so the 320px flex-basis of .pg-head__main became a 320px-tall empty band. */
@media (max-width: 640px) { .dr .pg-head > .pg-head__main { flex: 0 0 auto; } }
/* ==== /track:y4-polish ==== */
/* ==== track:z2-deals ==== */
/* ⋯ menus opened by DealTile.bindMenus sit on <body> while open (fixed, placed inside the content area). */
.dtile-menu.dtile-menu--portal { position: fixed; z-index: 900; }
.mg-tile.is-menu-open, .mg-tile.is-menu-open:hover { transform: none !important; transition: none !important; }
/* Composite fields (a bare input inside a bordered group, e.g. the wizard's Enterprise value):
   one gold ring around the group, none on the bare input inside it. */
.mg-app-ui .in__bare:focus-visible { outline: none; }
.mg-app-ui .in--group:has(.in__bare:focus-visible) { outline: 2px solid #8a5e08; outline-offset: 3px; }
/* Custom selects (deal form): open upward when the window has no room below (phone wizard). */
.cs.cs--up > .cs__dropdown { top: auto; bottom: calc(100% + 4px); }
/* Dictionary lists loading / failed (deal form): the three selects say so; a note offers Try again. */
.cs.cs--loading > .cs__trigger, .cs.cs--failed > .cs__trigger { cursor: default; opacity: 0.72; }
.cs.cs--loading > .cs__trigger .cs__label { animation: mg-dfi-pulse 1.2s ease-in-out infinite; }
@keyframes mg-dfi-pulse { 50% { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) { .cs.cs--loading > .cs__trigger .cs__label { animation: none; } }
.dfi-dict-note { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 14px; padding: 10px 12px; border: 1px solid var(--mg-hair); border-radius: var(--mg-r-ctl); background: var(--mg-tint); font: 400 13px/1.45 var(--mg-sans); color: var(--mg-ink-2); }
.fs .dfi-dict-note { grid-column: 1 / -1; }
/* Edit Deal drawer (DealFormInfo layout 'stack'): the new-deal wizard's fields. */
.dfi-stack { display: flex; flex-direction: column; }
.dfi-stack .fs { display: flex; flex-direction: column; gap: 14px; padding: 0 0 22px; }
.dfi-stack .fs + .fs { padding-top: 22px; border-top: 1px solid var(--mg-hair); }
.dfi-stack .fs__t { font: 600 14px/1.35 var(--mg-sans); color: var(--mg-ink); }
.dfi-stack .fs__fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px 16px; align-content: start; }
@media (max-width: 480px) { .dfi-stack .fs__fields { grid-template-columns: minmax(0, 1fr); } }
.dfi-stack .f { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.dfi-stack .f__l { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; font: 500 13px/1.3 var(--mg-sans); color: var(--mg-ink); }
.dfi-stack .f__l em { font-style: normal; font-weight: 400; color: var(--mg-ink-3); }
.dfi-stack .f__req { color: var(--mg-ink); }
.dfi-stack .f__max { font: 400 12px/1.45 var(--mg-sans); color: var(--mg-red-text); }
.dfi-stack .in { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; height: 38px; min-height: 38px; padding: 0 13px; background: #fff; border: 1px solid var(--mg-edge); border-radius: var(--mg-r-ctl); font: 400 14px/1 var(--mg-sans); color: var(--mg-ink-3); min-width: 0; box-shadow: none; }
.dfi-stack .in .ic { width: 16px; height: 16px; flex: none; color: var(--mg-ink-3); transition: transform 150ms var(--mg-ease); }
.dfi-stack input.in { color: var(--mg-ink); outline: none; }
.dfi-stack input.in::placeholder, .dfi-stack .in__bare::placeholder { color: var(--mg-ink-3); opacity: 1; }
.dfi-stack input.in:focus, .dfi-stack .in--group:focus-within, .dfi-stack .cs.open > .cs__trigger.in { border-color: var(--mg-ink); box-shadow: 0 0 0 3px rgba(25, 25, 24, 0.08); }
.dfi-stack button.in { cursor: pointer; text-align: left; }
.dfi-stack .cs { min-width: 0; width: 100%; }
.dfi-stack .cs__trigger.in:hover { border-color: var(--mg-ink-3); }
.dfi-stack .cs[data-value]:not([data-value=""]) > .cs__trigger.in { color: var(--mg-ink); }
.dfi-stack .cs__label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dfi-stack .cs.open .cs__arrow { transform: rotate(180deg); }
.dfi-stack .cs__dropdown { border: 1px solid var(--mg-hair); border-radius: var(--mg-r-md); background: #fff; box-shadow: var(--mg-shadow-pop); padding: 4px; max-height: 264px; }
.dfi-stack .cs__option { padding: 9px 10px; border-radius: var(--mg-r-ctl); font: 400 14px/1.3 var(--mg-sans); color: var(--mg-ink); cursor: pointer; }
.dfi-stack .cs__option:hover { background: var(--mg-hover); }
.dfi-stack .cs__option--selected { color: var(--mg-ink); font-weight: 500; background: var(--mg-tint); }
.dfi-stack .in--group { padding: 0; gap: 0; cursor: text; position: relative; }
.dfi-stack .in__affix { flex: none; padding-left: 13px; font: 400 14px/1 var(--mg-sans); color: var(--mg-ink-3); }
.dfi-stack .in__bare { flex: 1; min-width: 0; height: 100%; padding: 0 10px 0 5px; border: 0; background: transparent; font: 400 14px/1 var(--mg-sans); color: var(--mg-ink); outline: none; }
.dfi-stack .cs--unit { width: auto; flex: none; position: static; }
.dfi-stack .cs--unit .cs__dropdown { left: auto; right: 0; width: 160px; }
.dfi-stack .in__unit { display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 11px 0 12px; border: 0; border-left: 1px solid rgba(25, 25, 24, 0.12); border-radius: 0 var(--mg-r-ctl) var(--mg-r-ctl) 0; background: var(--mg-tint); font: 500 13px/1 var(--mg-sans); color: var(--mg-ink); cursor: pointer; }
.dfi-stack .in__unit .ic { width: 14px; height: 14px; color: var(--mg-ink-3); }
/* ==== /track:z2-deals ==== */
/* ==== track:z3-files ==== */
/* CSS spinner used where Font Awesome fa-spin used to be (no icon font on rebuilt pages). */
.mg-spin { display: inline-block; width: 12px; height: 12px; flex: none; vertical-align: -1px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: mg-spin 0.8s linear infinite; }
@keyframes mg-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .mg-spin { animation-duration: 2.4s; } }
/* Data room coverage list: a real grid of readable columns (no zero-width title column, no letter-per-line). */
.dr .covlist, .dr .covlist--13 { grid-auto-flow: row; grid-template-rows: none; grid-auto-columns: auto; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); columns: auto; gap: 4px 24px; }
.dr .covlist__row { grid-template-columns: 16px minmax(112px, 1fr) auto; }
.dr .covlist__t { overflow-wrap: break-word; word-break: normal; hyphens: auto; }
.dr .covlist__sq { flex-wrap: wrap; justify-content: flex-end; max-width: 128px; }
@media (max-width: 640px) { .dr .covlist, .dr .covlist--13 { grid-template-columns: minmax(0, 1fr); margin-top: 0; } }
/* Diligence Index rail stays in view while the list scrolls. */
@media (min-width: 1100px) {
  .dr .pane { align-items: start; }
  .dr .pane > .idx { position: sticky; top: 16px; max-height: calc(100vh - 112px); overflow-y: auto; overscroll-behavior: contain; }
}
/* 1100–1439: narrower fixed columns so the Name column keeps room for file names. */
@media (max-width: 1439px) {
  .dr .col-cb { width: 44px; } .dr .col-added { width: 120px; } .dr .col-status { width: 92px; } .dr .col-used { width: 88px; } .dr .col-act { width: 72px; }
  .dr .ft .tbl th, .dr .ft .tbl td { padding-left: 10px; padding-right: 10px; }
  .dr .ft .tbl .c-cb { padding-left: 16px; }
}
/* Batch bar: count + Clear stay together; the action buttons wrap as one group (never one button alone). */
.dr .dr-batch { gap: 8px 16px; }
.dr .dr-batch__sel { display: inline-flex; align-items: baseline; gap: 10px; flex: none; }
.dr .dr-batch__sel .dr-batch__n { margin-right: 0; }
.dr .dr-batch__acts { display: flex; flex-wrap: wrap; gap: 6px; }
.dr .dr-batch__acts .btn { padding-left: 10px; padding-right: 10px; }
/* Search field clear button in the ink of the field, not the blue WebKit glyph. */
.search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; width: 14px; height: 14px; margin-left: 6px; cursor: pointer; opacity: 0.7;
  background: center / 14px 14px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23585853' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E"); }
.search input::-webkit-search-cancel-button:hover { opacity: 1; }
/* Menus: current deal, keyboard focus. */
.dr-menu { max-height: calc(100vh - 16px); overflow-y: auto; }
.dr-menu > a, .dr-menu > button { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dr-menu > .is-current { font-weight: 600; background: var(--mg-tint); }
.dr-menu > *:focus-visible { outline: 2px solid var(--mg-gold, #c79a2b); outline-offset: -2px; }
/* Switch deal: a search box, then two-line rows (target company / code name), as the old switcher. */
.dr-menu--deals { min-width: 300px; max-width: 360px; }
.dr-menu--deals > .dr-menu__search { display: flex; align-items: center; gap: 8px; padding: 6px 10px; margin-bottom: 4px; border-radius: 6px; background: var(--mg-tint); color: var(--mg-ink-3); cursor: text; }
.dr-menu--deals > .dr-menu__search:hover { background: var(--mg-tint); }
.dr-menu--deals > .dr-menu__search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: 400 13px/1.3 var(--mg-sans); color: var(--mg-ink); }
.dr-menu--deals > .dr-menu__rows { display: flex; flex-direction: column; padding: 0; max-height: min(60vh, 420px); overflow-y: auto; cursor: default; }
.dr-menu--deals > .dr-menu__rows:hover { background: none; }
.dr-menu--deals .dr-menu__rows > a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: 6px; color: var(--mg-ink); text-decoration: none; }
.dr-menu--deals .dr-menu__rows > a:hover { background: var(--mg-hover); }
.dr-menu--deals .dr-menu__rows > a.is-current { font-weight: 600; background: var(--mg-tint); }
.dr-menu--deals .dr-menu__rows > .sub { padding: 8px 10px; color: var(--mg-ink-3); }
.dr-deal { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.dr-deal__t { display: flex; align-items: center; gap: 8px; min-width: 0; font: 500 13px/1.3 var(--mg-sans); overflow-wrap: anywhere; }
.dr-deal__c { font: 400 12px/1.3 var(--mg-sans); color: var(--mg-ink-3); }
.dr-deal__arch { font: 500 10px/1 var(--mg-sans); letter-spacing: .04em; text-transform: uppercase; padding: 2px 6px; border-radius: 999px; background: var(--mg-tint); color: var(--mg-ink-3); }
/* Category dialog: numbered sections with their categories. */
.dr-catlist { gap: 12px; padding-right: 4px; }
.dr-catgrp { margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 2px; }
.dr-catgrp legend { display: flex; gap: 8px; padding: 0 0 4px; font: 600 13px/1.3 var(--mg-sans); color: var(--mg-ink); }
.dr-cat { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 2px 8px 2px 4px; border-radius: 6px; cursor: pointer; }
.dr-cat:hover { background: var(--mg-hover); }
.dr-cat__n { min-width: 28px; font: 500 12px/1.3 var(--mg-sans); color: var(--mg-ink-3); font-variant-numeric: tabular-nums; }
/* Folder index note, error and loading states. */
.idx-none { margin: 4px 6px 8px; font: 400 12px/1.5 var(--mg-sans); color: var(--mg-ink-3); }
.dr-err { margin-top: 20px; padding: 24px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.dr-err .err__p { margin: 0; font: 400 13px/1.5 var(--mg-sans); color: var(--mg-ink-2); }
.dr-sk .pg-head__main { display: flex; flex-direction: column; gap: 10px; }
.dr-sk .sumt__cell { display: flex; flex-direction: column; gap: 10px; }
.dr-sk .sk-line { animation: mg-sk-pulse 1.4s ease-in-out infinite; }
.dr-sk__idx { display: flex; flex-direction: column; gap: 14px; min-height: 320px; padding: 20px 16px; }
.dr-sk__tbl { display: flex; flex-direction: column; }
.dr-sk__row { display: grid; grid-template-columns: 16px minmax(0, 1fr) 15% 12%; gap: 16px; align-items: center; padding: 18px 24px; border-bottom: 1px solid var(--mg-hair); }
.dr-sk__row .sk-line { width: auto; }
.dr-sk__phone { display: none; }
.dr-sk__phone .sk-line { margin-bottom: 10px; border-radius: 10px; }
@keyframes mg-sk-pulse { 50% { opacity: 0.55; } }
@media (prefers-reduced-motion: reduce) { .dr-sk .sk-line { animation: none; } }
@media (max-width: 640px) {
  .dr-sk .dr-sk__phone { display: block; }
  .dr .m-search { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 10px; height: 40px; }
  .dr .m-scope { margin: 8px 0 0; }
  .dr .m-empty { margin-top: 16px; padding: 24px 16px; border-radius: 10px; background: var(--mg-paper, #fff); box-shadow: inset 0 0 0 1px var(--mg-hair); text-align: center; }
  .dr .m-empty__t { margin: 0; font: 600 14px/1.4 var(--mg-sans); color: var(--mg-ink); }
  .dr .m-empty__p { margin: 6px 0 0; font: 400 13px/1.5 var(--mg-sans); color: var(--mg-ink-2); }
}
/* File names on one line: the stem shortens with an ellipsis, the extension always shows (full name in the title). */
.dr .ft .fname__t { flex: 1 1 auto; min-width: 0; }
.dr .ft .fname__n { display: block; min-width: 0; white-space: nowrap; overflow: hidden; overflow-wrap: normal; }
.dr .ft .fname__stem { display: inline-block; max-width: calc(100% - 3.4em); overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
/* Index rail wide enough for long section names at 1100–1440. */
@media (min-width: 1100px) { .dr .pane { grid-template-columns: clamp(300px, 23vw, 340px) minmax(0, 1fr); } }
/* ==== /track:z3-files ==== */
/* ==== track:z5-admin ==== */
/* Audit trail: three columns from 1180 px, two (orgs over summary | detail) from 901 px, one below.
   Never a sideways scroll. */
.mg-app-ui .at-root { overflow: visible; }
@media (min-width: 1180px) {
  .mg-app-ui .at-layout { grid-template-columns: minmax(200px,240px) minmax(300px,380px) minmax(0,1fr); }
}
@media (max-width: 1179px) and (min-width: 901px) {
  .mg-app-ui .at-layout { grid-template-columns: minmax(260px,320px) minmax(0,1fr); grid-template-rows: minmax(0,40%) minmax(0,1fr); grid-template-areas: "orgs det" "sum det"; }
  .mg-app-ui .at-layout > .at-col:nth-child(1) { grid-area: orgs; border-bottom: 1px solid var(--at-border); }
  .mg-app-ui .at-layout > .at-col:nth-child(2) { grid-area: sum; }
  .mg-app-ui .at-layout > .at-col:nth-child(3) { grid-area: det; }
}
@media (max-width: 900px) {
  .mg-app-ui .at-root { overflow: visible; }
  .mg-app-ui .at-layout { grid-template-columns: minmax(0,1fr); }
}
/* DD categories: the register never scrolls sideways (rows reflow), so the row menu is not clipped. */
.mg-app-ui .dc-tree { overflow: visible; }
/* Sign-in / sign-up: the logo leads the form on phones; text links are 44px targets. */
.gate__phone-logo { display: none; }
.gate__top .ulink, .auth__row .ulink { display: inline-flex; align-items: center; min-height: 44px; }
@media (max-width: 760px) {
  .gate__phone-logo { display: inline-flex; }
  .gate__top { flex-wrap: wrap; justify-content: flex-end; }
  .gate__top .gate__phone-logo { margin-right: auto; }
  .su-phone-logo { margin-bottom: 20px; }
}
@media (max-width: 430px) { .gate__top > span { display: none; } }
/* ==== /track:z5-admin ==== */
/* ==== track:p-c ==== */
/* Data room file names: one truncation rule. The stem shortens with an ellipsis and the extension
   follows it directly, so every row reads "Name….ext" with the same (zero) gap. */
.dr .ft .fname__n { display: flex; align-items: baseline; }
.dr .ft .fname__stem { display: block; flex: 0 1 auto; max-width: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dr .ft .fname__tail { display: block; flex: none; white-space: nowrap; }
/* Buyer Q&A: data-room pane error with a Retry button, and its loading skeleton. */
.qa-err { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.qa-sk .dev-stats > div { min-height: 64px; }
/* Preview sidebar: "Primary" sits inside its own category chip. */
.pv-detail-categories .pv-detail-category .pv-detail-note.pv-detail-primary { margin-left: 0; color: var(--mg-ink-3); font-size: 12px; }
/* ==== /track:p-c ==== */
/* ==== track:p-a ==== */
/* R2 N1: the open ⋯ wrapper (and its row) sit above the later rows' ⋯ buttons. */
.dtile-more.is-menu-open { z-index: 950; }
.is-menu-open:not(.mg-tile):not(.dtile-more) { position: relative; z-index: 940; }
/* R2 N2: the dictionary note spans the fields grid it sits in. */
.fs__fields > .dfi-dict-note, .wiz-form-grid > .dfi-dict-note { grid-column: 1 / -1; }
/* ==== /track:p-a ==== */
/* ==== track:cover-scroll ==== */
/* A full-page snapshot keeps its own aspect so the part below the sheet can scroll into view on hover
   (CoverFlip.scroller sets the transform); one no taller than the sheet still fills it from the top. */
.sheet[data-cover-scroll] > img { height: auto !important; min-height: 100%; bottom: auto !important; will-change: transform; }
@media (prefers-reduced-motion: reduce) { .sheet[data-cover-scroll] > img { transform: none !important; transition: none !important; } }
/* ==== /track:cover-scroll ==== */
/* ==== track:p2-auth-aux ==== */
/* Sign-in gate companions (forgot / reset / accept-invite / SSO) share handoff 20's story and form. */
.desk .pg__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2.4cqw; margin-top: 2.6cqw; }
.desk .pg__grid .pg__ph { display: grid; place-items: center; width: auto; margin: 0; padding: 0; background: none; border: 0.14cqw dashed #b9b7ae; border-radius: 0.6cqw; color: #77756e; font-size: 1.3cqw; }
.gate__foot a:hover { color: #191918; }
@media (min-width: 761px) { .gate__top .ulink { min-height: 0; } }
.gate__top:empty { min-height: 13px; }
.auth__ctx { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; font: 500 13px/1.3 var(--mg-sans); color: var(--mg-ink-2); }
.auth__ctx .ic { width: 16px; height: 16px; color: var(--mg-ink-3); flex: none; }
.auth__ctx b { font-weight: 600; color: var(--mg-ink); }
.f__in[readonly] { background: #fafaf7; color: var(--mg-ink-2); }
.f__meter { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.f__meter .meter > i { background: var(--mg-ink); transition: width .2s ease; }
.f__meter .f__help { min-width: 7ch; text-align: right; }
/* A finished step (link sent, password updated) and a page-level problem (invalid link). */
.auth-done, .auth-fail { margin-top: 26px; padding: 18px 18px 20px; border-radius: 8px; background: #fafaf7; box-shadow: inset 0 0 0 1px rgba(25,25,24,.08); }
.auth-done p, .auth-fail p { margin: 8px 0 0; font: 400 14px/1.5 var(--mg-sans); color: var(--mg-ink-2); overflow-wrap: anywhere; }
.auth-done p b { font-weight: 600; color: var(--mg-ink); }
.auth-fail > .ic { display: block; width: 20px; height: 20px; color: #b91c1c; margin-bottom: 8px; }
.auth-fail .err__t { margin: 0; font: 600 15px/1.4 var(--mg-sans); color: var(--mg-ink); }
.auth-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 18px; }
.auth-wait { display: flex; flex-direction: column; gap: 10px; margin-top: 30px; }
.auth-wait .sk-line { height: 40px; border-radius: 8px; }
.auth-wait .st { margin-top: 4px; }
.auth__alt .ulink { font-size: 14px; }
@media (max-width: 760px) { .auth-actions .btn { width: 100%; } }
.auth [hidden] { display: none !important; }
.gate a.btn--primary { color: var(--mg-on-ink); }
.gate a.btn { text-decoration: none; }
.ulink--btn { background: none; border: 0; padding: 0; cursor: pointer; }
/* ==== /track:p2-auth-aux ==== */
/* ==== track:p2-phone-dataroom ==== */
/* Phone data room (handoff 31): its own head, summary tile, index control and one grouped file card.
   Desktop keeps .dr-wide (head + summary); everything here lives under .dr-phone. */
@media (max-width: 640px) {
  .dr .dr-wide { display: none; }
  .dr .dr-phone { margin-top: 0; }
  .dr-phone .drp-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -10px 0 2px; }
  .dr .dr-phone .m-back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin: 0 0 0 -2px; font: 500 14px/1 var(--mg-sans); color: var(--mg-ink-2); text-decoration: none; }
  .dr-phone .m-back .ic { width: 16px; height: 16px; color: var(--mg-ink-3); }
  .dr-phone .drp-switch { min-height: 44px; padding: 0; border: 0; background: none; cursor: pointer; color: var(--mg-ink-2); }
  .dr-phone .drp-switch .ic { color: var(--mg-ink-3); }
  .dr-phone .drp-head .pg-title { font-size: 32px; }
  .dr-phone .drp-head .pg-sub { margin: 8px 0 0; font: 400 14px/1.5 var(--mg-sans); color: var(--mg-ink-2); }
  .dr-phone .m-upload { width: 100%; height: 44px; margin-top: 18px; justify-content: center; }
  .dr-phone .drp-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
  .dr-phone .drp-actions:empty { display: none; }
  .dr-phone .drp-actions .btn { height: 44px; padding: 0 10px; gap: 6px; justify-content: center; }
  .dr-phone .drp-actions .btn:only-child { grid-column: 1 / -1; }
  .dr-phone .drp-head + .drp-actions { margin-top: 18px; }
  .dr-phone .m-sum { margin-top: 24px; }
  .dr-phone .m-figrow { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
  .dr-phone .m-pct { font: 500 13px/1.3 var(--mg-sans); color: var(--mg-ink-2); text-align: right; }
  .dr-phone .sumt__bar.m-wide { max-width: none; }
  .dr-phone .m-progrow { align-items: center; justify-content: space-between; }
  .dr-phone .cov34 { display: flex; align-items: center; gap: 5px; }
  .dr-phone .cov34 > span { display: flex; gap: 2px; flex: 1 1 0; }
  .dr-phone .cov34 i { display: block; flex: 1 1 0; min-width: 3px; height: 14px; border-radius: 1.5px; background: var(--mg-graph); }
  .dr-phone .cov34 i.p { background: var(--mg-gold); }
  .dr-phone .cov34 i.e { background: transparent; box-shadow: inset 0 0 0 1px rgba(25, 25, 24, 0.38); }
  .dr-phone .cov34__legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font: 400 12px/1.2 var(--mg-sans); color: var(--mg-ink-2); }
  .dr-phone .cov34__legend span { display: inline-flex; align-items: center; gap: 7px; }
  .dr-phone .cov34__legend .sq { display: block; width: 6px; height: 10px; border-radius: 1.5px; }
  .dr-phone .cov34__legend .sq--e { box-shadow: inset 0 0 0 1px rgba(25, 25, 24, 0.38); }
  .dr-phone .m-label { display: block; margin: 28px 0 8px; font: 600 13px/1.3 var(--mg-sans); color: var(--mg-ink-2); }
  .dr-phone .m-select { width: 100%; height: 44px; text-align: left; }
  .dr-phone .m-select b { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .dr-phone .m-select span.n { margin-left: auto; margin-right: 8px; color: var(--mg-ink-3); font-weight: 500; }
  .dr-phone .m-select .ic { flex: none; }
  .dr .dr-phone .m-search { margin-top: 8px; height: 44px; }
  .dr-phone .m-files { display: block; gap: 0; margin-top: 16px; overflow: hidden; }
  .dr-phone .m-file { position: relative; display: block; padding: 0; border-radius: 0; background: none; box-shadow: none; }
  .dr-phone .m-file + .m-file { border-top: 1px solid var(--mg-hair); }
  .dr-phone .m-file--now { background: var(--mg-tint); }
  .dr-phone .m-file--failed { background: rgba(178, 59, 44, 0.04); }
  .dr-phone .m-file__open { display: block; width: 100%; padding: 14px 16px; border: 0; background: none; text-align: left; font: inherit; color: var(--mg-ink); cursor: pointer; }
  .dr-phone .m-file__open:focus-visible { outline: 2px solid var(--mg-ink); outline-offset: -2px; }
  .dr-phone .m-file__top { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; align-items: start; }
  .dr-phone .fname__ic { display: grid; place-items: center; width: 32px; height: 36px; border-radius: var(--mg-r-ctl); background: #fff; box-shadow: inset 0 0 0 1px rgba(25, 25, 24, 0.12), 0 1px 2px rgba(25, 25, 24, 0.05); color: var(--mg-ink-2); }
  .dr-phone .fname__ic .ic { width: 16px; height: 16px; }
  .dr-phone .m-file__body { display: block; min-width: 0; }
  .dr-phone .m-file__name { display: block; font: 500 14px/1.35 var(--mg-sans); color: var(--mg-ink); overflow-wrap: anywhere; }
  .dr-phone .m-file__cat { display: block; margin-top: 2px; font: 400 12px/1.35 var(--mg-sans); color: var(--mg-ink-3); }
  .dr-phone .m-file__bad { display: block; margin-top: 4px; font: 400 12px/1.4 var(--mg-sans); color: var(--mg-red, #b23b2c); }
  .dr-phone .m-file__meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 10px 32px 0 44px; font: 400 12px/1.2 var(--mg-sans); color: var(--mg-ink-3); }
  .dr-phone .m-file__meta .st { font-size: 12px; flex: none; }
  .dr-phone .m-file__meta .dr-stall { margin-left: 6px; font: 400 12px/1.2 var(--mg-sans); color: var(--mg-ink-3); }
  .dr-phone .m-file__by { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
  .dr-phone .m-file__more { position: absolute; right: 2px; bottom: 0; width: 44px; height: 44px; color: var(--mg-ink-3); }
  .dr-phone .m-more { display: flex; align-items: center; justify-content: space-between; width: auto; margin-top: 16px; font: 400 14px/1 var(--mg-sans); color: var(--mg-ink-3); }
  .dr-phone .m-more .btn { height: 44px; }
}
.drp-menu { padding: 6px; max-height: min(70vh, 480px); }
.drp-menu .drp-mi { display: grid; grid-template-columns: minmax(0, 1fr) auto 16px; align-items: center; gap: 10px; min-height: 44px; }
.drp-menu .drp-mi__t { min-width: 0; overflow-wrap: anywhere; }
.drp-menu .drp-mi__code { display: inline-block; min-width: 30px; color: var(--mg-ink-3); font-variant-numeric: tabular-nums; }
.drp-menu .drp-mi--sub { padding-left: 22px; color: var(--mg-ink-2); }
.drp-menu .drp-mi__n { color: var(--mg-ink-3); font-variant-numeric: tabular-nums; }
.drp-menu .drp-mi .ic { width: 16px; height: 16px; }
.drp-menu .drp-mh { padding: 12px 10px 4px; margin-top: 6px; border-top: 1px solid var(--mg-hair); border-radius: 0; font: 600 12px/1.2 var(--mg-sans); color: var(--mg-ink-3); cursor: default; }
.drp-menu .drp-mh:hover { background: none; }
/* ==== /track:p2-phone-dataroom ==== */

/* ==== track:p3-share ==== */
/* Share Document dialog (handoff 12), scoped to .shm so the global .dlg (MgStates confirm) is untouched. */
.shm{position:fixed;inset:0;z-index:1000;place-items:center;padding:24px;background:rgba(25,25,24,.42)}
.shm .shm__dlg{display:flex;flex-direction:column;width:620px;max-width:calc(100vw - 48px);max-height:calc(100vh - 48px);margin:0;border-radius:12px;background:#fff;box-shadow:0 0 0 1px rgba(25,25,24,.06),0 28px 64px -18px rgba(25,25,24,.45);overflow:hidden}
.shm .dlg__head{flex:none;display:flex;align-items:flex-start;gap:16px;padding:22px 24px 18px}
.shm .dlg__head .iconbtn{margin-left:auto}
.shm .dlg__body{flex:1 1 auto;min-height:0;overflow-y:auto;padding:0 0 20px}
.shm .dlg__title{margin:0;font:400 28px/1.1 'Newsreader',Georgia,serif;letter-spacing:-.014em;color:#191918}
.shm .dlg__doc{display:flex;align-items:center;gap:14px;margin:0 24px;padding:12px}
.shm .dlg__thumb{flex:none;width:74px;padding:7px 8px 0;height:54px;border-radius:6px;background:#ebeae4;box-shadow:inset 0 1px 2px rgba(25,25,24,.08);overflow:hidden;box-sizing:border-box}
.shm .dlg__thumb .sheet{width:100%}
.shm .dlg__thumb .sheet img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:top}
.shm .dlg__docname{display:flex;flex-direction:column;gap:5px;min-width:0}
.shm .dlg__docname b{font:600 14px/1.3 'Inter',sans-serif;color:#191918;overflow-wrap:anywhere}
.shm .dlg__docmeta{display:flex;align-items:center;flex-wrap:wrap;gap:4px 8px;font:400 12px/1.2 'Inter',sans-serif;color:#555550}
.shm .dlg__docmeta .st{font:500 12px/1.2 'Inter',sans-serif}
.shm .dlg__sec{position:relative;padding:18px 24px 0}
.shm .dlg__k{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:9px;font:600 13px/1.2 'Inter',sans-serif;color:#191918}
.shm .dlg__k span{font-weight:400;font-size:12px;color:#555550;text-align:right}
.shm .addr{display:flex;align-items:flex-start;gap:8px}
.shm .addr__field{flex:1;min-width:0;display:flex;align-items:center;flex-wrap:wrap;gap:6px;min-height:38px;padding:4px 8px;border:1px solid rgba(25,25,24,.18);border-radius:6px;background:#fff;box-sizing:border-box;cursor:text}
.shm .addr__field.is-focus{box-shadow:0 0 0 3px rgba(25,25,24,.05);border-color:rgba(25,25,24,.32)}
.shm .addr__chips{display:contents}
.shm .addr__chip{display:inline-flex;align-items:center;gap:6px;max-width:100%;height:28px;padding:0 4px 0 10px;border-radius:999px;background:#f1f0ea;box-shadow:inset 0 0 0 1px rgba(25,25,24,.08);font:500 13px/1 'Inter',sans-serif;color:#191918;box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.shm .addr__chip button{flex:none;display:inline-grid;place-items:center;width:22px;height:22px;padding:0;border:0;border-radius:50%;background:transparent;color:#555550;cursor:pointer}
.shm .addr__chip button:hover{background:rgba(25,25,24,.06);color:#191918}
.shm .addr__chip button .ic{width:14px;height:14px}
.shm .addr__in{flex:1;min-width:150px;height:28px;border:0;outline:0;padding:0;font:400 14px/1 'Inter',sans-serif;color:#191918;background:transparent;box-shadow:none}
.shm .addr__in:focus,.shm .addr__in:focus-visible{outline:none;box-shadow:none}
.shm .addr__in::placeholder{color:#555550;opacity:1}
.shm .addr .btn{flex:none;height:38px}
.shm .shm-sugg{position:absolute;left:24px;right:84px;top:calc(100% + 4px);z-index:2;margin:0;padding:4px;list-style:none;border-radius:8px;background:#fff;box-shadow:0 0 0 1px rgba(25,25,24,.1),0 12px 28px -12px rgba(25,25,24,.35)}
.shm .shm-sugg li{display:flex;align-items:center;gap:12px;padding:8px 10px;border-radius:6px;cursor:pointer}
.shm .shm-sugg li:hover,.shm .shm-sugg li.is-on{background:#f4f3ec}
.shm .shm-sugg li[aria-disabled]{cursor:default;opacity:.62}
.shm .shm-sugg__who{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1}
.shm .shm-sugg__who b{font:600 13px/1.3 'Inter',sans-serif;color:#191918}
.shm .shm-sugg__who span{font:400 12px/1.3 'Inter',sans-serif;color:#555550;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.shm .shm-sugg__tag{flex:none;font:500 12px/1 'Inter',sans-serif;color:#33322f}
.shm .shm-msg{display:none;margin:8px 0 0;font:400 12px/1.45 'Inter',sans-serif;color:#33322f}
.shm .shm-msg.is-on{display:block}
.shm .shm-msg.is-err{color:var(--mg-red-text,#a3261b)}
.shm .ppl{margin:0;padding:0;list-style:none;border-top:1px solid rgba(25,25,24,.08)}
.shm .ppl__row{display:grid;grid-template-columns:minmax(0,1fr) auto 32px;align-items:center;gap:12px;padding:11px 0;border-bottom:1px solid rgba(25,25,24,.06)}
.shm .ppl__who{display:flex;flex-direction:column;gap:2px;min-width:0}
.shm .ppl__who b{font:600 13px/1.3 'Inter',sans-serif;color:#191918;overflow-wrap:anywhere}
.shm .ppl__who span{font:400 12px/1.35 'Inter',sans-serif;color:#555550;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.shm .ppl__who .ppl__note{white-space:normal;color:#33322f}
.shm .ppl__when{display:flex;flex-direction:column;align-items:flex-end;gap:4px;font:400 12px/1 'Inter',sans-serif;color:#33322f;white-space:nowrap}
.shm .ppl__until{display:inline-flex;align-items:center;gap:5px;padding:2px 0;border:0;background:none;font:500 12px/1.2 'Inter',sans-serif;color:#191918;cursor:pointer;text-decoration:underline;text-decoration-color:rgba(25,25,24,.3);text-underline-offset:3px}
.shm .ppl__until .ic{width:13px;height:13px;color:#555550}
.shm .access{display:grid;grid-template-columns:minmax(0,1fr) 196px;align-items:center;gap:16px}
.shm .access p{margin:4px 0 0;font:400 12px/1.4 'Inter',sans-serif;color:#555550}
.shm .shm-date{position:relative;display:block}
.shm .shm-date--row{display:inline-block}
.shm .access .select{width:100%;height:38px}
.shm .access .select .ic:first-child{color:#555550}
.shm .shm-date__t{flex:1;text-align:left;padding-left:8px}
.shm .shm-date__in{position:absolute;left:0;bottom:0;width:100%;height:1px;opacity:0;pointer-events:none;border:0;padding:0}
.shm .verify{display:flex;align-items:center;gap:10px;margin:18px 24px 0;padding:11px 14px;font:400 13px/1.4 'Inter',sans-serif;color:#33322f}
.shm .verify .ic{flex:none;width:16px;height:16px;color:#191918}
.shm .dlg__foot{flex:none;display:flex;align-items:center;justify-content:flex-end;gap:8px;padding:14px 24px;border-top:1px solid rgba(25,25,24,.08);background:#fafaf7}
.shm .dlg__foot .btn:first-child{margin-right:auto}
.shm .dlg__foot .btn--primary .ic{color:#fcaa2d}
@media (max-width:560px){
  .shm{padding:16px}
  .shm .shm__dlg{width:100%;max-width:100%;max-height:calc(100vh - 32px)}
  .shm .dlg__head{padding:18px 16px 14px}
  .shm .dlg__title{font-size:24px}
  .shm .dlg__k{flex-direction:column;align-items:flex-start;gap:4px}
  .shm .dlg__k span{text-align:left}
  .shm .dlg__doc{margin:0 16px}
  .shm .dlg__sec{padding:16px 16px 0}
  .shm .shm-sugg{left:16px;right:16px}
  .shm .addr__in{min-width:100px}
  .shm .access{grid-template-columns:minmax(0,1fr)}
  .shm .verify{margin:16px 16px 0}
  .shm .ppl__row{grid-template-columns:minmax(0,1fr) 32px}
  .shm .ppl__when{grid-column:1;grid-row:2;align-items:flex-start}
  .shm .ppl__row .sm-revoke{grid-column:2;grid-row:1 / span 2}
  .shm .dlg__foot{flex-wrap:wrap;padding:12px 16px}
  .shm .dlg__foot .btn{flex:1 1 auto;height:44px}
  .shm .dlg__foot .btn--primary{order:-1;flex-basis:100%}
  .shm .dlg__foot .btn:first-child{margin-right:0}
}
/* ==== /track:p3-share ==== */
/* ==== track:p4-indev ==== */
/* In-development pages (handoff 23-25): right-hand pane parts and the shared-document rows. */
.dev .dev-pane { flex: 1; gap: 16px; }
.dev .dev-pane > .where__note { margin-top: auto; }
.dev .dev-pane > .where__note--cap { margin-top: -2px; }
.dev .dev-pane > .where__note--cap + .dist { margin-top: auto; }
.dev .btn .ic { width: 14px; height: 14px; }
.dev-sk { padding: 20px 24px; background: #fff; border-radius: var(--mg-r-tile, 10px); box-shadow: 0 0 0 1px var(--mg-hair); }
.dev-sk .sk-line { animation: mg-sk-pulse 1.4s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .dev-sk .sk-line { animation: none; } }
.dev-err { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
/* 23: the empty tray where the pitch-book page will sit (handoff 19 empty treatment) */
.dev-empty { overflow: hidden; display: flex; flex-direction: column; }
.dev-empty__tray { height: 170px; padding: 22px 0 0; background: var(--mg-floor-deep); box-shadow: inset 0 1px 2px rgba(25, 25, 24, 0.08), inset 0 0 0 1px rgba(25, 25, 24, 0.04); display: flex; justify-content: center; overflow: hidden; }
.dev-ghost { position: relative; width: 260px; aspect-ratio: 16 / 9; border: 1.5px dashed rgba(25, 25, 24, 0.24); border-radius: 2px; background: rgba(255, 255, 255, 0.55); padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.dev-ghost i { display: block; height: 7px; border-radius: 3px; background: #e2e1db; }
.dev-ghost i.t { height: 12px; width: 62%; margin: 0 0 4px; background: #dcdbd5; }
.dev-empty__body { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 18px 24px 22px; }
.dev-empty .empty__t { font: 600 16px/1.35 var(--mg-sans); color: var(--mg-ink); }
.dev-empty .empty__p { margin-top: 6px; font: 400 14px/1.5 var(--mg-sans); color: var(--mg-ink-2); max-width: 44ch; }
/* 23: teaser distribution card; 24: shared-document rows */
.mg-tile.dist { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 18px; padding: 12px 18px; text-decoration: none; color: var(--mg-ink); }
a.dist:hover { color: var(--mg-ink); background: var(--mg-hover); }
.dist__l { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.dist__l b { font: 500 13px/1.3 var(--mg-sans); overflow-wrap: anywhere; }
.dist .shared__n { display: inline-flex; grid-template-columns: none; }
.shared .tile-head { flex-wrap: wrap; gap: 2px 10px; padding: 20px 24px 0; }
.shared .tile-head + * { margin-top: 14px; }
.shared__row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 6px 16px; padding: 12px 24px; border-top: 1px solid var(--mg-hair); text-decoration: none; color: var(--mg-ink); }
.shared__row:hover { color: var(--mg-ink); background: var(--mg-hover); }
.shared__row b { font: 500 13px/1.35 var(--mg-sans); overflow-wrap: anywhere; }
.shared__row > .st { min-width: 84px; }
.shared__n { display: inline-grid; grid-template-columns: 14px 3ch; align-items: center; column-gap: 6px; text-align: right; font: 500 13px/1 var(--mg-sans); color: var(--mg-ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.shared__n .ic { width: 14px; height: 14px; color: var(--mg-ink-3); }
.shared__empty { margin: 0; padding: 12px 24px 18px; font: 400 13px/1.5 var(--mg-sans); color: var(--mg-ink-2); }
/* 24: coverage list sized to the deal's own section count (one / two / three columns) */
.cov__plot .covlist--qa { --rows: var(--r1); --col: 340px; }
@container covplot (min-width: 600px) { .cov__plot .covlist--qa { --rows: var(--r2); } }
@container covplot (min-width: 1040px) { .cov__plot .covlist--qa { --rows: var(--r3); } }
.cov--bare .cov__keys { margin-top: 0; }
.cov--bare .cov__side { padding-top: 18px; }
/* 25: model types and the model card (the deal's Excel models in place of the sample, D4) */
.plan .mtypes { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; padding: 0; }
.dev .plan .mtypes li { display: block; padding: 5px 9px; border: 0; border-radius: 6px; background: var(--mg-tint); box-shadow: inset 0 0 0 1px rgba(25, 25, 24, 0.1); font: 500 12px/1.25 var(--mg-sans); color: var(--mg-ink-2); white-space: nowrap; }
.mdl { display: flex; flex-direction: column; overflow: hidden; }
.mdl__head { display: flex; align-items: center; gap: 12px; padding: 16px 18px 15px; text-decoration: none; color: var(--mg-ink); }
.mdl__head:hover { color: var(--mg-ink); background: var(--mg-hover); }
.mdl__t { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.mdl__t b { font: 400 19px/1.15 var(--mg-serif); letter-spacing: -0.01em; overflow-wrap: anywhere; }
.mdl__t span { font: 400 12px/1.35 var(--mg-sans); color: var(--mg-ink-3); }
.mdl__open { flex: none; display: inline-flex; align-items: center; gap: 6px; font: 500 13px/1 var(--mg-sans); white-space: nowrap; }
.mdl__open .ic { width: 14px; height: 14px; }
.mdl__qc { padding: 14px 18px 12px; border-top: 1px solid var(--mg-hair); background: var(--mg-tint); }
.mdl__qch { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 16px; }
.mdl__qch span:last-child { font: 400 12px/1.3 var(--mg-sans); color: var(--mg-ink-2); }
.mdl__files { list-style: none; margin: 8px 0 0; padding: 0; }
.mdl__files li { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 40px; padding: 6px 0; border-top: 1px solid rgba(25, 25, 24, 0.07); }
.mdl__files li:first-child { border-top: 0; }
.mdl__n { font: 500 12px/1 var(--mg-sans); color: var(--mg-ink-3); text-align: right; font-variant-numeric: tabular-nums; }
.mdl__f { display: flex; flex-direction: column; gap: 2px; min-width: 0; text-decoration: none; color: var(--mg-ink); }
.mdl__f:hover b { text-decoration: underline; text-underline-offset: 2px; }
.mdl__f b { font: 500 13px/1.3 var(--mg-sans); overflow-wrap: anywhere; }
.mdl__f span { font: 400 12px/1.3 var(--mg-sans); color: var(--mg-ink-3); }
.mdl__use { font: 400 12px/1.3 var(--mg-sans); color: var(--mg-ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.mdl__more { display: inline-block; margin-top: 8px; font: 500 12px/1.3 var(--mg-sans); color: var(--mg-ink-2); }
@media (max-width: 560px) {
  .mdl__files li { grid-template-columns: 18px minmax(0, 1fr); }
  .mdl__use { grid-column: 2; }
  .mdl__open { display: none; }
  .shared__row { grid-template-columns: minmax(0, 1fr) auto; }
  .shared__row b { grid-column: 1 / -1; }
  .mg-tile.dist { grid-template-columns: minmax(0, 1fr) auto; }
  .dist__l { grid-column: 1 / -1; }
}
/* ==== /track:p4-indev ==== */

/* ==== track:p4-admin-states ==== */
/* States vocabulary (handoff 19) outside the dashboard scope: error copy block, "Could not display" tile. */
.err { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 16px 24px 22px; flex: 1; }
.err__ic { width: 20px; height: 20px; color: #b91c1c; margin-bottom: 6px; }
.err .btn { margin-top: auto; }
.err-doc { display: flex; flex-direction: column; }
.err-doc .rpt-tile__cover { box-sizing: border-box; aspect-ratio: auto; height: 132px; padding: 16px 18px 0; position: relative; }
.err-doc .rpt-tile__body { padding: 14px 20px 0; }
.err-doc .rpt-tile__title { font-size: 16px; min-height: 0; }
.err-doc .err { padding: 10px 20px 20px; }
.err-doc .err .err__p { margin-bottom: 14px; }
.err-well .err__ic { margin-bottom: 4px; }
/* DD categories (handoff 18): the note under the tabs, the Contents rail and the one-table register. */
.dd-note { margin: 0 0 20px; font: 400 13px/1.45 var(--mg-sans); color: var(--mg-ink-2); }
.dd-body { display: grid; grid-template-columns: clamp(304px, 23vw, 332px) minmax(0, 1fr); gap: 20px; align-items: start; }
.dd-body .idx { position: sticky; top: 16px; max-height: calc(100vh - 112px); overflow-y: auto; }
.dd-body .idx__head { padding: 4px 6px 12px; }
.dd-body .idx-row { text-decoration: none; color: var(--mg-ink); }
.dd-body .idx-row.is-on { color: var(--mg-on-ink); }
.idx-note p + p { margin-top: 8px; }
.ref { overflow: hidden; container-type: inline-size; min-width: 0; }
.ref__head { display: grid; grid-template-columns: 48px 220px minmax(0, 1fr) 32px; column-gap: 18px; align-items: center; height: 44px; padding: 0 20px 0 24px; background: #fafaf7; border-bottom: 1px solid rgba(25, 25, 24, 0.08); font: 600 12px/1 var(--mg-sans); color: #555550; }
.sec4 { padding: 22px 20px 8px 24px; scroll-margin-top: 16px; }
.sec4 + .sec4 { border-top: 1px solid rgba(25, 25, 24, 0.1); }
.sec4__head { display: grid; grid-template-columns: 48px minmax(0, 1fr) 32px; column-gap: 18px; align-items: baseline; padding-bottom: 6px; }
.sec4__n { font: 400 26px/1 'Newsreader', Georgia, serif; letter-spacing: -0.01em; color: #191918; font-variant-numeric: lining-nums tabular-nums; }
.sec4__t { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; min-width: 0; }
.sec4__t h2 { margin: 0; font: 400 24px/1.15 'Newsreader', Georgia, serif; letter-spacing: -0.012em; color: #191918; overflow-wrap: anywhere; }
.sec4__t > span { font: 400 13px/1 var(--mg-sans); color: #555550; white-space: nowrap; }
.sec4__head .iconbtn { align-self: center; }
.sec4__none { padding: 8px 0 14px 66px; font: 400 13px/1.5 var(--mg-sans); color: var(--mg-ink-3); }
.cat4 { display: grid; grid-template-columns: 48px 220px minmax(0, 1fr) 32px; column-gap: 18px; align-items: start; padding: 13px 0 14px; }
.cat4 + .cat4 { border-top: 1px solid rgba(25, 25, 24, 0.06); }
.cat4__n { padding-top: 2px; font: 500 13px/1.45 var(--mg-sans); color: #555550; font-variant-numeric: tabular-nums; }
.cat4__t { padding-top: 1px; font: 500 14px/1.45 var(--mg-sans); color: #191918; overflow-wrap: anywhere; }
.cat4__c { margin: 0; max-width: 760px; font: 400 14px/1.58 var(--mg-sans); color: #33322f; overflow-wrap: anywhere; }
.cat4__c--none { color: var(--mg-ink-3); }
.cat4__x { display: block; margin-top: 4px; font: 400 13px/1.5 var(--mg-sans); color: #555550; }
.cat4__x b { font-weight: 600; color: #33322f; }
.cat4 .iconbtn { margin-top: -4px; }
.cat4--off .cat4__t, .cat4--off .cat4__c, .sec4--off .sec4__t h2 { opacity: 0.6; }
.dd-off { margin-left: 8px; font: 400 12px/1 var(--mg-sans); }
.dd-menu-host { position: relative; }
@container (max-width: 739px) {
  .ref__head { display: none; }
  .cat4 { grid-template-columns: 44px minmax(0, 1fr) 32px; }
  .cat4__c { grid-column: 2 / 3; }
  .cat4 .dd-menu-host { grid-column: 3; grid-row: 1; }
  .sec4__head { grid-template-columns: 44px minmax(0, 1fr) 32px; }
  .sec4__none { padding-left: 62px; }
}
@media (min-width: 1640px) { .dd-body { grid-template-columns: 352px minmax(0, 1fr); } }
@media (max-width: 1240px) {
  .dd-body { grid-template-columns: minmax(0, 1fr); }
  .dd-body .idx { position: static; max-height: none; overflow: visible; padding-inline: 18px; }
  .dd-body .idx__list { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); grid-template-rows: repeat(7, auto); column-gap: 20px; }
}
@media (max-width: 640px) { .dd-body .idx__list { grid-auto-flow: row; grid-template-rows: none; } }
@media (max-width: 1100px) { .dd-page .pg-head__main { flex-basis: 100%; } }
/* ==== /track:p4-admin-states ==== */
/* ==== track:p4-dataroom ==== */
/* Deal Data Room / Firm Library desktop (handoff 13 / 15): back to the handoff summary + coverage band. */
.dr .pg-meta .dotlist { column-gap: 22px; }
.dr .pg-meta .dotlist .dot { left: -13px; }
.dr .pg-head__main .pg-meta .src { display: inline-flex; align-items: center; gap: 0; margin: 0; font: inherit; color: inherit; }
.dr .pg-head__main .pg-meta .src .ic { width: 14px; height: 14px; margin-right: 6px; color: var(--mg-ink-3); }
@media (max-width: 1240px) { .dr .pg-head__main { flex-basis: 100%; } }
.dr-crumb-switch { margin-left: 2px; }
.dr .sumt .cov { grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); gap: 0; padding: 0; }
.dr .sumt .cov__keys { display: grid; gap: 8px; margin-top: 18px; }
.dr .sumt .cov__keys span { display: grid; grid-template-columns: 12px 22px minmax(0, 1fr); gap: 0 8px; }
.dr .sumt .cov--none { display: block; }
.dr .sumt .cov--none .cov__none { padding: 16px 24px; }
.dr .sumt .cov__none b { font-weight: 500; color: var(--mg-ink-2); }
/* Coverage list filled column by column: --r1 / --r2 / --r3 = rows for 1, 2 or 3 columns. */
.dr .covlist.dr-covlist { --rows: var(--r1); grid-auto-flow: column; grid-template-columns: none; grid-template-rows: repeat(var(--rows), auto);
  grid-auto-columns: minmax(0, 340px); columns: auto; gap: 4px 24px; }
@container covplot (min-width: 600px) { .dr .covlist.dr-covlist { --rows: var(--r2); } }
@container covplot (min-width: 1040px) { .dr .covlist.dr-covlist { --rows: var(--r3); } }
.dr .covlist.dr-covlist .covlist__row { width: 100%; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.dr .covlist.dr-covlist .covlist__row:focus-visible { outline: 2px solid var(--mg-ink); outline-offset: -2px; }
.dr .covlist .sq { width: 14px; height: 14px; border-radius: 4px; }
/* Files toolbar: pills on the first row, the search on the second. */
.dr .ft-tools.fbar { display: grid; gap: 12px; }
.dr .ft .fbar__tools .dr-search { flex: 1 1 272px; max-width: 340px; margin-left: 0; }
.dr .ft .tbl .c-used .used { gap: 6px; font: 500 13px/1 var(--mg-sans); color: var(--mg-ink); text-decoration: none; }
.dr .ft .tbl .c-used .used .ic { width: 14px; height: 14px; color: var(--mg-ink-3); }
.dr .ft a.fname { text-decoration: none; }
.dr .ft a.fname:hover .fname__stem, .dr .ft a.fname:hover .fname__tail { text-decoration: underline; text-underline-offset: 3px; }
.dr .ft .fname__ic .ic { width: 16px; height: 16px; }
.dr .ft .tbl .c-used a.used { display: flex; line-height: 1; }
.dr .ft .tbl .c-used a.used:hover { text-decoration: underline; text-underline-offset: 3px; }
.dr .ft-foot__l { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; }
/* Under 1400px the index sits above the files and runs in columns (3, then 2 under 1240px). */
@media (min-width: 641px) and (max-width: 1399px) {
  .dr .pane, .dr .pane.dr-desk { grid-template-columns: minmax(0, 1fr); }
  .dr .pane > .idx { position: static; max-height: none; overflow: visible; padding: 16px 18px 12px; }
  .dr .idx__head { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px 24px; }
  .dr .idx__head .seg { width: 260px; }
  .mg-app-ui .dr .idx__list, .dr .idx__list { columns: 3; column-gap: 32px; overflow: visible; max-height: none; }
  .dr .idx-row, .dr .idx-sep, .dr .idx-grp { break-inside: avoid; }
  .dr .idx-sep { break-before: avoid; break-after: avoid; }
  .dr .idx-note { margin: 16px 0 4px; }
}
@media (min-width: 641px) and (max-width: 1239px) { .mg-app-ui .dr .idx__list, .dr .idx__list { columns: 2; } }
/* File preview (handoff 14): header icon tile, side panel head, facts, Used in drafts cards, foot. */
.fp-bar .fp-ic { display: inline-grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 8px; background: #fafaf7; box-shadow: inset 0 0 0 1px rgba(25, 25, 24, 0.1); color: #33322f; }
.fp-bar .fp-ic:empty { display: none; }
.fp-bar .fp-ic .ic { width: 18px; height: 18px; }
.fp-side { display: flex; flex-direction: column; }
.fp-side .fp-sec { padding: 22px 22px 20px; border-bottom: 1px solid rgba(25, 25, 24, 0.08); }
.fp-side .fp-sec--used { border-bottom: 0; }
.fp-side .fp-cat { display: flex; align-items: baseline; gap: 10px; margin-top: 9px; padding: 0; border-radius: 0; background: none; box-shadow: none; font: inherit; color: inherit; }
.fp-side .fp-cat__n { display: inline-grid; place-items: center; flex: none; height: 22px; padding: 0 6px; border-radius: 4px; background: #f1f0ea; font: 600 12px/1 var(--mg-sans); color: #33322f; font-variant-numeric: tabular-nums; transform: translateY(-2px); }
.fp-side .fp-cat b { font: 400 22px/1.2 var(--mg-serif); letter-spacing: -0.012em; color: var(--mg-ink); font-optical-sizing: auto; overflow-wrap: anywhere; }
.fp-side .fp-sub { margin-top: 6px; font: 400 13px/1.4 var(--mg-sans); color: #555550; }
.fp-side .fp-also { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font: 400 13px/1.4 var(--mg-sans); color: var(--mg-ink-2); }
.fp-side .fp-also li { display: flex; align-items: baseline; gap: 8px; }
.fp-side .fp-also .fp-cat__n { height: 20px; transform: none; }
.fp-side .fp-dl dd { white-space: normal; }
.fp-side .fp-h { display: flex; align-items: baseline; gap: 8px; font: 600 13px/1.3 var(--mg-sans); color: var(--mg-ink); }
.fp-side .fp-h span { font-weight: 500; color: #555550; font-variant-numeric: tabular-nums; }
.fp-side .fp-summary { margin: 8px 0 0; font: 400 13px/1.5 var(--mg-sans); color: var(--mg-ink-2); white-space: pre-wrap; }
.fp-side .fp-none { margin: 8px 0 0; font: 400 12px/1.5 var(--mg-sans); color: var(--mg-ink-3); }
.fp-side .fp-doc { display: block; gap: 0; margin-top: 12px; padding: 0; overflow: hidden; color: var(--mg-ink); text-decoration: none; }
.fp-side .fp-doc__tray { position: relative; display: block; height: 174px; padding: 16px 20px 0; background: #ebeae4; box-shadow: inset 0 1px 2px rgba(25, 25, 24, 0.08), inset 0 0 0 1px rgba(25, 25, 24, 0.04); overflow: hidden; }
.fp-side .fp-doc__sheet { display: block; }
.fp-side .fp-doc__sheet > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.fp-side .fp-doc__blank { position: absolute; inset: 14% 12% auto; display: flex; flex-direction: column; gap: 6px; }
.fp-side .fp-doc__blank i { display: block; height: 6px; border-radius: 3px; background: rgba(25, 25, 24, 0.08); }
.fp-side .fp-doc__blank i:first-child { width: 60%; height: 10px; }
.fp-side .fp-doc__body { display: block; padding: 12px 14px 14px; border-top: 1px solid rgba(25, 25, 24, 0.08); }
.fp-side .fp-doc__t { display: block; font: 600 13px/1.35 var(--mg-sans); }
.fp-side .fp-doc__m { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 6px; font: 400 12px/1.3 var(--mg-sans); color: #555550; }
.fp-side .fp-doc__m .st { font: 500 12px/1.2 var(--mg-sans); }
.fp-side .fp-doc:hover .fp-doc__t { text-decoration: underline; text-underline-offset: 3px; }
.fp-side .fp-cite { display: flex; align-items: center; gap: 7px; margin-top: 9px; padding-top: 9px; border-top: 1px solid rgba(25, 25, 24, 0.06); font: 400 12px/1.4 var(--mg-sans); color: #33322f; }
.fp-side.pv-details .fp-foot { margin: auto 0 0; padding: 16px 22px 20px; display: flex; flex-direction: column; align-items: stretch; gap: 12px; background: #fafaf7; border-top: 1px solid rgba(25, 25, 24, 0.08); }
.fp-side .fp-note { display: grid; grid-template-columns: 16px minmax(0, 1fr); column-gap: 9px; font: 400 12px/1.5 var(--mg-sans); color: #33322f; text-wrap: pretty; }
.fp-side .fp-note .ic { width: 14px; height: 14px; margin-top: 2px; color: #555550; }
.fp-side .btn--block { width: 100%; justify-content: center; }
/* ==== /track:p4-dataroom ==== */
/* ==== track:p4-shell-deals ==== */
/* Top bar search: 300 px as in the handoff (the flex basis alone shrank it to its content, 224 px). */
@media (min-width: 761px) {
  body.mg-app-ui .df-topbar .tb-search { flex: 0 1 auto; width: 300px; min-width: 224px; }
}
/* One focus ring per field: the palette input sits in its own ruled band (the band is the field);
   the org switcher search uses the .search focus vocabulary (ink border + soft halo, no outline). */
body.mg-app-ui .df-cmd-palette__input:focus, body.mg-app-ui .df-cmd-palette__input:focus-visible { outline: none; box-shadow: none; }
body.mg-app-ui .df-org-popover__search:focus, body.mg-app-ui .df-org-popover__search:focus-visible {
  outline: none; border-color: var(--mg-ink); box-shadow: 0 0 0 3px rgba(25,25,24,.08);
}
body.mg-app-ui .df-cmd-palette__item { justify-content: flex-start; text-align: left; }
/* Switch Product marks: monochrome, like everything else in the shell. */
body.mg-app-ui .df-user-menu__item > :is(svg:not(.ic), img) { filter: grayscale(1); }
body.mg-app-ui .df-user-menu__item { justify-content: flex-start; text-align: left; }
/* Deal Information fields (new-deal wizard, Edit Deal drawer): the field says what is missing. */
.mg-app-ui .f .in[aria-invalid="true"], .mg-app-ui .f .cs.is-invalid > .cs__trigger {
  border-color: var(--mg-red); box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.08);
}
.mg-app-ui .f__err { display: block; margin-top: 6px; font: 500 12px/1.4 var(--mg-sans); color: var(--mg-red-text); }
/* Deal team picker, mg look (new-deal step 2 and the Edit Deal drawer's Deal Team tab; handoff 04 / 16):
   white rows on a hairline, grey initials, a dot and a word for the status, no coloured pills. */
.mg-app-ui .dft--mg > p:first-child { margin: 0 0 12px !important; font: 400 13px/1.5 var(--mg-sans) !important; color: var(--mg-ink-3) !important; }
.mg-app-ui .dft--mg .dft-search-wrap { margin-bottom: 12px !important; }
.mg-app-ui .dft--mg .dft-search-wrap > .ic { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--mg-ink-3); pointer-events: none; }
.mg-app-ui .dft--mg .dft-search { height: 38px; padding: 0 13px 0 36px !important; border: 1px solid var(--mg-edge) !important; border-radius: var(--mg-r-ctl) !important; background: #fff !important; font: 400 14px/1 var(--mg-sans) !important; color: var(--mg-ink) !important; outline: none; }
.mg-app-ui .dft--mg .dft-search::placeholder { color: var(--mg-ink-3); opacity: 1; }
.mg-app-ui .dft--mg .dft-search:focus, .mg-app-ui .dft--mg .dft-search:focus-visible { outline: none; border-color: var(--mg-ink) !important; box-shadow: 0 0 0 3px rgba(25, 25, 24, 0.08); }
.mg-app-ui .dft--mg .dft-list, .mg-app-ui .dft--mg .dft-invited-list { gap: 8px !important; }
.mg-app-ui .dft--mg .wiz-team-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--mg-hair) !important; border-radius: var(--mg-r-md); background: #fff !important; cursor: pointer; opacity: 1 !important; }
.mg-app-ui .dft--mg .wiz-team-row:hover { border-color: var(--mg-edge) !important; }
.mg-app-ui .dft--mg .wiz-team-row.is-selected { border-color: rgba(25, 25, 24, 0.24) !important; background: var(--mg-tint) !important; }
.mg-app-ui .dft--mg .wiz-team-row.is-removed { cursor: default; }
.mg-app-ui .dft--mg .wiz-team-row.is-removed .wiz-team-name { text-decoration: line-through; color: var(--mg-ink-3); }
.mg-app-ui .dft--mg .wiz-team-row input[type="checkbox"] { width: 16px; height: 16px; margin: 0; flex: none; accent-color: var(--mg-ink); }
.mg-app-ui .dft--mg .wiz-team-avatar { width: 32px; height: 32px; font: 600 12px/1 var(--mg-sans); background: #f1f0ea !important; color: var(--mg-ink) !important; box-shadow: inset 0 0 0 1px rgba(25, 25, 24, 0.1); }
.mg-app-ui .dft--mg :is(.wiz-team-avatar, .av--pending) .ic { width: 14px; height: 14px; color: var(--mg-ink-2); }
.mg-app-ui .dft--mg .wiz-team-info { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.mg-app-ui .dft--mg .wiz-team-name { display: flex; align-items: center; gap: 8px; font: 500 14px/1.3 var(--mg-sans); color: var(--mg-ink); }
.mg-app-ui .dft--mg .wiz-team-role { font: 400 13px/1.35 var(--mg-sans); color: var(--mg-ink-3); overflow-wrap: anywhere; }
.mg-app-ui .dft--mg .dft-status { margin-left: auto; flex: none; font: 500 13px/1.2 var(--mg-sans); color: var(--mg-ink-3); }
.mg-app-ui .dft--mg .st.dft-status { color: var(--mg-ink); }
.mg-app-ui .dft--mg .dft-invite-hint .wiz-team-row { border-style: dashed !important; }
.mg-app-ui .dft--mg .dft-invite-btn { display: inline-flex; align-items: center; gap: 4px; color: var(--mg-ink) !important; font: 500 13px/1 var(--mg-sans) !important; }
.mg-app-ui .dft--mg :is(.dft-invite-btn, .dft-invited-remove) .ic { width: 14px; height: 14px; }
.mg-app-ui .dft--mg .dft-invited-remove { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: var(--mg-r-ctl); background: none; color: var(--mg-ink-3) !important; cursor: pointer; }
.mg-app-ui .dft--mg .dft-invited-remove:hover { background: var(--mg-hover) !important; color: var(--mg-ink) !important; }
.mg-app-ui .dft--mg .dft-list > div:not(.wiz-team-row) { font: 400 13px/1.5 var(--mg-sans) !important; color: var(--mg-ink-3) !important; padding: 4px 0 !important; }
.mg-app-ui .dft--mg .dft-orphans > div:first-child { font: 500 12px/1.3 var(--mg-sans) !important; color: var(--mg-ink-3) !important; text-transform: none !important; letter-spacing: 0 !important; }
/* The phone drawer's control closes it: × instead of the collapse chevrons. */
.sb-collapse__x { display: none; }
.df-sidebar.mg-mobile-open .sb-collapse :is(.sb-collapse__close, .sb-collapse__open) { display: none; }
.df-sidebar.mg-mobile-open .sb-collapse .sb-collapse__x { display: block; }
/* ==== /track:p4-shell-deals ==== */

/* ==== track:d3-dataroom-indev ==== */
/* Phone data-room rows are links to the file preview (the row menu keeps Details). */
.dr-phone a.m-file__open { text-decoration: none; }
/* Inactive DD categories stay in the register, greyed: the number too. */
.cat4--off .cat4__n, .sec4--off .sec4__n { opacity: 0.6; }
/* ==== /track:d3-dataroom-indev ==== */

/* ==== track:f-d ==== */
/* Auth / share inputs: one ink ring (gold stays for nav, progress and alerts). */
.mg-app-ui .f__in:focus-visible { outline: none; }
.mg-app-ui .cbx-row input:focus-visible { outline: 2px solid #191918; outline-offset: 2px; }
/* Sign-in rhythm (handoff 20): the Remember/Forgot row sits 2 px closer; desktop drops the phone tap height. */
.auth__row { margin-top: -2px; }
@media (min-width: 761px) { .auth__row .ulink { min-height: 0; } .gate__foot { line-height: 1; } }
/* 23 DealScout: the empty page tray takes the pane's slack (the handoff's pitch-book page fills it), so the
   note and the teaser card follow it instead of leaving an empty band above the card. */
.dev .dev-pane > .dev-empty { flex: 1 1 auto; }
.dev .dev-pane > .dev-empty > .dev-empty__tray { flex: 1 1 auto; height: auto; min-height: 170px; padding: 22px 0; align-items: center; }
.dev .dev-pane > .dev-empty .dev-ghost { width: clamp(260px, 52%, 360px); }
/* 25 ModelIQ: the note sits right under the model card (handoff 25), not pinned to the pane bottom. */
.dev .dev-pane > .mdl + .where__note { margin-top: 0; }
/* ==== /track:f-d ==== */
/* ==== track:f-a ==== */
/* Deal tile who / when line: one line like the handoff (01 / 02), cut with an ellipsis; the tip's
   tip__sub and the title attribute keep it whole. Footers stay 57 px whatever the name length. */
.mg-tile--deal .act__who { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; }
/* Document card by-line on the dashboard and the hub: author · time on one line next to the share
   count (handoff 01 / 05); the author is cut first, the time and its dot stay. */
.dash .rpt-tile__by.dotlist, .hub .rpt-tile__by.dotlist { flex-wrap: nowrap; }
.dash .rpt-tile__by.dotlist > span:first-child, .hub .rpt-tile__by.dotlist > span:first-child { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.dash .rpt-tile__by.dotlist > span + span, .hub .rpt-tile__by.dotlist > span + span { flex: none; }
/* Phone deal card (handoff 28): the activity summary is one line, cut before the i. */
.m-card .m-deal__act > .has-tip { display: flex; align-items: center; min-width: 0; text-wrap: nowrap; }
.m-card .m-deal__what { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-card .m-deal__act .info { flex: none; }
/* ==== /track:f-a ==== */
/* ==== track:f-c ==== */
/* Menus sit on white (the cream paper is the sidebar's only). */
.dr-menu { background: var(--mg-tile); }
/* Handoff 13: index 21vw (280–332 px, 352 px from 1640) beside the files; both tiles end on the same line,
   the index note pinned to its bottom edge and the table footer to the table's. Both stay capped at the
   browser height (track card-cap): the index list and the file list scroll inside their cards. */
@media (min-width: 1400px) {
  .dr .pane, .dr .pane.dr-desk { grid-template-columns: clamp(280px, 21vw, 332px) minmax(0, 1fr); align-items: stretch; }
  .dr .pane > .idx { position: static; max-height: var(--mg-card-cap); overflow: hidden; }
  .dr .pane > .ft .tbl-scroll { flex: 1 1 auto; }
}
@media (min-width: 1640px) { .dr .pane, .dr .pane.dr-desk { grid-template-columns: 352px minmax(0, 1fr); } }
/* Handoff 13: the whole file row opens the preview. */
.dr .ft .tbl tbody tr[data-fid] { cursor: pointer; }
.dr .ft .tbl tbody tr[data-fid]:hover td { background: var(--mg-hover); }
/* Phone 31: the deal name carries the Switch deal chevron (the back row holds only the back link). */
.dr-phone .drp-title { display: flex; align-items: center; gap: 4px; min-width: 0; }
.dr-phone .drp-title .pg-title { min-width: 0; overflow-wrap: anywhere; }
.dr-phone .drp-title-switch { flex: none; width: 44px; height: 44px; color: var(--mg-ink-3); }
/* ==== /track:f-c ==== */
/* ==== track:f-b ==== */
/* Share dialog (handoff 12): one row per person — avatar initials, name / email / job title, the links they
   hold (Shared date + Access until each), remove. Suggestions float over the dialog (never clipped). */
.shm .ppl__row--person{grid-template-columns:32px minmax(0,1fr) auto 32px}
.shm .ppl__row--person .ppl__title{white-space:normal;overflow:visible;text-overflow:clip}
.shm .ppl__links{gap:6px}
.shm .ppl__link{display:flex;flex-direction:column;align-items:flex-end;gap:4px}
.shm .ppl__link + .ppl__link{padding-top:6px;border-top:1px dashed rgba(25,25,24,.1)}
.shm .shm-sugg.shm-sugg--float{position:fixed;right:auto;z-index:10050;overflow:auto;box-sizing:border-box}
@media (max-width:640px){
  .shm .ppl__row--person{grid-template-columns:32px minmax(0,1fr) 32px}
  .shm .ppl__row--person .ppl__when{grid-column:2;grid-row:2;align-items:flex-start}
  .shm .ppl__row--person .ppl__link{align-items:flex-start}
  .shm .ppl__row--person .sm-revoke{grid-column:3;grid-row:1 / span 2}
  .shm .ppl__row--person .av{grid-row:1 / span 2;align-self:start}
}
/* ==== /track:f-b ==== */
