/* =====================================================================
   PHASE 25 — POLISH
   Professional-audit overrides (DESIGN_PROFESSIONAL_AUDIT.md, 20 Sep 2026).
   One fenced block: every Phase-25 rule lives here so the pre-25 cascade
   is fully documented below and trivially revertible. Colors/typography
   come from tokens.css (CORE 2.0) — no new palette values except the two
   sanctioned subtle-red pill tints from the audit spec.
   ===================================================================== */

/* ---------- #16 · Row-height scale ---------- */
:root {
  --row-compact: 44px;       /* audit log, flat decision rows */
  --row-standard: 56px;      /* Active Work, Projects table (post-compression) */
  --row-with-context: 72px;  /* Inbox rows (two-line context) */
}

/* ---------- #5 · Header: search first, Create demoted ---------- */
.header-search {
  width: 420px;
  height: 40px;
  background: var(--surface-2, var(--bg-depth));
  border: 1px solid transparent;
}
.header-search:hover,
.header-search:focus-within {
  background: white;
  border-color: var(--border-subtle);
}
.btn-create {
  background: white;
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  padding: 7px 12px;
  font-weight: var(--fw-medium);
}
.btn-create:hover {
  background: var(--bg-depth);
  border-color: var(--border-strong);
}
.bell-pip {
  position: absolute;
  top: 5px;
  right: 5px;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border-radius: 8px;
  background: rgba(220, 38, 38, 0.12);
  color: #DC2626;
  font-size: 9.5px;
  font-weight: 700;
  line-height: 15px;
  text-align: center;
  letter-spacing: -0.01em;
}

/* ---------- #6 · Home hero: editorial, image-free ---------- */
.mg-home-hero-editorial {
  display: block;
  min-height: 0;
}
.mg-home-hero-editorial .mg-home-hero-body {
  padding: 34px 40px 30px;
}
.mg-hero-date {
  color: var(--text-tertiary);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
/* #11 — the greeting is the one serif editorial moment in the app */
.mg-home-hero-editorial .mg-home-hero-greet {
  font-family: var(--font-serif-v24);
  font-weight: 400;
  font-size: 42px;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
/* #8 — zero-value tiles dim; non-zero tiles carry the weight */
.mg-home-hero-editorial .mg-home-hero-stats {
  display: flex;
  align-items: center;
  gap: 0;
  max-width: none;
  margin-top: 22px;
  border-top: 1px solid var(--stroke-subtle);
  padding-top: 14px;
}
.mg-home-hero-editorial .mg-hh-stat {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 2px 18px;
  border-radius: 0;
  background: none;
}
.mg-home-hero-editorial .mg-hh-stat + .mg-hh-stat {
  border-left: 1px solid var(--stroke-subtle);
}
.mg-home-hero-editorial .mg-hh-stat:hover {
  background: none;
  transform: none;
}
.mg-home-hero-editorial .mg-hh-stat:hover .k { color: var(--text-secondary); }
.mg-home-hero-editorial .mg-hh-stat .v {
  font-size: 22px;
}
.mg-home-hero-editorial .mg-hh-stat .k {
  margin-top: 0;
}
.mg-hh-stat.stat-empty { opacity: 0.45; }
.mg-hh-stat.stat-empty .v {
  color: var(--text-tertiary);
  font-weight: 500;
}

/* ---------- #7 · Workspace banner: 220 → 156px ---------- */
.mg-ws-banner {
  height: 156px;
  margin-bottom: 20px;
}
.mg-ws-banner .mg-ws-banner-title {
  font-size: 24px;
}

/* ---------- #1 · Projects row: 5-element scannable density ---------- */
.prow2 {
  display: grid;
  grid-template-columns: minmax(200px, 1.5fr) 130px minmax(170px, 1fr) 150px auto;
  align-items: center;
  gap: 16px;
  height: var(--row-standard);
  padding: 0 18px;
}
.prow.pinned { background: none; }
.prow2-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.prow2-pin {
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--warning-solid);
}
.prow2-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.015em;
}
.prow2-code {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
}
.prow2-mile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  font-size: 12px;
  color: var(--text-secondary);
}
.prow2-mile .m-date {
  font-size: 11px;
  color: var(--text-tertiary);
  letter-spacing: -0.01em;
}
.prow2-mile .m-date.late { color: var(--danger-solid); }
.prow2-progress { min-width: 0; }
.prow2-bar {
  position: relative;
  height: 6px;
  border-radius: 4px;
  background: rgba(15, 15, 18, 0.06);
  overflow: hidden;
}
.prow2-bar > i {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--primary-01);
}
.prow2-bar.tone-red    > i { background: var(--danger-solid); }
.prow2-bar.tone-blue   > i { background: var(--primary-01); }
.prow2-bar.tone-amber  > i { background: var(--warning-solid); }
.prow2-bar.tone-green  > i { background: var(--success-solid); }
.prow2-bar.tone-purple > i { background: var(--primary-04); }
.prow2-bar-num {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-secondary);
  letter-spacing: 0;
}
/* status dot (#9 family) */
.prow2-status {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  white-space: nowrap;
}
.sdot {
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.sdot-label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
}
.sdot-red    .sdot { background: var(--danger-solid); }
.sdot-blue   .sdot { background: var(--primary-01); }
.sdot-amber  .sdot { background: var(--warning-solid); }
.sdot-green  .sdot { background: var(--success-solid); }
.sdot-purple .sdot { background: var(--primary-04); }
.sdot-gray   .sdot { background: #767676; }

/* ---------- #9 · State dots everywhere (decisions) ---------- */
.state-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.state-inline .state-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}
.state-inline .state-label {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}
.state-inline-md .state-label { font-size: 12px; }

/* ---------- #4 · Recent Decisions: flat rows, capped ---------- */
.rd-row {
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--row-compact);
  padding: 0 14px;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
}
.rd-row + .rd-row { margin-top: 1px; }
.rd-row:hover { background: var(--bg-depth); }
.rd-row .rd-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.rd-row .rd-when {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-tertiary);
}
.rd-more {
  display: block;
  padding: 10px 14px 8px;
  font-size: 12px;
  color: var(--text-tertiary);
}

/* ---------- #3 · Momentum: weakest 3 + rest summary ---------- */
.pm-weakest {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pm-row {
  display: grid;
  grid-template-columns: 130px 1fr 40px;
  align-items: center;
  gap: 10px;
}
.pm-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
  min-width: 0;
}
.pm-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-track {
  height: 6px;
  border-radius: 4px;
  overflow: hidden;
}
.pm-fill {
  height: 100%;
  border-radius: 4px;
}
.pm-value {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-secondary);
  text-align: right;
}
.pm-rest {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--stroke-subtle);
  margin-top: 4px;
}
.pm-rest-eyebrow {
  flex: none;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.pm-rest-names {
  font-size: 11.5px;
  color: var(--text-tertiary);
  letter-spacing: -0.01em;
  line-height: 1.5;
}

/* ---------- #15 · Recent files: compact list ---------- */
.files-list {
  display: flex;
  flex-direction: column;
  padding: 2px 4px;
}
.file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--row-compact);
  padding: 8px 12px;
  border-radius: 10px;
}
.file-row:hover { background: var(--bg-depth); }
.file-row + .file-row { border-top: 1px solid var(--stroke-subtle); }
.file-kind-badge {
  flex: none;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  background: rgba(15, 15, 18, 0.04);
  border-radius: 6px;
  padding: 3px 7px;
  min-width: 64px;
  text-align: center;
}
.file-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.file-meta {
  flex: none;
  max-width: 40%;
  font-size: 11.5px;
  color: var(--text-tertiary);
}

/* ---------- #16 · Active Work rows pinned to standard ---------- */
.work-row { min-height: var(--row-standard); }

/* ---------- #16 · Inbox rows: 96 → 72px ---------- */
.ib-row {
  padding: 12px 16px;
  min-height: var(--row-with-context);
}

/* ---------- #18 · Progress bars: solid, no gradients ---------- */
.pbar.blue   > i { background: var(--primary-01); }
.pbar.warn   > i { background: var(--warning-solid); }
.pbar.red    > i { background: var(--danger-solid); }
.pbar.green  > i { background: var(--success-solid); }
.pbar.purple > i { background: var(--primary-04); }

/* ---------- #19 · Cards: flat with boundaries ---------- */
/* The :not-chain rule late in styles.css carries (0,4,0) specificity, so the
   override mirrors it to win the cascade on source order. */
.card,
.card:not(.card--hero):not(.card--elevated):not(.card--inverse) {
  box-shadow: none;
}
/* floating surfaces keep their elevation */
.popover,
.dropdown,
.geni-panel,
.person-popover,
.profile-popover,
.cmd-palette,
.toast {
  box-shadow: var(--elevation-2);
}

/* ---------- #21 · Focus ring visible on dark surfaces ---------- */
.dvd-root :focus-visible,
.surface-inverse :focus-visible,
[data-theme="dark"] :focus-visible,
.dvd-root button:focus-visible,
.dvd-root a:focus-visible {
  box-shadow: 0 0 0 3px rgba(93, 135, 255, 0.60) !important;
}

/* ---------- #22 · Clients capacity note ---------- */
.cw-empty-note {
  font-size: 12px;
  color: var(--text-tertiary);
  padding: 16px 0;
  text-align: center;
  font-style: italic;
  letter-spacing: -0.01em;
}

/* ---------- #24 · Toast region (stacked, bottom-center) ---------- */
.toast-region {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1200;
  pointer-events: none;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
}
.toast {
  position: fixed;
  z-index: 1200;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--shade-02, #17170F);
  color: white;
  border-radius: var(--r-lg);
  font-size: 13px;
  letter-spacing: -0.01em;
  animation: p25-toast-in 200ms cubic-bezier(0.4, 0, 0.2, 1);
}
.toast-icon {
  display: inline-flex;
  color: var(--success-solid);
}
.toast-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  opacity: 0.6;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
}
@keyframes p25-toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- #26 · ⌘K command palette ---------- */
.cmd-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(15, 15, 18, 0.32);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 12vh 20px 0;
  animation: p25-fade-in 140ms ease-out;
}
.cmd-palette {
  width: 560px;
  max-width: 100%;
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  overflow: hidden;
}
.cmd-palette input {
  width: 100%;
  border: 0;
  outline: none;
  padding: 16px 18px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text-primary);
  background: transparent;
  border-bottom: 1px solid var(--stroke-subtle);
}
.cmd-palette input::placeholder { color: var(--text-tertiary); }
.cmd-results {
  max-height: 340px;
  overflow-y: auto;
  padding: 6px;
}
.cmd-result {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: none;
  text-align: left;
  padding: 10px 12px;
  border-radius: 9px;
  cursor: pointer;
  font-family: inherit;
}
.cmd-result.active { background: var(--bg-depth); }
.cmd-group {
  flex: none;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  min-width: 66px;
}
.cmd-label {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.cmd-meta {
  flex: none;
  max-width: 30%;
  font-size: 11px;
  color: var(--text-tertiary);
}
.cmd-empty {
  padding: 22px 14px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-tertiary);
}
.cmd-footer {
  padding: 9px 14px;
  border-top: 1px solid var(--stroke-subtle);
  font-size: 11px;
  color: var(--text-tertiary);
}
.cmd-footer kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  background: rgba(15, 15, 18, 0.05);
  border-radius: 4px;
  padding: 1px 5px;
}
@keyframes p25-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ---------- #14 · Sidebar workspace switcher chevron ---------- */
.side-ws .ws-chev {
  color: rgba(255, 255, 255, 0.55);
  margin-left: auto;
}
/* keep the top toggle next to the chevron, not pushed away */
.side-ws .side-toggle-top { margin-left: 2px; }
.side-collapsed .ws-chev { display: none; }
/* ==== END PHASE 25 — POLISH ==== */
