    :root {
      --ink: #18231f;
      --muted: #65756e;
      --line: #dce5df;
      --soft: #f4f7f2;
      --field: #edf4ea;
      --panel: #fff;
      --green: #2f7d51;
      --gold: #d7a439;
      --blue: #377aa6;
      --red: #be5a4a;
      --plum: #6b5a86;
      --shadow: 0 16px 42px rgba(24, 35, 31, .08);
    }

    * { box-sizing: border-box; }

    body {
      margin: 0;
      color: var(--ink);
      background: linear-gradient(180deg, #fbfcfa, #eef3ec);
      font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      line-height: 1.45;
    }

    button, input, select, textarea { font: inherit; }

    .hidden { display: none !important; }

    .login {
      min-height: 100vh;
      display: grid;
      place-items: center;
      padding: 20px;
    }

    .login-card {
      width: min(440px, 100%);
      background: white;
      border: 1px solid var(--line);
      border-radius: 8px;
      box-shadow: var(--shadow);
      padding: 24px;
    }

    .mark {
      width: 48px;
      height: 48px;
      border-radius: 8px;
      display: grid;
      place-items: center;
      /* brand mark, monochrome decree: black ground, white letter, grey edge */
      background: linear-gradient(135deg, #222223, #54585a);
      border: 1px solid #54585a;
      color: #f5f5f4;
      font-weight: 900;
    }

    h1, h2, h3, p { margin-top: 0; }

    .login-card h1 {
      margin: 14px 0 6px;
      font-size: 28px;
    }

    .muted { color: var(--muted); }

    label {
      display: grid;
      gap: 6px;
      margin: 14px 0;
      font-weight: 700;
      font-size: 13px;
    }

    input, select {
      width: 100%;
      min-height: 42px;
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 10px 12px;
      background: white;
      color: var(--ink);
    }

    textarea {
      width: 100%;
      min-height: 96px;
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 10px 12px;
      background: white;
      color: var(--ink);
      resize: vertical;
    }

    input[type="checkbox"] {
      width: 18px;
      min-height: 18px;
      height: 18px;
      padding: 0;
    }

    .button {
      min-height: 42px;
      border: 0;
      border-radius: 8px;
      background: var(--ink);
      color: white;
      padding: 10px 14px;
      cursor: pointer;
      font-weight: 800;
    }

    .ghost {
      background: var(--field);
      color: var(--ink);
      border: 1px solid var(--line);
    }

    .danger {
      background: var(--red);
      color: white;
    }

    .small {
      min-height: 34px;
      padding: 7px 10px;
      font-size: 13px;
    }

    .app {
      min-height: 100vh;
      display: grid;
      grid-template-columns: 280px 1fr;
    }

    aside {
      position: sticky;
      top: 0;
      height: 100vh;
      padding: 22px 18px;
      border-right: 1px solid var(--line);
      background: rgba(255,255,255,.9);
      overflow: auto;
    }

    .brand {
      display: grid;
      grid-template-columns: 48px minmax(0, 1fr) auto;
      align-items: center;
      gap: 12px;
      margin-bottom: 20px;
    }

    .brand h1 {
      margin: 0;
      font-size: 18px;
      line-height: 1.1;
    }

    .brand p {
      margin: 4px 0 0;
      font-size: 12px;
    }

    nav {
      display: grid;
      gap: 8px;
      margin-bottom: 20px;
    }

    .nav-btn {
      border: 0;
      background: transparent;
      border-radius: 8px;
      padding: 10px 12px;
      text-align: left;
      color: var(--muted);
      cursor: pointer;
      font-weight: 800;
    }

    .nav-btn.active, .nav-btn:hover {
      color: var(--ink);
      background: var(--field);
    }

    main {
      padding: 24px;
      min-width: 0;
    }

    .topbar {
      display: none;
    }

    .topbar h2 {
      margin: 0;
      font-size: 1px;
    }

    .top-actions {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
      justify-content: flex-end;
    }

    .shell-actions {
      align-items: center;
      justify-self: end;
      flex-wrap: nowrap;
      position: fixed;
      top: 14px;
      right: 18px;
      z-index: 60;
      padding: 3px;
      border: 1px solid var(--line);
      border-radius: 10px;
      background: rgba(255, 255, 255, .86);
      box-shadow: 0 8px 24px rgba(20, 24, 32, .08);
      backdrop-filter: blur(10px);
    }

    .app-control {
      min-height: 30px;
      padding: 5px 9px;
      font-size: 12px;
      border-radius: 8px;
      font-weight: 800;
    }

    .grid { display: grid; gap: 16px; }

    .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }

    .two { grid-template-columns: minmax(0, 1.35fr) minmax(320px, .9fr); }

    .three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

    .panel, .kpi {
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 8px;
      box-shadow: var(--shadow);
    }

    .panel { padding: 18px; min-width: 0; }

    .kpi {
      min-height: 112px;
      padding: 16px;
      display: grid;
      align-content: space-between;
    }

    .label {
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: .08em;
      font-size: 12px;
      font-weight: 800;
    }

    .kpi strong {
      display: block;
      margin-top: 8px;
      font-size: 30px;
    }

    .overview-dashboard {
      display: grid;
      gap: 14px;
    }

    .metric-strip {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 12px;
    }

    .metric-card {
      min-height: 88px;
      padding: 13px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: white;
      box-shadow: var(--shadow);
    }

    .metric-card span {
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: .06em;
      font-size: 11px;
      font-weight: 900;
    }

    .metric-card strong {
      display: block;
      margin-top: 7px;
      font-size: 28px;
      line-height: 1;
    }

    .metric-card p {
      margin: 8px 0 0;
      color: var(--muted);
      font-size: 12px;
    }

    .overview-main {
      display: grid;
      grid-template-columns: minmax(0, 1.4fr) minmax(320px, .8fr);
      gap: 14px;
      align-items: stretch;
    }

    .overview-lower {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 14px;
    }

    .compact-panel {
      min-height: 0;
    }

    .compact-panel h3 {
      margin-bottom: 10px;
      font-size: 15px;
    }

    .h-scroll {
      display: flex;
      gap: 10px;
      overflow-x: auto;
      padding-bottom: 4px;
      scroll-snap-type: x proximity;
    }

    .h-scroll > * {
      flex: 0 0 min(260px, 84vw);
      scroll-snap-align: start;
    }

    .mini-board {
      display: grid;
      gap: 8px;
    }

    .mini-stage {
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 10px;
      align-items: center;
      padding: 9px 10px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--soft);
    }

    .mini-stage strong {
      font-size: 13px;
    }

    .mini-stage span {
      min-width: 32px;
      min-height: 28px;
      display: grid;
      place-items: center;
      border-radius: 8px;
      background: white;
      font-weight: 900;
    }

    .crop-summary-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
      gap: 10px;
    }

    .crop-summary-card {
      border: 1px solid var(--line);
      border-radius: 8px;
      background: white;
      color: var(--ink);
      padding: 12px;
      text-align: left;
      cursor: pointer;
      display: grid;
      gap: 8px;
    }

    .crop-summary-card:hover {
      border-color: var(--green);
      background: var(--field);
    }

    .crop-summary-card strong {
      font-size: 16px;
    }

    .crop-stats {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
    }

    .vision-row {
      display: grid;
      gap: 8px;
      padding: 12px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: white;
    }

    .vision-row h3 {
      margin: 0;
      font-size: 15px;
    }

    .vision-meta {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
    }

    .vision-dashboard {
      display: grid;
      gap: 14px;
    }

    .vision-card-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
      gap: 12px;
    }

    .vision-controls {
      display: flex;
      gap: 8px;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      margin-bottom: 12px;
    }

    .vision-controls input {
      min-width: min(360px, 72vw);
    }

    .vision-mode {
      display: inline-flex;
      gap: 4px;
      padding: 3px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--field);
    }

    .vision-mode button {
      border: 0;
      border-radius: 6px;
      background: transparent;
      color: var(--ink);
      padding: 7px 10px;
      font-weight: 900;
      cursor: pointer;
    }

    .vision-mode button.active {
      background: white;
      box-shadow: var(--shadow);
    }

    .vision-table-wrap {
      max-height: 480px;
      overflow: auto;
      border: 1px solid var(--line);
      border-radius: 8px;
    }

    .vision-table-wrap .vision-grid {
      border: 0;
      border-radius: 0;
    }

    .vision-edit {
      width: 100%;
      min-width: 150px;
      min-height: 34px;
      padding: 6px 8px;
      border-radius: 6px;
      font-size: 13px;
    }

    textarea.vision-edit {
      min-width: 260px;
      min-height: 58px;
      resize: vertical;
    }

    .vision-option-picker {
      min-width: 240px;
    }

    .vision-option-picker .next-step-options {
      grid-template-columns: 1fr;
      max-height: 260px;
    }

    .profile-summary-top {
      margin-bottom: 14px;
    }

    .profile-summary-top textarea {
      min-height: 150px;
    }

    .profile-summary-card {
      display: grid;
      gap: 10px;
      margin-bottom: 14px;
      padding: 14px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: white;
    }

    .profile-summary-card p {
      margin: 0;
    }

    .summary-edit summary {
      width: max-content;
      min-height: 30px;
      padding: 5px 9px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--field);
      color: var(--ink);
      font-size: 12px;
      font-weight: 900;
      cursor: pointer;
      list-style: none;
    }

    .summary-edit summary::-webkit-details-marker {
      display: none;
    }

    .summary-edit form {
      margin-top: 10px;
    }

    .task-workbench {
      grid-template-columns: minmax(320px, .72fr) minmax(0, 1.28fr);
      align-items: start;
    }

    .task-panel {
      display: grid;
      gap: 12px;
    }

    #taskAccountId {
      min-height: 180px;
      overflow: auto;
    }

    .task-list-scroll {
      display: grid;
      gap: 10px;
      max-height: calc(100vh - 330px);
      min-height: 320px;
      overflow: auto;
      padding-right: 4px;
    }

    .task-search-bar {
      display: flex;
      gap: 8px;
      align-items: center;
      flex-wrap: wrap;
    }

    .task-search-bar label {
      flex: 1 1 260px;
      margin: 0;
    }

    .activity-compact {
      display: grid;
      gap: 8px;
      max-height: 360px;
      overflow: auto;
      padding-right: 4px;
    }

    .activity-chip {
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 10px;
      background: var(--soft);
    }

    .activity-chip strong {
      display: block;
      margin: 4px 0;
    }

    .missing-compact {
      max-height: 360px;
      overflow: auto;
      padding-right: 4px;
    }

    .log-grid {
      display: grid;
      grid-template-columns: minmax(280px, .8fr) minmax(0, 1.2fr);
      gap: 14px;
      align-items: start;
    }

    .log-list {
      display: grid;
      gap: 8px;
      max-height: 560px;
      overflow: auto;
      padding-right: 4px;
    }

    .log-week-list {
      display: grid;
      gap: 10px;
      max-height: 640px;
      overflow: auto;
      padding-right: 4px;
    }

    .log-week {
      border: 1px solid var(--line);
      border-radius: 8px;
      background: white;
      overflow: hidden;
    }

    .log-week summary {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      align-items: center;
      padding: 12px;
      cursor: pointer;
      font-weight: 900;
    }

    .log-week-body {
      border-top: 1px solid var(--line);
      padding: 10px;
      display: grid;
      gap: 10px;
    }

    .log-period-controls {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
      margin-bottom: 12px;
    }

    .log-period-controls button {
      min-height: 30px;
      padding: 5px 9px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--field);
      color: var(--ink);
      font-size: 12px;
      font-weight: 900;
      cursor: pointer;
    }

    .log-period-controls button.active {
      background: var(--ink);
      border-color: var(--ink);
      color: white;
    }

    .log-period-controls button:disabled {
      opacity: .45;
      cursor: default;
    }

    .daily-breakdown {
      display: grid;
      gap: 8px;
      margin-top: 12px;
      max-height: 260px;
      overflow: auto;
      padding-right: 4px;
    }

    .log-item {
      border: 1px solid var(--line);
      border-radius: 8px;
      background: white;
      padding: 10px;
    }

    .log-item strong {
      display: block;
      margin-bottom: 4px;
    }

    .vision-grid {
      display: grid;
      grid-template-columns: repeat(5, minmax(150px, 1fr));
      gap: 0;
      border: 1px solid var(--line);
      border-radius: 8px;
      overflow: auto;
      background: white;
    }

    .vision-grid-header,
    .vision-grid-cell {
      padding: 9px 10px;
      border-bottom: 1px solid var(--line);
      border-right: 1px solid var(--line);
      min-width: 150px;
    }

    .vision-grid-header {
      background: var(--soft);
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: .06em;
      font-size: 11px;
      font-weight: 900;
    }

    .vision-grid-cell {
      font-size: 13px;
    }

    .map-wrap {
      position: relative;
      border: 1px solid var(--line);
      border-radius: 8px;
      overflow: hidden;
      background: #b9d0dc;
      min-height: 420px;
      height: 520px;
      user-select: none;
      cursor: grab;
      box-shadow: inset 0 0 0 1px rgba(255,255,255,.25);
    }
    .google-map-canvas { position: absolute; inset: 0; display: none; }
    .map-wrap.google-ready .google-map-canvas { display: block; }
    .map-wrap.google-ready .tile-grid, .map-wrap.google-ready .map-fallback, .map-wrap.google-ready [data-map-pins], .map-wrap.google-ready .map-attribution { display: none; }
    gmp-place-autocomplete { display: block; width: 100%; min-height: 38px; }

    .map-wrap.dragging { cursor: grabbing; }

    .map-wrap.compact-map {
      height: 320px;
      min-height: 320px;
    }

    .map-wrap::before {
      content: "";
      position: absolute;
      inset: 0;
      z-index: 2;
      pointer-events: none;
      background: linear-gradient(180deg, rgba(24,35,31,.06), rgba(24,35,31,.18));
      mix-blend-mode: multiply;
    }

    .tile-grid {
      position: absolute;
      inset: 0;
    }

    .tile-grid img {
      position: absolute;
      width: 256px;
      height: 256px;
      display: block;
      filter: saturate(.86) contrast(1.04);
    }

    .map-fallback {
      position: absolute;
      inset: 0;
      opacity: .28;
      pointer-events: none;
    }

    .land { fill: #d2ddcb; stroke: #b5c5ad; stroke-width: 1.4; }
    .water-line { stroke: rgba(55,122,166,.22); stroke-width: 1; fill: none; }

    .map-attribution {
      position: absolute;
      right: 8px;
      bottom: 8px;
      z-index: 8;
      padding: 3px 6px;
      border-radius: 6px;
      background: rgba(255,255,255,.88);
      color: var(--muted);
      font-size: 11px;
    }

    .map-controls {
      position: absolute;
      top: 10px;
      left: 10px;
      display: grid;
      gap: 6px;
      z-index: 8;
    }

    .map-controls button {
      width: 26px;
      height: 26px;
      border: 1px solid var(--line);
      border-radius: 7px;
      background: rgba(255,255,255,.96);
      color: var(--ink);
      font-size: 0.9rem;
      line-height: 1;
      font-weight: 800;
      cursor: pointer;
    }
    .map-controls { gap: 5px; }   /* smaller zoom controls (Josh 2026-07-17) */

    .map-empty {
      position: absolute;
      z-index: 8;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
      background: rgba(255,255,255,.92);
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 12px 14px;
      color: var(--muted);
      max-width: 340px;
      text-align: center;
    }

    .pin {
      position: absolute;
      z-index: 6;
      width: 20px;
      height: 20px;
      border-radius: 50%;
      border: 3px solid white;
      transform: translate(-50%, -50%);
      box-shadow: 0 10px 24px rgba(0,0,0,.28), 0 0 0 8px rgba(255,255,255,.18);
      cursor: pointer;
      transition: transform .15s ease, box-shadow .15s ease;
    }

    .pin::after {
      content: attr(data-name);
      position: absolute;
      left: 16px;
      top: -8px;
      white-space: nowrap;
      background: rgba(255,255,255,.94);
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 4px 7px;
      color: var(--ink);
      font-size: 12px;
      font-weight: 800;
      opacity: 0;
      pointer-events: none;
      transition: .15s ease;
    }

    .pin:hover {
      transform: translate(-50%, -50%) scale(1.16);
      box-shadow: 0 12px 26px rgba(0,0,0,.3), 0 0 0 10px rgba(255,255,255,.26);
    }

    .pin:hover::after { opacity: 1; }
    .pin.proven { background: var(--green); }
    .pin.trial { background: var(--map-trialing, #a678e8); }   /* purple = trialing (Josh 2026-07-24) */
    .pin.discussion { background: var(--blue); }
    .pin.prospect { background: var(--plum); }

    .pin.dormant { background: var(--red); }
    .google-status-marker { position: relative; width: 13px; height: 13px; border: 2px solid #fff;   /* smaller — the map will fill in (Josh 2026-07-24) */ border-radius: 50%; background: var(--plum); box-shadow: 0 3px 12px rgba(0,0,0,.35); cursor: pointer; }
    /* 2026-07-13 (Josh: hover showed no names, clicks missed): a generous
       invisible hit ring around the small dot, and an INSTANT name chip on
       hover — the native title tooltip needs a ~1s hover and reads as broken */
    .google-status-marker::before { content: ''; position: absolute; inset: -9px; border-radius: 50%; }
    .google-status-marker::after {
      content: attr(data-name);
      position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
      padding: 4px 9px; border-radius: 7px; white-space: nowrap;
      font-size: 11.5px; font-weight: 700; letter-spacing: 0.01em;
      background: rgba(13, 14, 16, 0.94); color: #f5f2ec;
      box-shadow: 0 6px 18px rgba(0,0,0,.35);
      opacity: 0; pointer-events: none; transition: opacity 120ms ease;
      z-index: 30;
    }
    .google-status-marker:hover { transform: scale(1.25); }
    .google-status-marker:hover::after { opacity: 1; }
    .google-status-marker.proven { background: var(--green); }
    .google-status-marker.trial { background: var(--map-trialing, #a678e8); }
    .google-status-marker.discussion { background: var(--blue); }
    .google-status-marker.prospect { background: var(--plum); }

    .map-filter-bar {
      position: absolute;
      left: 56px;
      top: 10px;
      right: 10px;
      z-index: 8;
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
      align-items: center;
    }

    .map-filter-bar.collapsed {
      right: auto;
    }

    .map-filter-toggle {
      min-height: 30px;
      padding: 5px 9px;
      border: 1px solid rgba(255,255,255,.7);
      border-radius: 999px;
      background: rgba(255,255,255,.96);
      color: var(--ink);
      font-size: 12px;
      font-weight: 900;
      cursor: pointer;
      box-shadow: 0 8px 20px rgba(24,35,31,.08);
    }

    .map-filter-bar.collapsed label {
      display: none;
    }

    .map-filter-bar label {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      width: auto;
      min-height: 30px;
      margin: 0;
      padding: 5px 8px;
      border: 1px solid rgba(255,255,255,.7);
      border-radius: 999px;
      background: rgba(255,255,255,.92);
      color: var(--ink);
      font-size: 12px;
      font-weight: 900;
      box-shadow: 0 8px 20px rgba(24,35,31,.08);
    }

    .map-filter-bar input {
      width: 13px;
      height: 13px;
      min-height: 13px;
    }

    .map-legend {
      position: absolute;
      right: 10px;
      top: 54px;
      z-index: 8;
      display: grid;
      gap: 6px;
      padding: 9px 10px;
      border: 1px solid rgba(255,255,255,.75);
      border-radius: 8px;
      background: rgba(255,255,255,.94);
      box-shadow: 0 10px 24px rgba(24,35,31,.12);
      font-size: 12px;
      font-weight: 800;
      color: var(--ink);
    }

    .map-legend-row {
      display: flex;
      align-items: center;
      gap: 7px;
      white-space: nowrap;
    }

    .map-swatch {
      width: 11px;
      height: 11px;
      border-radius: 50%;
      border: 2px solid white;
      box-shadow: 0 0 0 1px rgba(24,35,31,.14);
    }

    .map-swatch.prospect { background: var(--plum); }
    .map-swatch.discussion { background: var(--blue); }
    .map-swatch.trial { background: var(--gold); }
    .map-swatch.proven { background: var(--green); }
    .map-swatch.dormant { background: var(--red); }

    .map-region-strip {
      position: absolute;
      left: 10px;
      right: 10px;
      bottom: 28px;
      z-index: 8;
      display: flex;
      gap: 8px;
      overflow-x: auto;
      pointer-events: none;
    }

    .map-region-chip {
      flex: 0 0 auto;
      padding: 7px 9px;
      border: 1px solid rgba(255,255,255,.75);
      border-radius: 8px;
      background: rgba(255,255,255,.9);
      box-shadow: 0 8px 20px rgba(24,35,31,.08);
      font-size: 12px;
      font-weight: 900;
    }

    .map-card {
      position: absolute;
      right: 14px;
      top: 150px;
      z-index: 9;
      width: min(330px, calc(100% - 28px));
      padding: 14px;
      border: 1px solid rgba(255,255,255,.82);
      border-radius: 8px;
      background: rgba(255,255,255,.95);
      box-shadow: 0 18px 44px rgba(24,35,31,.18);
    }

    .map-card h3 {
      margin-bottom: 4px;
      font-size: 17px;
    }

    .map-card dl {
      display: grid;
      grid-template-columns: auto 1fr;
      gap: 5px 10px;
      margin: 10px 0;
      font-size: 13px;
    }

    .map-card dt {
      color: var(--muted);
      font-weight: 900;
    }

    .map-card dd {
      margin: 0;
    }

    .toolbar {
      display: flex;
      gap: 10px;
      align-items: end;
      flex-wrap: wrap;
      margin-bottom: 14px;
    }

    .toolbar label {
      margin: 0;
      min-width: 160px;
      flex: 1 1 160px;
    }

    .account-workbench {
      grid-template-columns: minmax(0, 1.25fr) minmax(360px, .85fr);
      align-items: start;
    }

    .account-directory {
      display: grid;
      gap: 12px;
    }

    .account-directory-bar {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
    }

    .account-search-mini {
      width: min(340px, 100%);
      margin: 0;
    }

    .account-search-mini input {
      min-height: 36px;
      padding: 8px 10px;
    }

    .account-list-minimal {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
      gap: 8px;
      max-height: calc(100vh - 240px);
      overflow: auto;
      padding-right: 4px;
    }

    .account-list-card {
      border: 1px solid var(--line);
      border-radius: 8px;
      background: white;
      color: var(--ink);
      padding: 11px;
      text-align: left;
      cursor: pointer;
      min-height: 92px;
      display: grid;
      align-content: start;
      gap: 5px;
    }

    .account-list-card:hover {
      border-color: var(--green);
      box-shadow: 0 10px 24px rgba(24,35,31,.08);
    }

    .row-actions {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      align-items: center;
    }

    .inline-stage {
      min-width: 150px;
      min-height: 34px;
      padding: 6px 8px;
    }

    .form-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 0 12px;
    }

    .wide { grid-column: 1 / -1; }

    .question-list {
      display: grid;
      gap: 8px;
      margin: 12px 0 0;
      padding: 0;
      list-style: none;
    }

    .question-list li {
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 10px;
      background: var(--soft);
      color: #2f3d38;
      font-size: 14px;
    }

    .question-answer-form {
      display: grid;
      gap: 8px;
      margin-top: 10px;
    }

    .question-card .link-button {
      color: var(--ink);
      font-size: 14px;
    }

    .clickable {
      cursor: pointer;
      transition: border-color .15s ease, transform .15s ease;
    }

    .clickable:hover {
      border-color: var(--green);
      transform: translateY(-1px);
    }

    .link-button {
      border: 0;
      background: transparent;
      color: var(--green);
      padding: 0;
      font-weight: 900;
      cursor: pointer;
      text-align: left;
    }

    .profile-grid {
      grid-template-columns: minmax(0, 1.15fr) minmax(340px, .85fr);
      align-items: start;
    }

    .profile-hero {
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 16px;
      align-items: start;
      margin-bottom: 16px;
    }

    .profile-snapshot {
      display: grid;
      gap: 16px;
    }

    .profile-shell {
      display: grid;
      gap: 12px;
    }

    .profile-shell .snapshot-title {
      margin-bottom: 2px;
    }

    .profile-actions {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
      justify-content: flex-end;
    }

    .snapshot-title {
      display: flex;
      justify-content: space-between;
      align-items: start;
      gap: 16px;
      flex-wrap: wrap;
    }

    .snapshot-title h2 {
      margin-bottom: 4px;
    }

    .snapshot-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(150px, 1fr));
      gap: 0 12px;
    }

    .summary-box textarea {
      min-height: 132px;
    }

    details.accordion {
      border: 1px solid var(--line);
      border-radius: 8px;
      background: white;
      padding: 0;
      overflow: hidden;
    }

    details.accordion + details.accordion {
      margin-top: 10px;
    }

    details.accordion summary {
      cursor: pointer;
      padding: 12px 14px;
      font-weight: 900;
      background: var(--soft);
      list-style: none;
    }

    details.accordion summary::-webkit-details-marker {
      display: none;
    }

    .accordion-body {
      padding: 14px;
    }

    .profile-tabs {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      margin: 16px 0;
    }

    .profile-tabs button {
      border: 1px solid var(--line);
      border-radius: 8px;
      background: white;
      color: var(--muted);
      padding: 9px 12px;
      font-weight: 900;
      cursor: pointer;
    }

    .profile-tabs button.active {
      background: var(--ink);
      color: white;
      border-color: var(--ink);
    }

    .section-head {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 12px;
      flex-wrap: wrap;
      margin-bottom: 10px;
    }

    .section-head h3 {
      margin-bottom: 0;
    }

    .profile-card-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
      gap: 12px;
    }

    .profile-card {
      border: 1px solid var(--line);
      border-radius: 8px;
      background: white;
      padding: 12px;
      display: grid;
      gap: 8px;
    }

    .profile-card h3, .profile-card p {
      margin-bottom: 0;
    }

    .trial-card {
      cursor: pointer;
    }

    .trial-card:focus-within, .trial-card:hover {
      border-color: var(--green);
    }

    .crop-picker {
      grid-column: 1 / -1;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: white;
      padding: 12px;
      margin: 14px 0;
    }

    .crop-options {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
      gap: 8px;
      max-height: 300px;
      overflow: auto;
      padding: 8px 2px 0;
    }

    .crop-option {
      display: flex;
      gap: 8px;
      align-items: center;
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 8px;
      margin: 0;
      background: var(--soft);
      font-size: 13px;
    }

    .crop-option input {
      flex: 0 0 auto;
    }

    .timeline-list {
      position: relative;
      display: grid;
      gap: 10px;
    }

    .timeline-card {
      position: relative;
      border-left: 4px solid var(--green);
    }

    .story-prompts {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
      gap: 12px;
    }

    .story-prompts textarea {
      min-height: 120px;
    }

    .drawer-panel {
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--soft);
      padding: 14px;
      margin-bottom: 14px;
    }

    .form-actions {
      display: flex;
      gap: 10px;
      align-items: center;
      flex-wrap: wrap;
      margin-top: 8px;
    }

    .mini-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 12px;
    }

    .missing-list {
      display: grid;
      gap: 8px;
      margin: 0;
      padding: 0;
      list-style: none;
    }

    .missing-list li {
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--soft);
      padding: 10px;
      font-weight: 800;
    }

    .contact-card, .opportunity-card, .pipeline-card {
      border: 1px solid var(--line);
      border-radius: 8px;
      background: white;
      padding: 12px;
    }

    .pipeline-board {
      display: grid;
      grid-template-columns: repeat(6, minmax(120px, 1fr));
      gap: 8px;
      align-items: start;
    }

    .pipeline-column {
      min-width: 0;
      max-height: 420px;
      overflow-y: auto;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--soft);
      padding: 0 6px 8px;
    }

    .pipeline-column h3 {
      position: sticky;
      top: 0;
      z-index: 2;
      background: var(--soft);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 6px;
      padding: 10px 2px 8px;
      font-size: 12px;
      margin-bottom: 6px;
    }

    .pipeline-column h3 span {
      display: inline-grid;
      place-items: center;
      min-width: 22px;
      height: 20px;
      border-radius: 999px;
      background: white;
      border: 1px solid var(--line);
      color: var(--muted);
      font-size: 11px;
    }

    .pipeline-column.drag-over {
      border-color: var(--green);
      background: #eef7ee;
    }

    .pipeline-card[draggable="true"] {
      cursor: grab;
      margin-bottom: 6px;
      padding: 8px;
      font-size: 12px;
    }

    .pipeline-card-lite {
      border-color: #dfe7e2;
      box-shadow: 0 1px 1px rgba(24, 35, 31, .03);
    }

    .pipeline-card.dragging {
      opacity: .55;
    }

    .pipeline-card h3 {
      font-size: 13px;
      margin: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .pipeline-card p {
      margin-bottom: 4px;
    }

    .pipeline-card-lite p {
      margin: 3px 0 0;
      font-size: 11px;
      line-height: 1.25;
    }

    .pipeline-empty {
      display: block;
      padding: 8px 2px;
      color: var(--muted);
      font-size: 11px;
      font-weight: 800;
    }

    .pipeline-lite-toolbar {
      margin-bottom: 6px;
      padding-bottom: 4px;
    }

    .opportunity-grid {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .rank-list { display: grid; gap: 10px; }

    .rank-row, .rec {
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 12px;
      background: white;
    }

    .rank-row {
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 12px;
      align-items: center;
    }

    .score {
      width: 48px;
      height: 48px;
      border-radius: 8px;
      display: grid;
      place-items: center;
      background: var(--ink);
      color: white;
      font-weight: 900;
    }

    .pill {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      border-radius: 999px;
      padding: 4px 8px;
      background: var(--field);
      font-size: 12px;
      font-weight: 800;
      white-space: nowrap;
    }

    .bar {
      height: 8px;
      border-radius: 999px;
      background: var(--field);
      overflow: hidden;
      margin-top: 8px;
    }

    .bar span {
      display: block;
      height: 100%;
      border-radius: inherit;
      background: linear-gradient(90deg, var(--green), var(--gold));
    }

    table {
      width: 100%;
      border-collapse: collapse;
      background: white;
    }

    th, td {
      padding: 11px 10px;
      border-bottom: 1px solid var(--line);
      text-align: left;
      vertical-align: top;
      font-size: 14px;
    }

    th {
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: .08em;
      font-size: 12px;
      background: var(--soft);
    }

    .table-wrap {
      max-height: 560px;
      overflow: auto;
      border: 1px solid var(--line);
      border-radius: 8px;
    }

    .intake-flow {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 10px;
      margin-bottom: 16px;
    }

    .flow-step {
      min-height: 104px;
      padding: 14px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: white;
      box-shadow: var(--shadow);
    }

    .flow-step strong {
      display: block;
      margin-top: 8px;
      font-size: 16px;
    }

    .intake-layout {
      grid-template-columns: minmax(320px, .86fr) minmax(0, 1.14fr);
      align-items: start;
    }

    .intake-card {
      display: grid;
      gap: 12px;
    }

    .intake-card h3, .intake-review h3 {
      margin-bottom: 4px;
    }

    .intake-card textarea {
      min-height: 220px;
    }

    .intake-history {
      display: grid;
      gap: 8px;
      max-height: 460px;
      overflow: auto;
    }

    .intake-history-item {
      width: 100%;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: white;
      padding: 10px;
      text-align: left;
      color: var(--ink);
      cursor: pointer;
    }

    .intake-history-item.active,
    .intake-history-item:hover {
      border-color: var(--green);
      background: var(--field);
    }

    .intake-review {
      display: grid;
      gap: 16px;
    }

    .intake-preview {
      padding: 14px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--soft);
    }

    .entity-grid,
    .classification-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
    }

    .entity-group,
    .classification-card,
    .match-card {
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 12px;
      background: white;
    }

    .entity-group h4,
    .classification-card h4,
    .match-card h4 {
      margin: 0 0 8px;
      font-size: 15px;
    }

    .entity-pills {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
    }

    .entity-pill {
      max-width: 100%;
      border: 1px solid var(--line);
      border-radius: 999px;
      padding: 5px 8px;
      background: var(--field);
      color: var(--ink);
      font-size: 12px;
      font-weight: 800;
      overflow-wrap: anywhere;
    }

    .entity-pill.long {
      width: 100%;
      border-radius: 8px;
      font-weight: 600;
      line-height: 1.35;
    }

    .classification-card ul {
      margin: 8px 0 0;
      padding-left: 18px;
      color: #2f3d38;
    }

    .match-grid {
      display: grid;
      gap: 8px;
    }

    .match-score {
      display: inline-grid;
      place-items: center;
      width: 42px;
      height: 42px;
      border-radius: 50%;
      background: var(--ink);
      color: white;
      font-weight: 900;
      float: right;
      margin-left: 10px;
    }

    .intake-apply {
      display: grid;
      gap: 10px;
      padding-top: 12px;
      border-top: 1px solid var(--line);
    }

    .review-list {
      display: grid;
      gap: 10px;
    }

    .intake-review-minimal {
      grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }

    .intake-account-search {
      display: grid;
      gap: 6px;
    }

    .intake-account-search input {
      width: 100%;
    }

    .intake-more-details {
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 10px 12px;
      background: var(--soft);
    }

    .intake-more-details summary {
      cursor: pointer;
      font-weight: 700;
      color: var(--muted);
    }

    .intake-more-details .review-list {
      margin-top: 10px;
    }

    .review-block {
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 12px;
      background: var(--panel);
    }

    .review-block.compact p {
      margin: 0;
      color: var(--ink);
      white-space: pre-line;
    }

    .review-block h4 {
      margin: 0 0 8px;
      font-size: 15px;
    }

    .review-block ul {
      margin: 0;
      padding-left: 18px;
      color: #2f3d38;
    }

    .intake-extraction-status {
      display: grid;
      gap: 6px;
      padding: 10px 12px;
      border: 1px solid var(--line);
      border-left: 4px solid var(--green);
      border-radius: 8px;
      background: var(--soft);
    }

    .intake-extraction-status strong {
      display: block;
      margin-top: 2px;
      color: var(--ink);
    }

    .intake-extraction-status p {
      margin: 0;
      color: var(--muted);
      font-size: 12px;
      line-height: 1.4;
    }

    .intake-extraction-status.tone-low {
      border-left-color: #b45309;
      background: #fff7ed;
    }

    .intake-extraction-meta {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
    }

    .intake-extraction-meta span {
      border: 1px solid var(--line);
      border-radius: 999px;
      padding: 3px 7px;
      color: var(--muted);
      font-size: 11px;
      font-weight: 800;
    }

    .suggestion-groups {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
      gap: 8px;
    }

    .suggestion-group-card {
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 10px;
      background: var(--panel);
    }

    .suggestion-group-card > div {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      margin-bottom: 7px;
    }

    .suggestion-group-card > div span {
      display: inline-grid;
      place-items: center;
      min-width: 22px;
      height: 22px;
      border-radius: 999px;
      background: var(--ink);
      color: white;
      font-size: 11px;
      font-weight: 900;
    }

    .suggestion-group-card ul {
      display: grid;
      gap: 6px;
      margin: 0;
      padding: 0;
      list-style: none;
    }

    .suggestion-group-card li {
      display: grid;
      gap: 2px;
      min-width: 0;
    }

    .suggestion-group-card b,
    .suggestion-group-card small {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .suggestion-group-card b {
      font-size: 12px;
      color: var(--ink);
    }

    .suggestion-group-card small {
      color: var(--muted);
      font-size: 11px;
    }

    .suggestion-group-card.tone-needs_review,
    .suggestion-group-card.tone-conflicting_with_existing_data,
    .suggestion-group-card.tone-low_confidence {
      background: #fff7ed;
      border-color: #fed7aa;
    }

    .intake-evidence-panel {
      display: grid;
      gap: 8px;
      padding: 10px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--soft);
    }

    .section-head.tight {
      margin: 0;
      gap: 8px;
    }

    .section-head.tight h4 {
      margin: 0;
      font-size: 14px;
    }

    .evidence-list {
      display: grid;
      gap: 8px;
    }

    .evidence-card {
      display: grid;
      gap: 6px;
      padding: 9px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--panel);
    }

    .evidence-card > div {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
    }

    .evidence-card small {
      color: var(--muted);
      font-weight: 700;
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .evidence-card blockquote {
      margin: 0;
      color: var(--ink);
      font-size: 12px;
      line-height: 1.45;
    }

    body.night-mode .intake-extraction-status,
    body.night-mode .intake-evidence-panel {
      background: #171a1d;
      border-color: #2d3338;
    }

    body.night-mode .intake-extraction-status.tone-low,
    body.night-mode .suggestion-group-card.tone-needs_review,
    body.night-mode .suggestion-group-card.tone-conflicting_with_existing_data,
    body.night-mode .suggestion-group-card.tone-low_confidence {
      background: #241d13;
      border-color: #5f4520;
    }

    body.night-mode .suggestion-group-card,
    body.night-mode .evidence-card {
      background: #111417;
      border-color: #2d3338;
    }

    body.night-mode .intake-extraction-meta span {
      border-color: #30363d;
      color: #9ba3aa;
    }

    .matrix-toolbar {
      display: flex;
      gap: 10px;
      align-items: center;
      flex-wrap: wrap;
      margin-bottom: 12px;
    }

    .matrix-toolbar.compact {
      justify-content: space-between;
      gap: 12px;
      padding-bottom: 8px;
      border-bottom: 1px solid var(--line);
    }

    .matrix-main-tools,
    .matrix-quiet-tools,
    .matrix-row-tools {
      display: flex;
      align-items: center;
      gap: 7px;
      flex-wrap: wrap;
    }

    .matrix-row-tools {
      gap: 3px;
      flex-wrap: nowrap;
      justify-content: center;
    }

    .matrix-row-tools input[type="checkbox"] {
      width: 14px;
      height: 14px;
      min-width: 14px;
      min-height: 14px;
    }

    .matrix-toolbar label {
      margin: 0;
      min-width: 180px;
      flex: 1 1 180px;
    }

    .matrix-toolbar.compact label {
      min-width: 170px;
      flex: 0 1 240px;
      color: var(--muted);
    }

    .matrix-toolbar.compact input,
    .matrix-toolbar.compact select {
      min-height: 34px;
      padding: 7px 9px;
    }

    .matrix-inline-field {
      display: flex;
      align-items: center;
      gap: 8px;
      min-width: 0 !important;
      flex: 0 1 auto !important;
      color: var(--muted);
      font-weight: 800;
    }

    .matrix-inline-field span {
      flex: 0 0 auto;
      white-space: nowrap;
      font-size: 12px;
    }

    .matrix-inline-field input,
    .matrix-inline-field select {
      min-width: 0;
      width: clamp(118px, 15vw, 220px);
    }

    .matrix-search-input {
      min-width: 190px;
      width: clamp(190px, 22vw, 320px);
      min-height: 34px;
      padding: 7px 10px;
      border-radius: 8px;
    }

    .accounts-view-icons {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 2px;
      border: 1px solid var(--line);
      border-radius: 10px;
      background: var(--field);
    }

    .accounts-view-icons .icon-button {
      width: 30px;
      height: 30px;
      min-height: 30px;
      border-color: transparent;
      background: transparent;
      border-radius: 7px;
    }

    .accounts-view-icons .icon-button.active {
      background: white;
      border-color: var(--line);
      color: var(--green);
      box-shadow: 0 1px 2px rgba(24, 35, 31, .06);
    }

    .icon-button {
      width: 36px;
      height: 36px;
      min-height: 36px;
      padding: 0;
      display: inline-grid;
      place-items: center;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: white;
      color: var(--ink);
      cursor: pointer;
      font-weight: 900;
    }

    .icon-button:hover {
      background: var(--field);
    }

    .matrix-delete {
      min-height: 34px;
      padding: 7px 10px;
      font-size: 13px;
    }

    .matrix-tool-menu {
      position: relative;
    }

    .matrix-tool-menu summary {
      list-style: none;
      min-height: 34px;
      padding: 7px 10px;
      border: 1px solid transparent;
      border-radius: 8px;
      color: var(--muted);
      cursor: pointer;
      font-weight: 800;
      font-size: 13px;
    }

    .matrix-tool-menu summary.icon-summary {
      min-width: 34px;
      height: 34px;
      padding: 0 9px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      border-color: var(--line);
      background: white;
      color: var(--ink);
    }

    .filter-icon {
      width: 14px;
      height: 14px;
      display: inline-block;
      background: currentColor;
      clip-path: polygon(5% 8%, 95% 8%, 62% 48%, 62% 94%, 38% 94%, 38% 48%);
    }

    .filter-summary-text {
      max-width: 132px !important;
    }

    .matrix-tool-menu summary span {
      display: inline-block;
      margin-left: 6px;
      color: var(--muted);
      font-size: 11px;
      font-weight: 700;
      max-width: 190px;
      overflow: hidden;
      text-overflow: ellipsis;
      vertical-align: bottom;
      white-space: nowrap;
    }

    .matrix-tool-menu summary::-webkit-details-marker {
      display: none;
    }

    .matrix-tool-menu[open] summary,
    .matrix-tool-menu summary:hover {
      color: var(--ink);
      border-color: var(--line);
      background: var(--field);
    }

    .matrix-tool-popover {
      position: absolute;
      right: 0;
      top: calc(100% + 8px);
      z-index: 20;
      width: min(560px, 88vw);
      max-height: 420px;
      overflow: auto;
      padding: 12px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: white;
      box-shadow: var(--shadow);
    }

    .popover-close {
      position: absolute;
      top: 8px;
      right: 8px;
      width: 30px;
      height: 30px;
      min-height: 30px;
      font-size: 12px;
    }

    .matrix-tool-menu:not([open]) > .matrix-tool-popover {
      display: none;
    }

    .matrix-edit-popover {
      display: grid;
      gap: 14px;
    }

    .matrix-filter-popover {
      left: 0;
      right: auto;
      width: min(340px, 86vw);
      display: grid;
      gap: 9px;
    }

    .matrix-filter-popover .matrix-inline-field {
      justify-content: space-between;
      width: 100%;
    }

    .matrix-filter-popover .matrix-inline-field select {
      width: 190px;
    }

    .matrix-edit-section {
      display: grid;
      gap: 8px;
    }

    .matrix-edit-section h3 {
      margin: 0;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: .08em;
      font-size: 12px;
    }

    .matrix-column-menu {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 6px;
    }

    .matrix-row-handle {
      width: 18px;
      height: 24px;
      display: inline-grid;
      place-items: center;
      border: 0;
      border-radius: 6px;
      background: transparent;
      color: var(--muted);
      cursor: grab;
      font-weight: 900;
      line-height: 1;
      user-select: none;
    }

    .matrix-row-handle:active {
      cursor: grabbing;
    }

    .matrix-grid tr.drag-over td {
      background: #eef7ee;
      box-shadow: inset 0 2px 0 var(--green);
    }

    .matrix-grid input,
    .matrix-grid select {
      min-width: 140px;
      min-height: 30px;
      padding: 5px 7px;
      border-radius: 6px;
      font-size: 13px;
    }

    .matrix-grid textarea {
      min-width: 220px;
      min-height: 42px;
      padding: 5px 7px;
      border-radius: 6px;
      font-size: 13px;
    }

    .matrix-grid input[type="checkbox"],
    .matrix-toolbar input[type="checkbox"],
    .entity-pill input[type="checkbox"] {
      width: 14px;
      height: 14px;
      min-height: 14px;
    }

    .matrix-grid th {
      position: sticky;
      top: 0;
      z-index: 4;
    }

    .matrix-grid td,
    .matrix-grid th {
      padding: 6px 7px;
      font-size: 13px;
    }

    .matrix-grid.table-wrap {
      max-height: calc(100vh - 315px);
    }

    .matrix-grid th:first-child,
    .matrix-grid td:first-child {
      min-width: 38px;
      width: 38px;
      max-width: 38px;
      padding-left: 3px;
      padding-right: 3px;
    }

    .matrix-tabs {
      position: sticky;
      bottom: 0;
      z-index: 8;
      display: flex;
      gap: 6px;
      align-items: center;
      flex-wrap: wrap;
      padding: 10px 0 0;
      background: var(--panel);
      border-top: 1px solid var(--line);
      margin-top: 10px;
    }

    .matrix-tabs-top {
      position: static;
      bottom: auto;
      padding: 0 0 10px;
      margin: 0 0 12px;
      background: transparent;
      border-top: 0;
      border-bottom: 1px solid var(--line);
    }

    .matrix-tab {
      border: 1px solid var(--line);
      border-radius: 999px;
      background: var(--field);
      color: var(--ink);
      min-height: 32px;
      padding: 6px 10px;
      font-weight: 800;
      cursor: pointer;
    }

    .matrix-tab.active {
      background: var(--ink);
      color: white;
    }

    .matrix-company-cell {
      display: block;
      min-width: 240px;
    }

    .matrix-company-main {
      display: flex;
      align-items: center;
      gap: 6px;
      min-width: 0;
    }

    /* Ambient Donna: a passive per-row signal dot (Observe surfaces none). Subtle by
       design — a colored dot, not a badge. Tier drives the color, same palette as the rail. */
    .matrix-signal-dot {
      width: 8px; height: 8px; border-radius: 50%; flex: none;
      background: var(--green); cursor: default;
    }
    .matrix-signal-dot.donna-tier-critical { background: #b3261e; box-shadow: 0 0 0 3px rgba(179,38,30,0.12); }
    .matrix-signal-dot.donna-tier-high { background: #d98a00; }
    .matrix-signal-dot.donna-tier-medium { background: #137952; }
    .matrix-signal-dot.donna-tier-low { background: var(--line); }

    /* The "matrix" room's own Donna dial — compact segmented control in the toolbar. */
    .matrix-donna-dial { display: inline-flex; align-items: center; gap: 6px; }
    .matrix-donna-label { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }

    /* Professionalize "show original" (Slice C): the verbatim raw underneath a cleaned
       note, revealed on a quiet disclosure so what you actually said is always recoverable. */
    .note-original { margin-top: 6px; }
    .note-original summary { cursor: pointer; opacity: 0.55; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; list-style: none; }
    .note-original summary::-webkit-details-marker { display: none; }
    .note-original[open] summary { opacity: 0.75; }
    .note-original-text { margin: 6px 0 0; opacity: 0.72; font-style: italic; font-size: 0.85rem; }

    /* Trial observation history (filing brain): the progression of dated findings on a trial,
       so a sequence of observations reads as a story, not just the latest flattened value. */
    .trial-findings-history { margin-top: 16px; }
    .findings-timeline { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
    .findings-entry { position: relative; padding: 10px 12px; border-left: 2px solid var(--border, rgba(120,130,150,0.3)); background: var(--surface-2, rgba(120,130,150,0.06)); border-radius: 0 8px 8px 0; }
    .findings-entry-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
    .findings-date { font-size: 0.74rem; font-weight: 600; letter-spacing: 0.02em; color: var(--muted); font-variant-numeric: tabular-nums; }
    .findings-text { margin: 0; }

    .matrix-company-button {
      border: 0;
      background: transparent;
      color: var(--ink);
      cursor: pointer;
      text-align: left;
      padding: 0;
      display: grid;
      gap: 2px;
      min-width: 0;
      flex: 1 1 auto;
    }

    .matrix-test-button {
      border: 1px solid var(--line);
      background: var(--panel-soft);
      color: var(--ink);
      border-radius: 999px;
      cursor: pointer;
      flex: 0 0 auto;
      font-size: 10px;
      font-weight: 850;
      line-height: 1;
      min-height: 22px;
      padding: 5px 8px;
      white-space: nowrap;
    }

    .matrix-test-button:hover {
      border-color: var(--pfv-green);
      color: var(--pfv-green-dark);
    }

    .matrix-note-composer {
      align-items: center;
      display: flex;
      gap: 5px;
      min-width: 210px;
      width: 100%;
    }

    .matrix-note-composer input {
      flex: 1 1 auto;
      min-width: 0;
    }

    .matrix-note-send {
      align-items: center;
      border: 1px solid var(--line);
      background: var(--pfv-green);
      color: #fff;
      border-radius: 999px;
      cursor: pointer;
      display: inline-flex;
      flex: 0 0 auto;
      font-weight: 900;
      height: 24px;
      justify-content: center;
      width: 24px;
    }

    .matrix-company-button strong,
    .matrix-company-meta {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .matrix-company-button:hover strong {
      text-decoration: underline;
    }

    .matrix-grid tbody tr {
      height: 44px;
    }

    .matrix-grid td {
      white-space: nowrap;
    }

    .matrix-company-actions {
      display: inline-flex;
      align-items: center;
      gap: 3px;
      opacity: .22;
      transition: opacity .15s ease;
    }

    .matrix-grid tr:hover .matrix-company-actions,
    .matrix-company-actions:focus-within {
      opacity: 1;
    }

    .matrix-company-link {
      justify-self: start;
      font-weight: 900;
      color: var(--ink);
      text-align: left;
    }

    .matrix-company-meta {
      color: var(--muted);
      font-size: 11px;
      font-weight: 700;
      line-height: 1.3;
    }

    .matrix-row-icon {
      width: 24px;
      height: 24px;
      min-height: 24px;
      border-radius: 6px;
      font-size: 13px;
    }

    .matrix-grid .quick-call-menu summary {
      width: 24px;
      height: 24px;
      border-radius: 6px;
      font-size: 12px;
    }

    .compact-metrics-four {
      grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .cold-list-tabs {
      margin-top: 12px;
    }

    .cold-list-tabs .matrix-tab {
      max-width: 220px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .stage-manager,
    .next-step-menu,
    .address-suggestions {
      display: grid;
      gap: 8px;
    }

    .stage-row,
    .matrix-tab-row {
      display: grid;
      grid-template-columns: minmax(180px, 1fr) auto auto auto auto;
      gap: 8px;
      align-items: center;
      padding: 8px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: white;
    }

    .next-step-picker {
      display: grid;
      gap: 8px;
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 10px;
      background: white;
    }

    details.next-step-picker:not([open]) > :not(summary) {
      display: none;
    }

    .next-step-options {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 6px;
      max-height: 280px;
      overflow: auto;
      padding-right: 4px;
    }

    .next-step-options label {
      min-height: 34px;
      display: flex;
      align-items: center;
      gap: 7px;
      padding: 7px 8px;
      border: 1px solid var(--line);
      border-radius: 6px;
      background: var(--soft);
      font-size: 13px;
      line-height: 1.25;
    }

    .matrix-grid .matrix-multi-picker {
      min-width: 160px;
      padding: 0;
      border: 0;
      background: transparent;
    }

    .matrix-grid .matrix-multi-picker summary {
      list-style: none;
      min-height: 32px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      padding: 6px 8px;
      border: 1px solid var(--line);
      border-radius: 6px;
      background: white;
      cursor: pointer;
      font-weight: 800;
      color: var(--ink);
      white-space: nowrap;
    }

    .matrix-grid .matrix-multi-picker summary::-webkit-details-marker {
      display: none;
    }

    .matrix-grid .matrix-multi-picker summary::after {
      content: "Open";
      color: var(--muted);
      font-size: 11px;
      text-transform: uppercase;
      letter-spacing: .06em;
    }

    .matrix-grid .matrix-multi-picker[open] {
      position: fixed;
      z-index: 90;
      left: 50%;
      top: 50%;
      width: min(380px, 92vw);
      max-height: 78vh;
      overflow: auto;
      transform: translate(-50%, -50%);
      padding: 14px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: white;
      box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
    }

    .matrix-grid .matrix-multi-picker[open] summary {
      margin-bottom: 10px;
      background: var(--ink);
      color: white;
      border-color: var(--ink);
    }

    .matrix-grid .matrix-multi-picker[open] summary::after {
      content: "Close when done";
      color: rgba(255,255,255,.72);
    }

    .matrix-grid .matrix-multi-picker input[type="search"] {
      width: 100%;
      min-width: 0;
      margin-bottom: 10px;
    }

    .matrix-grid .matrix-multi-picker .next-step-options {
      grid-template-columns: 1fr;
      max-height: 360px;
      overflow: auto;
      padding-right: 4px;
    }

    .matrix-grid .matrix-multi-picker .next-step-options label {
      min-height: 34px;
      display: flex;
      align-items: center;
      gap: 7px;
      padding: 7px 8px;
      border: 1px solid var(--line);
      border-radius: 6px;
      background: var(--soft);
      font-size: 13px;
      line-height: 1.25;
    }

    .address-suggestions button {
      border: 1px solid var(--line);
      border-radius: 8px;
      background: white;
      color: var(--ink);
      padding: 8px 10px;
      text-align: left;
      cursor: pointer;
    }

    .activity-list {
      display: grid;
      gap: 8px;
      max-height: 280px;
      overflow: auto;
    }

    .upload {
      display: grid;
      gap: 12px;
      margin-bottom: 16px;
      padding: 16px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: white;
    }

    .modal-backdrop {
      position: fixed;
      inset: 0;
      z-index: 80;
      display: grid;
      place-items: center;
      padding: 20px;
      background: rgba(15, 23, 42, 0.34);
    }

    #quickUploadRoot .modal-backdrop {
      z-index: 220;
    }

    .quick-modal {
      width: min(860px, 96vw);
      max-height: 88vh;
      overflow: auto;
      display: grid;
      gap: 14px;
      padding: 18px;
      position: relative;
      z-index: 221;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--panel);
      box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
    }

    .quick-modal-intelligence {
      width: min(780px, calc(100vw - 28px));
      background: #f8faf7;
    }

    .account-pick-list {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
      gap: 8px;
      max-height: 210px;
      overflow: auto;
      padding-right: 4px;
    }

    .account-pick {
      border: 1px solid var(--line);
      border-radius: 8px;
      background: white;
      color: var(--ink);
      padding: 10px;
      text-align: left;
      cursor: pointer;
    }

    .account-pick.active {
      border-color: var(--green);
      box-shadow: 0 0 0 2px rgba(19, 121, 82, 0.12);
    }

    /* Account-match picker (Josh design 2026-07-18): one prominent best guess,
       alternates + search behind a disclosure. */
    .account-best-guess {
      border: 1px solid var(--line);
      border-left: 3px solid var(--green);
      border-radius: 8px;
      background: #f3f8f4;
      padding: 10px 12px;
    }
    .account-best-guess.account-best-none { border-left-color: var(--line); background: #f7f7f6; }
    .account-best-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
    .account-best-guess h3 { margin: 5px 0 2px; }
    .account-match-reason { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
    .account-change { margin-top: 8px; }
    .account-change > summary { cursor: pointer; font-size: 13px; color: var(--green); padding: 4px 0; }
    .account-alternates { margin: 6px 0; display: grid; gap: 6px; }
    .account-search-label { display: block; margin-top: 8px; font-size: 13px; }

    /* Ambient Donna rail + dial (Slice A, governance-first) */
    .donna-rail { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 10px 0; background: #fbfcfb; }
    .donna-rail-head { display: flex; align-items: center; gap: 8px; }
    .donna-rail-pulse { width: 8px; height: 8px; border-radius: 50%; flex: none; }
    .donna-rail-pulse.quiet { background: var(--line); }
    .donna-rail-pulse.live { background: var(--green); box-shadow: 0 0 0 3px rgba(19,121,82,0.15); }
    .donna-dial { margin-left: auto; display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
    .donna-dial-seg { border: 0; background: white; color: var(--muted); padding: 4px 10px; font-size: 12px; cursor: pointer; }
    .donna-dial-seg + .donna-dial-seg { border-left: 1px solid var(--line); }
    .donna-dial-seg.active { background: var(--green); color: white; }
    .donna-rail-hint { margin: 6px 0 0; font-size: 12px; }

    /* Ambient Donna rail zones (Slice B) */
    .donna-zone { margin-top: 8px; }
    .donna-zone-label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
    .donna-list { margin: 4px 0 0; padding-left: 16px; }
    .donna-list li { font-size: 13px; margin: 2px 0; }
    .donna-list.donna-changed li { color: var(--muted); }
    .donna-watch.donna-tier-critical { color: #b3261e; font-weight: 600; list-style: none; margin-left: -12px; }
    .donna-watch.donna-tier-critical::before { content: "🔴 "; }
    .donna-watch.donna-tier-high { color: #a15c00; }
    .donna-watch.donna-tier-medium, .donna-watch.donna-tier-low { color: var(--ink); }
    .donna-list.donna-next { list-style: none; padding-left: 0; }
    .donna-list.donna-next .donna-next-item::before { content: "→ "; color: var(--green); }
    .donna-stage-btn { margin-left: 6px; }

    /* Approvals inbox (messaging game plan, 2026-07-18) */
    #reviewBadgeRoot { position: relative; }
    .approvals-badge { position: relative; }
    .approvals-count { background: #9a6208; }
    .approvals-panel {
      position: fixed; right: 18px; bottom: 118px; z-index: 60;
      width: 320px; max-width: 86vw; max-height: 62vh; overflow-y: auto;
      background: var(--surface, #fff); color: var(--ink);
      border: 1px solid var(--line); border-radius: 12px;
      box-shadow: 0 10px 34px -12px rgba(24,35,31,.4); padding: 10px;
    }
    body.night-mode .approvals-panel { background: #161d18; border-color: #27312b; }
    .approvals-head { display: flex; align-items: center; justify-content: space-between;
      font-weight: 650; font-size: 13px; padding: 4px 6px 8px; }
    .approvals-zero { font-size: 11px; color: var(--muted); font-weight: 500; }
    .approval-card { border: 1px solid var(--line); border-left: 3px solid #9a6208;
      border-radius: 10px; padding: 10px 11px; margin-bottom: 8px; background: var(--surface-2, #f4f7f5); }
    body.night-mode .approval-card { background: #1b241e; border-color: #27312b; border-left-color: #d59a3f; }
    .approval-kind { font-size: 10px; letter-spacing: .07em; text-transform: uppercase;
      color: #9a6208; font-weight: 700; }
    body.night-mode .approval-kind { color: #d59a3f; }
    .approval-main { font-size: 13px; margin: 3px 0 8px; }
    .approval-act { display: flex; gap: 7px; }
    .approvals-empty { font-size: 12.5px; color: var(--muted); text-align: center; padding: 14px 6px; margin: 0; }

    /* Donna's rhythm (cadence personalization) */
    .cadence-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; margin-top: 8px; }
    @media (max-width: 560px) { .cadence-grid { grid-template-columns: 1fr; } }
    .cadence-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
    .cadence-stage-name { flex: 1; }
    .cadence-row input[type="number"] { width: 58px; text-align: right; }

    /* Prose-insight review queue (Josh 2026-07-18) */
    .insight-review-list { display: grid; gap: 8px; margin-top: 6px; }
    .insight-review-row {
      display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
      border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: white;
    }
    .insight-review-body p { margin: 0 0 4px; }
    .insight-review-actions { display: flex; gap: 6px; flex: none; }

    .quick-upload-form {
      display: grid;
      gap: 12px;
    }

    .quick-upload-form textarea {
      min-height: 120px;
    }

    .quick-upload-polished { gap: 14px; }
    .quick-upload-mini-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
    }
    .quick-upload-context {
      display: flex;
      justify-content: space-between;
      gap: 10px;
      align-items: start;
      padding: 12px 14px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #fff;
    }
    .quick-upload-context strong { display: block; margin-top: 4px; }
    .quick-upload-tabs {
      display: inline-flex;
      gap: 4px;
      padding: 4px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #eef2ee;
      width: max-content;
    }
    .quick-upload-tabs button {
      min-height: 32px;
      padding: 5px 12px;
      border: 0;
      border-radius: 6px;
      background: transparent;
      color: var(--muted);
      font-weight: 800;
      cursor: pointer;
    }
    .quick-upload-tabs button.active {
      background: #fff;
      color: var(--ink);
      box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
    }
    .quick-upload-pane { display: grid; gap: 12px; }
    .quick-upload-dropzone {
      display: grid;
      justify-items: center;
      gap: 6px;
      padding: 18px;
      border: 1px dashed #b8c5ba;
      border-radius: 8px;
      background: #fcfdfb;
      text-align: center;
      transition: border-color 120ms ease, background 120ms ease, transform 120ms ease;
    }
    .quick-upload-dropzone.dragging {
      border-color: #5a8f6a;
      background: #f1f7f2;
      transform: translateY(-1px);
    }
    .quick-upload-glyph {
      display: grid;
      place-items: center;
      width: 42px;
      height: 42px;
      border-radius: 50%;
      background: #edf4ef;
      color: #2d6b44;
      font-size: 18px;
      font-weight: 900;
    }
    .quick-upload-notes { margin: 0; }
    .quick-upload-notes textarea {
      min-height: 150px;
      margin-top: 6px;
    }
    .quick-upload-processing {
      display: grid;
      justify-items: center;
      gap: 10px;
      padding: 22px 10px 10px;
      text-align: center;
    }
    .seed-sprout-loader {
      position: relative;
      width: 180px;
      height: 140px;
      --plant: #5f8d46;
      --plant-dark: #406431;
      --soil: #867258;
      --seed: #b99254;
    }
    .seed-sprout-loader .soil-line {
      position: absolute;
      left: 16px;
      right: 16px;
      top: 72px;
      height: 10px;
      border-radius: 999px;
      background: linear-gradient(90deg, #9f8a6e, #6f5f48);
    }
    .seed-sprout-loader .seed-core,
    .seed-sprout-loader .root-line,
    .seed-sprout-loader .stem-line,
    .seed-sprout-loader .leaf,
    .seed-sprout-loader .check-mark {
      position: absolute;
      left: 50%;
      transform-origin: center bottom;
      transition: opacity 180ms ease, transform 180ms ease;
      opacity: 0;
    }
    .seed-sprout-loader .seed-core {
      top: 62px;
      width: 18px;
      height: 12px;
      margin-left: -9px;
      border-radius: 12px 12px 10px 10px;
      background: var(--seed);
      opacity: 1;
    }
    .seed-sprout-loader .root-line {
      top: 74px;
      width: 3px;
      height: 20px;
      margin-left: -1.5px;
      border-radius: 999px;
      background: #dcc8a5;
    }
    .seed-sprout-loader .stem-line {
      top: 42px;
      width: 4px;
      height: 32px;
      margin-left: -2px;
      border-radius: 999px;
      background: var(--plant-dark);
    }
    .seed-sprout-loader .leaf {
      top: 38px;
      width: 28px;
      height: 14px;
      background: linear-gradient(135deg, #8ab36f, var(--plant));
    }
    .seed-sprout-loader .leaf-left {
      margin-left: -28px;
      border-radius: 16px 16px 4px 16px;
      transform: rotate(-30deg) scale(.6);
    }
    .seed-sprout-loader .leaf-right {
      margin-left: 0;
      border-radius: 16px 16px 16px 4px;
      transform: rotate(30deg) scale(.6);
    }
    .seed-sprout-loader .check-mark {
      top: 8px;
      margin-left: -12px;
      color: #2a7142;
      font-size: 22px;
      font-weight: 900;
    }
    .seed-sprout-loader[data-phase="seed"] .seed-core {
      animation: seedPulse 1.1s ease-in-out infinite;
    }
    .seed-sprout-loader[data-phase="sprout"] .root-line,
    .seed-sprout-loader[data-phase="sprout"] .stem-line,
    .seed-sprout-loader[data-phase="sprout"] .leaf-left {
      opacity: 1;
    }
    .seed-sprout-loader[data-phase="corn"] .root-line,
    .seed-sprout-loader[data-phase="corn"] .stem-line,
    .seed-sprout-loader[data-phase="corn"] .leaf-left,
    .seed-sprout-loader[data-phase="corn"] .leaf-right,
    .seed-sprout-loader[data-phase="corn"] .check-mark {
      opacity: 1;
    }
    .seed-sprout-loader[data-phase="corn"] .stem-line { animation: stemRise 1.1s ease-in-out infinite; }
    @keyframes seedPulse {
      0%, 100% { transform: scale(1); }
      50% { transform: scale(1.08); }
    }
    @keyframes stemRise {
      0%, 100% { transform: scaleY(1); }
      50% { transform: scaleY(1.08); }
    }
    .quick-review-topline {
      display: flex;
      justify-content: space-between;
      gap: 10px;
      align-items: start;
      flex-wrap: wrap;
    }
    .quick-review-meta {
      display: flex;
      gap: 8px;
      align-items: center;
      flex-wrap: wrap;
      font-size: 11px;
    }
    .intelligence-review-more > summary {
      cursor: pointer;
      font-weight: 800;
      color: var(--ink);
    }
    .summary-meta {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
      margin-top: 10px;
      font-size: 11px;
      color: var(--muted);
    }
    .summary-meta span {
      padding: 3px 7px;
      border: 1px solid var(--line);
      border-radius: 999px;
      background: #f4f6f4;
    }
    .trial-mapping-review {
      display: grid;
      gap: 10px;
      padding: 12px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #fbfcfb;
    }
    .trial-mapping-list {
      display: grid;
      gap: 8px;
    }
    .trial-mapping-option {
      display: grid;
      grid-template-columns: auto minmax(0, 1fr);
      gap: 10px;
      align-items: start;
      padding: 10px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #fff;
      cursor: pointer;
    }
    .trial-mapping-option input {
      margin-top: 2px;
    }
    .trial-mapping-option span {
      display: grid;
      gap: 4px;
      min-width: 0;
    }
    .trial-mapping-option small {
      color: var(--muted);
    }

    .cold-toolbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      flex-wrap: wrap;
      margin-bottom: 8px;
    }

    .cold-tools,
    .cold-filters {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }

    .cold-stats {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
      gap: 8px;
      margin: 8px 0 12px;
    }

    .cold-stat {
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--soft);
      padding: 9px 10px;
    }

    .cold-stat strong {
      display: block;
      font-size: 20px;
      line-height: 1.1;
    }

    .cold-status-filters {
      display: flex;
      gap: 6px;
      align-items: center;
      flex-wrap: wrap;
      margin: 4px 0 8px;
    }

    .cold-filter-chip {
      min-height: 30px;
      padding: 5px 9px;
      border: 1px solid var(--line);
      border-radius: 999px;
      background: #fff;
      color: var(--ink);
      cursor: pointer;
      font-size: 12px;
      font-weight: 900;
    }

    .cold-filter-chip strong {
      margin-left: 4px;
      color: var(--muted);
    }

    .cold-filter-chip.active {
      background: var(--ink);
      color: #fff;
      border-color: var(--ink);
    }

    .cold-filter-chip.active strong {
      color: rgba(255,255,255,.8);
    }

    .cold-goal {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      width: auto;
      margin: 0;
      font-size: 12px;
      font-weight: 900;
      color: var(--muted);
    }

    .cold-goal input {
      width: 74px;
      min-height: 34px;
    }

    .cold-column-menu {
      position: relative;
    }

    .cold-column-menu summary {
      min-height: 34px;
      padding: 7px 10px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: white;
      color: var(--ink);
      font-size: 12px;
      font-weight: 900;
      cursor: pointer;
      list-style: none;
    }

    .cold-column-popover {
      position: absolute;
      z-index: 50;
      top: calc(100% + 8px);
      left: 0;
      width: min(360px, 88vw);
      padding: 12px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: white;
      box-shadow: 0 18px 44px rgba(24,35,31,.18);
    }

    .cold-column-list {
      display: grid;
      gap: 6px;
      max-height: 320px;
      overflow: auto;
      padding-right: 4px;
    }

    .cold-column-row {
      display: grid;
      grid-template-columns: 1fr auto auto;
      gap: 6px;
      align-items: center;
      padding: 6px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--soft);
    }

    .cold-column-row label {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      min-width: 0;
      margin: 0;
      font-size: 13px;
      font-weight: 800;
    }

    .cold-column-row input {
      width: 14px;
      height: 14px;
      min-height: 14px;
    }

    .cold-column-row button {
      min-width: 30px;
      min-height: 28px;
      padding: 4px 7px;
    }

    .cold-table input,
    .cold-table select,
    .cold-table textarea {
      min-width: 150px;
    }

    .cold-table thead th {
      position: sticky;
      top: 0;
      z-index: 6;
      background: var(--soft);
    }

    /* the 28px first-column clamp died with the checkbox column (F3) — with
       the name cell leading the row (2026-07-31) it would crush the name */

    .cold-table textarea {
      min-height: 38px;
      resize: vertical;
    }

    .cold-table .cold-notes {
      min-width: 240px;
    }

    .cold-row-moved {
      background: rgba(19, 121, 82, 0.06);
    }

    .cold-table tr.cold-status-interested td {
      background: rgba(19, 121, 82, 0.24);
    }

    .cold-table tr.cold-status-needs-info td {
      background: rgba(224, 169, 74, 0.34);
    }

    .cold-table tr.cold-status-not-interested td {
      background: rgba(177, 75, 75, 0.26);
    }

    .cold-table tr.cold-status-no-answer td {
      background: rgba(15, 23, 42, 0.28);
    }

    .cold-table tr.cold-status-left-voicemail td {
      background: rgba(72, 82, 94, 0.22);
    }

    .cold-table tr.cold-status-trial td {
      background: rgba(67, 122, 165, 0.24);
    }

    .cold-table tr.cold-status-neutral td {
      background: rgba(89, 103, 97, 0.12);
    }

    .cold-table tr[class*="cold-status-"] td:first-child {
      box-shadow: inset 5px 0 0 rgba(89, 103, 97, .7);
    }

    .cold-table tr.cold-status-interested td:first-child {
      box-shadow: inset 5px 0 0 var(--green);
    }

    .cold-table tr.cold-status-needs-info td:first-child {
      box-shadow: inset 5px 0 0 var(--gold);
    }

    .cold-table tr.cold-status-not-interested td:first-child {
      box-shadow: inset 5px 0 0 var(--red);
    }

    .cold-table tr.cold-status-no-answer td:first-child {
      box-shadow: inset 5px 0 0 #111827;
    }

    .cold-table tr.cold-status-left-voicemail td:first-child {
      box-shadow: inset 5px 0 0 #475569;
    }

    .cold-table tr.cold-status-trial td:first-child {
      box-shadow: inset 5px 0 0 #2563eb;
    }

    .cold-table tr[class*="cold-status-"] input,
    .cold-table tr[class*="cold-status-"] select,
    .cold-table tr[class*="cold-status-"] textarea {
      background: rgba(255,255,255,.86);
    }

    .cold-call-meta {
      display: block;
      margin-top: 4px;
      font-size: 11px;
      color: var(--muted);
      font-weight: 800;
      white-space: nowrap;
    }

    .quick-call-menu {
      position: relative;
    }

    .quick-call-menu summary {
      list-style: none;
      display: inline-grid;
      place-items: center;
      width: 34px;
      height: 34px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: white;
      color: var(--ink);
      cursor: pointer;
      font-weight: 900;
    }

    .quick-call-menu summary::-webkit-details-marker {
      display: none;
    }

    .quick-call-popover {
      position: absolute;
      z-index: 60;
      right: 0;
      top: calc(100% + 6px);
      display: grid;
      gap: 6px;
      width: 190px;
      padding: 8px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: white;
      box-shadow: 0 18px 44px rgba(24,35,31,.18);
    }

    .message {
      min-height: 24px;
      color: var(--muted);
      font-weight: 700;
    }

    .error { color: var(--red); }
    .ok { color: var(--green); }

    /* Agriculture Intelligence OS */
    body { background: #f3f5f2; }

    .app { grid-template-columns: 232px minmax(0, 1fr); }

    aside {
      padding: 18px 14px;
      background: #16221c;
      border-right: 0;
      color: #f5f8f5;
    }

    .brand { grid-template-columns: 40px 1fr; gap: 10px; margin-bottom: 24px; }
    .brand .mark { width: 40px; height: 40px; background: #4c9a68; }
    .brand h1 { color: #fff; font-size: 15px; }
    .brand p { color: #9eb0a5; }

    nav { gap: 4px; }

    .nav-btn {
      position: relative;
      min-height: 42px;
      padding: 10px 12px 10px 36px;
      color: #aebdb4;
      font-size: 13px;
    }

    .nav-btn::before {
      content: attr(data-nav-mark);
      position: absolute;
      left: 12px;
      top: 50%;
      width: 16px;
      transform: translateY(-50%);
      color: #7f9588;
      font-size: 11px;
      text-align: center;
    }

    .nav-btn.active, .nav-btn:hover { color: #fff; background: #26372e; }
    .nav-btn.active::before { color: #7fc296; }

    main { padding: 18px 22px 28px; }

    .topbar {
      min-height: 40px;
      margin: 0 0 14px;
      padding-bottom: 10px;
      border-bottom: 1px solid #d9e0da;
    }

    .panel, .kpi { box-shadow: 0 1px 2px rgba(24, 35, 31, .04); }

    .workspace-head {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 12px;
      margin-bottom: 10px;
    }

    .workspace-head-copy { display: flex; align-items: center; min-width: 0; }
    .workspace-head h2 { margin: 0; font-size: 24px; line-height: 1.15; letter-spacing: 0; }
    .workspace-head p { margin: 5px 0 0; color: var(--muted); }
    .workspace-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

    .command-layout {
      display: grid;
      grid-template-columns: minmax(0, 1.45fr) minmax(300px, .72fr);
      gap: 14px;
      align-items: start;
    }

    .command-column { display: grid; gap: 14px; }

    .command-map-panel {
      padding: 0;
      overflow: hidden;
    }

    .command-map-panel .map-wrap {
      border: 0;
      border-top: 1px solid var(--line);
      border-radius: 0;
      height: 430px;
      min-height: 430px;
    }

    .command-map-panel.expanded .map-wrap {
      height: min(68vh, 640px);
      min-height: 520px;
    }

    .focus-panel {
      padding: 0;
      overflow: hidden;
    }

    .focus-header {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      align-items: center;
      padding: 14px 16px;
      border-bottom: 1px solid var(--line);
      background: #fafbf9;
    }

    .focus-header h3 { margin: 0; font-size: 14px; }
    .focus-header span { color: var(--muted); font-size: 12px; font-weight: 800; }
    .command-summary-row {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
      gap: 12px;
      align-items: start;
    }
    .command-work-board {
      display: grid;
      grid-template-columns: minmax(0, 1.7fr) minmax(280px, .72fr);
      gap: 12px;
      align-items: start;
    }
    .command-head-actions { justify-content: flex-end; }
    .action-list { display: grid; }

    .action-row {
      width: 100%;
      min-height: 76px;
      display: grid;
      grid-template-columns: 10px minmax(0, 1fr) auto;
      align-items: center;
      gap: 12px;
      padding: 12px 16px;
      border: 0;
      border-bottom: 1px solid var(--line);
      background: #fff;
      color: var(--ink);
      text-align: left;
      cursor: pointer;
    }

    .action-row:last-child { border-bottom: 0; }
    .action-row:hover { background: #f7faf7; }
    .action-signal { width: 8px; height: 34px; border-radius: 3px; background: #8aa397; }
    .action-row.urgent .action-signal { background: #c85848; }
    .action-row.warning .action-signal { background: #d39b32; }
    .action-row.opportunity .action-signal { background: #39836e; }
    .action-copy strong { display: block; margin-bottom: 3px; font-size: 14px; }
    .action-copy span { color: var(--muted); font-size: 12px; }
    .action-meta { color: var(--muted); font-size: 11px; font-weight: 800; text-align: right; }

    .brief-card {
      padding: 16px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #fff;
    }

    .brief-card + .brief-card { margin-top: 10px; }
    .brief-card h3 { margin: 7px 0 5px; font-size: 15px; }
    .brief-card p { margin: 0; color: var(--muted); font-size: 13px; }

    .signal-label {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      color: #3a7252;
      font-size: 10px;
      font-weight: 900;
      text-transform: uppercase;
      letter-spacing: .08em;
    }

    .signal-label::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #54a572; }

    .day-score {
      display: grid;
      grid-template-columns: auto 1fr;
      gap: 12px;
      align-items: center;
    }

    .day-score strong {
      width: 58px;
      height: 58px;
      display: grid;
      place-items: center;
      border: 6px solid #dbe9df;
      border-top-color: var(--green);
      border-radius: 50%;
      font-size: 16px;
    }

    .compact-metrics { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
    .compact-metrics-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .compact-metric { padding: 10px 12px; border-right: 1px solid var(--line); }
    .compact-metric:last-child { border-right: 0; }
    .compact-metric strong { display: block; font-size: 20px; }
    .compact-metric span { color: var(--muted); font-size: 11px; }
    .accounts-metrics-strip { border-top: 0; }

    .account-dossier { max-width: 1380px; margin: 0 auto; }

    .dossier-hero {
      position: sticky;
      top: 0;
      z-index: 25;
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 16px;
      padding: 14px 16px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: rgba(255,255,255,.96);
      box-shadow: 0 8px 24px rgba(24,35,31,.08);
      backdrop-filter: blur(12px);
    }

    .dossier-hero h2 { margin: 3px 0; font-size: 22px; }
    .dossier-meta { color: var(--muted); font-size: 12px; }
    .dossier-actions { display: flex; align-items: center; gap: 7px; }

    .dossier-score-row {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 8px;
      margin: 12px 0;
    }

    .dossier-score {
      min-height: 76px;
      padding: 11px 12px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #fff;
    }

    .dossier-score span { display: block; color: var(--muted); font-size: 10px; font-weight: 900; text-transform: uppercase; }
    .dossier-score strong { display: block; margin-top: 6px; font-size: 20px; }

    .dossier-nav {
      position: sticky;
      top: 86px;
      z-index: 20;
      display: flex;
      gap: 5px;
      overflow-x: auto;
      margin-bottom: 12px;
      padding: 6px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: rgba(243,245,242,.96);
      backdrop-filter: blur(10px);
    }

    .dossier-nav button {
      flex: 0 0 auto;
      min-height: 30px;
      padding: 5px 9px;
      border: 0;
      border-radius: 6px;
      background: transparent;
      color: var(--muted);
      cursor: pointer;
      font-size: 11px;
      font-weight: 900;
    }

    .dossier-nav button:hover { background: #fff; color: var(--ink); }
    .dossier-section { scroll-margin-top: 132px; margin-bottom: 12px; }
    .dossier-section > summary {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 12px;
      min-height: 50px;
      padding: 12px 15px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #fff;
      cursor: pointer;
      font-weight: 900;
      list-style: none;
    }
    .dossier-section > summary::-webkit-details-marker { display: none; }
    .dossier-section[open] > summary { border-radius: 8px 8px 0 0; border-bottom-color: transparent; }
    .dossier-body { padding: 0; border-radius: 0 0 8px 8px; }
    .dossier-body > .panel, .dossier-body > .grid > .panel { border-radius: 0; box-shadow: none; }
    .profile-shell { display: grid; gap: 12px; }
    .profile-hero-copy { display: grid; gap: 8px; }
    .profile-identity-row {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 8px;
    }
    .profile-stage-pill {
      background: #eef4ec;
      border-color: #c5d6c4;
    }
    .profile-tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
    .profile-launch-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
      gap: 8px;
    }
    .profile-launch-card {
      display: grid;
      gap: 8px;
      min-height: 108px;
      padding: 12px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #fff;
      color: var(--ink);
      text-align: left;
      cursor: pointer;
      transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
    }
    .profile-launch-card:hover {
      border-color: #bdd3c3;
      box-shadow: 0 8px 22px rgba(28, 48, 30, .08);
      transform: translateY(-1px);
    }
    .profile-launch-card-head {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 8px;
    }
    .profile-launch-card span {
      color: var(--muted);
      font-size: 11px;
      font-weight: 900;
      text-transform: uppercase;
    }
    .profile-launch-card b {
      color: var(--muted);
      font-size: 11px;
      font-weight: 800;
      text-transform: uppercase;
    }
    .profile-launch-card strong {
      font-size: 18px;
      line-height: 1.1;
      overflow-wrap: anywhere;
    }
    .profile-launch-card small {
      color: var(--muted);
      font-size: 12px;
      line-height: 1.35;
      overflow-wrap: anywhere;
    }
    .profile-launch-card-simple {
      min-height: 58px;
      place-items: center;
      text-align: center;
      padding: 10px;
    }
    .profile-launch-card-simple strong {
      font-size: 14px;
      line-height: 1.1;
    }
    .profile-inline-expand {
      margin-top: 4px;
    }
    .profile-inline-expand summary {
      cursor: pointer;
      color: var(--muted);
      font-size: 11px;
      font-weight: 800;
      list-style: none;
    }
    .profile-inline-expand summary::-webkit-details-marker { display: none; }
    .profile-inline-expand p {
      margin: 8px 0 0;
      color: var(--muted);
      font-size: 12px;
      line-height: 1.5;
    }
    .profile-glance-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
      gap: 8px;
    }
    .profile-glance-card {
      display: grid;
      gap: 8px;
      min-height: 110px;
      padding: 12px 13px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #fff;
    }
    .profile-glance-card strong { font-size: 16px; line-height: 1.25; }
    .profile-header-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .profile-focus-panel { margin-bottom: 0; }
    .profile-main-panel { display: grid; gap: 12px; }
    .profile-summary-layout { align-items: start; }
    .profile-summary-primary { display: grid; gap: 12px; }
    .summary-status-row { display: flex; flex-wrap: wrap; gap: 6px; }
    .profile-summary-callout {
      display: grid;
      gap: 8px;
      padding: 14px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #f7f8f6;
    }
    .profile-summary-callout p {
      margin: 0;
      font-size: 14px;
      line-height: 1.6;
    }
    .summary-lines {
      display: grid;
      gap: 8px;
      padding: 12px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #f7f8f6;
    }
    .summary-line {
      position: relative;
      padding-left: 14px;
      line-height: 1.45;
    }
    .summary-line::before {
      content: '';
      position: absolute;
      left: 0;
      top: .58em;
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: #5a986c;
    }
    .summary-sources summary,
    .profile-more-list summary {
      cursor: pointer;
      color: var(--muted);
      font-size: 12px;
      font-weight: 800;
    }
    .profile-summary-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
      gap: 8px;
    }
    .profile-summary-item {
      display: grid;
      gap: 6px;
      padding: 12px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #f7f8f6;
    }
    .profile-summary-item span {
      color: var(--muted);
      font-size: 11px;
      font-weight: 900;
      text-transform: uppercase;
    }
    .profile-summary-item strong {
      font-size: 14px;
      line-height: 1.4;
      font-weight: 700;
    }
    .profile-summary-editor { margin-top: 0; }
    .profile-card-stack {
      display: grid;
      gap: 12px;
      align-content: start;
    }
    .profile-mini-list {
      display: grid;
      gap: 10px;
    }
    .profile-mini-list div {
      display: grid;
      gap: 3px;
      padding: 10px 12px;
      border-radius: 8px;
      background: #f6f7f4;
    }
    .profile-short-list {
      margin: 0;
      padding-left: 18px;
      display: grid;
      gap: 6px;
    }
    .profile-panel-backdrop {
      position: fixed;
      inset: 0;
      display: grid;
      place-items: center;
      padding: 18px;
      background: rgba(28, 36, 31, .28);
      backdrop-filter: blur(6px);
      z-index: 180;
    }
    .profile-panel-shell {
      width: min(1120px, 100%);
      max-height: calc(100vh - 36px);
      display: grid;
    }
    .profile-panel-frame {
      display: grid;
      grid-template-rows: auto minmax(0, 1fr);
      overflow: hidden;
      border: 1px solid var(--line);
      border-radius: 10px;
      background: #f5f7f4;
      box-shadow: 0 24px 60px rgba(21, 30, 23, .18);
    }
    .profile-panel-head {
      display: flex;
      justify-content: space-between;
      align-items: start;
      gap: 12px;
      padding: 14px 16px;
      border-bottom: 1px solid var(--line);
      background: #fff;
    }
    .profile-panel-head h3 {
      margin: 4px 0 0;
      font-size: 16px;
    }
    .profile-panel-body {
      overflow: auto;
      padding: 14px;
    }
    .profile-more-panel { display: grid; gap: 12px; }
    .inset-panel {
      margin-bottom: 12px;
      border-style: dashed;
      background: #fbfcfa;
    }

    .trial-summary-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
    .trial-ops-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
    .trial-ops-card { display: grid; gap: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
    .trial-ops-card h3 { margin: 0; font-size: 16px; }
    .trial-ops-top { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
    .trial-card-score { display: grid; justify-items: end; gap: 6px; }
    .trial-card-nav-row { display: flex; justify-content: flex-end; }
    .trial-card-nav { display: grid; grid-template-columns: 28px 34px 28px; align-items: center; text-align: center; font-size: 11px; color: var(--muted); }
    .trial-card-nav button { width: 28px; height: 28px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; }
    .trial-card-nav button:first-child { border-radius: 6px 0 0 6px; }
    .trial-card-nav button:last-child { border-radius: 0 6px 6px 0; }
    .trial-progress { height: 7px; overflow: hidden; border-radius: 4px; background: #e6ebe7; }
    .trial-progress span { display: block; height: 100%; background: #4a9165; }
    .trial-signals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
    .trial-signal { padding: 8px; border-radius: 6px; background: #f4f6f3; }
    .trial-signal span { display: block; color: var(--muted); font-size: 9px; text-transform: uppercase; font-weight: 900; }
    .trial-signal strong { display: block; margin-top: 3px; font-size: 13px; }
    .trial-risk { color: #a74c40; }
    .trial-card-note { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; }
    .trial-card-note strong { color: var(--ink); }
    .trial-card-note .trial-risk { color: #a74c40; }
    .trial-next-action { margin: 0; color: var(--muted); line-height: 1.45; }
    .experiment-db-panel { display: grid; gap: 12px; }
    .experiment-view-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; border: 0; background: transparent; }
    .experiment-view-card { min-width: 0; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); text-align: left; cursor: pointer; }
    .experiment-view-card:hover,
    .experiment-view-card.active { border-color: #aeb7c7; background: #f4f6fb; box-shadow: 0 1px 8px rgba(20,24,32,.06); }
    .experiment-view-card strong { display: block; font-size: 22px; line-height: 1; }
    .experiment-view-card span { display: block; margin-top: 5px; color: var(--ink); font-size: 12px; font-weight: 900; }
    .experiment-view-card small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
    .experiment-db-toolbar { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(130px, 160px) minmax(160px, 210px) minmax(130px, 170px) auto; gap: 8px; align-items: start; }
    .experiment-filter-drawer { position: relative; justify-self: end; }
    .experiment-filter-drawer summary { min-height: 34px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink); font-size: 12px; font-weight: 900; cursor: pointer; list-style: none; }
    .experiment-filter-drawer summary::-webkit-details-marker { display: none; }
    .experiment-filter-grid { position: absolute; right: 0; top: calc(100% + 6px); z-index: 8; width: min(720px, calc(100vw - 48px)); display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 18px 45px rgba(20,24,32,.14); }
    .experiment-filter-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; padding-top: 2px; }
    .experiment-db-toolbar label { margin: 0; color: var(--muted); font-size: 11px; font-weight: 900; }
    .experiment-db-toolbar input,
    .experiment-db-toolbar select { width: 100%; min-height: 34px; margin: 0; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); font-size: 12px; }
    .experiment-filter-grid input,
    .experiment-filter-grid select { margin-top: 4px; }
    .experiment-db-head { margin-top: 2px; }
    .experiment-db-wrap { max-height: calc(100vh - 390px); min-height: 280px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
    .experiment-db-table { width: 100%; border-collapse: collapse; font-size: 12px; }
    .experiment-db-table th { position: sticky; top: 0; z-index: 2; padding: 9px 10px; border-bottom: 1px solid var(--line); background: #f7f8f6; color: var(--muted); font-size: 10px; text-align: left; text-transform: uppercase; letter-spacing: .04em; }
    .experiment-db-table td { max-width: 230px; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; color: var(--ink); }
    .experiment-db-row { cursor: pointer; }
    .experiment-db-row:hover { background: #f7faf8; }
    .experiment-db-row td:first-child strong,
    .experiment-db-row td:first-child span { display: block; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .experiment-db-row td:first-child span { margin-top: 2px; color: var(--muted); font-size: 11px; }
    .experiment-group-row td { padding: 7px 10px; background: #eef2ee; color: var(--muted); font-size: 10px; font-weight: 900; text-transform: uppercase; }
    .experiment-row-menu { display: inline-block; }
    .experiment-row-menu summary { width: 28px; height: 28px; }
    .experiment-pagination { display: flex; justify-content: flex-end; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
    .experiment-empty { min-height: 260px; }
    .trial-status-pill { display: inline-flex; align-items: center; min-height: 20px; padding: 2px 7px; border-radius: 999px; border: 1px solid var(--line); background: #f4f6f3; color: var(--ink); font-size: 10px; font-weight: 900; white-space: nowrap; }
    .trial-status-pill.status-running { background: #eaf1ff; border-color: #cad8f4; color: #274b86; }
    .trial-status-pill.status-awaiting { background: #fff4df; border-color: #ead2a4; color: #805916; }
    .trial-status-pill.status-results { background: #e9f4ed; border-color: #c7ddce; color: #276040; }
    .trial-status-pill.status-complete { background: #eef0f4; border-color: #d7dbe3; color: #465162; }
    .trial-status-pill.status-muted { background: #f3f1ef; border-color: #ddd7d2; color: #726a63; }
    .trial-status-pill.status-scheduled { background: #edf2ff; border-color: #d7def8; color: #404f91; }
    .trial-detail-modal { width: min(1120px, calc(100vw - 28px)); }
    .trial-detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 6px; }
    .trial-detail-meta > span:not(.trial-status-pill) { display: inline-flex; align-items: center; min-height: 20px; padding: 2px 7px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted); font-size: 10px; font-weight: 800; }
    .trial-detail-brief-bar { display: grid; grid-template-columns: 110px 110px 170px minmax(0, 1fr); gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: #fff; }
    .trial-detail-brief-bar div { min-width: 0; padding: 8px 9px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfa; }
    .trial-detail-brief-bar span { display: block; color: var(--muted); font-size: 10px; font-weight: 900; text-transform: uppercase; }
    .trial-detail-brief-bar strong { display: block; margin-top: 3px; color: var(--ink); font-size: 12px; white-space: normal; }
    .trial-detail-status-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 12px; }
    .trial-detail-tabs { position: sticky; top: 75px; z-index: 4; display: flex; gap: 4px; padding: 8px 16px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.97); overflow-x: auto; }
    .trial-detail-tabs button { min-height: 30px; padding: 5px 10px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 900; cursor: pointer; }
    .trial-detail-tabs button.active,
    .trial-detail-tabs button:hover { border-color: var(--line); background: #f4f6f3; color: var(--ink); }
    .trial-detail-body { padding: 16px; background: #f7f9f6; }
    .trial-detail-panel { display: grid; gap: 12px; }
    .trial-overview-dossier { gap: 12px; }
    .trial-dossier-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
    .trial-dossier-section { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
    .trial-dossier-section span { display: block; color: var(--muted); font-size: 10px; font-weight: 900; text-transform: uppercase; }
    .trial-dossier-section p { margin: 6px 0 0; color: var(--ink); line-height: 1.45; }
    .trial-secondary-details { border: 1px solid var(--line); border-radius: 8px; background: #fff; }
    .trial-secondary-details summary { padding: 10px 12px; color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 900; }
    .trial-secondary-details .trial-read-grid { padding: 0 12px 12px; }
    .trial-detail-composer { padding: 0 16px 12px; background: #f7f9f6; }
    .trial-detail-composer .trial-inline-composer { margin-top: 0; }
    .trial-danger-zone { margin: 0 16px 16px; color: var(--muted); font-size: 12px; }
    .trial-danger-zone summary { cursor: pointer; font-weight: 900; }
    .trial-danger-zone .row-actions { justify-content: flex-start; margin-top: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
    .trial-linked-actions,
    .trial-report-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
    .trial-report-actions h3 { margin: 2px 0; }
    .trial-timeline-list,
    .trial-note-list { display: grid; gap: 8px; }
    .trial-timeline-item,
    .trial-note-list p { margin: 0; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
    .trial-timeline-item span { display: block; color: var(--muted); font-size: 10px; font-weight: 900; text-transform: uppercase; }
    .trial-timeline-item strong { display: block; margin-top: 2px; }
    .trial-timeline-item p { margin: 4px 0 0; color: var(--muted); }
    .experiments-secondary > summary,
    .experiments-checks > summary,
    .cross-trial-compact > summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; font-weight: 900; }
    .experiments-secondary-body { display: grid; gap: 12px; margin-top: 12px; }

    .cold-table th, .cold-table td { padding-top: 5px; padding-bottom: 5px; }
    .cold-table input, .cold-table select { min-height: 30px; padding: 4px 7px; }
    .cold-notes { min-height: 34px; max-height: 58px; }

    .command-task-form { display: grid; gap: 8px; }
    .command-task-form label { margin: 0; }
    .command-task-form input, .command-task-form select { min-height: 36px; padding: 7px 9px; }
    .task-bucket { display: grid; gap: 5px; align-content: start; }
    .command-task-strip {
      display: grid;
      gap: 8px;
      align-content: start;
    }
    .command-task-strip.embedded {
      margin-top: 12px;
      padding-top: 12px;
      border-top: 1px solid var(--line);
    }
    .command-summary-row > .command-task-strip.embedded {
      margin-top: 0;
      padding: 12px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #fff;
    }
    .command-task-strip.embedded .focus-header {
      padding: 0;
      border-bottom: 0;
      background: transparent;
    }
    .command-task-strip.embedded .command-task-list { max-height: 380px; }
    .command-task-strip .focus-header {
      margin-bottom: 0;
    }
    .command-task-tabs {
      display: flex;
      gap: 4px;
      padding: 3px;
      border: 1px solid var(--line);
      border-radius: 7px;
      background: #f5f7f5;
    }
    .command-task-tabs button {
      flex: 1;
      min-height: 28px;
      padding: 4px 6px;
      border: 0;
      border-radius: 5px;
      background: transparent;
      color: var(--muted);
      font-size: 11px;
      font-weight: 900;
      cursor: pointer;
    }
    .command-task-tabs button.active {
      background: #fff;
      color: var(--ink);
      box-shadow: 0 1px 4px rgba(0,0,0,.08);
    }
    .command-task-tabs button span {
      margin-left: 3px;
      color: inherit;
      opacity: .75;
    }
    .command-task-list {
      display: grid;
      gap: 5px;
      max-height: 270px;
      overflow: auto;
      padding-right: 2px;
    }
    .command-agenda-synthesis {
      display: grid;
      grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
      gap: 10px;
      min-height: 0;
    }
    .mini-section-title {
      margin: 0 0 6px;
      color: var(--muted);
      font-size: 10px;
      font-weight: 900;
      text-transform: uppercase;
      letter-spacing: .04em;
    }
    .command-agenda-list {
      display: grid;
      gap: 5px;
      max-height: 380px;
      overflow: auto;
      padding-right: 2px;
    }
    .command-work-board .command-task-strip.embedded .command-agenda-synthesis {
      min-height: 360px;
    }
    .command-task-row {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 5px;
      align-items: stretch;
    }
    .command-task-main {
      min-height: 34px;
      padding: 6px 8px;
      border: 1px solid var(--line);
      border-radius: 6px;
      background: #fff;
      color: var(--ink);
      text-align: left;
      cursor: pointer;
    }
    .command-task-main strong,
    .command-task-main span {
      display: block;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .command-agenda-row {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 5px;
      align-items: stretch;
      border-left: 3px solid #2878bd;
    }
    .command-agenda-row.event-meeting { border-left-color: #7c3fb0; }
    .command-agenda-row.event-experiment { border-left-color: #d38a14; }
    .command-agenda-row.event-attention { border-left-color: #bc3d3d; }
    .command-agenda-row.event-google-calendar { border-left-color: #3f8a59; }
    .command-agenda-main {
      min-height: 34px;
      padding: 6px 8px;
      border: 1px solid var(--line);
      border-left: 0;
      border-radius: 0 6px 6px 0;
      background: #fff;
      color: var(--ink);
      text-align: left;
      text-decoration: none;
      cursor: pointer;
    }
    .command-agenda-main span,
    .command-agenda-main strong,
    .command-agenda-main small {
      display: block;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .command-agenda-main span,
    .command-agenda-main small {
      color: var(--muted);
      font-size: 10px;
      font-weight: 800;
    }
    .task-completion-modal textarea {
      min-height: 92px;
      resize: vertical;
    }
    .command-task-main strong { font-size: 12px; line-height: 1.2; }
    .command-task-main span { margin-top: 2px; color: var(--muted); font-size: 10px; }
    .command-task-complete {
      min-height: 34px;
      padding: 0 8px;
      border-radius: 6px;
      font-size: 11px;
    }
    .trial-date-row {
      display: block;
      width: 100%;
      padding: 8px 0;
      border: 0;
      border-top: 1px solid var(--line);
      background: transparent;
      color: var(--ink);
      text-align: left;
      cursor: pointer;
    }
    .trial-date-row strong,
    .trial-date-row span {
      display: block;
      overflow-wrap: anywhere;
    }
    .trial-date-row span { margin-top: 3px; color: var(--muted); font-size: 12px; }

    .calendar-agenda { display: grid; }
    .calendar-row { display: grid; grid-template-columns: minmax(0, 1fr) 34px; align-items: stretch; border-bottom: 1px solid var(--line); }
    .calendar-row:last-child { border-bottom: 0; }
    .calendar-row > button { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 3px 10px; padding: 10px 14px; border: 0; background: #fff; color: var(--ink); text-align: left; cursor: pointer; }
    .calendar-row > button:hover { background: #f7faf7; }
    .calendar-row > button span { grid-row: span 2; color: var(--muted); font-size: 11px; font-weight: 900; }
    .calendar-row > button strong { font-size: 13px; }
    .calendar-row > button small { color: var(--muted); }
    .calendar-row > a { display: grid; place-items: center; margin: 8px 6px 8px 0; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); text-decoration: none; font-weight: 900; }
    .calendar-row > .calendar-entry { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 3px 10px; padding: 10px 14px; border: 0; background: #fff; color: var(--ink); text-align: left; cursor: pointer; text-decoration: none; }
    .calendar-row > .calendar-entry:hover { background: #f7faf7; }
    .calendar-row > .calendar-entry span { grid-row: span 2; color: var(--muted); font-size: 11px; font-weight: 900; }
    .calendar-row > .calendar-entry strong { font-size: 13px; }
    .calendar-row > .calendar-entry small { color: var(--muted); }
    .calendar-row.event-task { border-left: 4px solid #2878bd; }
    .calendar-row.event-meeting { border-left: 4px solid #7c3fb0; }
    .calendar-row.event-experiment { border-left: 4px solid #d38a14; }
    .calendar-row.event-google-calendar { border-left: 4px solid #3f8a59; }
    .calendar-row.event-completed { opacity: .55; }
    .calendar-row-action { display:grid; place-items:center; padding:5px; }
    .calendar-row-action > a, .calendar-row-action > button { width:28px; height:28px; min-height:28px; display:grid; place-items:center; padding:0; border:1px solid var(--line); border-radius:6px; background:#fff; color:var(--ink); text-decoration:none; cursor:pointer; }
    .calendar-period-bar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
    .calendar-period-bar .segmented { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: #f5f7f5; }
    .calendar-period-bar .segmented button { min-height: 28px; padding: 4px 8px; border: 0; border-radius: 5px; background: transparent; font-weight: 800; cursor: pointer; }
    .calendar-period-bar .segmented button.active { background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
    .calendar-range-label { min-width: 190px; text-align: center; font-weight: 900; }
    .calendar-visual { --calendar-visual-height: 520px; height: var(--calendar-visual-height); margin-top: 10px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
    .calendar-visual:not(.calendar-day-view):not(.calendar-year-grid) { display: grid; grid-template-rows: auto minmax(0, 1fr); }
    .calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
    .calendar-weekdays span { padding: 7px 8px; border-right: 1px solid var(--line); background: #f1f4f1; color: var(--muted); font-size: 10px; font-weight: 900; text-transform: uppercase; }
    .calendar-weekdays span:last-child { border-right: 0; }
    .calendar-grid { grid-auto-rows: minmax(0, 1fr); min-height: 0; }
    .calendar-day { min-height: 0; padding: 7px; border-top: 1px solid var(--line); border-right: 1px solid var(--line); background: #fff; overflow: hidden; }
    .calendar-day:nth-child(7n) { border-right: 0; }
    .calendar-day.outside { background: #f7f8f6; color: #9ba49e; }
    .calendar-day.today { box-shadow: inset 0 0 0 2px #2878bd; }
    .calendar-day-number { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; font-size: 11px; font-weight: 900; }
    .calendar-day-events { display: grid; gap: 4px; }
    .calendar-event-chip { display: block; width: 100%; min-height: 0; padding: 4px 5px; overflow: hidden; border: 0; border-left: 3px solid #2878bd; border-radius: 3px; background: #e7f0f8; color: #1f405b; font-size: 10px; font-weight: 800; text-align: left; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
    .calendar-event-chip.event-meeting { border-left-color: #7c3fb0; background: #f0e9f6; color: #51306a; }
    .calendar-event-chip.event-experiment { border-left-color: #d38a14; background: #fff2d9; color: #70500e; }
    .calendar-event-chip.event-attention { border-left-color: #bc3d3d; background: #fde8e6; color: #7f2929; }
    .calendar-day-view { display: grid; grid-template-columns: 62px minmax(0, 1fr); }
    .calendar-time-rail { display: grid; grid-template-rows: repeat(8, 1fr); border-right: 1px solid var(--line); background: #f7f8f6; }
    .calendar-time-rail span { padding: 8px 7px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 10px; text-align: right; }
    .calendar-day-surface { padding: 10px; background: repeating-linear-gradient(to bottom,#fff 0,#fff 39px,#edf0ed 40px); }
    .calendar-day-surface .calendar-event-chip { margin-bottom: 7px; padding: 8px; white-space: normal; }
    .calendar-year-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); overflow: auto; }
    .calendar-month-tile { min-height: 104px; padding: 9px; background: #fff; }
    .calendar-month-tile strong { display: block; margin-bottom: 7px; }
    .calendar-month-tile span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
    .executive-brief { border-left: 4px solid #315f43; }
    .executive-brief h2 { margin: 5px 0 8px; font-size: 20px; }
    .executive-brief p { max-width: 1000px; line-height: 1.55; }
    .brief-account-list { display: grid; gap: 8px; margin-top: 10px; }
    .brief-account-row { padding: 9px 0; border-top: 1px solid var(--line); }
    .brief-account-row strong, .brief-account-row span { display: block; }
    .brief-account-row span { margin-top: 3px; color: var(--muted); font-size: 12px; }
    .analytics-toggle summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0 0; cursor: pointer; font-weight: 900; }
    .analytics-toggle summary::-webkit-details-marker { display: none; }
    .analytics-toggle summary::after { content: 'v'; font-size: 13px; }
    .analytics-toggle[open] summary::after { content: '^'; }
    .analytics-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 14px; margin-top: 12px; }
    .analytics-grid.compact {
      grid-template-columns: 1fr;
      gap: 10px;
    }
    .bar-chart { display: grid; gap: 8px; }
    .bar-row { display: grid; grid-template-columns: 104px minmax(0, 1fr) 38px; gap: 8px; align-items: center; font-size: 11px; }
    .analytics-grid.compact .bar-row {
      grid-template-columns: 84px minmax(0, 1fr) 28px;
      gap: 6px;
    }
    .bar-track { height: 9px; overflow: hidden; border-radius: 5px; background: #e6ebe7; }
    .bar-track span { display: block; height: 100%; border-radius: inherit; background: #3f7a56; }
    .bar-row:nth-child(2) .bar-track span { background: #2878bd; }
    .bar-row:nth-child(3) .bar-track span { background: #d38a14; }
    .bar-row:nth-child(4) .bar-track span { background: #7c3fb0; }
    .activity-trend { display: flex; align-items: end; gap: 5px; height: 105px; padding: 8px 0 20px; }
    .analytics-grid.compact .activity-trend {
      height: 74px;
      padding-bottom: 16px;
    }
    .activity-trend div { flex: 1; min-width: 12px; position: relative; border-radius: 3px 3px 0 0; background: #4d8763; }
    .activity-trend div span { position: absolute; left: 50%; bottom: -18px; transform: translateX(-50%); color: var(--muted); font-size: 9px; white-space: nowrap; }
    .command-work-log-card {
      align-self: start;
      overflow: hidden;
    }
    .command-work-log-card .focus-header h3 {
      margin: 0;
      font-size: 14px;
    }
    .command-brief-line {
      margin: 0;
      padding: 12px 14px 0;
      color: var(--muted);
      font-size: 12px;
      line-height: 1.5;
    }
    .command-log-goal {
      display: grid;
      grid-template-columns: 118px minmax(0, 1fr);
      gap: 10px;
      align-items: center;
      padding: 12px 14px 4px;
    }
    .command-goal-ring {
      width: 98px;
      aspect-ratio: 1;
      display: grid;
      place-items: center;
      justify-self: center;
      position: relative;
      border-radius: 999px;
      background: conic-gradient(#4d8763 var(--goal-progress, 0%), #e4e9e5 0);
    }
    .command-goal-ring::after {
      content: "";
      position: absolute;
      inset: 10px;
      border-radius: inherit;
      background: #fff;
    }
    .command-goal-ring strong,
    .command-goal-ring span {
      position: relative;
      z-index: 1;
      display: block;
      text-align: center;
    }
    .command-goal-ring strong {
      font-size: 19px;
      line-height: 1;
    }
    .command-goal-ring span {
      width: 62px;
      margin-top: 3px;
      color: var(--muted);
      font-size: 9px;
      font-weight: 900;
      line-height: 1.1;
      text-transform: uppercase;
    }
    .command-log-stats {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 6px;
    }
    .command-log-stat {
      min-width: 0;
      padding: 8px;
      border: 1px solid var(--line);
      border-radius: 7px;
      background: #f7f9f7;
    }
    .command-log-stat strong,
    .command-log-stat span,
    .command-log-stat small {
      display: block;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .command-log-stat strong {
      font-size: 16px;
      line-height: 1.05;
    }
    .command-log-stat span {
      margin-top: 3px;
      color: var(--muted);
      font-size: 10px;
      font-weight: 800;
    }
    .command-log-stat small {
      margin-top: 2px;
      color: var(--muted);
      font-size: 9px;
    }
    .command-work-log-card .analytics-grid {
      padding: 6px 14px 0;
    }
    .command-work-log-card .bar-chart {
      gap: 6px;
    }
    .command-work-log-card .activity-trend {
      height: 58px;
      padding-top: 4px;
      padding-bottom: 14px;
    }
    .command-brief-details {
      padding: 0 14px 14px;
    }
    .accounts-view-switcher { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: #f2f4f2; }
    .accounts-view-switcher button { min-height: 30px; padding: 5px 10px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-weight: 900; cursor: pointer; }
    .accounts-view-switcher button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.1); }
    .accounts-map-panel { margin-bottom: 12px; }
    .account-analytics { display: grid; gap: 12px; }
    .account-analytics-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
    .account-analytics-metrics div { padding: 10px; border-left: 3px solid #3f7a56; background: #f3f6f3; }
    .account-analytics-metrics strong, .account-analytics-metrics span { display: block; }
    .account-analytics-metrics span { margin-top: 4px; color: var(--muted); font-size: 10px; }
    .inspiration-line { margin: 5px 0 0; max-width: 760px; color: var(--muted); }
    .command-quick-actions { display: flex; gap: 6px; align-items: center; }
    .calendar-tools { display: flex; align-items: center; gap: 6px; }
    .calendar-tools .button { min-width: 32px; width: auto; }
    .calendar-connected { display: inline-flex; align-items: center; gap: 6px; color: #28633d; font-size: 11px; font-weight: 800; }
    .calendar-connected::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #3c9b5f; }
    .calendar-setup { display: grid; gap: 12px; }
    .calendar-setup code { display: block; padding: 9px; border: 1px solid var(--line); border-radius: 6px; background: #f7f8f6; overflow-wrap: anywhere; }
    .oauth-uri-box { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 7px; background: #f7f8f6; }
    .oauth-uri-box span { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
    .oauth-uri-box code { display: block; padding: 8px; border: 1px solid #d9e0d5; border-radius: 6px; background: #fff; overflow-wrap: anywhere; color: #143324; }
    .oauth-uri-box p { margin: 0; }
    #globalMessage { display: none !important; }

    .intelligence-review { display: grid; gap: 12px; }
    .review-match { padding: 10px 12px; border-left: 3px solid var(--green); background: #f3f8f4; }
    .review-match h3 { margin: 5px 0 2px; }
    .intelligence-review-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: 340px; overflow: auto; }
    .intelligence-review-grid section { padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
    .intelligence-review-grid ul { margin: 7px 0 0; padding-left: 18px; color: var(--muted); font-size: 12px; }
    .review-feedback textarea { min-height: 82px; }
    .inline-label-action { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
    .inline-label-action .icon-button { width: 28px; height: 28px; min-height: 28px; }
    .observation-summary { padding: 11px; border-left: 3px solid var(--green); background: #f3f8f4; }
    .observation-summary p { margin: 6px 0 0; }
    .settings-modal { width: min(720px, calc(100vw - 28px)); }
    .settings-sections { display: grid; gap: 10px; }
    .settings-section { padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
    .settings-section h3 { margin: 0 0 10px; font-size: 14px; }
    .settings-status { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
    .settings-status div { padding: 9px; background: #f4f6f3; border-radius: 6px; }
    .settings-status strong, .settings-status span { display: block; }
    .settings-status span { margin-top: 3px; color: var(--muted); font-size: 11px; }
    .settings-status.compact-status { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 10px; }
    .gmail-intake-panel { border-color: #cbdccf; background: #fbfdf9; }
    .command-message-alert {
      position: relative;
      display: inline-grid;
      place-items: center;
    }
    .command-message-alert > summary { list-style: none; cursor: pointer; }
    .command-message-alert > summary::-webkit-details-marker { display: none; }
    .message-alert-button {
      position: relative;
      width: 34px;
      height: 34px;
      min-height: 34px;
      display: grid;
      place-items: center;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #fff;
      color: var(--ink);
      font-weight: 900;
      box-shadow: 0 1px 2px rgba(24, 35, 31, .04);
    }
    .message-alert-icon {
      width: 18px;
      height: 18px;
      display: grid;
      place-items: center;
      border-radius: 50%;
      background: #1d2439;
      color: #fff;
      position: relative;
    }
    .message-alert-icon::before {
      content: "";
      width: 9px;
      height: 8px;
      border: 1.7px solid currentColor;
      border-bottom: 0;
      border-radius: 7px 7px 3px 3px;
      transform: translateY(1px);
    }
    .message-alert-icon::after {
      content: "";
      position: absolute;
      left: 50%;
      bottom: 3px;
      width: 8px;
      height: 2px;
      border-radius: 999px;
      background: currentColor;
      transform: translateX(-50%);
    }
    .message-alert-count {
      position: absolute;
      top: -6px;
      right: -6px;
      min-width: 18px;
      height: 18px;
      display: grid;
      place-items: center;
      padding: 0 5px;
      border-radius: 999px;
      background: #be5a4a;
      color: #fff;
      font-size: 10px;
      font-weight: 900;
    }
    .bulk-inbox-button {
      cursor: pointer;
    }
    .bulk-inbox-icon {
      position: relative;
      width: 18px;
      height: 16px;
      border: 2px solid currentColor;
      border-top: 0;
      border-radius: 2px 2px 5px 5px;
    }
    .bulk-inbox-icon::before {
      content: "";
      position: absolute;
      left: 50%;
      top: -5px;
      width: 12px;
      height: 8px;
      border: 2px solid currentColor;
      border-bottom: 0;
      border-radius: 4px 4px 0 0;
      transform: translateX(-50%);
    }
    .bulk-inbox-icon::after {
      content: "";
      position: absolute;
      left: 50%;
      top: 4px;
      width: 7px;
      height: 7px;
      border-left: 2px solid currentColor;
      border-bottom: 2px solid currentColor;
      transform: translateX(-50%) rotate(-45deg);
    }
    #bulkInboxRoot .modal-backdrop {
      z-index: 125;
    }
    .bulk-inbox-modal {
      width: min(720px, calc(100vw - 28px));
      gap: 16px;
    }
    .bulk-inbox-form {
      display: grid;
      gap: 12px;
    }
    .bulk-inbox-dropzone {
      min-height: 180px;
    }
    .bulk-file-list {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }
    .bulk-file-list span,
    .bulk-result-row {
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #fff;
      color: var(--ink);
    }
    .bulk-file-list span {
      padding: 7px 9px;
      font-size: 12px;
      font-weight: 800;
    }
    .bulk-file-list small {
      color: var(--muted);
      font-weight: 700;
    }
    .bulk-inbox-results {
      display: grid;
      gap: 8px;
      padding-top: 2px;
    }
    .bulk-result-row {
      display: grid;
      gap: 3px;
      width: 100%;
      padding: 10px 12px;
      text-align: left;
      cursor: pointer;
    }
    .bulk-result-row:hover {
      border-color: var(--green);
      background: #f8fbf8;
    }
    .bulk-result-row span {
      color: var(--muted);
      font-size: 12px;
      font-weight: 700;
    }
    .command-message-drawer {
      position: absolute;
      z-index: 80;
      top: calc(100% + 8px);
      right: 0;
      width: min(520px, calc(100vw - 32px));
      padding: 0 14px 14px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #fbfdf9;
      box-shadow: 0 18px 44px rgba(24,35,31,.18);
    }
    .command-message-drawer .focus-header {
      margin: 0 -14px 10px;
      border-radius: 8px 8px 0 0;
    }
    .command-message-tools { justify-content: flex-end; margin-bottom: 8px; }
    .command-message-list { display: grid; gap: 8px; max-height: 320px; overflow: auto; padding-right: 2px; }
    .command-message-alert .gmail-card { box-shadow: none; }
    .command-review { margin-top: 10px; }
    .gmail-list { display: grid; gap: 8px; }
    .gmail-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
    .gmail-card.active { border-color: #79a77d; box-shadow: 0 0 0 2px rgba(80, 132, 84, .12); }
    .gmail-card-head { display: flex; align-items: start; justify-content: space-between; gap: 10px; }
    .gmail-card-head strong { display: block; }
    .gmail-card-head p, .gmail-card-main p { margin: 4px 0 0; }
    .intake-prefill-chip { margin: 8px 0 0; padding: 6px 9px; border-radius: 6px; background: #eaf3ff; color: #1f4b7a; border: 1px solid #bcd6f2; font-size: 12px; font-weight: 700; }
    .gmail-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
    .gmail-meta span { padding: 3px 6px; border-radius: 5px; background: #eef4ef; color: #3e5f49; font-size: 11px; font-weight: 800; }
    .gmail-actions { display: flex; flex-wrap: wrap; gap: 5px; align-content: start; justify-content: end; max-width: 270px; }
    .order-modal { width: min(1180px, calc(100vw - 28px)); max-height: calc(100vh - 28px); overflow: auto; }
    .order-workspace { display: grid; grid-template-columns: minmax(0, .9fr) minmax(420px, 1.1fr); gap: 14px; align-items: start; }
    .order-preview { min-height: 520px; display: grid; place-items: center; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: #e9edea; }
    .order-preview img { display: block; width: 100%; height: auto; background: #fff; }
    .order-preview-sheet { position:relative; width:100%; }
    .order-preview-sheet > .order-template-logo { position:absolute; top:4.3%; right:5.5%; width:12.5%; height:auto; background:#fff; }
    .order-preview-empty { max-width: 280px; color: var(--muted); text-align: center; }
    .order-account-field {
      position: relative;
    }
    .order-account-suggestions {
      display: grid;
      gap: 5px;
      margin-top: 6px;
      max-height: 190px;
      overflow: auto;
    }
    .order-account-suggestion {
      display: grid;
      gap: 2px;
      width: 100%;
      padding: 8px 10px;
      border: 1px solid var(--line);
      border-radius: 7px;
      background: #fff;
      color: var(--ink);
      text-align: left;
      cursor: pointer;
    }
    .order-account-suggestion:hover,
    .order-account-suggestion:focus {
      border-color: #8ab993;
      background: #f0f7f2;
      outline: 0;
    }
    .order-account-suggestion strong,
    .order-account-suggestion span {
      display: block;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .order-account-suggestion span {
      color: var(--muted);
      font-size: 12px;
      font-weight: 650;
    }
    .field-missing input, .field-missing textarea, .field-missing select { border-color: #c72c32 !important; background: #fff4f4 !important; }
    .missing-order-alert { padding: 9px 11px; border: 1px solid #e8b1b3; border-radius: 6px; background: #fff4f4; color: #8f2429; font-size: 12px; }
    .order-items { display: grid; gap: 6px; }
    .order-item { display: grid; grid-template-columns: 1.3fr 1.1fr .55fr .7fr 32px; gap: 6px; align-items: end; }
    .order-item label { margin: 0; }
    .order-sales { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 10px; }
    .order-sales div { padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
    .order-sales strong, .order-sales span { display: block; }
    .order-sales span { color: var(--muted); font-size: 10px; }
    .sales-workspace { display: grid; gap: 12px; }
    .sales-toolbar {
      display: flex;
      gap: 8px;
      align-items: end;
      flex-wrap: wrap;
    }
    .sales-toolbar .segmented {
      display: inline-flex;
      padding: 3px;
      border: 1px solid var(--line);
      border-radius: 7px;
      background: #f5f7f5;
    }
    .sales-toolbar .segmented button {
      min-height: 30px;
      padding: 5px 9px;
      border: 0;
      border-radius: 5px;
      background: transparent;
      color: var(--muted);
      font-weight: 900;
      cursor: pointer;
    }
    .sales-toolbar .segmented button.active {
      background: #fff;
      color: var(--ink);
      box-shadow: 0 1px 4px rgba(0,0,0,.08);
    }
    .sales-toolbar label { margin: 0; }
    .sales-search { flex: 1 1 260px; }
    .sales-summary-grid {
      display: grid;
      grid-template-columns: .85fr .85fr 1.3fr;
      gap: 8px;
    }
    .sales-summary-grid > div {
      min-width: 0;
      padding: 11px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: #fff;
    }
    .sales-summary-grid strong { display: block; margin-top: 4px; font-size: 20px; }
    .sales-summary-grid p { margin: 5px 0 0; }
    .sales-table-wrap { max-height: calc(100vh - 360px); overflow: auto; }
    .sales-table th,
    .sales-table td {
      white-space: nowrap;
      vertical-align: middle;
    }
    .sales-row-actions {
      display: flex;
      gap: 4px;
      align-items: center;
    }
    .sales-row-actions a,
    .sales-row-actions button {
      width: 28px;
      height: 28px;
      min-height: 28px;
      display: grid;
      place-items: center;
      padding: 0;
      border: 1px solid var(--line);
      border-radius: 6px;
      background: #fff;
      color: var(--ink);
      text-decoration: none;
      cursor: pointer;
      font-size: 12px;
      font-weight: 900;
    }
    .payment-paid { background:#e3f3e7;color:#23633a; }
    .payment-no-invoice { background:#eef1ef;color:#56645d; }
    .payment-unpaid, .payment-overdue { background:#fde5e4;color:#922f32; }
    .payment-partial { background:#fff1cc;color:#795d12; }
    .trial-read-view { display: grid; gap: 12px; padding: 16px; }
    .trial-read-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
    .trial-read-field { padding:10px; border:1px solid var(--line); border-radius:7px; background:#fff; }
    .trial-read-field span { display:block; color:var(--muted); font-size:10px; font-weight:900; text-transform:uppercase; }
    .trial-read-field strong { display:block; margin-top:5px; font-size:13px; white-space:pre-wrap; }
    .trial-read-field.wide { grid-column:1/-1; }

    .matrix-grid td { vertical-align: middle; }
    .matrix-grid td > input, .matrix-grid td > select, .matrix-grid td > textarea { min-height: 29px; padding: 4px 7px; font-size: 12px; }
    .matrix-grid td > select { min-width: 132px; }
    .matrix-tag-editor { min-width: 190px; max-width: 260px; display: grid; gap: 4px; }
    .matrix-tag-list { display: flex; gap: 3px; flex-wrap: wrap; }
    .matrix-tag { display: inline-flex; align-items: center; gap: 3px; padding: 2px 5px; border-radius: 5px; background: #e6f0e8; color: #285e3b; font-size: 10px; font-weight: 900; }
    .matrix-tag button { width: 14px; height: 14px; padding: 0; border: 0; background: transparent; color: inherit; cursor: pointer; line-height: 1; }
    .matrix-tag-editor input { min-height: 27px; padding: 3px 6px; border-radius: 5px; font-size: 11px; }

    .trial-focus-modal { width: min(980px, calc(100vw - 28px)); max-height: calc(100vh - 28px); overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: #f7f9f6; box-shadow: 0 24px 70px rgba(24,35,31,.26); }
    .trial-focus-header { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; gap: 16px; align-items: start; padding: 16px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.97); }
    .trial-focus-header h2 { margin: 5px 0 3px; font-size: 21px; }
    .trial-focus-progress { padding: 12px 16px; background: #fff; }
    .trial-focus-progress > div:first-child { display: flex; justify-content: space-between; margin-bottom: 7px; font-size: 12px; }
    .trial-focus-section { padding: 16px; border-top: 1px solid var(--line); background: #fff; }
    .trial-focus-section .section-head { margin-bottom: 10px; }
    .trial-question-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
    .trial-question-grid label { margin: 0; }
    .missing-chip-list { display: flex; flex-wrap: wrap; gap: 6px; }
    .missing-chip-list span { padding: 5px 7px; border: 1px solid #ead7ad; border-radius: 6px; background: #fff8e8; color: #795d20; font-size: 11px; font-weight: 900; }
    .trial-focus-actions { position: sticky; bottom: 0; z-index: 5; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--line); background: rgba(255,255,255,.97); }
    .input-suffix { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: stretch; }
    .input-suffix input { border-radius: 6px 0 0 6px; }
    .input-suffix span { display: grid; place-items: center; padding: 0 10px; border: 1px solid var(--line); border-left: 0; border-radius: 0 6px 6px 0; background: #eef2ee; color: var(--muted); font-size: 11px; font-weight: 900; }
    .trial-evidence { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
    .trial-evidence-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 7px; }
    .trial-evidence-item { min-width: 0; padding: 7px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); text-decoration: none; }
    .trial-evidence-item img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 4px; }
    .trial-evidence-item strong, .trial-evidence-item small { display: block; margin-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .trial-evidence-item small { color: var(--muted); }
    .trial-result-cell-grid .trial-read-field.is-empty strong {
      color: var(--muted);
      font-weight: 700;
    }
    .trial-inline-composer {
      display: grid;
      grid-template-columns: 34px minmax(0, 1fr) 34px;
      gap: 8px;
      align-items: end;
      margin-top: 12px;
      padding: 8px;
      border: 1px solid var(--line);
      border-radius: 12px;
      background: #fff;
    }
    .trial-inline-composer textarea {
      min-height: 34px;
      max-height: 120px;
      resize: vertical;
      margin: 0;
      padding: 8px 10px;
      border: 0;
      background: transparent;
      box-shadow: none;
      line-height: 1.45;
    }
    .trial-inline-composer .icon-button {
      width: 34px;
      height: 34px;
      min-height: 34px;
      border-radius: 999px;
    }
    .trial-inline-composer .message {
      grid-column: 1 / -1;
      margin: 0;
    }
    .trial-composer-plus {
      border-color: var(--line);
      background: #fffdf8;
      color: var(--muted);
      font-size: 18px;
    }
    .trial-composer-send {
      background: #242833;
      color: #fff;
    }
    .trial-composer-file {
      grid-column: 2 / 3;
      display: inline-flex;
      width: fit-content;
      max-width: 100%;
      gap: 6px;
      align-items: center;
      padding: 4px 7px;
      border: 1px solid var(--line);
      border-radius: 999px;
      background: #f3f2ed;
      color: var(--ink);
      font-size: 12px;
      font-weight: 760;
    }
    .trial-composer-file span {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .trial-composer-file button {
      display: inline-grid;
      width: 18px;
      height: 18px;
      place-items: center;
      padding: 0;
      border: 0;
      border-radius: 999px;
      background: transparent;
      color: var(--muted);
      cursor: pointer;
    }
    .trial-file-icon { display: grid; place-items: center; aspect-ratio: 4/3; border-radius: 4px; background: #edf2ee; color: #42604e; font-size: 11px; font-weight: 900; }
    .trial-action-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
    .trial-action-grid .button { width: 100%; }
    .cross-trial-compact { border: 1px solid var(--line); border-radius: 8px; background: #fff; }
    .cross-trial-compact > summary { display: flex; justify-content: space-between; padding: 10px 12px; cursor: pointer; font-weight: 900; }
    .cross-trial-mini { display: flex; gap: 5px; padding: 0 10px 10px; overflow-x: auto; }
    .cross-trial-mini button { flex: 0 0 auto; min-height: 28px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 5px; background: #f5f7f5; color: var(--ink); font-size: 11px; cursor: pointer; }
    .recording-tools { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
    .recording-active { color: #a92f34; font-weight: 900; }

    .cold-table tbody tr { height: 42px; }
    .cold-table td { vertical-align: middle; }
    .cold-table td:nth-child(2) select { width: 138px; min-width: 138px; font-size: 11px; }
    .cold-table textarea, .cold-table .cold-notes { min-height: 30px; height: 30px; max-height: 30px; resize: none; overflow: hidden; }
    .cold-table .quick-call-menu summary { width: 30px; height: 30px; }
    .cold-table td:last-child,
    .cold-table th:last-child { width: 74px; min-width: 74px; }

    @media (max-width: 1050px) {
      .command-layout { grid-template-columns: 1fr; }
      .command-work-board { grid-template-columns: 1fr; }
      .command-agenda-synthesis { grid-template-columns: 1fr; }
      .dossier-hero { position: static; }
      .dossier-nav { top: 0; }
    }

    @media (max-width: 720px) {
      .workspace-head { align-items: stretch; flex-direction: column; }
      #overview .workspace-head {
        align-items: center;
        flex-direction: row;
      }
      .workspace-actions { width: 100%; }
      #overview .workspace-actions {
        width: auto;
      }
      #overview .workspace-head .inspiration-line {
        display: none;
      }
      .command-head-actions { align-self: flex-end; width: auto; }
      #overview .command-head-actions {
        align-self: center;
      }
      .workspace-actions .button { flex: 0 0 auto; width: auto; }
      .cold-lead-card { grid-template-columns: 1fr; }
      .cold-lead-actions { justify-content: stretch; }
      .cold-lead-actions .button { width: 100%; }
      .profile-top-summary { grid-template-columns: 1fr; }
      .profile-top-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .action-row { grid-template-columns: 8px minmax(0, 1fr); }
      .action-meta { display: none; }
      .compact-metrics, .dossier-score-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .dossier-hero { grid-template-columns: 1fr; }
      .dossier-actions { justify-content: space-between; }
      .trial-ops-grid { grid-template-columns: 1fr; }
      .experiment-db-toolbar { grid-template-columns: 1fr 1fr; }
      .experiment-db-toolbar > input,
      .experiment-filter-drawer { grid-column: 1 / -1; }
      .experiment-filter-drawer { justify-self: stretch; }
      .experiment-filter-drawer summary { text-align: center; }
      .experiment-view-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .trial-detail-brief-bar,
      .trial-dossier-grid { grid-template-columns: 1fr; }
      .experiment-view-card {
        min-height: 0;
        padding: 8px 9px;
      }
      .experiment-view-card strong {
        font-size: 18px;
      }
      .experiment-view-card span {
        margin-top: 3px;
        font-size: 11px;
      }
      .experiment-view-card small {
        display: none;
      }
      .experiment-filter-grid { position: fixed; left: 12px; right: 12px; top: 112px; width: auto; grid-template-columns: 1fr 1fr; }
      .trial-question-grid, .intelligence-review-grid { grid-template-columns: 1fr; }
      .quick-upload-mini-grid { grid-template-columns: 1fr; }
      .order-item { grid-template-columns: 1fr 1fr; }
      .order-workspace { grid-template-columns: 1fr; }
      .order-preview { min-height: 300px; }
      .trial-read-grid { grid-template-columns: 1fr; }
      .sales-summary-grid { grid-template-columns: 1fr; }
      .sales-toolbar { align-items: stretch; }
      .sales-toolbar .segmented { overflow-x: auto; }
      .contact-page-card { grid-template-columns: 1fr; }
      .contact-page-details { grid-template-columns: 1fr; }
      .contact-page-actions { justify-content: start; }
      .order-item .icon-button { align-self: end; }
      .order-sales, .settings-status { grid-template-columns: repeat(2, 1fr); }
      .trial-summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .calendar-visual { --calendar-visual-height: 430px; }
      .calendar-row > button { grid-template-columns: 76px minmax(0, 1fr); }
      .analytics-grid { grid-template-columns: 1fr; }
      .calendar-year-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
      #appView > aside { padding: 12px; }
      #appView > aside .brand { margin-bottom: 10px; }
      #appView > aside nav {
        display: flex;
        grid-template-columns: none;
        gap: 4px;
        overflow-x: auto;
        margin-bottom: 0;
        padding-bottom: 2px;
      }
      #appView > aside .nav-btn {
        flex: 0 0 auto;
        min-height: 36px;
        padding: 8px 10px 8px 29px;
        white-space: nowrap;
      }
    }

    @media (max-width: 560px) {
      .command-summary-row { grid-template-columns: 1fr; }
      .command-work-board { grid-template-columns: 1fr; }
      .command-log-goal { grid-template-columns: 1fr; }
      .command-goal-ring { width: 88px; }
    }

    @media (max-width: 1050px) {
      .app { grid-template-columns: 1fr; }
      aside { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
      nav { grid-template-columns: repeat(4, minmax(0, 1fr)); }
      .kpis, .two, .three, .intake-flow, .entity-grid, .classification-grid, .metric-strip, .overview-lower { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .overview-main { grid-template-columns: 1fr; }
      .pipeline-board { grid-template-columns: repeat(6, minmax(110px, 1fr)); }
    }

    @media (max-width: 820px) {
      .pipeline-board { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
    }

    @media (max-width: 720px) {
      main { padding: 16px; }
      nav, .kpis, .two, .three, .intake-flow, .intake-layout, .entity-grid, .classification-grid, .metric-strip, .overview-lower { grid-template-columns: 1fr; }
      .topbar { align-items: stretch; flex-direction: column; }
      .top-actions { justify-content: stretch; }
      .form-actions .button,
      form > .button,
      form label + .button {
        width: 100%;
      }
      .workspace-actions .button,
      .sales-toolbar .button,
      .calendar-tools .button,
      .row-actions .button,
      .account-approval-toolbar-button {
        width: auto;
        flex: 0 0 auto;
      }
      .top-actions .app-control { width: auto; }
      .pipeline-board { grid-template-columns: 1fr; }
      .map-wrap { min-height: 320px; height: 320px; }
      .map-filter-bar { left: 10px; top: 54px; max-height: 76px; overflow: auto; }
      .map-card { top: auto; bottom: 54px; }
      .calendar-day { min-height: 78px; padding: 4px; }
      .calendar-event-chip { padding: 3px; font-size: 9px; }
      .calendar-year-grid, .account-analytics-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .sales-table-wrap { max-height: none; }
      .gmail-card { grid-template-columns: 1fr; }
      .gmail-actions { justify-content: start; max-width: none; }
      .accounts-view-switcher { width: 100%; }
      .accounts-view-switcher button { flex: 1; }
      .account-workbench, .form-grid, .profile-grid, .opportunity-grid, .snapshot-grid, .mini-grid, .log-grid { grid-template-columns: 1fr; }
      .profile-hero { grid-template-columns: 1fr; }
    }

    /* PFV Design System: modern agricultural intelligence */
    :root {
      color-scheme: light;
      --ink: #17231d;
      --ink-strong: #0d1712;
      --muted: #65746c;
      --muted-2: #87948d;
      --line: #d9e3dc;
      --line-strong: #c2d0c7;
      --soft: #f5f7f2;
      --field: #eef4ec;
      --panel: #fffefa;
      --panel-2: #f9fbf6;
      --canvas: #f2f5ef;
      --green: #2f7650;
      --green-2: #4f9468;
      --green-soft: #e7f2e9;
      --gold: #c8962e;
      --gold-soft: #fff4d8;
      --blue: #2f7198;
      --blue-soft: #e7f1f6;
      --red: #b84e43;
      --red-soft: #fde8e5;
      --plum: #675682;
      --clay: #9b6750;
      --clay-soft: #f4ece6;
      --focus: #5c8f72;
      --shadow-xs: 0 1px 2px rgba(20, 34, 27, .05);
      --shadow-sm: 0 8px 20px rgba(20, 34, 27, .07);
      --shadow: 0 18px 48px rgba(20, 34, 27, .1);
      --shadow-lg: 0 28px 80px rgba(20, 34, 27, .18);
      --radius-xs: 5px;
      --radius-sm: 7px;
      --radius-md: 8px;
      --space-1: 4px;
      --space-2: 8px;
      --space-3: 12px;
      --space-4: 16px;
      --space-5: 20px;
      --space-6: 24px;
      --text-xs: 10px;
      --text-sm: 12px;
      --text-md: 14px;
      --text-lg: 16px;
      --text-xl: 20px;
      --text-2xl: 24px;
      --text-3xl: 30px;
    }

    html {
      background: var(--canvas);
      text-rendering: optimizeLegibility;
      -webkit-font-smoothing: antialiased;
    }

    body {
      background:
        linear-gradient(180deg, rgba(255, 254, 250, .9) 0%, rgba(242, 245, 239, .98) 44%, #edf3ec 100%);
      color: var(--ink);
      font-size: var(--text-md);
      line-height: 1.5;
    }

    h1, h2, h3 {
      color: var(--ink-strong);
      letter-spacing: 0;
    }

    h1 { font-size: var(--text-3xl); line-height: 1.08; }
    h2 { font-size: var(--text-2xl); line-height: 1.14; }
    h3 { font-size: var(--text-lg); line-height: 1.22; }

    p { color: inherit; }
    .muted { color: var(--muted); }

    *:focus-visible {
      outline: 2px solid rgba(92, 143, 114, .48);
      outline-offset: 2px;
    }

    ::selection {
      background: rgba(79, 148, 104, .22);
      color: var(--ink-strong);
    }

    .app {
      grid-template-columns: 236px minmax(0, 1fr);
      background: transparent;
    }

    aside {
      background:
        linear-gradient(180deg, #132019 0%, #17271e 46%, #102017 100%);
      color: #f7fbf6;
      box-shadow: inset -1px 0 0 rgba(255, 255, 255, .05);
    }

    aside::after {
      content: '';
      display: block;
      height: 1px;
      margin-top: var(--space-4);
      background: linear-gradient(90deg, transparent, rgba(143, 185, 152, .28), transparent);
    }

    .mark,
    .brand .mark {
      border: 1px solid rgba(255, 255, 255, .12);
      background: linear-gradient(135deg, #6db276, #2c7452 54%, #2f7198);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 10px 22px rgba(0, 0, 0, .18);
    }

    .brand h1 {
      font-size: 15px;
      font-weight: 900;
    }

    .brand p { color: #a9b9af; }

    .nav-btn {
      border-radius: var(--radius-sm);
      color: #b8c7bd;
      transition: background .16s ease, color .16s ease, transform .16s ease;
    }

    .nav-btn:hover {
      transform: translateX(1px);
    }

    .nav-btn.active,
    .nav-btn:hover {
      background: rgba(255, 255, 255, .09);
      color: #fffefa;
    }

    .nav-btn.active {
      box-shadow: inset 3px 0 0 #78bd84;
    }

    .nav-btn::before { color: #8ea197; }
    .nav-btn.active::before { color: #9bdaa5; }

    main {
      padding: var(--space-5) var(--space-6) 32px;
    }

    .topbar {
      border-bottom: 1px solid rgba(194, 208, 199, .72);
    }

    .grid,
    .overview-dashboard,
    .sales-workspace,
    .profile-shell,
    .command-column {
      gap: var(--space-4);
    }

    .panel,
    .kpi,
    .profile-card,
    .profile-glance-card,
    .profile-launch-card,
    .trial-ops-card,
    .rank-row,
    .rec,
    .flow-step,
    .intake-card,
    .intake-review,
    .contact-card,
    .opportunity-card,
    .pipeline-card,
    .gmail-card,
    .sales-summary-grid > div,
    .trial-read-field,
    .settings-section,
    .account-list-card {
      border-color: var(--line);
      border-radius: var(--radius-md);
      background: var(--panel);
      box-shadow: var(--shadow-xs);
    }

    .panel,
    .kpi {
      box-shadow: var(--shadow-sm);
    }

    .panel {
      padding: var(--space-5);
    }

    .focus-panel,
    .command-map-panel,
    .command-messages,
    .executive-brief {
      overflow: hidden;
      box-shadow: var(--shadow-sm);
    }

    .focus-header,
    .section-head,
    .quick-modal-head,
    .profile-panel-head,
    .trial-focus-header {
      background: linear-gradient(180deg, #fffefa, #f7faf5);
      border-color: var(--line);
    }

    .workspace-head {
      margin-bottom: var(--space-4);
      padding-bottom: var(--space-1);
    }

    .workspace-head h2 {
      font-size: var(--text-2xl);
      font-weight: 850;
    }

    .signal-label,
    .label,
    th,
    .profile-summary-item span,
    .dossier-score span,
    .trial-signal span,
    .oauth-uri-box span,
    .profile-ai-summary span,
    .profile-top-grid span {
      color: #49735a;
      letter-spacing: .07em;
      font-size: var(--text-xs);
      font-weight: 900;
    }

    .signal-label::before {
      background: linear-gradient(135deg, var(--green-2), #8bc176);
      box-shadow: 0 0 0 3px rgba(79, 148, 104, .14);
    }

    .button,
    .icon-button,
    .nav-btn,
    .matrix-tab,
    .accounts-view-switcher button,
    .command-task-tabs button,
    .calendar-period-bar .segmented button,
    .sales-toolbar .segmented button,
    .cold-filter-chip,
    .profile-tabs button,
    .dossier-nav button,
    summary {
      transition: background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease;
    }

    .button {
      border: 1px solid transparent;
      border-radius: var(--radius-sm);
      background: linear-gradient(180deg, #203428, #16251d);
      box-shadow: var(--shadow-xs);
      color: #fffefa;
      font-weight: 850;
    }

    .button:hover {
      transform: translateY(-1px);
      box-shadow: var(--shadow-sm);
    }

    .button:active {
      transform: translateY(0);
      box-shadow: var(--shadow-xs);
    }

    .button.ghost,
    .ghost,
    .app-control.ghost {
      border-color: var(--line);
      background: linear-gradient(180deg, #fffefa, #eef4ec);
      color: var(--ink);
    }

    .button.ghost:hover,
    .ghost:hover,
    .icon-button:hover {
      border-color: var(--line-strong);
      background: #e9f2e8;
      color: var(--ink-strong);
    }

    .danger,
    .button.danger {
      background: linear-gradient(180deg, #c35a4d, #9f4038);
      color: #fffefa;
    }

    .icon-button {
      border-radius: var(--radius-sm);
      background: linear-gradient(180deg, #fffefa, #f2f6ef);
      box-shadow: var(--shadow-xs);
    }

    input,
    select,
    textarea,
    .vision-edit {
      border-color: var(--line);
      border-radius: var(--radius-sm);
      background: #fffefa;
      color: var(--ink-strong);
      box-shadow: inset 0 1px 0 rgba(20, 34, 27, .03);
      transition: background .16s ease, border-color .16s ease, box-shadow .16s ease;
    }

    input:hover,
    select:hover,
    textarea:hover {
      border-color: var(--line-strong);
    }

    input:focus,
    select:focus,
    textarea:focus,
    .vision-edit:focus {
      border-color: rgba(79, 148, 104, .78);
      box-shadow: 0 0 0 3px rgba(79, 148, 104, .14);
      outline: 0;
    }

    label {
      color: #31493b;
      font-size: var(--text-sm);
      font-weight: 850;
    }

    .message {
      color: var(--muted);
      font-size: var(--text-sm);
      font-weight: 750;
    }

    .message.ok,
    .ok { color: #2e704a; }
    .message.error,
    .error { color: #a9443c; }

    .pill,
    .entity-pill,
    .matrix-tag,
    .gmail-meta span {
      border: 1px solid rgba(194, 208, 199, .82);
      border-radius: 999px;
      background: #eef4ec;
      color: #355946;
      font-size: var(--text-sm);
      font-weight: 850;
    }

    .payment-paid,
    .pill.proven,
    .google-status-marker.proven {
      background: var(--green-soft);
      color: #23613d;
    }

    .payment-partial,
    .event-experiment,
    .pin.trial {
      background: var(--gold-soft);
      color: #725717;
    }

    .payment-unpaid,
    .payment-overdue,
    .trial-risk {
      background: var(--red-soft);
      color: #8f322d;
    }

    .payment-no-invoice {
      background: #eef1ef;
      color: #59675f;
    }

    .score,
    .match-score,
    .day-score strong {
      border-radius: var(--radius-md);
      background: linear-gradient(135deg, #1a2f23, #2f7650);
      color: #fffefa;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), var(--shadow-xs);
    }

    .day-score strong {
      border: 6px solid rgba(79, 148, 104, .2);
      border-top-color: var(--green-2);
      background: #fffefa;
      color: var(--green);
    }

    .bar,
    .bar-track,
    .trial-progress {
      background: #e5ede6;
      box-shadow: inset 0 1px 1px rgba(20, 34, 27, .05);
    }

    .bar span,
    .bar-track span,
    .trial-progress span {
      background: linear-gradient(90deg, var(--green), #86b76f);
    }

    .action-signal {
      border-radius: 999px;
      background: #82978c;
    }

    .action-row.urgent .action-signal,
    .event-attention {
      background: var(--red);
    }

    .action-row.warning .action-signal {
      background: var(--gold);
    }

    .action-row.opportunity .action-signal {
      background: var(--green);
    }

    table {
      border-collapse: separate;
      border-spacing: 0;
      background: var(--panel);
    }

    .table-wrap,
    .vision-table-wrap,
    .matrix-grid.table-wrap,
    .sales-table-wrap {
      border-color: var(--line);
      border-radius: var(--radius-md);
      background: var(--panel);
      box-shadow: var(--shadow-xs);
    }

    th {
      position: sticky;
      top: 0;
      z-index: 2;
      border-bottom-color: var(--line-strong);
      background: #edf4eb;
      color: #4c6657;
    }

    td {
      background: rgba(255, 254, 250, .92);
    }

    tbody tr:hover td,
    .matrix-grid tr:hover td {
      background: #f3f8f1;
    }

    .matrix-grid input,
    .matrix-grid select,
    .matrix-grid textarea,
    .cold-table input,
    .cold-table select,
    .cold-table textarea {
      background: #fffefa;
    }

    .matrix-tabs,
    .accounts-view-switcher,
    .command-task-tabs,
    .calendar-period-bar .segmented,
    .sales-toolbar .segmented,
    .vision-mode,
    .cold-status-filters {
      border-color: var(--line);
      border-radius: var(--radius-sm);
      background: #eaf1e9;
    }

    .matrix-tab,
    .accounts-view-switcher button,
    .command-task-tabs button,
    .calendar-period-bar .segmented button,
    .sales-toolbar .segmented button,
    .vision-mode button {
      color: var(--muted);
    }

    .matrix-tab.active,
    .accounts-view-switcher button.active,
    .command-task-tabs button.active,
    .calendar-period-bar .segmented button.active,
    .sales-toolbar .segmented button.active,
    .vision-mode button.active {
      background: #fffefa;
      color: var(--ink-strong);
      box-shadow: var(--shadow-xs);
    }

    .matrix-tool-popover,
    .quick-call-popover,
    .cold-column-popover,
    .next-step-menu,
    .address-suggestions {
      border-color: var(--line);
      border-radius: var(--radius-md);
      background: var(--panel);
      box-shadow: var(--shadow);
    }

    .modal-backdrop,
    .profile-panel-backdrop {
      background: rgba(16, 28, 22, .42);
      backdrop-filter: blur(7px);
    }

    .quick-modal,
    .trial-focus-modal,
    .profile-panel-frame {
      border-color: rgba(194, 208, 199, .86);
      border-radius: var(--radius-md);
      background: linear-gradient(180deg, #fffefa, #f6f9f3);
      box-shadow: var(--shadow-lg);
    }

    .modal-close,
    .popover-close {
      border-color: var(--line);
      background: #fffefa;
      color: var(--muted);
    }

    .modal-close:hover,
    .popover-close:hover {
      background: var(--red-soft);
      color: #8f322d;
    }

    .empty-state,
    .map-empty,
    .order-preview-empty,
    .pipeline-empty,
    .table-wrap td[colspan] {
      border-radius: var(--radius-md);
      color: var(--muted);
      text-align: center;
    }

    .empty-state {
      display: grid;
      place-items: center;
      gap: var(--space-1);
      min-height: 120px;
      padding: var(--space-5);
      border: 1px dashed var(--line-strong);
      background: #f7faf4;
    }

    .empty-state strong {
      color: var(--ink);
    }

    .seed-sprout-loader,
    .quick-upload-processing {
      color: var(--green);
    }

    .quick-upload-dropzone {
      border-color: var(--line-strong);
      background: linear-gradient(180deg, #fffefa, #f3f8f1);
    }

    .quick-upload-dropzone.dragging {
      border-color: var(--green-2);
      background: #edf7ed;
      box-shadow: 0 0 0 3px rgba(79, 148, 104, .14);
    }

    .calendar-visual {
      border-color: var(--line);
      border-radius: var(--radius-md);
      background: var(--panel);
      box-shadow: var(--shadow-xs);
    }

    .calendar-day {
      background: #fffefa;
    }

    .calendar-day.outside {
      background: #f2f5f0;
      color: var(--muted-2);
    }

    .calendar-day.today {
      box-shadow: inset 0 0 0 2px rgba(47, 113, 152, .82);
      background: #fbfdf8;
    }

    .calendar-day-surface {
      background: repeating-linear-gradient(to bottom, #fffefa 0, #fffefa 39px, #e8efe8 40px);
    }

    .calendar-event-chip {
      border-left-color: var(--blue);
      border-radius: var(--radius-xs);
      background: var(--blue-soft);
      color: #214e6b;
    }

    .calendar-event-chip.event-meeting {
      border-left-color: var(--plum);
      background: #eee8f4;
      color: #4d4161;
    }

    .calendar-event-chip.event-experiment {
      border-left-color: var(--gold);
      background: var(--gold-soft);
      color: #725717;
    }

    .calendar-event-chip.event-attention {
      border-left-color: var(--red);
      background: var(--red-soft);
      color: #8f322d;
    }

    .command-task-main,
    .gmail-card,
    .profile-launch-card,
    .profile-glance-card,
    .account-list-card,
    .trial-evidence-item {
      transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease, background .16s ease;
    }

    .command-task-main:hover,
    .gmail-card:hover,
    .profile-launch-card:hover,
    .account-list-card:hover,
    .trial-evidence-item:hover {
      border-color: var(--line-strong);
      background: #fbfdf8;
      box-shadow: var(--shadow-sm);
      transform: translateY(-1px);
    }

    .command-messages,
    .gmail-intake-panel {
      border-color: #cadbcf;
      background: linear-gradient(180deg, #fbfdf8, #f5f9f2);
    }

    .executive-brief {
      border-left-color: var(--green);
    }

    .map-wrap {
      background: #dce9dc;
    }

    .land { fill: #cadbc8; stroke: #a9baa9; }
    .water-line { stroke: rgba(47, 113, 152, .25); }

    .pin,
    .google-status-marker {
      box-shadow: 0 6px 16px rgba(20, 34, 27, .28);
    }

    .pin.prospect,
    .google-status-marker.prospect { background: var(--plum); }
    .pin.discussion,
    .google-status-marker.discussion { background: var(--blue); }
    .pin.trial,
    .google-status-marker.trial { background: var(--map-trialing, #a678e8); }
    .pin.dormant,
    .google-status-marker.dormant { background: var(--red); }

    .cold-filter-chip {
      background: #fffefa;
      border: 1px solid var(--line);
    }

    .cold-filter-chip.active {
      background: var(--green);
      border-color: var(--green);
      color: #fffefa;
    }

    .cold-table tr.cold-status-interested td { background: #eef8ee; }
    .cold-table tr.cold-status-needs-info td { background: #fff8e7; }
    .cold-table tr.cold-status-not-interested td { background: #f8ece9; }
    .cold-table tr.cold-status-no-answer td,
    .cold-table tr.cold-status-left-voicemail td { background: #f2f5f1; }
    .cold-table tr.cold-status-trial td { background: #edf4fb; }

    .sales-summary-grid > div,
    .dossier-score,
    .compact-metric,
    .settings-status div,
    .account-analytics-metrics div {
      background: linear-gradient(180deg, #fffefa, #f5f8f2);
    }

    .profile-summary-callout,
    .summary-lines,
    .profile-summary-item,
    .review-match,
    .observation-summary {
      border-color: #cfe0d1;
      background: #f3f9f2;
    }

    .field-missing input,
    .field-missing textarea,
    .field-missing select,
    .missing-order-alert {
      border-color: #dfaaa5 !important;
      background: #fff4f2 !important;
      color: #8f322d;
    }

    .missing-chip-list span {
      border-color: #e4c886;
      background: var(--gold-soft);
      color: #725717;
    }

    .skeleton,
    .loading-state {
      position: relative;
      overflow: hidden;
      border-radius: var(--radius-md);
      background: #e8eee7;
    }

    .skeleton::after,
    .loading-state::after {
      content: '';
      position: absolute;
      inset: 0;
      transform: translateX(-100%);
      background: linear-gradient(90deg, transparent, rgba(255,255,255,.62), transparent);
      animation: pfvShimmer 1.4s ease-in-out infinite;
    }

    @keyframes pfvShimmer {
      100% { transform: translateX(100%); }
    }

    @media (prefers-reduced-motion: reduce) {
      *,
      *::before,
      *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
      }
    }

    @media (max-width: 1050px) {
      .app { grid-template-columns: 1fr; }
      aside {
        position: sticky;
        top: 0;
        z-index: 60;
        height: auto;
        padding: var(--space-3);
        border-bottom: 1px solid rgba(255,255,255,.08);
      }
      .brand {
        margin-bottom: var(--space-2);
      }
      main {
        padding: var(--space-4);
      }
      .panel {
        padding: var(--space-4);
      }
    }

    @media (max-width: 720px) {
      body { font-size: 13px; }
      main { padding: var(--space-3); }
      .brand {
        grid-template-columns: 36px 1fr;
      }
      .brand .mark {
        width: 36px;
        height: 36px;
      }
      .topbar {
        gap: var(--space-2);
        padding-bottom: var(--space-2);
      }
      .top-actions {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
      }
      .top-actions .icon-button,
      .top-actions .button {
        width: 100%;
      }
      .workspace-head h2 {
        font-size: var(--text-xl);
      }
      .panel,
      .quick-modal,
      .trial-focus-modal,
      .profile-panel-body {
        padding: var(--space-3);
      }
      .focus-header {
        padding: var(--space-3);
        align-items: start;
      }
      .calendar-period-bar,
      .sales-toolbar,
      .matrix-toolbar.compact {
        align-items: center;
      }
      .calendar-period-bar .segmented,
      .sales-toolbar .segmented,
      .command-task-tabs {
        width: 100%;
        overflow-x: auto;
      }
      .calendar-period-bar .segmented button,
      .sales-toolbar .segmented button,
      .command-task-tabs button {
        flex: 1 0 auto;
      }
      .workspace-actions .button,
      .row-actions .button,
      .calendar-tools .button,
      .sales-toolbar .button,
      .sales-toolbar .button.small,
      .account-approval-toolbar-button {
        width: auto;
        flex: 0 0 auto;
      }
      .workspace-actions,
      .row-actions,
      .sales-toolbar {
        align-items: center;
      }
      .calendar-day {
        min-height: 82px;
        padding: 5px;
      }
      .calendar-event-chip {
        padding: 4px;
        font-size: 9px;
      }
      .table-wrap,
      .matrix-grid.table-wrap,
      .sales-table-wrap {
        border-radius: var(--radius-sm);
      }
      th,
      td {
        padding: 8px 7px;
      }
      .matrix-search-input,
      .sales-search,
      .matrix-main-tools,
      .matrix-quiet-tools {
        width: 100%;
      }
      .matrix-main-tools {
        display: grid;
        grid-template-columns: 1fr;
      }
      .matrix-quiet-tools {
        justify-content: start;
      }
      .gmail-actions,
      .dossier-actions,
      .row-actions {
        justify-content: start;
      }
    }

    /* Notion-inspired workspace refinement */
    :root {
      --notion-bg: #fbfaf7;
      --notion-panel: #fffdf8;
      --notion-hover: #f3f2ed;
      --notion-line: #e7e2d8;
      --notion-text: #22231f;
      --notion-muted: #77736a;
    }

    body {
      background: var(--notion-bg);
      color: var(--notion-text);
    }

    .app {
      grid-template-columns: 244px minmax(0, 1fr);
    }

    aside {
      background: #f7f6f1;
      color: var(--notion-text);
      border-right: 1px solid var(--notion-line);
      box-shadow: none;
    }

    aside::after { display: none; }

    .brand .mark,
    .mark {
      border-color: #d8dfd3;
      background: linear-gradient(135deg, #68a874, #337b57);
      box-shadow: none;
      color: #fff;
    }

    .brand h1 { color: var(--notion-text); }
    .brand p { color: var(--notion-muted); }

    .nav-btn {
      color: #585a53;
      font-weight: 750;
      border-radius: 6px;
    }

    .nav-btn::before { color: #8b8d84; }

    .nav-btn:hover {
      background: var(--notion-hover);
      color: var(--notion-text);
      transform: none;
    }

    .nav-btn.active {
      background: #e8eee5;
      color: #1e3528;
      box-shadow: inset 3px 0 0 #4d9466;
    }

    .nav-btn.active::before { color: #4d9466; }

    main {
      max-width: 1680px;
      width: 100%;
      margin: 0 auto;
      background: var(--notion-bg);
    }

    .topbar {
      min-height: 38px;
      border-bottom: 1px solid var(--notion-line);
    }

    .top-actions {
      gap: 8px;
    }

    .top-actions .app-control {
      border-radius: 6px;
      box-shadow: none;
    }

    .panel,
    .kpi,
    .profile-card,
    .profile-glance-card,
    .profile-launch-card,
    .trial-ops-card,
    .rank-row,
    .rec,
    .gmail-card,
    .sales-summary-grid > div,
    .trial-read-field,
    .settings-section,
    .account-list-card {
      background: var(--notion-panel);
      border-color: var(--notion-line);
      box-shadow: none;
    }

    .panel:hover,
    .profile-card:hover,
    .profile-launch-card:hover,
    .account-list-card:hover {
      box-shadow: none;
    }

    .workspace-head {
      margin-bottom: 18px;
    }

    .workspace-head h2 {
      font-size: 28px;
      font-weight: 760;
    }

    .workspace-head p,
    .muted {
      color: var(--notion-muted);
    }

    .button {
      min-height: 38px;
      border-radius: 6px;
      background: #1f2d24;
      box-shadow: none;
      font-weight: 760;
    }

    .button:hover {
      transform: none;
      box-shadow: none;
      background: #263a2d;
    }

    .button.ghost,
    .ghost,
    .icon-button {
      background: #fffdf8;
      border-color: var(--notion-line);
      box-shadow: none;
    }

    .button.ghost:hover,
    .ghost:hover,
    .icon-button:hover {
      background: var(--notion-hover);
      border-color: #d8d1c3;
    }

    input,
    select,
    textarea,
    .vision-edit {
      border-color: var(--notion-line);
      background: #fffdf8;
      box-shadow: none;
    }

    input:focus,
    select:focus,
    textarea:focus,
    .vision-edit:focus {
      border-color: #9db99f;
      box-shadow: 0 0 0 2px rgba(77, 148, 102, .14);
    }

    .focus-header,
    .section-head,
    .quick-modal-head,
    .profile-panel-head,
    .trial-focus-header {
      background: #fffdf8;
    }

    #overview .grid {
      gap: 18px;
    }

    #overview .workspace-head {
      max-width: none;
      align-items: center;
      margin-bottom: 8px;
    }

    #overview .workspace-head > div:first-child {
      display: flex;
      align-items: baseline;
      gap: 8px;
      min-width: 0;
    }

    #overview .workspace-head .signal-label {
      display: none;
    }

    #overview .workspace-head h2 {
      margin: 1px 0 0;
      font-size: 22px;
      line-height: 1.08;
      flex: 0 0 auto;
    }

    #overview .workspace-head p {
      min-width: 0;
      margin: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      font-size: 12px;
      line-height: 1.35;
    }

    #overview .command-head-actions {
      align-self: center;
    }

    .executive-brief,
    .command-messages,
    .command-map-panel,
    .focus-panel,
    .command-task-strip {
      border-radius: 8px;
      border-color: var(--notion-line);
      background: #fffdf8;
    }

    .command-work-board {
      grid-template-columns: minmax(0, 1.65fr) minmax(300px, .72fr);
    }

    .command-work-board > .command-task-strip.embedded {
      min-height: 500px;
    }

    .command-work-log-card {
      background: #fffdf8;
    }

    .command-log-stat {
      border-color: var(--notion-line);
      background: #f7f6f0;
    }

    .command-goal-ring::after {
      background: #fffdf8;
    }

    .executive-brief {
      border-left: 3px solid #4d9466;
    }

    .executive-brief .focus-header,
    .command-messages .focus-header,
    .command-map-panel .focus-header,
    .focus-panel .focus-header,
    .command-task-strip .focus-header {
      padding: 16px 18px;
      border-bottom-color: #eee9df;
    }

    .executive-brief p {
      color: #33352f;
      font-size: 14px;
      line-height: 1.65;
    }

    .calendar-visual,
    .table-wrap,
    .matrix-grid.table-wrap,
    .sales-table-wrap {
      border-color: var(--notion-line);
      box-shadow: none;
    }

    th {
      background: #f3f2ed;
      color: #6c6d66;
      letter-spacing: .05em;
    }

    td {
      background: #fffdf8;
    }

    tbody tr:hover td,
    .matrix-grid tr:hover td {
      background: #f8f7f2;
    }

    .matrix-tabs,
    .accounts-view-switcher,
    .command-task-tabs,
    .calendar-period-bar .segmented,
    .sales-toolbar .segmented,
    .vision-mode,
    .cold-status-filters {
      background: #f0efe9;
      border-color: var(--notion-line);
    }

    .matrix-tab.active,
    .accounts-view-switcher button.active,
    .command-task-tabs button.active,
    .calendar-period-bar .segmented button.active,
    .sales-toolbar .segmented button.active,
    .vision-mode button.active {
      background: #fffdf8;
      box-shadow: none;
    }

    .sales-import-hub,
    .account-request-workspace {
      display: grid;
      grid-template-columns: minmax(260px, 1.2fr) minmax(220px, .8fr);
      gap: 14px;
      align-items: start;
      padding: 16px;
      border: 1px solid var(--notion-line);
      border-radius: 8px;
      background: #fbfaf6;
    }

    .sales-import-hub h3,
    .account-request-workspace h3 {
      margin: 4px 0 6px;
      font-size: 18px;
    }

    .sales-import-actions {
      display: grid;
      gap: 8px;
      justify-items: start;
    }

    .sales-import-actions code {
      display: inline-flex;
      padding: 6px 8px;
      border: 1px solid var(--notion-line);
      border-radius: 6px;
      background: #fffdf8;
      color: #526157;
      font-size: 12px;
    }

    .sales-import-schema,
    .account-request-rules,
    .account-request-list {
      grid-column: 1 / -1;
    }

    .sales-import-schema {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
    }

    .sales-import-schema span {
      padding: 5px 8px;
      border-radius: 999px;
      background: #edf3eb;
      color: #405849;
      font-size: 12px;
      font-weight: 760;
    }

    .account-request-form {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
      gap: 8px;
      align-items: end;
    }

    .account-request-form label {
      margin: 0;
    }

    .account-request-rules {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 8px;
    }

    .account-request-rules div,
    .account-request-row {
      padding: 10px 12px;
      border: 1px solid var(--notion-line);
      border-radius: 8px;
      background: #fffdf8;
    }

    .account-request-rules strong,
    .account-request-rules span,
    .account-request-row strong,
    .account-request-row span {
      display: block;
    }

    .account-request-rules span,
    .account-request-row span,
    .account-request-row p {
      margin: 4px 0 0;
      color: var(--notion-muted);
      font-size: 12px;
    }

    .account-request-list {
      display: grid;
      gap: 8px;
    }

    .account-approval-strip {
      grid-template-columns: minmax(220px, 1fr) auto;
      align-items: center;
    }

    .account-approval-strip .account-request-copy p {
      max-width: 560px;
    }

    .account-approval-open {
      justify-self: end;
      min-width: 150px;
    }

    .account-approval-toolbar-button {
      color: #365c43;
      background: #eef6eb;
      border-color: #c9dac5;
      white-space: nowrap;
    }

    .account-approval-strip .account-request-list {
      grid-column: 1 / -1;
      grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    }

    .account-approval-modal {
      width: min(600px, calc(100vw - 28px));
      gap: 14px;
      padding-top: 22px;
      background: #fffdf8;
    }

    .account-approval-close {
      position: absolute;
      top: 12px;
      right: 12px;
      z-index: 2;
    }

    .account-approval-head {
      padding-right: 42px;
    }

    .account-approval-entry {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 8px;
      align-items: center;
    }

    .account-approval-entry input {
      height: 46px;
      border-radius: 8px;
      font-size: 15px;
    }

    .account-approval-check {
      height: 46px;
      min-width: 86px;
    }

    #accountApprovalResult:empty {
      display: none;
    }

    .account-approval-result {
      display: grid;
      grid-template-columns: 1fr;
      gap: 10px;
      align-items: center;
      min-height: 0;
      padding: 12px;
      border: 1px solid var(--notion-line);
      border-radius: 8px;
      background: #fbfaf6;
    }

    .account-approval-result.checking {
      justify-items: center;
      min-height: 160px;
      text-align: center;
    }

    .account-approval-summary {
      display: grid;
      gap: 6px;
    }

    .account-approval-summary strong {
      font-size: 16px;
      line-height: 1.25;
    }

    .account-approval-result p {
      margin: 0;
      line-height: 1.5;
    }

    .account-approval-status-line {
      display: inline-flex;
      width: fit-content;
      margin: 0 !important;
      padding: 4px 8px;
      border-radius: 999px;
      background: #edf3eb;
      color: #405849;
      font-size: 12px;
      font-weight: 780;
    }

    .account-approval-seed {
      width: 110px;
      height: 96px;
      transform: scale(.72);
      transform-origin: center;
    }

    .account-approval-badge {
      display: inline-flex;
      align-items: center;
      min-height: 24px;
      padding: 3px 9px;
      border-radius: 999px;
      border: 1px solid var(--notion-line);
      font-size: 12px;
      font-weight: 820;
    }

    .account-approval-badge.open {
      border-color: #bfd3bd;
      background: #eef6eb;
      color: #315f3e;
    }

    .account-approval-badge.taken {
      border-color: #dfcfaa;
      background: #fbf2df;
      color: #7a5a19;
    }

    .account-approval-badge.suggested {
      border-color: #cbd5c7;
      background: #f5f6f1;
      color: #526157;
    }

    .account-approval-reason {
      min-height: 64px;
      resize: vertical;
    }

    .account-approval-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }

    .pending-accounts-list {
      display: grid;
      gap: 8px;
    }

    .pending-account-row {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 8px 12px;
      align-items: center;
      padding: 12px;
      border: 1px solid var(--notion-line);
      border-radius: 8px;
      background: #fffdf8;
    }

    .pending-account-row strong,
    .pending-account-row span {
      display: block;
    }

    .pending-account-row div > span,
    .pending-account-row p {
      margin: 4px 0 0;
      color: var(--notion-muted);
      font-size: 12px;
    }

    .pending-account-row p {
      grid-column: 1 / -1;
    }

    .cold-lead-list {
      display: grid;
      gap: 8px;
    }

    .cold-lead-card {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 12px;
      align-items: start;
      padding: 12px;
      border: 1px solid var(--notion-line);
      border-radius: 8px;
      background: #fffdf8;
    }

    .cold-lead-main {
      display: grid;
      gap: 5px;
    }

    .cold-lead-main strong {
      font-size: 15px;
      line-height: 1.3;
    }

    .cold-lead-main p {
      margin: 0;
      font-size: 12px;
      line-height: 1.45;
    }

    .cold-lead-actions {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, auto));
      gap: 8px;
      justify-content: end;
      align-items: center;
    }

    .cold-lead-dormant {
      grid-column: 1 / -1;
      display: grid;
      gap: 4px;
      margin: 0;
      color: var(--notion-muted);
      font-size: 12px;
      font-weight: 760;
    }

    .cold-lead-dormant input {
      min-width: 160px;
    }

    .cold-lead-table-wrap {
      max-height: min(68vh, 760px);
    }

    .cold-lead-table td {
      vertical-align: top;
    }

    .cold-lead-table td strong,
    .cold-lead-table td span,
    .cold-lead-table td small {
      display: block;
      max-width: 220px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .cold-lead-table td small {
      margin-top: 3px;
      color: var(--muted);
      font-size: 11px;
    }

    .cold-lead-table td p {
      display: -webkit-box;
      max-width: 300px;
      margin: 0;
      overflow: hidden;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 2;
      color: var(--muted);
      font-size: 12px;
      line-height: 1.35;
    }

    .cold-lead-actions.compact {
      display: flex;
      flex-wrap: wrap;
      gap: 5px;
      justify-content: flex-start;
      min-width: 190px;
    }

    .cold-lead-actions.compact .button {
      width: auto;
      min-height: 28px;
      padding: 4px 7px;
      font-size: 11px;
    }

    .cold-lead-dormant.compact {
      display: flex;
      align-items: center;
      gap: 5px;
      margin: 0;
    }

    .cold-lead-dormant.compact input {
      min-width: 124px;
      min-height: 30px;
      padding: 5px 7px;
      font-size: 12px;
    }

    .account-approval-sync-note {
      margin: -4px 0 0;
      color: var(--notion-muted);
      font-size: 12px;
      line-height: 1.45;
    }

    .account-dossier {
      max-width: 1120px;
    }

    .dossier-hero.profile-hero {
      position: static;
      display: block;
      padding: 8px 0 18px;
      border: 0;
      border-bottom: 1px solid var(--notion-line);
      border-radius: 0;
      background: transparent;
      box-shadow: none;
    }

    .profile-hero-copy {
      max-width: 860px;
    }

    .dossier-hero h2 {
      margin: 14px 0 8px;
      font-size: 34px;
      font-weight: 760;
      letter-spacing: -.01em;
    }

    .dossier-actions {
      margin-top: 12px;
      justify-content: start;
    }

    .profile-top-summary,
    .profile-launch-grid,
    .profile-intelligence-bar,
    .profile-main-panel {
      max-width: 980px;
    }

    .profile-top-summary {
      margin-top: 18px;
    }

    .profile-ai-summary,
    .profile-top-grid > div,
    .profile-intelligence-bar,
    .profile-summary-callout,
    .summary-lines,
    .profile-summary-item,
    .profile-card,
    .profile-glance-card,
    .profile-launch-card {
      border-color: #ebe5da;
      background: transparent;
      box-shadow: none;
    }

    .profile-top-grid > div,
    .profile-summary-item,
    .profile-glance-card {
      background: #fffdf8;
    }

    .profile-launch-card {
      min-height: 86px;
      padding: 12px 0;
      border-width: 0 0 1px;
      border-radius: 0;
    }

    .profile-launch-card:hover {
      transform: none;
      background: #f8f7f2;
      box-shadow: none;
    }

    .profile-launch-card-simple {
      min-height: 42px;
      place-items: start;
      text-align: left;
    }

    .profile-summary-primary {
      padding: 0;
      border: 0;
      background: transparent;
      box-shadow: none;
    }

    .profile-summary-callout {
      padding: 16px 0;
      border-width: 1px 0;
      border-radius: 0;
      background: transparent;
    }

    .profile-summary-callout p {
      font-size: 15px;
      line-height: 1.75;
    }

    .profile-summary-grid {
      grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    }

    .profile-card-grid {
      gap: 10px;
    }

    .profile-card {
      border-radius: 8px;
    }

    .profile-panel-frame,
    .quick-modal,
    .trial-focus-modal {
      background: #fffdf8;
      border-color: var(--notion-line);
      box-shadow: 0 24px 80px rgba(28, 27, 23, .18);
    }

    .theme-toggle-active,
    body.night-mode #themeToggleBtn {
      background: #21372a;
      color: #e9f5dc;
      border-color: #3c684c;
    }

    .matrix-stage td:first-child {
      border-left: 4px solid transparent;
    }

    .matrix-stage-lead td:first-child { border-left-color: #9db7d6; }
    .matrix-stage-evaluating td:first-child { border-left-color: #b9a6d8; }
    .matrix-stage-setup td:first-child { border-left-color: #d8b65d; }
    .matrix-stage-testing td:first-child { border-left-color: #4b9b74; }
    .matrix-stage-awaiting td:first-child { border-left-color: #e08b58; }
    .matrix-stage-commercial td:first-child { border-left-color: #4b8fb8; }
    .matrix-stage-customer td:first-child { border-left-color: #2f7d51; }
    .matrix-stage-dormant td:first-child { border-left-color: #9d8f7f; }

    .matrix-stage-select,
    td.matrix-stage select,
    td.matrix-stage input,
    .inline-stage {
      border-width: 1px;
      font-weight: 780;
    }

    .matrix-stage-lead select,
    .matrix-stage-lead input,
    .matrix-stage-select.matrix-stage-lead { background: #eef5fb; color: #285273; border-color: #c8d9ea; }
    .matrix-stage-evaluating select,
    .matrix-stage-evaluating input,
    .matrix-stage-select.matrix-stage-evaluating { background: #f3effa; color: #59447b; border-color: #d9cdec; }
    .matrix-stage-setup select,
    .matrix-stage-setup input,
    .matrix-stage-select.matrix-stage-setup { background: #fff7df; color: #745718; border-color: #e8d396; }
    .matrix-stage-testing select,
    .matrix-stage-testing input,
    .matrix-stage-select.matrix-stage-testing { background: #eaf7ee; color: #27633e; border-color: #bfe0c9; }
    .matrix-stage-awaiting select,
    .matrix-stage-awaiting input,
    .matrix-stage-select.matrix-stage-awaiting { background: #fff0e8; color: #8a4626; border-color: #efc4ae; }
    .matrix-stage-commercial select,
    .matrix-stage-commercial input,
    .matrix-stage-select.matrix-stage-commercial { background: #eaf5fa; color: #285f7f; border-color: #bfdae8; }
    .matrix-stage-customer select,
    .matrix-stage-customer input,
    .matrix-stage-select.matrix-stage-customer { background: #e7f6e7; color: #235f36; border-color: #badfbd; }
    .matrix-stage-dormant select,
    .matrix-stage-dormant input,
    .matrix-stage-select.matrix-stage-dormant { background: #f2efeb; color: #66594a; border-color: #d6cbc0; }

    .matrix-multi-picker summary,
    .next-step-options label {
      border-radius: 999px;
    }

    .next-step-options label {
      padding: 6px 8px;
      border: 1px solid transparent;
    }

    .matrix-action-call summary,
    .next-step-options .matrix-action-call { background: #edf6ff; color: #285a83; border-color: #c7def1; }
    .matrix-action-email summary,
    .next-step-options .matrix-action-email { background: #f2effa; color: #604783; border-color: #d9d0ee; }
    .matrix-action-visit summary,
    .next-step-options .matrix-action-visit { background: #ecf7ef; color: #2d6944; border-color: #c1dfca; }
    .matrix-action-review summary,
    .next-step-options .matrix-action-review { background: #fff5de; color: #785917; border-color: #e7d08b; }
    .matrix-action-order summary,
    .next-step-options .matrix-action-order { background: #fcefe8; color: #844529; border-color: #ecc4af; }
    .matrix-action-follow summary,
    .next-step-options .matrix-action-follow { background: #edf5f2; color: #32685d; border-color: #c5ddd5; }
    .matrix-action-general summary,
    .next-step-options .matrix-action-general { background: #f3f2ed; color: #5c5c54; border-color: #ded8cc; }

    [data-theme="night"] {
      color-scheme: dark;
    }

    body.night-mode {
      /* Militia brand pass (2026-07-25): neutral near-blacks, no green tint */
      --ink: #f5f5f4;
      --muted: #a6a9ab;
      --line: #3a3b3d;
      --soft: #1a1a1b;
      --field: #232324;
      --panel: #1c1c1d;
      --green: #6cc28a;
      --gold: #f5f5f4;   /* monochrome decree */
      --blue: #75b7df;
      --red: #d4494e;
      --plum: #b79cdd;
      --shadow: 0 18px 48px rgba(0, 0, 0, .28);
      --notion-bg: #161617;
      --notion-panel: #1d1d1e;
      --notion-hover: #2a2a2b;
      --notion-line: #38383a;
      --notion-text: #f5f5f4;
      --notion-muted: #a6a9ab;
      background: radial-gradient(circle at top left, #222223, #161617 42%, #0e0e0f);
      color: var(--notion-text);
    }

    body.night-mode aside,
    body.night-mode main,
    body.night-mode .topbar,
    body.night-mode .focus-header,
    body.night-mode .section-head,
    body.night-mode .quick-modal-head,
    body.night-mode .profile-panel-head,
    body.night-mode .trial-focus-header {
      background: var(--notion-bg);
      color: var(--notion-text);
    }

    body.night-mode aside {
      border-right-color: var(--notion-line);
    }

    body.night-mode .brand h1,
    body.night-mode .workspace-head h2,
    body.night-mode h1,
    body.night-mode h2,
    body.night-mode h3 {
      color: var(--notion-text);
    }

    body.night-mode .panel,
    body.night-mode .kpi,
    body.night-mode .profile-card,
    body.night-mode .profile-glance-card,
    body.night-mode .profile-launch-card,
    body.night-mode .trial-ops-card,
    body.night-mode .rank-row,
    body.night-mode .rec,
    body.night-mode .gmail-card,
    body.night-mode .sales-summary-grid > div,
    body.night-mode .trial-read-field,
    body.night-mode .settings-section,
    body.night-mode .account-list-card,
    body.night-mode .quick-modal,
    body.night-mode .profile-panel-frame,
    body.night-mode .trial-focus-modal,
    body.night-mode .sales-import-hub,
    body.night-mode .account-request-workspace,
    body.night-mode .pending-account-row,
    body.night-mode .cold-lead-card {
      background: var(--notion-panel);
      border-color: var(--notion-line);
      color: var(--notion-text);
      box-shadow: none;
    }

    body.night-mode .nav-btn {
      color: var(--notion-muted);
    }

    body.night-mode .nav-btn:hover {
      background: var(--notion-hover);
      color: var(--notion-text);
    }

    body.night-mode .nav-btn.active {
      background: #182720;
      color: #e7f4e8;
      box-shadow: inset 3px 0 0 #6cc28a;
    }

    body.night-mode input,
    body.night-mode select,
    body.night-mode textarea,
    body.night-mode .vision-edit {
      background: #0f1815;
      border-color: var(--notion-line);
      color: var(--notion-text);
    }

    body.night-mode input::placeholder,
    body.night-mode textarea::placeholder {
      color: #76867d;
    }

    body.night-mode .button {
      background: #dce9d6;
      color: #122018;
    }

    body.night-mode .button.ghost,
    body.night-mode .ghost,
    body.night-mode .icon-button {
      background: #15201c;
      border-color: var(--notion-line);
      color: var(--notion-text);
    }

    body.night-mode .button.ghost:hover,
    body.night-mode .ghost:hover,
    body.night-mode .icon-button:hover,
    body.night-mode .profile-launch-card:hover {
      background: var(--notion-hover);
      border-color: #40574b;
    }

    body.night-mode th {
      background: #17231f;
      color: #afbeb6;
      border-color: var(--notion-line);
    }

    body.night-mode td {
      background: #101815;
      color: var(--notion-text);
      border-color: var(--notion-line);
    }

    body.night-mode tbody tr:hover td,
    body.night-mode .matrix-grid tr:hover td {
      background: #15211d;
    }

    body.night-mode .matrix-tabs,
    body.night-mode .accounts-view-switcher,
    body.night-mode .command-task-tabs,
    body.night-mode .calendar-period-bar .segmented,
    body.night-mode .sales-toolbar .segmented,
    body.night-mode .vision-mode,
    body.night-mode .cold-status-filters {
      background: #121c18;
      border-color: var(--notion-line);
    }

    body.night-mode .matrix-tab.active,
    body.night-mode .accounts-view-switcher button.active,
    body.night-mode .command-task-tabs button.active,
    body.night-mode .calendar-period-bar .segmented button.active,
    body.night-mode .sales-toolbar .segmented button.active,
    body.night-mode .vision-mode button.active {
      background: #1b2923;
      color: #e8f5e5;
    }

    body.night-mode .pill,
    body.night-mode .profile-exec-chips span,
    body.night-mode .sales-import-schema span,
    body.night-mode .account-approval-status-line {
      background: #1a2822;
      border-color: #30463b;
      color: #d8e8dd;
    }

    body.night-mode .matrix-stage-lead select,
    body.night-mode .matrix-stage-lead input,
    body.night-mode .matrix-stage-select.matrix-stage-lead { background: #122436; color: #b9ddff; border-color: #24516d; }
    body.night-mode .matrix-stage-evaluating select,
    body.night-mode .matrix-stage-evaluating input,
    body.night-mode .matrix-stage-select.matrix-stage-evaluating { background: #241d33; color: #d4c3f2; border-color: #4b3c69; }
    body.night-mode .matrix-stage-setup select,
    body.night-mode .matrix-stage-setup input,
    body.night-mode .matrix-stage-select.matrix-stage-setup { background: #302812; color: #f6d982; border-color: #66501d; }
    body.night-mode .matrix-stage-testing select,
    body.night-mode .matrix-stage-testing input,
    body.night-mode .matrix-stage-select.matrix-stage-testing { background: #132b1d; color: #a9e8ba; border-color: #2d6741; }
    body.night-mode .matrix-stage-awaiting select,
    body.night-mode .matrix-stage-awaiting input,
    body.night-mode .matrix-stage-select.matrix-stage-awaiting { background: #321d14; color: #f0b491; border-color: #734228; }
    body.night-mode .matrix-stage-commercial select,
    body.night-mode .matrix-stage-commercial input,
    body.night-mode .matrix-stage-select.matrix-stage-commercial { background: #142938; color: #b2ddf4; border-color: #2d5d77; }
    body.night-mode .matrix-stage-customer select,
    body.night-mode .matrix-stage-customer input,
    body.night-mode .matrix-stage-select.matrix-stage-customer { background: #102b1a; color: #b4edbf; border-color: #2b683c; }
    body.night-mode .matrix-stage-dormant select,
    body.night-mode .matrix-stage-dormant input,
    body.night-mode .matrix-stage-select.matrix-stage-dormant { background: #211f1d; color: #d1c6b9; border-color: #51483e; }

    body.night-mode .matrix-action-call summary,
    body.night-mode .next-step-options .matrix-action-call { background: #142638; color: #bddfff; border-color: #2c5476; }
    body.night-mode .matrix-action-email summary,
    body.night-mode .next-step-options .matrix-action-email { background: #221d32; color: #d7c6f4; border-color: #4c3f68; }
    body.night-mode .matrix-action-visit summary,
    body.night-mode .next-step-options .matrix-action-visit { background: #142c1e; color: #b8edc4; border-color: #326542; }
    body.night-mode .matrix-action-review summary,
    body.night-mode .next-step-options .matrix-action-review { background: #312812; color: #f4d983; border-color: #67511e; }
    body.night-mode .matrix-action-order summary,
    body.night-mode .next-step-options .matrix-action-order { background: #321d14; color: #efb79b; border-color: #70432d; }
    body.night-mode .matrix-action-follow summary,
    body.night-mode .next-step-options .matrix-action-follow { background: #142b27; color: #b2e5dc; border-color: #315f58; }
    body.night-mode .matrix-action-general summary,
    body.night-mode .next-step-options .matrix-action-general { background: #1c211d; color: #d5ded5; border-color: #38473d; }

    @media (max-width: 1050px) {
      .app {
        grid-template-columns: 1fr;
      }
      aside {
        background: #f7f6f1;
      }
      #appView > aside nav {
        display: flex;
        overflow-x: auto;
      }
      .sales-import-hub,
      .account-request-workspace {
        grid-template-columns: 1fr;
      }
      .command-work-board {
        grid-template-columns: 1fr;
      }
      .account-request-form,
      .account-request-rules,
      .account-approval-result {
        grid-template-columns: 1fr;
      }
      .account-approval-open {
        justify-self: start;
      }
    }

    @media (max-width: 720px) {
      .top-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }
      .workspace-head h2 {
        font-size: 24px;
      }
      .dossier-hero h2 {
        font-size: 28px;
      }
      .profile-top-summary,
      .profile-launch-grid,
      .profile-intelligence-bar,
      .profile-main-panel {
        max-width: none;
      }
    }

    /* Codex palette override */
    :root {
      --ink: #20242d;
      --muted: #687080;
      --line: #d8dee8;
      --soft: #f6f7fb;
      --field: #eef1f6;
      --panel: #ffffff;
      --green: #5b7cfa;
      --gold: #c58a28;
      --blue: #4f7cff;
      --red: #d85f67;
      --plum: #8b73d9;
      --shadow: 0 18px 46px rgba(22, 25, 34, .08);
      --notion-bg: #f6f7fb;
      --notion-panel: #ffffff;
      --notion-hover: #eceff6;
      --notion-line: #d8dee8;
      --notion-text: #20242d;
      --notion-muted: #687080;
      --accent: #5b7cfa;
      --accent-strong: #415ed9;
      --accent-soft: #eef2ff;
      --violet: #8b73d9;
      --violet-soft: #f3f0ff;
    }

    body {
      background: var(--notion-bg);
      color: var(--notion-text);
    }

    main,
    aside,
    .topbar,
    .focus-header,
    .section-head,
    .quick-modal-head,
    .profile-panel-head,
    .trial-focus-header {
      background: var(--notion-bg);
      color: var(--notion-text);
    }

    aside {
      border-right-color: var(--notion-line);
    }

    .brand .mark,
    .mark {
      border-color: #cfd6e6;
      background: linear-gradient(135deg, #20242d, #5b7cfa 62%, #8b73d9);
      color: #fff;
    }

    .brand h1,
    .workspace-head h2,
    h1,
    h2,
    h3 {
      color: var(--notion-text);
    }

    .brand p,
    .workspace-head p,
    .muted {
      color: var(--notion-muted);
    }

    .nav-btn {
      color: #616978;
    }

    .nav-btn:hover {
      background: var(--notion-hover);
      color: var(--notion-text);
    }

    .nav-btn.active {
      background: #e9ecf5;
      color: #20242d;
      box-shadow: inset 3px 0 0 var(--accent);
    }

    .nav-btn.active::before {
      color: var(--accent);
    }

    .panel,
    .kpi,
    .profile-card,
    .profile-glance-card,
    .profile-launch-card,
    .trial-ops-card,
    .rank-row,
    .rec,
    .gmail-card,
    .sales-summary-grid > div,
    .trial-read-field,
    .settings-section,
    .account-list-card,
    .quick-modal,
    .profile-panel-frame,
    .trial-focus-modal,
    .sales-import-hub,
    .account-request-workspace,
    .pending-account-row,
    .cold-lead-card,
    .executive-brief,
    .command-messages,
    .command-map-panel,
    .focus-panel,
    .command-task-strip {
      background: var(--notion-panel);
      border-color: var(--notion-line);
      color: var(--notion-text);
      box-shadow: none;
    }

    .executive-brief {
      border-left-color: var(--accent);
    }

    .executive-brief p {
      color: #343945;
    }

    .button {
      background: var(--accent);
      color: #222223;   /* gold CTAs carry the brand black, never white */
    }

    .button:hover {
      background: var(--accent-strong);
    }

    .button.ghost,
    .ghost,
    .icon-button {
      background: #ffffff;
      border-color: var(--notion-line);
      color: var(--notion-text);
    }

    .button.ghost:hover,
    .ghost:hover,
    .icon-button:hover {
      background: var(--notion-hover);
      border-color: #c6cfdf;
    }

    input,
    select,
    textarea,
    .vision-edit {
      background: #ffffff;
      border-color: var(--notion-line);
      color: var(--notion-text);
    }

    input:focus,
    select:focus,
    textarea:focus,
    .vision-edit:focus {
      border-color: var(--accent);
      box-shadow: 0 0 0 2px rgba(91, 124, 250, .14);
    }

    th {
      background: #eef1f6;
      color: #646d7c;
      border-color: var(--notion-line);
    }

    td {
      background: #ffffff;
      color: var(--notion-text);
      border-color: var(--notion-line);
    }

    tbody tr:hover td,
    .matrix-grid tr:hover td {
      background: #f4f6fb;
    }

    .matrix-tabs,
    .accounts-view-switcher,
    .command-task-tabs,
    .calendar-period-bar .segmented,
    .sales-toolbar .segmented,
    .vision-mode,
    .cold-status-filters {
      background: #edf0f6;
      border-color: var(--notion-line);
    }

    .matrix-tab.active,
    .accounts-view-switcher button.active,
    .command-task-tabs button.active,
    .calendar-period-bar .segmented button.active,
    .sales-toolbar .segmented button.active,
    .vision-mode button.active {
      background: #ffffff;
      color: var(--notion-text);
      box-shadow: none;
    }

    .sales-import-hub,
    .account-request-workspace,
    .account-approval-result {
      background: #f7f8fc;
    }

    .sales-import-actions code,
    .account-request-rules div,
    .account-request-row,
    .account-approval-modal {
      background: #ffffff;
      border-color: var(--notion-line);
      color: var(--notion-text);
    }

    .sales-import-schema span,
    .account-approval-status-line,
    .pill {
      background: var(--accent-soft);
      border-color: #dbe3ff;
      color: #3f54bf;
    }

    .account-approval-toolbar-button,
    .account-approval-badge.open {
      background: var(--accent-soft);
      border-color: #dbe3ff;
      color: #3f54bf;
    }

    .account-approval-badge.taken {
      background: #fff6df;
      border-color: #ead392;
      color: #7b5a12;
    }

    .account-approval-badge.suggested {
      background: #f1f3f8;
      border-color: #d8dee8;
      color: #545d6c;
    }

    .theme-toggle-active,
    body.night-mode #themeToggleBtn {
      background: #20242d;
      border-color: #343a47;
      color: #ffffff;
    }

    .pin.proven,
    .google-status-marker.proven,
    .map-swatch.proven {
      /* SEMANTIC, not brand: proven/customer stays GREEN (Josh's 2026-07-24
         decree — "only green ones should be customers"), decoupled from the
         gold brand accent */
      background: var(--green);
    }

    .review-match,
    .observation-summary {
      border-left-color: var(--accent);
      background: #f6f8ff;
    }

    .matrix-stage-lead td:first-child { border-left-color: #91a4c7; }
    .matrix-stage-evaluating td:first-child { border-left-color: #8b73d9; }
    .matrix-stage-setup td:first-child { border-left-color: #d39d33; }
    .matrix-stage-testing td:first-child { border-left-color: #4f7cff; }
    .matrix-stage-awaiting td:first-child { border-left-color: #d66d4d; }
    .matrix-stage-commercial td:first-child { border-left-color: #6b7cff; }
    .matrix-stage-customer td:first-child { border-left-color: #59647a; }
    .matrix-stage-dormant td:first-child { border-left-color: #9aa1af; }

    .matrix-stage-lead select,
    .matrix-stage-lead input,
    .matrix-stage-select.matrix-stage-lead { background: #f1f4f9; color: #46546a; border-color: #ccd5e4; }
    .matrix-stage-evaluating select,
    .matrix-stage-evaluating input,
    .matrix-stage-select.matrix-stage-evaluating { background: #f3f0ff; color: #6650b8; border-color: #ddd5ff; }
    .matrix-stage-setup select,
    .matrix-stage-setup input,
    .matrix-stage-select.matrix-stage-setup { background: #fff7df; color: #745718; border-color: #e8d396; }
    .matrix-stage-testing select,
    .matrix-stage-testing input,
    .matrix-stage-select.matrix-stage-testing { background: #edf3ff; color: #3f54bf; border-color: #d3ddff; }
    .matrix-stage-awaiting select,
    .matrix-stage-awaiting input,
    .matrix-stage-select.matrix-stage-awaiting { background: #fff0e8; color: #8a4626; border-color: #efc4ae; }
    .matrix-stage-commercial select,
    .matrix-stage-commercial input,
    .matrix-stage-select.matrix-stage-commercial { background: #eef0ff; color: #4f58b8; border-color: #d6dbff; }
    .matrix-stage-customer select,
    .matrix-stage-customer input,
    .matrix-stage-select.matrix-stage-customer { background: #eef1f6; color: #485064; border-color: #d2d9e5; }
    .matrix-stage-dormant select,
    .matrix-stage-dormant input,
    .matrix-stage-select.matrix-stage-dormant { background: #f2f3f6; color: #606776; border-color: #d9dee7; }

    .matrix-action-call summary,
    .next-step-options .matrix-action-call { background: #edf3ff; color: #3f54bf; border-color: #d3ddff; }
    .matrix-action-email summary,
    .next-step-options .matrix-action-email { background: #f3f0ff; color: #6650b8; border-color: #ddd5ff; }
    .matrix-action-visit summary,
    .next-step-options .matrix-action-visit { background: #eff6ff; color: #315c92; border-color: #cadcf4; }
    .matrix-action-review summary,
    .next-step-options .matrix-action-review { background: #fff7df; color: #745718; border-color: #e8d396; }
    .matrix-action-order summary,
    .next-step-options .matrix-action-order { background: #fff0e8; color: #8a4626; border-color: #efc4ae; }
    .matrix-action-follow summary,
    .next-step-options .matrix-action-follow { background: #f1f4f9; color: #46546a; border-color: #ccd5e4; }
    .matrix-action-general summary,
    .next-step-options .matrix-action-general { background: #f2f3f6; color: #606776; border-color: #d9dee7; }

    body.night-mode {
      --ink: #f4f6fb;
      --muted: #a6adbb;
      --line: #2a3040;
      --soft: #151821;
      --field: #191d28;
      --panel: #151821;
      --green: #8aa2ff;
      --gold: #e0b85b;
      --blue: #8aa2ff;
      --red: #ee8b92;
      --plum: #b49cff;
      --shadow: 0 18px 48px rgba(0, 0, 0, .34);
      --notion-bg: #0f1117;
      --notion-panel: #151821;
      --notion-hover: #202433;
      --notion-line: #2a3040;
      --notion-text: #f4f6fb;
      --notion-muted: #a6adbb;
      --accent: #8aa2ff;
      --accent-strong: #a5b6ff;
      --accent-soft: #1d2439;
      --violet: #b49cff;
      --violet-soft: #251f38;
      background: radial-gradient(circle at top left, #1a2031, #0f1117 46%, #0a0c11);
      color: var(--notion-text);
    }

    body.night-mode aside,
    body.night-mode main,
    body.night-mode .topbar,
    body.night-mode .focus-header,
    body.night-mode .section-head,
    body.night-mode .quick-modal-head,
    body.night-mode .profile-panel-head,
    body.night-mode .trial-focus-header {
      background: var(--notion-bg);
      color: var(--notion-text);
    }

    body.night-mode .brand .mark,
    body.night-mode .mark {
      border-color: #343a47;
      background: linear-gradient(135deg, #f4f6fb, #8aa2ff 58%, #b49cff);
      color: #0f1117;
    }

    body.night-mode .nav-btn {
      color: var(--notion-muted);
    }

    body.night-mode .nav-btn:hover {
      background: var(--notion-hover);
      color: var(--notion-text);
    }

    body.night-mode .nav-btn.active {
      background: #1b2131;
      color: #f4f6fb;
      box-shadow: inset 3px 0 0 var(--accent);
    }

    body.night-mode .panel,
    body.night-mode .kpi,
    body.night-mode .profile-card,
    body.night-mode .profile-glance-card,
    body.night-mode .profile-launch-card,
    body.night-mode .trial-ops-card,
    body.night-mode .rank-row,
    body.night-mode .rec,
    body.night-mode .gmail-card,
    body.night-mode .sales-summary-grid > div,
    body.night-mode .trial-read-field,
    body.night-mode .settings-section,
    body.night-mode .account-list-card,
    body.night-mode .quick-modal,
    body.night-mode .profile-panel-frame,
    body.night-mode .trial-focus-modal,
    body.night-mode .sales-import-hub,
    body.night-mode .account-request-workspace,
    body.night-mode .pending-account-row,
    body.night-mode .cold-lead-card,
    body.night-mode .executive-brief,
    body.night-mode .command-messages,
    body.night-mode .command-map-panel,
    body.night-mode .focus-panel,
    body.night-mode .command-task-strip,
    body.night-mode .command-work-log-card {
      background: var(--notion-panel);
      border-color: var(--notion-line);
      color: var(--notion-text);
      box-shadow: none;
    }

    body.night-mode .command-log-stat {
      background: #151821;
      border-color: #2a3040;
      color: #f4f6fb;
    }

    body.night-mode .command-goal-ring {
      background: conic-gradient(#8aa2ff var(--goal-progress, 0%), #2a3040 0);
    }

    body.night-mode .command-goal-ring::after {
      background: #151821;
    }

    body.night-mode .executive-brief p {
      color: #d9deea;
    }

    body.night-mode input,
    body.night-mode select,
    body.night-mode textarea,
    body.night-mode .vision-edit {
      background: #11141c;
      border-color: var(--notion-line);
      color: var(--notion-text);
    }

    body.night-mode input::placeholder,
    body.night-mode textarea::placeholder {
      color: #777f90;
    }

    body.night-mode .button {
      background: var(--accent);
      color: #0f1117;
    }

    body.night-mode .button:hover {
      background: var(--accent-strong);
    }

    body.night-mode .button.ghost,
    body.night-mode .ghost,
    body.night-mode .icon-button {
      background: #181c27;
      border-color: var(--notion-line);
      color: var(--notion-text);
    }

    body.night-mode .button.ghost:hover,
    body.night-mode .ghost:hover,
    body.night-mode .icon-button:hover,
    body.night-mode .profile-launch-card:hover {
      background: var(--notion-hover);
      border-color: #3b4356;
    }

    body.night-mode th {
      background: #181c27;
      color: #a6adbb;
      border-color: var(--notion-line);
    }

    body.night-mode td {
      background: #151821;
      color: var(--notion-text);
      border-color: var(--notion-line);
    }

    body.night-mode tbody tr:hover td,
    body.night-mode .matrix-grid tr:hover td {
      background: #1a1f2b;
    }

    body.night-mode .matrix-tabs,
    body.night-mode .accounts-view-switcher,
    body.night-mode .command-task-tabs,
    body.night-mode .calendar-period-bar .segmented,
    body.night-mode .sales-toolbar .segmented,
    body.night-mode .vision-mode,
    body.night-mode .cold-status-filters {
      background: #11141c;
      border-color: var(--notion-line);
    }

    body.night-mode .matrix-tab.active,
    body.night-mode .accounts-view-switcher button.active,
    body.night-mode .command-task-tabs button.active,
    body.night-mode .calendar-period-bar .segmented button.active,
    body.night-mode .sales-toolbar .segmented button.active,
    body.night-mode .vision-mode button.active {
      background: #202433;
      color: var(--notion-text);
    }

    body.night-mode .sales-import-schema span,
    body.night-mode .account-approval-status-line,
    body.night-mode .pill {
      background: #1d2439;
      border-color: #303a5c;
      color: #c6d0ff;
    }

    body.night-mode .trial-summary-strip,
    body.night-mode .experiments-secondary,
    body.night-mode .experiments-checks,
    body.night-mode .cross-trial-compact,
    body.night-mode .command-message-drawer {
      background: var(--notion-panel);
      border-color: var(--notion-line);
      color: var(--notion-text);
    }

    body.night-mode .trial-progress {
      background: #252b38;
    }

    body.night-mode .trial-progress span {
      background: var(--accent);
    }

    body.night-mode .trial-card-note strong,
    body.night-mode .trial-card-note .trial-risk {
      color: #f0b491;
    }

    body.night-mode .account-approval-toolbar-button,
    body.night-mode .account-approval-badge.open {
      background: #1d2439;
      border-color: #303a5c;
      color: #c6d0ff;
    }

    body.night-mode .account-approval-badge.taken {
      background: #312812;
      border-color: #67511e;
      color: #f4d983;
    }

    body.night-mode .account-approval-badge.suggested {
      background: #1a1f2b;
      border-color: #343a47;
      color: #c8ceda;
    }

    body.night-mode .review-match,
    body.night-mode .observation-summary {
      background: #171d2d;
      border-left-color: var(--accent);
    }

    body.night-mode .matrix-stage-lead select,
    body.night-mode .matrix-stage-lead input,
    body.night-mode .matrix-stage-select.matrix-stage-lead { background: #1a2230; color: #c2cce0; border-color: #364157; }
    body.night-mode .matrix-stage-evaluating select,
    body.night-mode .matrix-stage-evaluating input,
    body.night-mode .matrix-stage-select.matrix-stage-evaluating { background: #251f38; color: #dbcfff; border-color: #4d426d; }
    body.night-mode .matrix-stage-setup select,
    body.night-mode .matrix-stage-setup input,
    body.night-mode .matrix-stage-select.matrix-stage-setup { background: #302812; color: #f6d982; border-color: #66501d; }
    body.night-mode .matrix-stage-testing select,
    body.night-mode .matrix-stage-testing input,
    body.night-mode .matrix-stage-select.matrix-stage-testing { background: #1d2439; color: #c6d0ff; border-color: #303a5c; }
    body.night-mode .matrix-stage-awaiting select,
    body.night-mode .matrix-stage-awaiting input,
    body.night-mode .matrix-stage-select.matrix-stage-awaiting { background: #321d14; color: #f0b491; border-color: #734228; }
    body.night-mode .matrix-stage-commercial select,
    body.night-mode .matrix-stage-commercial input,
    body.night-mode .matrix-stage-select.matrix-stage-commercial { background: #20223c; color: #c7ccff; border-color: #434875; }
    body.night-mode .matrix-stage-customer select,
    body.night-mode .matrix-stage-customer input,
    body.night-mode .matrix-stage-select.matrix-stage-customer { background: #202433; color: #d6dce9; border-color: #3b4356; }
    body.night-mode .matrix-stage-dormant select,
    body.night-mode .matrix-stage-dormant input,
    body.night-mode .matrix-stage-select.matrix-stage-dormant { background: #1a1d25; color: #b9c0ce; border-color: #363c49; }

    body.night-mode .matrix-action-call summary,
    body.night-mode .next-step-options .matrix-action-call { background: #1d2439; color: #c6d0ff; border-color: #303a5c; }
    body.night-mode .matrix-action-email summary,
    body.night-mode .next-step-options .matrix-action-email { background: #251f38; color: #dbcfff; border-color: #4d426d; }
    body.night-mode .matrix-action-visit summary,
    body.night-mode .next-step-options .matrix-action-visit { background: #17243a; color: #bdd4ff; border-color: #324b75; }
    body.night-mode .matrix-action-review summary,
    body.night-mode .next-step-options .matrix-action-review { background: #312812; color: #f4d983; border-color: #67511e; }
    body.night-mode .matrix-action-order summary,
    body.night-mode .next-step-options .matrix-action-order { background: #321d14; color: #efb79b; border-color: #70432d; }
    body.night-mode .matrix-action-follow summary,
    body.night-mode .next-step-options .matrix-action-follow { background: #1a2230; color: #c2cce0; border-color: #364157; }
    body.night-mode .matrix-action-general summary,
    body.night-mode .next-step-options .matrix-action-general { background: #1a1d25; color: #b9c0ce; border-color: #363c49; }

    body.night-mode .calendar-row,
    body.night-mode .calendar-visual,
    body.night-mode .calendar-weekdays span,
    body.night-mode .calendar-day,
    body.night-mode .calendar-time-rail,
    body.night-mode .calendar-time-rail span,
    body.night-mode .calendar-month-tile,
    body.night-mode .calendar-row > button,
    body.night-mode .calendar-row > .calendar-entry,
    body.night-mode .calendar-row-action > a,
    body.night-mode .calendar-row-action > button,
    body.night-mode .calendar-setup code {
      background: var(--notion-panel);
      border-color: var(--notion-line);
      color: var(--notion-text);
    }

    body.night-mode .calendar-row > button:hover,
    body.night-mode .calendar-row > .calendar-entry:hover {
      background: var(--notion-hover);
    }

    body.night-mode .calendar-weekdays span,
    body.night-mode .calendar-time-rail {
      background: #11141c;
    }

    body.night-mode .calendar-day.outside {
      background: #11141c;
      color: #777f90;
    }

    body.night-mode .calendar-day.today {
      box-shadow: inset 0 0 0 2px var(--accent);
    }

    body.night-mode .calendar-day-surface {
      background: repeating-linear-gradient(to bottom, #151821 0, #151821 39px, #242a38 40px);
    }

    body.night-mode .calendar-year-grid {
      background: var(--notion-line);
    }

    body.night-mode .calendar-event-chip {
      background: #1d2439;
      border-left-color: var(--accent);
      color: #c6d0ff;
    }

    body.night-mode .calendar-event-chip.event-meeting {
      background: #251f38;
      border-left-color: #b49cff;
      color: #dbcfff;
    }

    body.night-mode .calendar-event-chip.event-experiment {
      background: #312812;
      border-left-color: #e0b85b;
      color: #f4d983;
    }

    body.night-mode .calendar-event-chip.event-attention {
      background: #361d25;
      border-left-color: #ee8b92;
      color: #ffc3c8;
    }

    body.night-mode .calendar-row.event-google-calendar {
      border-left-color: #8aa2ff;
    }

    body.night-mode .calendar-connected::before {
      background: #8aa2ff;
    }

    body.night-mode .calendar-connected {
      color: #c6d0ff;
    }

    .profile-inline-panel {
      width: min(980px, 100%);
      margin-top: 12px;
      border-radius: 10px;
      box-shadow: none;
    }

    .profile-inline-panel .profile-panel-body {
      max-height: none;
      overflow: visible;
    }

    body.night-mode .map-wrap {
      background: #0f1117;
      border-color: var(--notion-line);
      box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04);
    }

    body.night-mode .map-wrap::before {
      background: linear-gradient(180deg, rgba(15, 17, 23, .18), rgba(15, 17, 23, .48));
      mix-blend-mode: normal;
    }

    body.night-mode .tile-grid img {
      filter: grayscale(1) invert(.88) hue-rotate(180deg) brightness(.58) contrast(1.08);
      opacity: .72;
    }

    body.night-mode .map-fallback {
      opacity: .68;
    }

    body.night-mode .land {
      fill: #1a1f2b;
      stroke: #303746;
    }

    body.night-mode .water-line {
      stroke: rgba(138, 162, 255, .16);
    }

    body.night-mode .map-controls button,
    body.night-mode .map-filter-toggle,
    body.night-mode .map-filter-bar label,
    body.night-mode .map-legend,
    body.night-mode .map-region-chip,
    body.night-mode .map-card,
    body.night-mode .map-attribution,
    body.night-mode .map-empty {
      background: rgba(24, 28, 39, .92);
      border-color: #343a47;
      color: #d6dce9;
      box-shadow: none;
    }

    body.night-mode .pin {
      border-color: #d6dce9;
      box-shadow: 0 12px 26px rgba(0, 0, 0, .34), 0 0 0 8px rgba(138, 162, 255, .12);
    }

    body.night-mode .pin::after {
      background: #181c27;
      border-color: #343a47;
      color: #f4f6fb;
    }

    body.night-mode .pin.proven,
    body.night-mode .google-status-marker.proven,
    body.night-mode .map-swatch.proven {
      background: #8aa2ff;
    }

    body.night-mode .pin.discussion,
    body.night-mode .google-status-marker.discussion,
    body.night-mode .map-swatch.discussion,
    body.night-mode .pin.trial,
    body.night-mode .google-status-marker.trial,
    body.night-mode .map-swatch.trial,
    body.night-mode .pin.prospect,
    body.night-mode .google-status-marker.prospect,
    body.night-mode .map-swatch.prospect {
      background: #6f7789;
    }

    body.night-mode .pin.dormant,
    body.night-mode .map-swatch.dormant {
      background: #4d5362;
    }

    body.night-mode .map-swatch {
      border-color: #d6dce9;
      box-shadow: 0 0 0 1px rgba(255, 255, 255, .08);
    }

    body.night-mode .matrix-stage-lead select,
    body.night-mode .matrix-stage-lead input,
    body.night-mode .matrix-stage-evaluating select,
    body.night-mode .matrix-stage-evaluating input,
    body.night-mode .matrix-stage-setup select,
    body.night-mode .matrix-stage-setup input,
    body.night-mode .matrix-stage-testing select,
    body.night-mode .matrix-stage-testing input,
    body.night-mode .matrix-stage-awaiting select,
    body.night-mode .matrix-stage-awaiting input,
    body.night-mode .matrix-stage-commercial select,
    body.night-mode .matrix-stage-commercial input,
    body.night-mode .matrix-stage-customer select,
    body.night-mode .matrix-stage-customer input,
    body.night-mode .matrix-stage-dormant select,
    body.night-mode .matrix-stage-dormant input,
    body.night-mode .matrix-stage-select,
    body.night-mode .next-step-options label,
    body.night-mode .matrix-multi-picker summary {
      background: #1a1f2b;
      border-color: #343a47;
      color: #d6dce9;
    }

    body.night-mode .matrix-action-call summary,
    body.night-mode .matrix-action-email summary,
    body.night-mode .matrix-action-visit summary,
    body.night-mode .matrix-action-review summary,
    body.night-mode .matrix-action-order summary,
    body.night-mode .matrix-action-follow summary,
    body.night-mode .matrix-action-general summary,
    body.night-mode .next-step-options .matrix-action-call,
    body.night-mode .next-step-options .matrix-action-email,
    body.night-mode .next-step-options .matrix-action-visit,
    body.night-mode .next-step-options .matrix-action-review,
    body.night-mode .next-step-options .matrix-action-order,
    body.night-mode .next-step-options .matrix-action-follow,
    body.night-mode .next-step-options .matrix-action-general {
      background: #1a1f2b;
      border-color: #343a47;
      color: #d6dce9;
    }

    body.night-mode .matrix-stage td:first-child,
    body.night-mode .matrix-stage-lead td:first-child,
    body.night-mode .matrix-stage-evaluating td:first-child,
    body.night-mode .matrix-stage-setup td:first-child,
    body.night-mode .matrix-stage-testing td:first-child,
    body.night-mode .matrix-stage-awaiting td:first-child,
    body.night-mode .matrix-stage-commercial td:first-child,
    body.night-mode .matrix-stage-customer td:first-child,
    body.night-mode .matrix-stage-dormant td:first-child {
      border-left-color: #59647a;
    }

    body.night-mode .icon-button.active,
    body.night-mode .matrix-row-icon,
    body.night-mode .matrix-tool-menu summary,
    body.night-mode .quick-call-menu summary,
    body.night-mode .filter-summary {
      background: #181c27;
      border-color: #343a47;
      color: #d6dce9;
    }

    body.night-mode .icon-button.active {
      box-shadow: inset 0 0 0 1px #59647a;
    }

    body.night-mode .trial-focus-modal {
      background: #0f1117;
      border-color: #2a3040;
      color: #f4f6fb;
    }

    body.night-mode .trial-focus-header,
    body.night-mode .trial-focus-progress,
    body.night-mode .trial-focus-section,
    body.night-mode .trial-focus-actions {
      background: #151821;
      border-color: #2a3040;
      color: #f4f6fb;
    }

    body.night-mode .trial-read-view,
    body.night-mode .trial-focus-modal .form-actions {
      background: #0f1117;
      color: #f4f6fb;
    }

    body.night-mode .trial-focus-modal .brief-card,
    body.night-mode .trial-read-field,
    body.night-mode .trial-evidence-item,
    body.night-mode .trial-inline-composer,
    body.night-mode .missing-focus,
    body.night-mode .trial-focus-modal .empty-state {
      background: #151821;
      border-color: #2a3040;
      color: #f4f6fb;
      box-shadow: none;
    }

    body.night-mode .experiment-db-wrap,
    body.night-mode .experiment-db-toolbar input,
    body.night-mode .experiment-db-toolbar select,
    body.night-mode .experiment-db-table th,
    body.night-mode .trial-detail-status-row,
    body.night-mode .trial-detail-brief-bar,
    body.night-mode .trial-detail-brief-bar div,
    body.night-mode .trial-detail-tabs,
    body.night-mode .experiment-view-card,
    body.night-mode .experiment-filter-drawer summary,
    body.night-mode .experiment-filter-grid,
    body.night-mode .trial-detail-meta > span:not(.trial-status-pill),
    body.night-mode .trial-dossier-section,
    body.night-mode .trial-secondary-details,
    body.night-mode .trial-danger-zone .row-actions,
    body.night-mode .trial-linked-actions,
    body.night-mode .trial-report-actions,
    body.night-mode .trial-timeline-item,
    body.night-mode .trial-note-list p {
      background: #151821;
      border-color: #2a3040;
      color: #f4f6fb;
    }

    body.night-mode .experiment-db-table td,
    body.night-mode .experiment-db-table th {
      border-color: #2a3040;
    }

    body.night-mode .experiment-db-row:hover,
    body.night-mode .experiment-view-card:hover,
    body.night-mode .experiment-view-card.active,
    body.night-mode .trial-detail-tabs button.active,
    body.night-mode .trial-detail-tabs button:hover,
    body.night-mode .experiment-group-row td {
      background: #1b202b;
      color: #f4f6fb;
      border-color: #343b4d;
    }

    body.night-mode .trial-detail-body {
      background: #0f1117;
    }

    body.night-mode .trial-detail-composer {
      background: #0f1117;
    }

    body.night-mode .trial-focus-modal input,
    body.night-mode .trial-focus-modal select,
    body.night-mode .trial-focus-modal textarea,
    body.night-mode .input-suffix span {
      background: #1a1f2b;
      border-color: #343a47;
      color: #d6dce9;
    }

    body.night-mode .trial-inline-composer textarea {
      background: transparent;
      border-color: transparent;
      color: #f4f6fb;
    }

    body.night-mode .trial-composer-plus {
      background: #1a1f2b;
      border-color: #343a47;
      color: #aab2c1;
    }

    body.night-mode .trial-composer-send {
      background: #8aa2ff;
      color: #0f1117;
    }

    body.night-mode .trial-composer-file {
      background: #1a1f2b;
      border-color: #343a47;
      color: #d6dce9;
    }

    body.night-mode .trial-progress {
      background: #202433;
    }

    body.night-mode .trial-progress span {
      background: #8aa2ff;
    }

    body.night-mode .missing-chip-list span {
      background: #241f14;
      border-color: #5a4826;
      color: #f4d983;
    }

    body.night-mode .trial-focus-modal .muted,
    body.night-mode .trial-read-field span,
    body.night-mode .trial-evidence-item small {
      color: #aab2c1;
    }

    body.night-mode .command-summary-row > .command-task-strip.embedded,
    body.night-mode .command-work-board > .command-task-strip.embedded,
    body.night-mode .command-agenda-main,
    body.night-mode .message-alert-button,
    body.night-mode .command-message-drawer {
      background: #151821;
      border-color: #2a3040;
      color: #f4f6fb;
      box-shadow: none;
    }

    body.night-mode .message-alert-icon {
      background: #8aa2ff;
      color: #0f1117;
    }

    body.night-mode .message-alert-count {
      background: #ee8b92;
      color: #1a0f12;
    }

    body.night-mode .bulk-file-list span,
    body.night-mode .bulk-result-row {
      background: #151821;
      border-color: #2a3040;
      color: #f4f6fb;
    }

    body.night-mode .bulk-result-row:hover {
      background: #1b2030;
      border-color: #485061;
    }

    body.night-mode .trial-summary-strip,
    body.night-mode .trial-ops-card,
    body.night-mode .trial-ops-card .pill,
    body.night-mode .trial-card-nav button,
    body.night-mode .experiments-secondary,
    body.night-mode .experiments-checks,
    body.night-mode .cross-trial-compact {
      background: #151821;
      border-color: #2a3040;
      color: #f4f6fb;
      box-shadow: none;
    }

    body.night-mode .trial-card-score,
    body.night-mode .trial-card-note,
    body.night-mode .trial-next-action {
      color: #aab2c1;
    }

    body.night-mode .trial-card-note strong {
      color: #d6dce9;
    }

    body.night-mode .trial-card-note .trial-risk {
      color: #f0b491;
      background: transparent;
    }

    body.night-mode .cold-stat,
    body.night-mode .cold-filter-chip,
    body.night-mode .cold-column-menu summary,
    body.night-mode .cold-column-popover,
    body.night-mode .cold-column-row,
    body.night-mode .cold-list-tabs .matrix-tab {
      background: #151821;
      border-color: #2a3040;
      color: #f4f6fb;
      box-shadow: none;
    }

    body.night-mode .cold-filter-chip strong,
    body.night-mode .cold-goal,
    body.night-mode .cold-call-meta {
      color: #aab2c1;
    }

    body.night-mode .cold-filter-chip.active,
    body.night-mode .cold-list-tabs .matrix-tab.active {
      background: #202433;
      border-color: #3b4356;
      color: #f4f6fb;
    }

    body.night-mode .cold-table tr.cold-status-interested td {
      background: #17251f;
    }

    body.night-mode .cold-table tr.cold-status-needs-info td {
      background: #241f14;
    }

    body.night-mode .cold-table tr.cold-status-not-interested td {
      background: #26191d;
    }

    body.night-mode .cold-table tr.cold-status-no-answer td,
    body.night-mode .cold-table tr.cold-status-left-voicemail td,
    body.night-mode .cold-table tr.cold-status-neutral td {
      background: #151821;
    }

    body.night-mode .cold-table tr.cold-status-trial td {
      background: #172033;
    }

    body.night-mode .cold-table tr[class*="cold-status-"] input,
    body.night-mode .cold-table tr[class*="cold-status-"] select,
    body.night-mode .cold-table tr[class*="cold-status-"] textarea {
      background: #0f1117;
      border-color: #343a47;
      color: #f4f6fb;
    }

    body.night-mode .cold-table tr[class*="cold-status-"] input::placeholder,
    body.night-mode .cold-table tr[class*="cold-status-"] textarea::placeholder {
      color: #777f90;
    }

    body.night-mode #appView aside .brand .shell-actions {
      background: rgba(21, 24, 33, .9);
      border-color: #2d323d;
      box-shadow: 0 8px 24px rgba(0, 0, 0, .22);
    }

    /* Shell controls live with the PFV brand so page content starts higher. */
    #appView aside .brand {
      grid-template-columns: 48px minmax(0, 1fr) auto;
      align-items: center;
      gap: 12px;
    }

    #appView aside .brand .shell-actions {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 6px;
      flex-wrap: nowrap;
      position: fixed;
      top: 14px;
      right: 18px;
      z-index: 60;
    }

    #appView aside .brand .app-control {
      width: auto;
      min-width: 0;
      min-height: 30px;
      flex: 0 0 auto;
      white-space: nowrap;
    }

    #appView main > .topbar {
      display: none !important;
      min-height: 0 !important;
      height: 0 !important;
      margin: 0 !important;
      padding: 0 !important;
      border: 0 !important;
    }

    /* Keep global app controls compact on small screens. */
    @media (max-width: 720px) {
      #appView aside .brand {
        grid-template-columns: 36px minmax(130px, 1fr) auto;
        gap: 8px;
      }

      #appView aside .brand h1,
      #appView aside .brand p {
        max-width: calc(100vw - 230px);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      #appView aside .brand .top-actions {
        display: flex;
        width: auto;
        gap: 6px;
        flex-wrap: nowrap;
        justify-content: flex-end;
      }

      #appView aside .brand .app-control,
      #appView aside .brand .button,
      #appView aside .brand .icon-button,
      #logoutBtn {
        width: auto;
        min-width: 0;
        min-height: 32px;
        flex: 0 0 auto;
        padding: 5px 8px;
        font-size: 12px;
        line-height: 1.1;
      }
    }

    /* Final night-mode cleanup: neutral panels, green actions, readable maps/sales/experiments. */
    body.night-mode {
      --line: #2d323d;
      --soft: #151821;
      --field: #191d26;
      --panel: #151821;
      --green: #6fbd86;
      --blue: #83a9d9;
      --plum: #6fbd86;
      --notion-bg: #0f1117;
      --notion-panel: #151821;
      --notion-hover: #202433;
      --notion-line: #2d323d;
      --notion-text: #f4f6fb;
      --notion-muted: #a6adbb;
      --accent: #6fbd86;
      --accent-strong: #86d89b;
      --accent-soft: #202433;
      background: radial-gradient(circle at top left, #171b23, #0f1117 46%, #0a0c11);
    }

    body.night-mode .button,
    body.night-mode .button:hover,
    body.night-mode .account-approval-toolbar-button,
    body.night-mode .account-approval-badge.open,
    body.night-mode .sales-toolbar .segmented button.active,
    body.night-mode .matrix-tab.active,
    body.night-mode .accounts-view-switcher button.active,
    body.night-mode .command-task-tabs button.active,
    body.night-mode .calendar-period-bar .segmented button.active,
    body.night-mode .vision-mode button.active {
      background: #6fbd86;
      border-color: #6fbd86;
      color: #0f1411;
      box-shadow: none;
    }

    body.night-mode .button.ghost,
    body.night-mode .ghost,
    body.night-mode .icon-button,
    body.night-mode .sales-row-actions a,
    body.night-mode .sales-row-actions button,
    body.night-mode .trial-card-nav button,
    body.night-mode .map-controls button,
    body.night-mode .map-filter-toggle {
      background: #1a1f2b;
      border-color: #343a47;
      color: #f4f6fb;
    }

    body.night-mode .button.ghost:hover,
    body.night-mode .ghost:hover,
    body.night-mode .icon-button:hover,
    body.night-mode .sales-row-actions a:hover,
    body.night-mode .sales-row-actions button:hover {
      background: #202633;
      border-color: #465063;
      color: #ffffff;
    }

    body.night-mode .panel,
    body.night-mode .metric-card,
    body.night-mode .kpi,
    body.night-mode .rec,
    body.night-mode .sales-workspace,
    body.night-mode .sales-summary-grid > div,
    body.night-mode .sales-import-hub,
    body.night-mode .order-sales div,
    body.night-mode .settings-status div,
    body.night-mode .trial-summary-strip,
    body.night-mode .trial-ops-card,
    body.night-mode .experiments-secondary,
    body.night-mode .experiments-checks,
    body.night-mode .cross-trial-compact,
    body.night-mode .experiment-view-card,
    body.night-mode .experiment-filter-grid,
    body.night-mode .trial-read-field,
    body.night-mode .trial-detail-status-row,
    body.night-mode .trial-detail-tabs,
    body.night-mode .trial-detail-body {
      background: #151821;
      border-color: #2d323d;
      color: #f4f6fb;
      box-shadow: none;
    }

    body.night-mode .order-preview,
    body.night-mode .order-account-suggestion {
      background: #11141c;
      border-color: #2d323d;
      color: #f4f6fb;
      box-shadow: none;
    }

    body.night-mode .order-preview-sheet > img:not(.order-template-logo) {
      filter: invert(.92) hue-rotate(180deg) saturate(.7) brightness(.78) contrast(1.05);
      background: #11141c;
    }

    body.night-mode .order-preview-sheet > .order-template-logo {
      border-radius: 4px;
      background: #ffffff;
      filter: none;
    }

    body.night-mode .order-account-suggestion:hover,
    body.night-mode .order-account-suggestion:focus {
      background: #202433;
      border-color: #6fbd86;
    }

    body.night-mode .order-account-suggestion span {
      color: #a6adbb;
    }

    body.night-mode .section-head,
    body.night-mode .focus-header,
    body.night-mode .trial-focus-header,
    body.night-mode .profile-panel-head {
      background: #11141c;
      border-color: #2d323d;
      color: #f4f6fb;
    }

    body.night-mode .pill,
    body.night-mode .entity-pill,
    body.night-mode .matrix-tag,
    body.night-mode .sales-import-schema span,
    body.night-mode .account-approval-status-line,
    body.night-mode .trial-ops-card .pill {
      background: #202433;
      border-color: #343a47;
      color: #d6dce9;
    }

    body.night-mode .map-wrap {
      background: #111827;
      border-color: #2d323d;
      box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04);
    }

    body.night-mode .map-wrap::before {
      background: linear-gradient(180deg, rgba(15, 17, 23, .08), rgba(15, 17, 23, .3));
      mix-blend-mode: normal;
    }

    body.night-mode .tile-grid img {
      filter: invert(.88) hue-rotate(180deg) saturate(.6) brightness(.68) contrast(1.08);
    }

    body.night-mode .land { fill: #2f3743; stroke: #4a5362; }
    body.night-mode .water-line { stroke: rgba(166, 173, 187, .18); }

    body.night-mode .map-filter-bar label,
    body.night-mode .map-legend,
    body.night-mode .map-card,
    body.night-mode .map-empty,
    body.night-mode .map-attribution,
    body.night-mode .pin::after {
      background: rgba(21, 24, 33, .95);
      border-color: #343a47;
      color: #f4f6fb;
      box-shadow: 0 16px 36px rgba(0, 0, 0, .34);
    }

    body.night-mode .pin,
    body.night-mode .google-status-marker,
    body.night-mode .map-swatch {
      border-color: #f4f6fb;
      box-shadow: 0 8px 20px rgba(0, 0, 0, .45);
    }

    body.night-mode .pin.prospect,
    body.night-mode .google-status-marker.prospect,
    body.night-mode .map-swatch.prospect { background: #6fbd86; }
    body.night-mode .pin.proven,
    body.night-mode .google-status-marker.proven,
    body.night-mode .map-swatch.proven { background: #48a868; }
    body.night-mode .pin.discussion,
    body.night-mode .google-status-marker.discussion,
    body.night-mode .map-swatch.discussion { background: #83a9d9; }
    body.night-mode .pin.trial,
    body.night-mode .google-status-marker.trial,
    body.night-mode .map-swatch.trial { background: #e0b85b; }
    body.night-mode .pin.dormant,
    body.night-mode .google-status-marker.dormant,
    body.night-mode .map-swatch.dormant { background: #ee8b92; }

    body.night-mode .sales-import-actions code,
    body.night-mode .sales-toolbar .segmented,
    body.night-mode .table-wrap,
    body.night-mode table,
    body.night-mode th,
    body.night-mode td {
      background: #151821;
      border-color: #2d323d;
      color: #f4f6fb;
    }

    body.night-mode th {
      background: #11141c;
      color: #a6adbb;
    }

    body.night-mode tbody tr:hover td {
      background: #1b202b;
    }

    body.night-mode .payment-paid { background: #183424; border-color: #2f7045; color: #9ee7ad; }
    body.night-mode .payment-partial { background: #352a12; border-color: #5c4820; color: #f0d484; }
    body.night-mode .payment-unpaid,
    body.night-mode .payment-overdue { background: #3a1d23; border-color: #69333d; color: #f0a5aa; }
    body.night-mode .payment-no-invoice { background: #202433; border-color: #343a47; color: #cbd2df; }

    body.night-mode .trial-status-pill {
      background: #202433;
      border-color: #343a47;
      color: #d6dce9;
    }

    body.night-mode .trial-status-pill.status-running,
    body.night-mode .trial-status-pill.status-results { background: #183424; border-color: #2f7045; color: #9ee7ad; }
    body.night-mode .trial-status-pill.status-awaiting,
    body.night-mode .trial-status-pill.status-scheduled { background: #352a12; border-color: #5c4820; color: #f0d484; }
    body.night-mode .trial-status-pill.status-complete { background: #1c2635; border-color: #354764; color: #b8c8ef; }
    body.night-mode .trial-status-pill.status-muted { background: #241f24; border-color: #4b404a; color: #cfc5cf; }

    #sales .metric-strip {
      grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
      gap: 8px;
    }

    #sales .metric-card {
      min-height: 78px;
      padding: 12px;
    }

    #sales .metric-card strong {
      font-size: clamp(20px, 3vw, 28px);
      line-height: 1.05;
      overflow-wrap: anywhere;
    }

    #sales .metric-card p {
      font-size: 11px;
    }

    @media (max-width: 720px) {
      #sales .metric-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }

      #sales .metric-card {
        min-height: 68px;
        padding: 10px;
      }
    }

    @media (max-width: 430px) {
      #sales .metric-strip {
        grid-template-columns: 1fr;
      }
    }

    /* Final profile and responsive polish */
    .matrix-detail-row td {
      display: none;
    }

    .matrix-detail-row td:first-child {
      border-left-width: 4px;
      border-left-style: solid;
    }

    .matrix-detail-strip {
      display: flex;
      flex-wrap: wrap;
      gap: 5px 12px;
      max-width: 100%;
      overflow: hidden;
      color: var(--muted);
      font-size: 11px;
      line-height: 1.35;
    }

    .matrix-detail-strip span {
      max-width: min(340px, 100%);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .matrix-detail-strip b {
      color: var(--ink);
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: .02em;
    }

    .command-agenda-synthesis.schedule-only {
      grid-template-columns: 1fr;
    }

    .profile-compact-list {
      display: grid;
      gap: 0;
      border-top: 1px solid var(--line);
    }

    .profile-compact-card {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: center;
      gap: 12px;
      padding: 11px 0;
      border-bottom: 1px solid var(--line);
      background: transparent;
    }

    .profile-compact-card h3 {
      margin: 5px 0 3px;
      font-size: 14px;
      line-height: 1.25;
    }

    .profile-compact-card p {
      margin: 0;
      font-size: 12px;
      line-height: 1.35;
    }

    .profile-compact-card .row-actions {
      flex-wrap: nowrap;
      justify-content: flex-end;
      gap: 5px;
    }

    .profile-compact-card .button,
    .profile-compact-card .icon-button {
      min-height: 30px;
      padding: 5px 8px;
      font-size: 12px;
    }

    .profile-compact-card .button.danger,
    .profile-card .button.danger {
      background: transparent;
      border-color: var(--line);
      color: var(--muted);
    }

    .profile-compact-card .button.danger:hover,
    .profile-card .button.danger:hover {
      background: #fff1f1;
      border-color: #e0a6a6;
      color: #9a2f2f;
    }

    .profile-compact-details {
      margin-top: 8px;
    }

    .profile-compact-details summary {
      cursor: pointer;
      color: var(--muted);
      font-size: 12px;
      font-weight: 800;
    }

    @media (max-width: 720px) {
      .app {
        grid-template-columns: 1fr;
      }

      .top-actions {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 6px;
      }

      .top-actions .icon-button,
      .top-actions .button {
        width: auto;
        min-height: 32px;
        padding: 6px 9px;
        font-size: 12px;
        flex: 0 0 auto;
      }

      .matrix-toolbar.compact {
        display: flex;
        align-items: center;
        gap: 8px;
      }

      .matrix-main-tools,
      .matrix-quiet-tools {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 6px;
        width: 100%;
      }

      .matrix-main-tools .matrix-search-input,
      .matrix-toolbar.compact label {
        flex: 1 1 180px;
        min-width: 0;
        width: auto;
      }

      .matrix-main-tools .button,
      .matrix-main-tools .icon-button,
      .matrix-main-tools .account-approval-toolbar-button,
      .matrix-quiet-tools .button,
      .matrix-quiet-tools .icon-button,
      .workspace-actions .button,
      .calendar-tools .button,
      .sales-toolbar .button,
      .sales-toolbar .button.small,
      .experiments-actions .button,
      .experiment-db-toolbar .button {
        width: auto;
        min-height: 32px;
        padding: 6px 9px;
        font-size: 12px;
        flex: 0 0 auto;
      }

      .accounts-view-switcher,
      .accounts-view-icons,
      .calendar-period-bar .segmented,
      .sales-toolbar .segmented,
      .command-task-tabs {
        flex: 0 1 auto;
        width: auto;
        max-width: 100%;
      }

      .profile-launch-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }

      .profile-launch-card {
        min-height: 42px;
      }

      .profile-compact-card {
        grid-template-columns: 1fr;
        align-items: start;
      }

      .profile-compact-card .row-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
      }

      .cold-lead-actions.compact {
        min-width: 0;
      }

      .cold-lead-actions.compact .button {
        width: auto;
      }
    }

    @media (max-width: 480px) {
      .matrix-main-tools .matrix-search-input,
      .matrix-toolbar.compact label {
        flex-basis: 100%;
      }

      .profile-launch-grid {
        grid-template-columns: 1fr;
      }
    }

    body.night-mode .profile-compact-list,
    body.night-mode .profile-compact-card {
      border-color: #2d323d;
    }

    body.night-mode .profile-compact-card .button.danger,
    body.night-mode .profile-card .button.danger {
      background: transparent;
      border-color: #343a47;
      color: #a6adbb;
    }

    body.night-mode .profile-compact-card .button.danger:hover,
    body.night-mode .profile-card .button.danger:hover {
      background: #3a1d23;
      border-color: #69333d;
      color: #f0a5aa;
    }

    /* Final cohesive table and green action system. */
    :root {
      --green: #4f9f6f;
      --blue: #4f9f6f;
      --accent: #4f9f6f;
      --accent-strong: #3f875c;
      --accent-soft: #edf7f0;
    }

    .brand .mark,
    .mark {
      background: linear-gradient(135deg, #20242d, #4f9f6f 62%, #9abf78);
    }

    .button:not(.ghost):not(.danger),
    .account-approval-toolbar-button,
    .account-approval-badge.open,
    .trial-composer-send,
    .profile-composer-send {
      background: var(--accent);
      border-color: var(--accent);
      color: #222223;   /* brand black on gold */
    }

    .button:not(.ghost):not(.danger):hover,
    .account-approval-toolbar-button:hover,
    .trial-composer-send:hover,
    .profile-composer-send:hover {
      background: var(--accent-strong);
      border-color: var(--accent-strong);
      color: #ffffff;
    }

    input:focus,
    select:focus,
    textarea:focus,
    .vision-edit:focus {
      border-color: var(--accent);
      box-shadow: 0 0 0 2px rgba(79, 159, 111, .16);
    }

    .nav-btn.active {
      box-shadow: inset 3px 0 0 var(--accent);
    }

    .executive-brief,
    .review-match,
    .observation-summary {
      border-left-color: var(--accent);
    }

    .table-wrap,
    .vision-table-wrap,
    .matrix-grid.table-wrap,
    .sales-table-wrap,
    .experiment-db-wrap,
    .cold-lead-table-wrap {
      border: 1px solid var(--notion-line, var(--line));
      border-radius: 8px;
      background: var(--notion-panel, var(--panel));
      box-shadow: 0 10px 24px rgba(22, 25, 34, .05);
      overflow: auto;
    }

    table,
    .vision-grid,
    .matrix-grid,
    .sales-table,
    .experiment-db-table,
    .cold-table,
    .cold-lead-table {
      width: 100%;
      border-collapse: separate;
      border-spacing: 0;
      background: var(--notion-panel, var(--panel));
    }

    th,
    .matrix-grid th,
    .sales-table th,
    .experiment-db-table th,
    .cold-table thead th,
    .cold-lead-table th {
      position: sticky;
      top: 0;
      z-index: 4;
      background: #eef3ef;
      border-bottom: 1px solid var(--notion-line, var(--line));
      color: #5b6672;
      font-size: 10px;
      font-weight: 900;
      letter-spacing: .045em;
      text-transform: uppercase;
    }

    td,
    .matrix-grid td,
    .sales-table td,
    .experiment-db-table td,
    .cold-table td,
    .cold-lead-table td {
      background: #ffffff;
      border-bottom: 1px solid var(--notion-line, var(--line));
      color: var(--notion-text, var(--ink));
    }

    tbody tr:hover td,
    .matrix-grid tr:hover td,
    .sales-table tbody tr:hover td,
    .experiment-db-row:hover td,
    .cold-lead-table tbody tr:hover td {
      background: #f4f8f5;
    }

    .sales-row-actions a,
    .sales-row-actions button,
    .matrix-grid .quick-call-menu summary,
    .matrix-tool-menu summary,
    .experiment-row-menu summary,
    .quick-call-menu summary {
      border-color: var(--notion-line, var(--line));
      color: var(--accent);
    }

    .sales-import-schema span,
    .account-approval-status-line,
    .pill,
    .account-approval-badge.open {
      background: var(--accent-soft);
      border-color: #c9e5d1;
      color: #2f714c;
    }

    .matrix-stage-testing td:first-child,
    .matrix-stage-commercial td:first-child {
      border-left-color: var(--accent);
    }

    .matrix-stage-testing select,
    .matrix-stage-testing input,
    .matrix-stage-select.matrix-stage-testing,
    .matrix-stage-commercial select,
    .matrix-stage-commercial input,
    .matrix-stage-select.matrix-stage-commercial,
    .matrix-action-call summary,
    .next-step-options .matrix-action-call,
    .matrix-action-visit summary,
    .next-step-options .matrix-action-visit {
      background: #edf7f0;
      border-color: #c9e5d1;
      color: #2f714c;
    }

    .trial-status-pill.status-running,
    .trial-status-pill.status-scheduled {
      background: #edf7f0;
      border-color: #c9e5d1;
      color: #2f714c;
    }

    .cold-table tr.cold-status-trial td,
    .cold-table tr.cold-status-trial:hover td {
      background: #edf7f0;
    }

    .cold-table tr.cold-status-trial td:first-child {
      box-shadow: inset 5px 0 0 var(--accent);
    }

    body.night-mode {
      --green: #6fbd86;
      --blue: #6fbd86;
      --accent: #6fbd86;
      --accent-strong: #86d89b;
      --accent-soft: #202433;
    }

    body.night-mode .brand .mark,
    body.night-mode .mark {
      background: linear-gradient(135deg, #f4f6fb, #6fbd86 58%, #9fc98a);
      color: #0f1411;
    }

    body.night-mode .button:not(.ghost):not(.danger),
    body.night-mode .account-approval-toolbar-button,
    body.night-mode .account-approval-badge.open,
    body.night-mode .trial-composer-send,
    body.night-mode .profile-composer-send {
      background: var(--accent);
      border-color: var(--accent);
      color: #0f1411;
    }

    body.night-mode .button:not(.ghost):not(.danger):hover,
    body.night-mode .account-approval-toolbar-button:hover,
    body.night-mode .trial-composer-send:hover,
    body.night-mode .profile-composer-send:hover {
      background: var(--accent-strong);
      border-color: var(--accent-strong);
      color: #0f1411;
    }

    body.night-mode .table-wrap,
    body.night-mode .vision-table-wrap,
    body.night-mode .matrix-grid.table-wrap,
    body.night-mode .sales-table-wrap,
    body.night-mode .experiment-db-wrap,
    body.night-mode .cold-lead-table-wrap {
      background: #151821;
      border-color: #2d323d;
      box-shadow: none;
    }

    body.night-mode th,
    body.night-mode .matrix-grid th,
    body.night-mode .sales-table th,
    body.night-mode .experiment-db-table th,
    body.night-mode .cold-table thead th,
    body.night-mode .cold-lead-table th {
      background: #11141c;
      border-color: #2d323d;
      color: #a6adbb;
    }

    body.night-mode td,
    body.night-mode .matrix-grid td,
    body.night-mode .sales-table td,
    body.night-mode .experiment-db-table td,
    body.night-mode .cold-table td,
    body.night-mode .cold-lead-table td {
      background: #151821;
      border-color: #2d323d;
      color: #f4f6fb;
    }

    body.night-mode tbody tr:hover td,
    body.night-mode .matrix-grid tr:hover td,
    body.night-mode .sales-table tbody tr:hover td,
    body.night-mode .experiment-db-row:hover td,
    body.night-mode .cold-lead-table tbody tr:hover td {
      background: #1b202b;
    }

    body.night-mode .sales-row-actions a,
    body.night-mode .sales-row-actions button,
    body.night-mode .matrix-grid .quick-call-menu summary,
    body.night-mode .matrix-tool-menu summary,
    body.night-mode .experiment-row-menu summary,
    body.night-mode .quick-call-menu summary {
      border-color: #343a47;
      color: #9ee7ad;
    }

    body.night-mode .sales-import-schema span,
    body.night-mode .account-approval-status-line,
    body.night-mode .pill,
    body.night-mode .account-approval-badge.open {
      background: #202433;
      border-color: #343a47;
      color: #d6dce9;
    }

    body.night-mode .matrix-stage-testing select,
    body.night-mode .matrix-stage-testing input,
    body.night-mode .matrix-stage-select.matrix-stage-testing,
    body.night-mode .matrix-stage-commercial select,
    body.night-mode .matrix-stage-commercial input,
    body.night-mode .matrix-stage-select.matrix-stage-commercial,
    body.night-mode .matrix-action-call summary,
    body.night-mode .next-step-options .matrix-action-call,
    body.night-mode .matrix-action-visit summary,
    body.night-mode .next-step-options .matrix-action-visit {
      background: #183424;
      border-color: #2f7045;
      color: #9ee7ad;
    }

    body.night-mode .cold-table tr.cold-status-trial td,
    body.night-mode .cold-table tr.cold-status-trial:hover td {
      background: #183424;
    }

    /* Compact account categories and simplified experiment search. */
    .matrix-category-select {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      min-width: 180px;
      margin: 0;
      padding: 3px 3px 3px 10px;
      border: 1px solid var(--notion-line, var(--line));
      border-radius: 8px;
      background: var(--notion-panel, #fff);
      color: var(--notion-muted, var(--muted));
      font-size: 12px;
      font-weight: 900;
    }

    .matrix-category-select span {
      color: var(--notion-muted, var(--muted));
      font-size: 11px;
      text-transform: uppercase;
      letter-spacing: .045em;
    }

    .matrix-category-select select {
      min-height: 30px;
      margin: 0;
      padding: 4px 28px 4px 8px;
      border: 0;
      background: transparent;
      color: var(--notion-text, var(--ink));
      font-weight: 900;
      cursor: pointer;
    }

    .experiment-db-toolbar-simple {
      grid-template-columns: minmax(240px, 1fr) auto;
      align-items: center;
    }

    .experiment-db-toolbar-simple #trialSearch {
      min-height: 38px;
      border-radius: 8px;
    }

    .experiment-upload-action {
      min-height: 36px;
      white-space: nowrap;
    }

    body.night-mode .matrix-category-select {
      background: #151821;
      border-color: #2d323d;
      color: #a6adbb;
    }

    body.night-mode .matrix-category-select select {
      color: #f4f6fb;
    }

    @media (max-width: 720px) {
      .matrix-category-select {
        flex: 1 1 180px;
        min-width: 0;
      }

      .matrix-category-select select {
        width: 100%;
      }

      .experiment-db-toolbar-simple {
        grid-template-columns: 1fr;
      }

      .experiment-upload-action {
        justify-self: start;
      }
    }

    /* PFV unified product design system pass.
       BRAND PALETTE (Josh, 2026-07-25 — the Militia creative playbook):
       Primary #222223 (near-black) · Secondary #AB2328 (deep red) ·
       Tertiary #54585A (grey) · Quaternary #F1C400 (gold) · Quinary #FFFFFF.
       Chrome/accents only — the SEMANTIC status tokens (customers green,
       trialing purple, awaiting-trial gold, qualified blue) are deliberately
       untouched per Josh's 2026-07-24 map-color decree. */
    :root {
      --pfv-bg: #f6f6f7;
      --pfv-panel: #ffffff;
      --pfv-panel-soft: #fafafa;
      --pfv-text: #222223;
      --pfv-muted: #54585a;
      --pfv-tertiary: #8a8e91;
      --pfv-green: #3e8e5c;
      --pfv-green-hover: #337a4e;
      --pfv-green-soft: #edf7f0;
      --pfv-gold: #222223;      /* monochrome decree: day accent = brand black */
      --pfv-gold-soft: #ececee;
      --pfv-red: #ab2328;
      --pfv-red-soft: #fbeeee;
      --pfv-line: #dcdcde;
      --pfv-focus: rgba(34, 34, 35, .30);
      --pfv-shadow: 0 12px 32px rgba(34, 34, 35, .07);
      --pfv-shadow-soft: 0 5px 18px rgba(34, 34, 35, .055);
      --space-1: 4px;
      --space-2: 8px;
      --space-3: 12px;
      --space-4: 16px;
      --space-5: 20px;
      --space-6: 24px;
      --space-8: 32px;
      --radius-control: 7px;
      --radius-panel: 10px;
      --radius-modal: 14px;
      --ink: var(--pfv-text);
      --muted: var(--pfv-muted);
      --line: var(--pfv-line);
      --soft: var(--pfv-bg);
      --field: #f1f4ef;
      --panel: var(--pfv-panel);
      --green: var(--pfv-green);
      --gold: var(--pfv-gold);
      --blue: var(--pfv-green);
      --red: var(--pfv-red);
      /* monochrome decree (2026-07-26): the accent is brand black by day,
         soft white by night; green reads as customers/success only */
      --accent: var(--pfv-gold);
      --accent-strong: #3a3b3d;
      --accent-soft: var(--pfv-gold-soft);
      --shadow: var(--pfv-shadow);
    }

    html {
      background: var(--pfv-bg);
    }

    body {
      background: var(--pfv-bg);
      color: var(--pfv-text);
      font-size: 14px;
      letter-spacing: 0;
    }

    h1,
    h2,
    h3,
    h4 {
      color: var(--pfv-text);
      letter-spacing: 0;
    }

    p {
      color: inherit;
    }

    .muted,
    small {
      color: var(--pfv-muted);
    }

    .app {
      grid-template-columns: 240px minmax(0, 1fr);
      background: var(--pfv-bg);
    }

    aside {
      padding: 18px 14px;
      background: var(--pfv-panel-soft);
      border-right: 1px solid var(--pfv-line);
      box-shadow: none;
    }

    main {
      width: 100%;
      max-width: 1680px;
      padding: 22px 24px 28px;
      margin: 0 auto;
    }

    .brand {
      grid-template-columns: 38px minmax(0, 1fr);
      gap: 10px;
      margin-bottom: 18px;
      padding-right: 0;
    }

    .brand .mark,
    .mark {
      width: 38px;
      height: 38px;
      border-radius: 10px;
      background: linear-gradient(135deg, #315f43, var(--pfv-green));
      color: #fff;
      font-size: 12px;
      box-shadow: none;
    }

    .brand h1 {
      max-width: 150px;
      color: var(--pfv-text);
      font-size: 15px;
      font-weight: 780;
      line-height: 1.16;
    }

    .brand p {
      max-width: 150px;
      color: var(--pfv-muted);
      font-size: 11px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    #appView .shell-actions {
      position: fixed;
      top: 12px;
      right: 16px;
      z-index: 80;
      display: inline-flex;
      align-items: center;
      gap: 4px;
      min-height: 34px;
      padding: 4px;
      border: 1px solid rgba(216, 224, 217, .82);
      border-radius: 999px;
      background: rgba(255, 255, 255, .88);
      box-shadow: 0 8px 24px rgba(31, 42, 36, .08);
      backdrop-filter: blur(10px);
    }

    #globalMessage {
      max-width: 220px;
      margin: 0 4px 0 2px;
      padding: 0 6px;
      border: 0;
      background: transparent;
      color: var(--pfv-muted);
      font-size: 12px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    nav {
      gap: 4px;
      margin-bottom: 0;
    }

    .nav-btn {
      display: flex;
      min-height: 40px;
      align-items: center;
      gap: 10px;
      padding: 0 10px;
      border: 1px solid transparent;
      border-radius: 8px;
      color: var(--pfv-muted);
      font-size: 13px;
      font-weight: 680;
      line-height: 1;
      transition: background .16s ease, color .16s ease, border-color .16s ease;
    }

    .nav-btn::before {
      display: none !important;
    }

    .nav-btn svg {
      width: 17px;
      height: 17px;
      flex: 0 0 17px;
      color: var(--pfv-tertiary);
      transition: color .16s ease;
    }

    .nav-btn span {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .nav-btn:hover {
      background: #eef3ed;
      color: var(--pfv-text);
    }

    .nav-btn:hover svg,
    .nav-btn.active svg {
      color: var(--pfv-green-hover);
    }

    .nav-btn.active {
      border-color: #d5e7d9;
      background: var(--pfv-green-soft);
      color: var(--pfv-text);
      box-shadow: inset 3px 0 0 var(--pfv-green);
    }

    .workspace-head,
    .section-head,
    .page-head,
    .matrix-head,
    .experiment-db-head,
    .sales-head {
      margin: 0 0 14px;
      padding: 0;
    }

    .workspace-head h2,
    .section-head h2,
    .page-head h2,
    .matrix-head h2,
    .experiment-db-head h2,
    .sales-head h2 {
      margin: 0;
      color: var(--pfv-text);
      font-size: clamp(24px, 2vw, 30px);
      font-weight: 760;
      line-height: 1.1;
    }

    .workspace-head p,
    .section-head p,
    .page-head p,
    .matrix-head p,
    .experiment-db-head p,
    .sales-head p {
      max-width: 780px;
      margin: 5px 0 0;
      color: var(--pfv-muted);
      font-size: 13px;
      line-height: 1.45;
    }

    input,
    select,
    textarea {
      border-color: var(--pfv-line);
      border-radius: var(--radius-control);
      background: var(--pfv-panel);
      color: var(--pfv-text);
      box-shadow: none;
    }

    input:focus,
    select:focus,
    textarea:focus,
    button:focus-visible,
    summary:focus-visible,
    a:focus-visible {
      outline: 3px solid var(--pfv-focus);
      outline-offset: 2px;
    }

    .button,
    button.button,
    .account-approval-toolbar-button,
    .trial-composer-send,
    .profile-composer-send {
      border: 1px solid var(--pfv-green);
      border-radius: var(--radius-control);
      background: var(--pfv-green);
      color: #fff;
      box-shadow: none;
      font-weight: 760;
      transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
    }

    .button:hover,
    button.button:hover,
    .account-approval-toolbar-button:hover,
    .trial-composer-send:hover,
    .profile-composer-send:hover {
      background: var(--pfv-green-hover);
      border-color: var(--pfv-green-hover);
      color: #fff;
    }

    .button.ghost,
    .ghost,
    button.ghost,
    .profile-back-button,
    .matrix-tool-menu summary,
    .quick-call-menu summary,
    .experiment-row-menu summary,
    .sales-row-actions button,
    .sales-row-actions a {
      border: 1px solid var(--pfv-line);
      background: var(--pfv-panel);
      color: var(--pfv-text);
      box-shadow: none;
    }

    .button.ghost:hover,
    .ghost:hover,
    button.ghost:hover,
    .profile-back-button:hover,
    .matrix-tool-menu summary:hover,
    .quick-call-menu summary:hover,
    .experiment-row-menu summary:hover,
    .sales-row-actions button:hover,
    .sales-row-actions a:hover {
      border-color: #c6d5ca;
      background: var(--pfv-green-soft);
      color: var(--pfv-green-hover);
    }

    .button.danger,
    .danger {
      border-color: var(--pfv-red);
      background: var(--pfv-red);
      color: #fff;
    }

    .button.danger.ghost,
    .danger.ghost {
      border-color: #f0c6ca;
      background: var(--pfv-red-soft);
      color: #9f3941;
    }

    .icon-button,
    .app-control.icon-button {
      width: 30px;
      min-width: 30px;
      height: 30px;
      min-height: 30px;
      padding: 0;
      display: inline-grid;
      place-items: center;
      border: 1px solid transparent;
      border-radius: 999px;
      background: transparent;
      color: var(--pfv-muted);
      line-height: 1;
    }

    .icon-button:hover,
    .app-control.icon-button:hover {
      border-color: var(--pfv-line);
      background: var(--pfv-green-soft);
      color: var(--pfv-green-hover);
    }

    #logoutBtn.app-control {
      min-height: 30px;
      padding: 0 10px;
      border-color: transparent;
      border-radius: 999px;
      background: transparent;
      color: var(--pfv-muted);
      font-size: 12px;
      font-weight: 720;
    }

    #logoutBtn.app-control:hover {
      border-color: var(--pfv-line);
      background: var(--pfv-green-soft);
      color: var(--pfv-green-hover);
    }

    .panel,
    .metric-card,
    .executive-brief,
    .command-task-strip,
    .command-agenda-synthesis,
    .command-work-log-card,
    .message-alert-button,
    .sales-summary-grid > div,
    .experiment-view-card,
    .profile-launch-card-simple,
    .profile-executive-summary,
    .profile-life-timeline,
    .quick-modal,
    .settings-modal,
    .order-modal,
    .trial-detail-modal,
    .profile-modal-panel {
      border: 1px solid var(--pfv-line);
      border-radius: var(--radius-panel);
      background: var(--pfv-panel);
      box-shadow: none;
      color: var(--pfv-text);
    }

    .panel,
    .metric-card,
    .executive-brief,
    .command-task-strip,
    .command-agenda-synthesis,
    .command-work-log-card,
    .sales-summary-grid > div,
    .experiment-view-card {
      padding: 14px;
    }

    .metric-card span,
    .sales-summary-grid span,
    .profile-exec-focus span,
    .trial-detail-brief-bar span {
      color: var(--pfv-tertiary);
      font-size: 10px;
      font-weight: 820;
      letter-spacing: .055em;
      text-transform: uppercase;
    }

    .pill,
    .status-pill,
    .trial-status-pill,
    .account-approval-badge.open,
    .sales-import-schema span {
      border: 1px solid #d5e7d9;
      background: var(--pfv-green-soft);
      color: #2f714c;
      font-weight: 720;
    }

    .risk-high,
    .status-risk,
    .trial-status-pill.status-risk,
    .trial-status-pill.status-blocked,
    .trial-status-pill.status-failed {
      border-color: #f0c6ca;
      background: var(--pfv-red-soft);
      color: #a8424b;
    }

    .risk-medium,
    .status-warning,
    .trial-status-pill.status-pending,
    .trial-status-pill.status-review {
      border-color: #ead49b;
      background: var(--pfv-gold-soft);
      color: #8a5f16;
    }

    .table-wrap,
    .vision-table-wrap,
    .matrix-grid.table-wrap,
    .sales-table-wrap,
    .experiment-db-wrap,
    .cold-lead-table-wrap {
      border: 1px solid var(--pfv-line);
      border-radius: var(--radius-panel);
      background: var(--pfv-panel);
      box-shadow: none;
      overflow: auto;
    }

    table,
    .matrix-grid,
    .sales-table,
    .experiment-db-table,
    .cold-table,
    .cold-lead-table {
      border-collapse: separate;
      border-spacing: 0;
      background: transparent;
      color: var(--pfv-text);
      font-size: 12px;
    }

    th,
    .matrix-grid th,
    .sales-table th,
    .experiment-db-table th,
    .cold-table thead th,
    .cold-lead-table th {
      height: 36px;
      padding: 8px 10px;
      border-bottom: 1px solid var(--pfv-line);
      background: #f0f3ee;
      color: var(--pfv-muted);
      font-size: 10px;
      font-weight: 820;
      letter-spacing: .055em;
      text-transform: uppercase;
    }

    td,
    .matrix-grid td,
    .sales-table td,
    .experiment-db-table td,
    .cold-table td,
    .cold-lead-table td {
      min-height: 42px;
      padding: 8px 10px;
      border-bottom: 1px solid var(--pfv-line);
      background: var(--pfv-panel);
      color: var(--pfv-text);
      vertical-align: middle;
    }

    tbody tr:last-child td {
      border-bottom: 0;
    }

    tbody tr:hover td,
    .matrix-grid tr:hover td,
    .sales-table tbody tr:hover td,
    .experiment-db-row:hover td,
    .cold-lead-table tbody tr:hover td {
      background: #f4f8f5;
    }

    .cold-table tr[class*="cold-status-"] td {
      background: var(--pfv-panel);
    }

    .cold-table tr[class*="cold-status-"] td:first-child,
    .matrix-stage-customer td:first-child,
    .matrix-stage-testing td:first-child,
    .matrix-stage-trial td:first-child,
    .matrix-stage-commercial td:first-child {
      box-shadow: inset 4px 0 0 var(--pfv-line);
    }

    .cold-table tr.cold-status-interested td:first-child,
    .matrix-stage-customer td:first-child,
    .matrix-stage-commercial td:first-child {
      box-shadow: inset 4px 0 0 var(--pfv-green);
    }

    .cold-table tr.cold-status-needs-info td:first-child,
    .matrix-stage-testing td:first-child,
    .matrix-stage-trial td:first-child {
      box-shadow: inset 4px 0 0 var(--pfv-gold);
    }

    .cold-table tr.cold-status-not-interested td:first-child {
      box-shadow: inset 4px 0 0 var(--pfv-red);
    }

    .matrix-toolbar.compact,
    .sales-toolbar,
    .experiment-db-toolbar-simple,
    .cold-toolbar,
    .cold-list-tabs {
      gap: 8px;
      align-items: center;
      padding: 8px;
      border: 1px solid var(--pfv-line);
      border-radius: var(--radius-panel);
      background: var(--pfv-panel);
      box-shadow: none;
    }

    .matrix-main-tools,
    .sales-toolbar,
    .experiment-db-toolbar-simple {
      display: grid;
      grid-template-columns: minmax(240px, 1fr) auto;
    }

    .matrix-category-select {
      min-height: 36px;
      min-width: 210px;
      border-color: var(--pfv-line);
      border-radius: var(--radius-control);
      background: var(--pfv-panel-soft);
      color: var(--pfv-muted);
    }

    .matrix-category-select select {
      min-height: 28px;
      color: var(--pfv-text);
    }

    .matrix-filter-menu summary,
    .matrix-tool-menu summary {
      min-height: 34px;
      border-radius: var(--radius-control);
    }

    .command-summary-row {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 14px;
      align-items: start;
      margin-bottom: 14px;
    }

    .command-work-board {
      grid-template-columns: minmax(0, 1.85fr) minmax(300px, .85fr);
      gap: 14px;
      align-items: start;
    }

    .executive-brief {
      border-left: 4px solid var(--pfv-green);
      background: var(--pfv-panel);
    }

    .executive-brief h2 {
      margin: 0 0 8px;
      font-size: 20px;
      line-height: 1.16;
    }

    .executive-brief p {
      max-width: 980px;
      margin-bottom: 0;
      color: var(--pfv-muted);
      line-height: 1.55;
    }

    .command-task-strip.embedded,
    .command-agenda-synthesis.schedule-only {
      background: var(--pfv-panel);
    }

    .command-agenda-synthesis {
      grid-template-columns: minmax(0, .9fr) minmax(0, 1.4fr);
      padding: 12px;
      background: var(--pfv-panel-soft);
    }

    .command-agenda-list {
      gap: 7px;
    }

    .command-agenda-row {
      min-height: 44px;
      border: 1px solid var(--pfv-line);
      border-left: 4px solid var(--pfv-green);
      border-radius: 8px;
      background: var(--pfv-panel);
      box-shadow: none;
    }

    .command-agenda-row.event-meeting { border-left-color: var(--pfv-green); }
    .command-agenda-row.event-experiment { border-left-color: var(--pfv-gold); }
    .command-agenda-row.event-attention { border-left-color: var(--pfv-red); }
    .command-agenda-row.event-google-calendar { border-left-color: #6f879e; }

    .command-agenda-main strong,
    .command-agenda-main span,
    .command-agenda-main small {
      overflow-wrap: anywhere;
    }

    .message-alert-button {
      min-height: 38px;
      padding: 8px 10px;
      border-radius: 999px;
      background: var(--pfv-panel);
    }

    .map-card,
    .map-preview,
    .matrix-map-shell,
    .workspace-map-panel {
      border-color: var(--pfv-line);
      background: var(--pfv-panel);
    }

    .cold-stats,
    .sales-summary-grid,
    .experiment-view-strip {
      gap: 8px;
    }

    .cold-stat,
    .experiment-view-card,
    .sales-summary-grid > div {
      min-height: 70px;
      border-color: var(--pfv-line);
      background: var(--pfv-panel);
    }

    .experiment-view-card {
      display: grid;
      align-content: center;
      padding: 11px 12px;
      cursor: pointer;
    }

    .experiment-view-card.active,
    .experiment-view-card:hover {
      border-color: #c6dcca;
      background: var(--pfv-green-soft);
      color: var(--pfv-text);
      box-shadow: none;
    }

    .experiment-view-card strong {
      color: var(--pfv-text);
      font-size: 21px;
      line-height: 1;
    }

    .experiment-view-card span {
      margin-top: 6px;
      color: var(--pfv-text);
      font-size: 12px;
    }

    .experiment-view-card small {
      margin-top: 2px;
      color: var(--pfv-muted);
      font-size: 10px;
    }

    .experiment-db-toolbar-simple #trialSearch,
    .sales-toolbar input,
    .matrix-toolbar input,
    .matrix-toolbar select {
      min-height: 36px;
    }

    .trial-detail-modal,
    .order-modal,
    .quick-modal,
    .settings-modal,
    .profile-modal-panel {
      border-radius: var(--radius-modal);
      /* Scroll vertically, clip horizontally. This rule used to set
         `overflow: hidden` (to clip the rounded corners), which OVERRODE the
         base .quick-modal { overflow: auto } — capping every modal at its
         max-height with no scrollbar, so tall modals (Settings > Product
         Knowledge, the profile panel) had their lower content unreachable
         (Josh, 2026-07-16). overflow-y:auto still clips the corners. */
      overflow-y: auto;
      overflow-x: hidden;
      box-shadow: 0 24px 80px rgba(31, 42, 36, .2);
    }

    .modal-backdrop,
    #quickUploadRoot .modal-backdrop,
    #bulkInboxRoot .modal-backdrop {
      background: rgba(20, 28, 23, .34);
      backdrop-filter: blur(6px);
    }

    .quick-modal-head,
    .order-modal-head,
    .trial-detail-header,
    .settings-modal-head,
    .profile-panel-head {
      border-bottom: 1px solid var(--pfv-line);
      background: rgba(255, 255, 255, .96);
      color: var(--pfv-text);
    }

    .modal-close,
    .quick-modal-close,
    .trial-detail-close {
      border-radius: 999px;
      color: var(--pfv-muted);
    }

    .modal-close:hover,
    .quick-modal-close:hover,
    .trial-detail-close:hover {
      background: var(--pfv-red-soft);
      color: #9f3941;
    }

    .trial-detail-brief-bar {
      grid-template-columns: repeat(3, minmax(100px, 145px)) minmax(0, 1fr);
      gap: 8px;
      padding: 10px 14px;
      background: var(--pfv-panel);
      border-bottom-color: var(--pfv-line);
    }

    .trial-detail-brief-bar div {
      border-color: var(--pfv-line);
      border-radius: 8px;
      background: var(--pfv-panel-soft);
    }

    .trial-detail-tabs {
      top: 0;
      gap: 5px;
      border-bottom-color: var(--pfv-line);
      background: rgba(255, 255, 255, .96);
    }

    .trial-detail-tabs button {
      border-radius: 7px;
      color: var(--pfv-muted);
    }

    .trial-detail-tabs button.active,
    .trial-detail-tabs button:hover {
      border-color: #c6dcca;
      background: var(--pfv-green-soft);
      color: var(--pfv-text);
    }

    .trial-detail-body,
    .trial-detail-composer {
      background: var(--pfv-bg);
    }

    .trial-dossier-grid,
    .trial-detail-panel {
      gap: 10px;
    }

    .order-preview,
    .order-excel-preview,
    .sales-import-preview {
      border-color: var(--pfv-line);
      background: var(--pfv-panel-soft);
      color: var(--pfv-text);
    }

    .sales-summary-grid {
      grid-template-columns: repeat(5, minmax(135px, 1fr));
    }

    .sales-summary-grid > div {
      min-width: 0;
      padding: 12px;
    }

    .sales-summary-grid strong {
      color: var(--pfv-text);
      font-size: 20px;
      line-height: 1.08;
      overflow-wrap: anywhere;
    }

    .sales-table-wrap {
      max-height: calc(100vh - 330px);
    }

    .loading,
    .empty-state,
    .empty,
    .message {
      color: var(--pfv-muted);
    }

    .empty-state,
    .empty {
      border: 1px dashed var(--pfv-line);
      border-radius: var(--radius-panel);
      background: var(--pfv-panel-soft);
      padding: 18px;
    }

    body.night-mode {
      /* Militia palette at home: near-black surfaces, full-strength gold */
      --pfv-bg: #161617;
      --pfv-panel: #222223;
      --pfv-panel-soft: #1b1b1c;
      --pfv-text: #f5f5f4;
      --pfv-muted: #a6a9ab;
      --pfv-tertiary: #7e8285;
      --pfv-green: #6fbd86;
      --pfv-green-hover: #86d89b;
      --pfv-green-soft: #1a2a20;
      --pfv-gold: #f5f5f4;      /* monochrome decree: night accent = soft white */
      --pfv-gold-soft: #232324;
      --pfv-red: #d4494e;
      --pfv-red-soft: #331416;
      --pfv-line: #3a3b3d;
      --pfv-focus: rgba(245, 245, 244, .30);
      --pfv-shadow: none;
      --ink: var(--pfv-text);
      --muted: var(--pfv-muted);
      --line: var(--pfv-line);
      --soft: var(--pfv-bg);
      --field: #232324;
      --panel: var(--pfv-panel);
      --green: var(--pfv-green);
      --gold: var(--pfv-gold);
      --blue: var(--pfv-green);
      --red: var(--pfv-red);
      --accent: var(--pfv-gold);
      --accent-strong: #ffffff;
      --accent-soft: var(--pfv-gold-soft);
      background: var(--pfv-bg);
      color: var(--pfv-text);
    }

    body.night-mode aside,
    body.night-mode .topbar {
      background: var(--pfv-panel-soft);
      border-color: var(--pfv-line);
    }

    body.night-mode #appView .shell-actions {
      border-color: rgba(43, 52, 46, .92);
      background: rgba(21, 26, 23, .88);
      box-shadow: none;
    }

    body.night-mode h1,
    body.night-mode h2,
    body.night-mode h3,
    body.night-mode h4,
    body.night-mode .brand h1,
    body.night-mode .workspace-head h2,
    body.night-mode .section-head h2,
    body.night-mode .page-head h2,
    body.night-mode .matrix-head h2,
    body.night-mode .experiment-db-head h2,
    body.night-mode .sales-head h2 {
      color: var(--pfv-text);
    }

    body.night-mode .muted,
    body.night-mode small,
    body.night-mode .brand p,
    body.night-mode .workspace-head p,
    body.night-mode .section-head p,
    body.night-mode .page-head p,
    body.night-mode .matrix-head p,
    body.night-mode .experiment-db-head p,
    body.night-mode .sales-head p {
      color: var(--pfv-muted);
    }

    body.night-mode input,
    body.night-mode select,
    body.night-mode textarea {
      border-color: var(--pfv-line);
      background: #101511;
      color: var(--pfv-text);
    }

    body.night-mode input::placeholder,
    body.night-mode textarea::placeholder {
      color: #707b74;
    }

    body.night-mode .nav-btn {
      color: var(--pfv-muted);
    }

    body.night-mode .nav-btn:hover {
      background: #19201b;
      color: var(--pfv-text);
    }

    body.night-mode .nav-btn.active {
      border-color: #2e4636;
      background: var(--pfv-green-soft);
      color: var(--pfv-text);
      box-shadow: inset 3px 0 0 var(--pfv-green);
    }

    body.night-mode .button,
    body.night-mode button.button,
    body.night-mode .account-approval-toolbar-button,
    body.night-mode .trial-composer-send,
    body.night-mode .profile-composer-send {
      border-color: var(--pfv-green);
      background: var(--pfv-green);
      color: #0f1411;
    }

    body.night-mode .button:hover,
    body.night-mode button.button:hover,
    body.night-mode .account-approval-toolbar-button:hover,
    body.night-mode .trial-composer-send:hover,
    body.night-mode .profile-composer-send:hover {
      border-color: var(--pfv-green-hover);
      background: var(--pfv-green-hover);
      color: #0f1411;
    }

    body.night-mode .button.ghost,
    body.night-mode .ghost,
    body.night-mode button.ghost,
    body.night-mode .profile-back-button,
    body.night-mode .matrix-tool-menu summary,
    body.night-mode .quick-call-menu summary,
    body.night-mode .experiment-row-menu summary,
    body.night-mode .sales-row-actions button,
    body.night-mode .sales-row-actions a {
      border-color: var(--pfv-line);
      background: #151a17;
      color: var(--pfv-text);
    }

    body.night-mode .button.ghost:hover,
    body.night-mode .ghost:hover,
    body.night-mode button.ghost:hover,
    body.night-mode .profile-back-button:hover,
    body.night-mode .matrix-tool-menu summary:hover,
    body.night-mode .quick-call-menu summary:hover,
    body.night-mode .experiment-row-menu summary:hover,
    body.night-mode .sales-row-actions button:hover,
    body.night-mode .sales-row-actions a:hover,
    body.night-mode .icon-button:hover,
    body.night-mode .app-control.icon-button:hover,
    body.night-mode #logoutBtn.app-control:hover {
      border-color: #334139;
      background: var(--pfv-green-soft);
      color: var(--pfv-green-hover);
    }

    body.night-mode .panel,
    body.night-mode .metric-card,
    body.night-mode .executive-brief,
    body.night-mode .command-task-strip,
    body.night-mode .command-agenda-synthesis,
    body.night-mode .command-work-log-card,
    body.night-mode .message-alert-button,
    body.night-mode .sales-summary-grid > div,
    body.night-mode .experiment-view-card,
    body.night-mode .profile-launch-card-simple,
    body.night-mode .profile-executive-summary,
    body.night-mode .profile-life-timeline,
    body.night-mode .quick-modal,
    body.night-mode .settings-modal,
    body.night-mode .order-modal,
    body.night-mode .trial-detail-modal,
    body.night-mode .profile-modal-panel,
    body.night-mode .table-wrap,
    body.night-mode .vision-table-wrap,
    body.night-mode .matrix-grid.table-wrap,
    body.night-mode .sales-table-wrap,
    body.night-mode .experiment-db-wrap,
    body.night-mode .cold-lead-table-wrap,
    body.night-mode .map-card,
    body.night-mode .map-preview,
    body.night-mode .matrix-map-shell,
    body.night-mode .workspace-map-panel,
    body.night-mode .order-preview,
    body.night-mode .order-excel-preview,
    body.night-mode .sales-import-preview {
      border-color: var(--pfv-line);
      background: var(--pfv-panel);
      color: var(--pfv-text);
      box-shadow: none;
    }

    body.night-mode th,
    body.night-mode .matrix-grid th,
    body.night-mode .sales-table th,
    body.night-mode .experiment-db-table th,
    body.night-mode .cold-table thead th,
    body.night-mode .cold-lead-table th {
      border-color: var(--pfv-line);
      background: #111613;
      color: var(--pfv-muted);
    }

    body.night-mode td,
    body.night-mode .matrix-grid td,
    body.night-mode .sales-table td,
    body.night-mode .experiment-db-table td,
    body.night-mode .cold-table td,
    body.night-mode .cold-lead-table td {
      border-color: var(--pfv-line);
      background: var(--pfv-panel);
      color: var(--pfv-text);
    }

    body.night-mode tbody tr:hover td,
    body.night-mode .matrix-grid tr:hover td,
    body.night-mode .sales-table tbody tr:hover td,
    body.night-mode .experiment-db-row:hover td,
    body.night-mode .cold-lead-table tbody tr:hover td {
      background: #1a211d;
    }

    body.night-mode .quick-modal-head,
    body.night-mode .order-modal-head,
    body.night-mode .trial-detail-header,
    body.night-mode .settings-modal-head,
    body.night-mode .profile-panel-head,
    body.night-mode .trial-detail-tabs {
      border-color: var(--pfv-line);
      background: rgba(21, 26, 23, .96);
      color: var(--pfv-text);
    }

    body.night-mode .trial-detail-body,
    body.night-mode .trial-detail-composer {
      background: var(--pfv-bg);
    }

    body.night-mode .trial-detail-brief-bar,
    body.night-mode .trial-detail-status-row,
    body.night-mode .trial-detail-brief-bar div,
    body.night-mode .matrix-category-select,
    body.night-mode .matrix-toolbar.compact,
    body.night-mode .sales-toolbar,
    body.night-mode .experiment-db-toolbar-simple,
    body.night-mode .cold-toolbar,
    body.night-mode .cold-list-tabs,
    body.night-mode .empty-state,
    body.night-mode .empty {
      border-color: var(--pfv-line);
      background: var(--pfv-panel-soft);
      color: var(--pfv-text);
    }

    body.night-mode .experiment-view-card.active,
    body.night-mode .experiment-view-card:hover,
    body.night-mode .trial-detail-tabs button.active,
    body.night-mode .trial-detail-tabs button:hover {
      border-color: #2e4636;
      background: var(--pfv-green-soft);
      color: var(--pfv-text);
    }

    body.night-mode .modal-backdrop,
    body.night-mode #quickUploadRoot .modal-backdrop,
    body.night-mode #bulkInboxRoot .modal-backdrop {
      background: rgba(3, 7, 5, .58);
    }

    @media (max-width: 1050px) {
      .app {
        grid-template-columns: 1fr;
        max-width: 100vw;
        overflow-x: hidden;
      }

      aside {
        position: sticky;
        top: 0;
        z-index: 70;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        height: auto;
        padding: 10px 12px;
        overflow: visible;
      }

      .brand {
        margin-bottom: 8px;
      }

      .brand h1,
      .brand p {
        max-width: none;
      }

      nav {
        display: flex;
        gap: 6px;
        overflow-x: auto;
        padding-bottom: 2px;
      }

      .nav-btn {
        flex: 0 0 auto;
        min-height: 36px;
      }

      .nav-btn.active {
        box-shadow: inset 0 -3px 0 var(--pfv-green);
      }

      main {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        padding: 16px;
        overflow-x: hidden;
      }

      .page,
      .panel,
      .table-wrap,
      .vision-table-wrap,
      .matrix-grid.table-wrap,
      .sales-table-wrap,
      .experiment-db-wrap,
      .cold-lead-table-wrap {
        width: 100%;
        min-width: 0;
        max-width: 100%;
      }

      .command-summary-row,
      .command-work-board,
      .command-agenda-synthesis,
      .matrix-main-tools,
      .sales-toolbar,
      .experiment-db-toolbar-simple {
        grid-template-columns: 1fr;
      }

      .sales-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }
    }

    @media (max-width: 720px) {
      main {
        padding: 12px;
      }

      .brand {
        grid-template-columns: 34px minmax(0, 1fr);
      }

      .brand .mark,
      .mark {
        width: 34px;
        height: 34px;
      }

      #appView .shell-actions {
        top: 8px;
        right: 8px;
        max-width: calc(100vw - 16px);
      }

      #globalMessage,
      #logoutBtn.app-control {
        display: none;
      }

      .workspace-head h2,
      .section-head h2,
      .page-head h2,
      .matrix-head h2,
      .experiment-db-head h2,
      .sales-head h2 {
        font-size: 22px;
      }

      .sales-summary-grid,
      .experiment-view-strip,
      .cold-stats {
        grid-template-columns: 1fr 1fr;
      }

      .sales-summary-grid > div,
      .experiment-view-card,
      .cold-stat {
        min-height: 62px;
        padding: 10px;
      }

      .quick-modal,
      .settings-modal,
      .order-modal,
      .trial-detail-modal,
      .profile-modal-panel {
        width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
      }

      .trial-detail-brief-bar {
        grid-template-columns: 1fr 1fr;
      }

      .matrix-category-select {
        width: 100%;
        min-width: 0;
      }
    }

    @media (max-width: 480px) {
      .nav-btn {
        padding: 0 9px;
        font-size: 12px;
      }

      .nav-btn svg {
        width: 15px;
        height: 15px;
      }

      .sales-summary-grid,
      .experiment-view-strip,
      .cold-stats,
      .trial-detail-brief-bar {
        grid-template-columns: 1fr;
      }

      .button,
      button.button,
      .ghost,
      button.ghost {
        width: auto;
        max-width: 100%;
      }
    }

    /* Accounts table density pass. */
    #matrix .workspace-head {
      min-height: 0;
      margin-bottom: 6px;
    }

    #matrix .workspace-head h2 {
      font-size: 21px;
      line-height: 1.05;
    }

    #matrix > .panel,
    #matrix .panel {
      padding: 8px;
    }

    #matrix .matrix-toolbar.compact {
      padding: 6px;
      border-radius: 8px;
    }

    #matrix .matrix-main-tools {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      align-items: center;
    }

    #matrix .matrix-search-input {
      flex: 1 1 220px;
      min-width: 180px;
      min-height: 32px;
      padding: 6px 9px;
      font-size: 12px;
    }

    #matrix .matrix-category-select {
      flex: 0 1 176px;
      min-width: 150px;
      min-height: 32px;
      padding: 2px 2px 2px 8px;
      gap: 5px;
      font-size: 11px;
    }

    #matrix .matrix-category-select span {
      font-size: 10px;
    }

    #matrix .matrix-category-select select {
      min-height: 26px;
      padding: 3px 22px 3px 6px;
      font-size: 12px;
    }

    #matrix .accounts-view-icons {
      gap: 3px;
      padding: 2px;
    }

    #matrix .accounts-view-icons .icon-button,
    #matrix .matrix-quiet-tools .icon-button,
    #matrix .matrix-main-tools .icon-button {
      width: 28px;
      min-width: 28px;
      height: 28px;
      min-height: 28px;
      border-radius: 7px;
      font-size: 13px;
    }

    #matrix .matrix-main-tools .button,
    #matrix .matrix-main-tools .account-approval-toolbar-button,
    #matrix .matrix-quiet-tools .button {
      min-height: 30px;
      padding: 5px 9px;
      border-radius: 7px;
      font-size: 12px;
      line-height: 1;
    }

    #matrix .matrix-tool-menu summary,
    #matrix .matrix-filter-menu summary {
      min-height: 30px;
      padding: 5px 8px;
      border-radius: 7px;
      font-size: 12px;
    }

    #matrix .matrix-sheet-actions {
      gap: 4px;
    }

    #matrix .message {
      min-height: 0;
      margin: 4px 0;
      font-size: 12px;
      line-height: 1.25;
    }

    #matrix .table-wrap.matrix-grid {
      max-height: calc(100vh - 170px);
      border-radius: 8px;
    }

    #matrix .matrix-grid th {
      height: 30px;
      padding: 5px 8px;
      font-size: 9px;
    }

    #matrix .matrix-grid td {
      min-height: 36px;
      padding: 5px 8px;
    }

    #matrix .matrix-grid input,
    #matrix .matrix-grid select,
    #matrix .matrix-grid textarea {
      min-height: 30px;
      padding: 5px 7px;
      font-size: 12px;
    }

    #matrix .matrix-company-button {
      min-height: 26px;
      padding: 0;
    }

    #matrix .matrix-tag-editor {
      min-width: 170px;
      max-width: 240px;
      gap: 4px;
    }

    #matrix .matrix-tag-list {
      gap: 4px;
    }

    #matrix .matrix-tag {
      min-height: 24px;
      gap: 5px;
      padding: 2px 3px 2px 8px;
      border: 1px solid #d5e7d9;
      border-radius: 999px;
      background: var(--pfv-green-soft);
      color: #2f714c;
      font-size: 11px;
      line-height: 1;
    }

    #matrix .matrix-tag button {
      display: inline-grid;
      width: 20px;
      height: 20px;
      place-items: center;
      border: 1px solid rgba(47, 113, 76, .18);
      border-radius: 999px;
      background: rgba(255, 255, 255, .72);
      color: #2f714c;
      font-size: 15px;
      font-weight: 760;
      line-height: 1;
    }

    #matrix .matrix-tag button:hover {
      border-color: #f0c6ca;
      background: var(--pfv-red-soft);
      color: #9f3941;
    }

    #matrix .matrix-tag-editor input {
      min-height: 28px;
      padding: 4px 7px;
      border-radius: 7px;
      font-size: 11px;
    }

    body.night-mode #matrix .matrix-tag {
      border-color: #2e4636;
      background: var(--pfv-green-soft);
      color: var(--pfv-green-hover);
    }

    body.night-mode #matrix .matrix-tag button {
      border-color: #334139;
      background: #151a17;
      color: var(--pfv-green-hover);
    }

    body.night-mode #matrix .matrix-tag button:hover {
      border-color: #543038;
      background: var(--pfv-red-soft);
      color: var(--pfv-red);
    }

    @media (max-width: 720px) {
      #matrix .matrix-main-tools {
        gap: 5px;
      }

      #matrix .matrix-category-select {
        flex: 1 1 140px;
        width: auto;
      }

      #matrix .matrix-search-input {
        flex-basis: 100%;
        min-width: 0;
      }

      #matrix .table-wrap.matrix-grid {
        max-height: calc(100vh - 210px);
      }
    }

    /* Cold-call note command processing. */
    .cold-note-box {
      display: grid;
      grid-template-columns: minmax(180px, 1fr) auto;
      gap: 5px;
      align-items: center;
      min-width: 240px;
    }

    .cold-note-box .cold-notes {
      min-width: 0;
      width: 100%;
      min-height: 32px;
      height: 32px;
      max-height: 32px;
      padding: 6px 8px;
      resize: none;
      overflow: hidden;
      border-radius: 8px;
    }

    .cold-note-send {
      align-items: center;
      display: inline-flex;
      justify-content: center;
      min-height: 30px;
      width: 30px;
      padding: 0;
      border: 1px solid var(--pfv-green);
      border-radius: 999px;
      background: var(--pfv-green);
      color: #fff;
      cursor: pointer;
      font-size: 12px;
      font-weight: 760;
      line-height: 1;
    }

    .cold-identity-cell {
      display: grid;
      gap: 3px;
      min-width: 230px;
    }

    .cold-identity-cell input {
      min-width: 0;
      width: 100%;
      min-height: 26px;
      padding: 3px 7px;
    }

    .cold-identity-cell .cold-farm-input {
      font-weight: 820;
    }

    .cold-identity-cell .cold-contact-input {
      color: var(--muted);
      font-size: 11px;
    }

    .cold-date-cell {
      align-items: center;
      display: grid;
      gap: 2px;
      min-width: 112px;
    }

    .cold-date-cell input {
      min-width: 0;
      width: 100%;
    }

    .cold-date-cell span {
      color: var(--muted);
      font-size: 10px;
      font-weight: 760;
      white-space: nowrap;
    }

    .cold-note-send:hover {
      border-color: var(--pfv-green-hover);
      background: var(--pfv-green-hover);
    }

    body.night-mode .cold-note-send {
      border-color: var(--pfv-green);
      background: var(--pfv-green);
      color: #0f1411;
    }

    body.night-mode .cold-note-send:hover {
      border-color: var(--pfv-green-hover);
      background: var(--pfv-green-hover);
      color: #0f1411;
    }

    /* Simplified Accounts controls. */
    #matrix .accounts-more-menu,
    #matrix .cold-more-menu {
      position: relative;
      flex: 0 0 auto;
    }

    #matrix .accounts-more-summary {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: 30px;
      padding: 5px 10px;
      border: 1px solid var(--pfv-line);
      border-radius: 7px;
      background: var(--pfv-panel);
      color: var(--pfv-muted);
      cursor: pointer;
      font-size: 12px;
      font-weight: 780;
      line-height: 1;
      list-style: none;
    }

    #matrix .accounts-more-summary::-webkit-details-marker {
      display: none;
    }

    #matrix .accounts-more-summary:hover {
      border-color: var(--pfv-green);
      color: var(--pfv-green-hover);
    }

    #matrix .accounts-more-popover,
    #matrix .cold-more-popover {
      position: fixed;
      z-index: 120;
      top: 50%;
      left: 50%;
      right: auto;
      transform: translate(-50%, -50%);
      display: grid;
      gap: 12px;
      width: min(420px, calc(100vw - 28px));
      max-height: min(620px, calc(100vh - 40px));
      overflow: auto;
      padding: 12px;
    }

    #matrix details[open].accounts-more-menu::before,
    #matrix details[open].cold-more-menu::before,
    #matrix details[open].matrix-selected-menu::before {
      content: "";
      position: fixed;
      z-index: 119;
      inset: 0;
      background: rgba(15, 20, 17, .28);
    }

    #matrix .accounts-more-section {
      display: grid;
      gap: 8px;
      padding-bottom: 10px;
      border-bottom: 1px solid var(--pfv-line);
    }

    #matrix .accounts-more-section:last-child {
      padding-bottom: 0;
      border-bottom: 0;
    }

    #matrix .accounts-more-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      align-items: center;
    }

    #matrix .accounts-filter-fields {
      display: grid;
      gap: 8px;
    }

    #matrix .accounts-filter-fields .matrix-inline-field {
      display: grid;
      grid-template-columns: 86px minmax(0, 1fr);
      gap: 8px;
      align-items: center;
      margin: 0;
      width: 100%;
    }

    #matrix .accounts-filter-fields .matrix-inline-field span {
      color: var(--pfv-muted);
      font-size: 11px;
      font-weight: 820;
    }

    #matrix .accounts-filter-fields input,
    #matrix .accounts-filter-fields select {
      width: 100%;
      min-width: 0;
      min-height: 32px;
      font-size: 12px;
    }

    #matrix .accounts-more-popover .accounts-view-icons {
      justify-self: start;
    }

    #matrix .accounts-more-popover .matrix-column-menu {
      max-height: 170px;
      overflow: auto;
      padding: 2px;
    }

    #matrix .cold-primary-tools {
      width: 100%;
    }

    #matrix .cold-search-label {
      display: grid;
      grid-template-columns: 48px minmax(180px, 1fr);
      flex: 1 1 320px;
      gap: 8px;
      align-items: center;
      margin: 0;
      color: var(--pfv-muted);
      font-size: 11px;
      font-weight: 820;
    }

    #matrix .cold-search-label input {
      width: 100%;
      min-width: 0;
      min-height: 32px;
      padding: 6px 9px;
      font-size: 12px;
    }

    #matrix .cold-more-popover .cold-column-menu {
      width: 100%;
    }

    #matrix .cold-more-popover .cold-column-menu summary {
      width: 100%;
      justify-content: center;
    }

    #matrix .cold-more-popover .cold-column-popover {
      position: static;
      width: 100%;
      margin-top: 8px;
      box-shadow: none;
    }

    .phone-cell {
      display: grid;
      grid-template-columns: minmax(120px, 1fr) auto;
      gap: 5px;
      align-items: center;
      min-width: 180px;
    }

    .phone-call-link {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: 28px;
      min-width: 28px;
      padding: 4px 7px;
      border: 1px solid var(--pfv-green);
      border-radius: 999px;
      background: var(--pfv-green);
      color: #fff;
      font-size: 11px;
      font-weight: 780;
      line-height: 1;
      text-decoration: none;
      white-space: nowrap;
    }

    .phone-call-link:hover {
      border-color: var(--pfv-green-hover);
      background: var(--pfv-green-hover);
      color: #fff;
    }

    body.night-mode .phone-call-link {
      color: #0f1411;
    }

    body.night-mode #matrix .accounts-more-summary {
      border-color: var(--pfv-line);
      background: #171b18;
      color: var(--pfv-muted);
    }

    body.night-mode #matrix .accounts-more-summary:hover {
      color: var(--pfv-green-hover);
    }

    /* Accounts / Cold Calls workflow switch. */
    .accounts-mode-toggle {
      display: inline-flex;
      align-items: center;
      flex: 0 0 auto;
      gap: 3px;
      min-height: 32px;
      padding: 3px;
      border: 1px solid var(--pfv-line);
      border-radius: 9px;
      background: var(--pfv-soft);
    }

    .accounts-mode-toggle button {
      min-height: 26px;
      padding: 4px 10px;
      border: 0;
      border-radius: 7px;
      background: transparent;
      color: var(--pfv-muted);
      cursor: pointer;
      font-size: 12px;
      font-weight: 780;
      line-height: 1;
      white-space: nowrap;
    }

    .accounts-mode-toggle button.active {
      background: var(--pfv-green);
      color: #fff;
      box-shadow: 0 1px 2px rgba(24, 35, 31, .12);
    }

    body.night-mode .accounts-mode-toggle {
      border-color: var(--pfv-line);
      background: #141815;
    }

    body.night-mode .accounts-mode-toggle button.active {
      color: #0f1411;
    }

    .cold-list-strip {
      display: flex;
      align-items: center;
      gap: 8px;
      margin: 0;
      min-width: 0;
    }

    .cold-list-strip > span {
      flex: 0 0 auto;
      color: var(--pfv-muted);
      font-size: 11px;
      font-weight: 860;
      text-transform: uppercase;
      letter-spacing: 0;
    }

    .cold-list-strip .cold-list-tabs {
      flex: 1 1 auto;
      min-width: 0;
      overflow-x: auto;
    }

    .cold-list-strip.excel-tabs {
      padding-top: 5px;
      border-top: 1px solid var(--pfv-line);
      background: var(--pfv-panel);
    }

    .cold-list-strip.excel-tabs .cold-list-tabs {
      gap: 3px;
      padding: 0;
      border: 0;
      border-radius: 0;
      background: transparent;
      box-shadow: none;
    }

    .cold-list-strip.excel-tabs .matrix-tab,
    .cold-list-strip.excel-tabs .button {
      min-height: 28px;
      padding: 4px 10px;
      border-radius: 8px 8px 0 0;
      border-bottom-color: transparent;
      font-size: 11px;
    }

    .cold-list-strip.excel-tabs .matrix-tab.active {
      background: var(--pfv-green);
      color: #fff;
    }

    .cold-table-footer {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      min-height: 34px;
      padding: 5px 2px 4px;
      color: var(--pfv-muted);
      font-size: 11px;
      font-weight: 760;
    }

    #matrix .accounts-cold-call-shell > .panel {
      padding: 8px;
    }

    #matrix .accounts-cold-call-toolbar {
      margin-bottom: 8px;
    }

    #matrix .accounts-cold-call-toolbar .matrix-main-tools,
    #matrix .cold-toolbar,
    #matrix .cold-filters,
    #matrix .cold-tools,
    #matrix .cold-status-filters,
    #matrix .cold-list-tabs {
      min-width: 0;
    }

    #matrix .cold-toolbar {
      padding: 6px;
      border-radius: 8px;
      margin-bottom: 6px;
    }

    #matrix .cold-tools .button,
    #matrix .cold-column-menu summary,
    #matrix .cold-filter-chip,
    #matrix .cold-list-tabs .matrix-tab {
      min-height: 30px;
      padding: 5px 9px;
      border-radius: 7px;
      font-size: 12px;
      line-height: 1;
      white-space: nowrap;
    }

    #matrix .cold-filters label {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      margin: 0;
      width: auto;
      min-width: 0;
      color: var(--pfv-muted);
      font-size: 11px;
      font-weight: 820;
      white-space: nowrap;
    }

    #matrix .cold-filters input,
    #matrix .cold-filters select {
      width: auto;
      min-width: 150px;
      min-height: 30px;
      padding: 5px 8px;
      font-size: 12px;
    }

    #matrix #coldDailyGoal {
      width: 70px;
      min-width: 70px;
    }

    #matrix .cold-status-filters {
      gap: 5px;
      margin: 5px 0 7px;
    }

    #matrix .accounts-cold-call-shell .table-wrap {
      max-height: calc(100vh - 268px);
      overflow: auto;
    }

    #matrix .cold-table {
      min-width: 980px;
    }

    #matrix .cold-table input,
    #matrix .cold-table select,
    #matrix .cold-table textarea {
      min-width: 128px;
    }

    #matrix .cold-note-box {
      min-width: 240px;
      grid-template-columns: minmax(170px, 1fr) auto;
    }

    #matrix .cold-table .cold-notes {
      min-width: 170px;
    }

    @media (max-width: 720px) {
      #matrix .accounts-mode-toggle {
        width: 100%;
      }

      #matrix .accounts-mode-toggle button {
        flex: 1 1 0;
      }

      #matrix .matrix-main-tools {
        align-items: stretch;
      }

      #matrix .matrix-main-tools .account-approval-toolbar-button,
      #matrix .matrix-main-tools .button,
      #matrix .matrix-main-tools .icon-button {
        flex: 0 0 auto;
      }

      #matrix .cold-toolbar,
      #matrix .cold-tools,
      #matrix .cold-filters,
      #matrix .cold-status-filters {
        align-items: stretch;
      }

      #matrix .cold-tools {
        width: 100%;
      }

      #matrix .cold-tools .button,
      #matrix .cold-column-menu {
        flex: 0 0 auto;
      }

      #matrix .cold-filters {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
      }

      #matrix .cold-filters label {
        display: grid;
        grid-template-columns: 74px minmax(0, 1fr);
        width: 100%;
        white-space: normal;
      }

      #matrix .cold-filters input,
      #matrix .cold-filters select {
        width: 100%;
        min-width: 0;
      }

      #matrix .cold-list-strip {
        align-items: stretch;
        gap: 5px;
      }

      #matrix .cold-status-filters {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 2px;
      }

      #matrix .cold-filter-chip {
        flex: 0 0 auto;
      }

      #matrix .table-wrap:has(.cold-table) {
        max-height: calc(100vh - 285px);
        overflow: auto;
      }

      .cold-list-strip.excel-tabs .matrix-tab,
      .cold-list-strip.excel-tabs .button {
        flex: 0 0 auto;
      }
    }

    /* Account rows as a focused work list. */
    #matrix .matrix-grid {
      border-spacing: 0;
    }

    #matrix .matrix-grid tbody tr.matrix-stage td {
      border-bottom-color: rgba(37, 50, 43, .08);
    }

    #matrix .matrix-grid tbody tr.matrix-stage-customer td {
      background: #edf7ef;
    }

    #matrix .matrix-grid tbody tr.matrix-stage-commercial td {
      background: #eef5f2;
    }

    #matrix .matrix-grid tbody tr.matrix-stage-awaiting td {
      background: #fff5e9;
    }

    #matrix .matrix-grid tbody tr.matrix-stage-testing td {
      background: #edf7f0;
    }

    #matrix .matrix-grid tbody tr.matrix-stage-setup td {
      background: #fff8e5;
    }

    #matrix .matrix-grid tbody tr.matrix-stage-evaluating td,
    #matrix .matrix-grid tbody tr.matrix-stage-lead td {
      background: #f3f6f8;
    }

    #matrix .matrix-grid tbody tr.matrix-stage-dormant td {
      background: #f2f1ee;
      color: #6d716d;
    }

    #matrix .matrix-grid tbody tr.matrix-stage-neutral td {
      background: var(--pfv-panel);
    }

    #matrix .matrix-grid tbody tr.matrix-stage:hover td {
      filter: brightness(.985);
    }

    #matrix .matrix-grid tbody tr.matrix-stage td:first-child {
      box-shadow: inset 5px 0 0 #a8b2aa;
    }

    #matrix .matrix-grid tbody tr.matrix-stage-customer td:first-child,
    #matrix .matrix-grid tbody tr.matrix-stage-commercial td:first-child {
      box-shadow: inset 5px 0 0 var(--pfv-green);
    }

    #matrix .matrix-grid tbody tr.matrix-stage-testing td:first-child {
      box-shadow: inset 5px 0 0 #4d8d6a;
    }

    #matrix .matrix-grid tbody tr.matrix-stage-awaiting td:first-child,
    #matrix .matrix-grid tbody tr.matrix-stage-setup td:first-child {
      box-shadow: inset 5px 0 0 var(--pfv-gold);
    }

    #matrix .matrix-grid tbody tr.matrix-stage-lead td:first-child,
    #matrix .matrix-grid tbody tr.matrix-stage-evaluating td:first-child {
      box-shadow: inset 5px 0 0 #8ca0b3;
    }

    #matrix .matrix-company-cell {
      display: grid;
      gap: 2px;
      min-width: 240px;
    }

    #matrix .matrix-note-composer {
      min-width: 220px;
    }

    #matrix .matrix-company-cell span {
      color: var(--pfv-muted);
      font-size: 11px;
      font-weight: 620;
      line-height: 1.2;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    #matrix .matrix-company-button strong {
      font-size: 13px;
      line-height: 1.15;
    }

    #matrix .matrix-action-cell .matrix-multi-picker summary {
      min-width: 150px;
      max-width: 220px;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    #matrix .matrix-date-cell {
      display: grid;
      grid-template-columns: 1fr;
      gap: 2px;
      min-width: 96px;
    }

    #matrix .matrix-date-cell input {
      min-width: 0;
      width: 100%;
    }

    #matrix .matrix-date-cell span {
      color: var(--pfv-muted);
      font-size: 10px;
      font-weight: 780;
      line-height: 1;
    }

    #matrix .matrix-date-cell.overdue span {
      color: var(--pfv-red);
    }

    #matrix .matrix-lead-cell select {
      min-width: 96px;
    }

    .cold-list-strip.excel-tabs {
      position: sticky;
      bottom: 0;
      z-index: 8;
      margin-top: 0;
      padding: 6px 2px 0;
      box-shadow: 0 -8px 18px rgba(24, 35, 31, .04);
    }

    .cold-list-strip.excel-tabs .matrix-tab,
    .cold-list-strip.excel-tabs .button {
      flex: 0 0 auto;
      max-width: 280px;
      min-width: 104px;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    body.night-mode #matrix .matrix-grid tbody tr.matrix-stage-customer td,
    body.night-mode #matrix .matrix-grid tbody tr.matrix-stage-commercial td {
      background: #142019;
    }

    body.night-mode #matrix .matrix-grid tbody tr.matrix-stage-testing td {
      background: #151f19;
    }

    body.night-mode #matrix .matrix-grid tbody tr.matrix-stage-awaiting td,
    body.night-mode #matrix .matrix-grid tbody tr.matrix-stage-setup td {
      background: #241f13;
    }

    body.night-mode #matrix .matrix-grid tbody tr.matrix-stage-evaluating td,
    body.night-mode #matrix .matrix-grid tbody tr.matrix-stage-lead td {
      background: #1a1f25;
    }

    body.night-mode #matrix .matrix-grid tbody tr.matrix-stage-dormant td {
      background: #1d1d1b;
      color: #a8aca8;
    }

    /* Compact popup and picker pass. */
    #matrix .matrix-action-cell .matrix-multi-picker {
      min-width: 118px;
      width: max-content;
      max-width: 156px;
    }

    #matrix .matrix-action-cell .matrix-action-select {
      min-width: 132px;
      max-width: 156px;
      min-height: 30px;
      height: 30px;
      border-radius: 6px;
      font-weight: 780;
    }

    #matrix .matrix-action-select.matrix-action-call { background: #edf3ff; color: #3f54bf; border-color: #d3ddff; }
    #matrix .matrix-action-select.matrix-action-email { background: #f3f0ff; color: #6650b8; border-color: #ddd5ff; }
    #matrix .matrix-action-select.matrix-action-visit { background: #eff6ff; color: #315c92; border-color: #cadcf4; }
    #matrix .matrix-action-select.matrix-action-review { background: #fff7df; color: #745718; border-color: #e8d396; }
    #matrix .matrix-action-select.matrix-action-order { background: #fff0e8; color: #8a4626; border-color: #efc4ae; }
    #matrix .matrix-action-select.matrix-action-follow { background: #f1f4f9; color: #46546a; border-color: #ccd5e4; }
    #matrix .matrix-action-select.matrix-action-general { background: #f2f3f6; color: #606776; border-color: #d9dee7; }

    body.night-mode #matrix .matrix-action-select.matrix-action-call { background: #1d2439; color: #c6d0ff; border-color: #303a5c; }
    body.night-mode #matrix .matrix-action-select.matrix-action-email { background: #251f38; color: #dbcfff; border-color: #4d426d; }
    body.night-mode #matrix .matrix-action-select.matrix-action-visit { background: #17243a; color: #bdd4ff; border-color: #324b75; }
    body.night-mode #matrix .matrix-action-select.matrix-action-review { background: #312812; color: #f4d983; border-color: #67511e; }
    body.night-mode #matrix .matrix-action-select.matrix-action-order { background: #321d14; color: #efb79b; border-color: #70432d; }
    body.night-mode #matrix .matrix-action-select.matrix-action-follow { background: #1a2230; color: #c2cce0; border-color: #364157; }
    body.night-mode #matrix .matrix-action-select.matrix-action-general { background: #1a1d25; color: #b9c0ce; border-color: #363c49; }

    #matrix .matrix-action-cell .matrix-multi-picker summary,
    #matrix .matrix-grid .matrix-multi-picker summary {
      min-width: 118px;
      max-width: 156px;
      min-height: 28px;
      padding: 4px 8px;
      border-radius: 999px;
      font-size: 11px;
      font-weight: 760;
      line-height: 1;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    #matrix .matrix-grid .matrix-multi-picker summary::after {
      content: "v";
      flex: 0 0 auto;
      color: var(--pfv-muted);
      font-size: 10px;
      font-weight: 760;
      text-transform: none;
      letter-spacing: 0;
    }

    #matrix .matrix-grid .matrix-multi-picker[open] {
      width: min(300px, calc(100vw - 32px));
      max-width: min(300px, calc(100vw - 32px));
      max-height: min(380px, calc(100vh - 48px));
      padding: 10px;
      border-radius: 10px;
      box-shadow: 0 20px 54px rgba(15, 23, 42, .20);
    }

    #matrix .matrix-grid .matrix-multi-picker[open] summary {
      width: 100%;
      min-width: 0;
      max-width: none;
      min-height: 30px;
      margin-bottom: 8px;
      border-radius: 8px;
      font-size: 12px;
    }

    #matrix .matrix-grid .matrix-multi-picker[open] summary::after {
      content: "Done";
      font-size: 10px;
      color: rgba(255,255,255,.72);
    }

    #matrix .matrix-grid .matrix-multi-picker input[type="search"] {
      min-height: 30px;
      margin-bottom: 8px;
      padding: 5px 8px;
      font-size: 12px;
    }

    #matrix .matrix-grid .matrix-multi-picker .next-step-options {
      max-height: 190px;
      gap: 5px;
    }

    #matrix .matrix-grid .matrix-multi-picker .next-step-options label {
      min-height: 28px;
      padding: 5px 7px;
      border-radius: 7px;
      font-size: 12px;
      line-height: 1.15;
    }

    #matrix .matrix-grid .matrix-multi-picker .row-actions {
      gap: 6px;
      margin-top: 6px;
    }

    #matrix .matrix-grid .matrix-multi-picker .row-actions input {
      min-height: 30px;
      padding: 5px 8px;
      font-size: 12px;
    }

    #matrix .accounts-more-popover,
    #matrix .cold-more-popover,
    #matrix .matrix-selected-popover,
    #matrix .matrix-filter-popover,
    #matrix .matrix-tool-popover {
      width: min(340px, calc(100vw - 28px));
      max-height: min(500px, calc(100vh - 42px));
      gap: 9px;
      padding: 10px;
      border-radius: 10px;
    }

    #matrix .accounts-more-popover .button,
    #matrix .cold-more-popover .button,
    #matrix .matrix-tool-popover .button,
    #matrix .accounts-more-popover .icon-button,
    #matrix .cold-more-popover .icon-button,
    #matrix .matrix-tool-popover .icon-button {
      min-height: 30px;
      padding: 5px 9px;
      font-size: 12px;
    }

    #matrix .accounts-more-section {
      gap: 6px;
      padding-bottom: 8px;
    }

    #matrix .accounts-filter-fields {
      gap: 6px;
    }

    #matrix .accounts-filter-fields .matrix-inline-field {
      grid-template-columns: 74px minmax(0, 1fr);
    }

    #matrix .accounts-more-popover .matrix-column-menu {
      max-height: 130px;
    }

    .quick-modal,
    .settings-modal,
    .order-modal,
    .bulk-inbox-modal,
    .trial-focus-modal,
    .trial-detail-modal,
    .profile-modal-panel,
    .account-approval-modal,
    .task-completion-modal {
      width: min(560px, calc(100vw - 28px));
      max-height: min(640px, calc(100vh - 28px));
      padding: 14px;
      border-radius: 10px;
    }

    .order-modal,
    .trial-detail-modal,
    .trial-focus-modal,
    .bulk-inbox-modal,
    .profile-modal-panel {
      width: min(760px, calc(100vw - 28px));
    }

    .quick-modal-head,
    .settings-modal-head,
    .order-modal-head,
    .trial-focus-header {
      gap: 4px;
      padding-bottom: 10px;
      margin-bottom: 10px;
    }

    .quick-modal-head h2,
    .settings-modal-head h2,
    .order-modal-head h2,
    .trial-focus-header h2 {
      font-size: 18px;
      line-height: 1.15;
    }

    .quick-modal label,
    .settings-modal label,
    .order-modal label,
    .trial-detail-modal label,
    .profile-modal-panel label {
      gap: 4px;
      font-size: 12px;
    }

    .quick-modal input,
    .quick-modal select,
    .quick-modal textarea,
    .settings-modal input,
    .settings-modal select,
    .settings-modal textarea,
    .order-modal input,
    .order-modal select,
    .order-modal textarea,
    .trial-detail-modal input,
    .trial-detail-modal select,
    .trial-detail-modal textarea,
    .profile-modal-panel input,
    .profile-modal-panel select,
    .profile-modal-panel textarea {
      min-height: 32px;
      padding: 6px 9px;
      font-size: 12px;
    }

    .quick-call-popover {
      width: min(220px, calc(100vw - 28px));
      padding: 8px;
      border-radius: 10px;
    }

    .modal-close,
    .popover-close,
    .account-approval-close {
      width: 28px;
      height: 28px;
      min-width: 28px;
      min-height: 28px;
      border-radius: 8px;
      font-size: 15px;
    }

    @media (max-width: 720px) {
      #matrix .matrix-action-cell .matrix-multi-picker {
        min-width: 112px;
        max-width: 140px;
      }

      #matrix .matrix-action-cell .matrix-multi-picker summary,
      #matrix .matrix-grid .matrix-multi-picker summary {
        min-width: 112px;
        max-width: 140px;
      }

      .quick-modal,
      .settings-modal,
      .order-modal,
      .bulk-inbox-modal,
      .trial-focus-modal,
      .trial-detail-modal,
      .profile-modal-panel,
      .account-approval-modal,
      .task-completion-modal {
        width: min(100vw - 18px, 560px);
        max-height: calc(100vh - 18px);
        padding: 10px;
      }
    }

    /* App-wide scroll normalization pass. */
    html {
      min-height: 100%;
      scroll-padding: 18px 0 48px;
    }

    body {
      min-height: 100dvh;
      overflow-x: hidden;
      overflow-y: auto;
    }

    #appView,
    #appView.app {
      align-items: start;
      min-height: 100dvh;
    }

    #appView main {
      min-height: 100dvh;
      overflow: visible;
      padding-bottom: max(56px, env(safe-area-inset-bottom));
    }

    #appView .page {
      min-height: calc(100dvh - 138px);
      padding-bottom: 18px;
      overflow: visible;
    }

    #appView .panel {
      min-height: 0;
    }

    .table-wrap,
    .vision-table-wrap,
    .matrix-grid.table-wrap,
    .sales-table-wrap,
    .experiment-db-wrap,
    .cold-lead-table-wrap {
      max-height: none !important;
      overflow-x: auto;
      scrollbar-gutter: stable;
      overscroll-behavior: auto;
    }

    #matrix .table-wrap.matrix-grid,
    #matrix .accounts-cold-call-shell .table-wrap,
    #matrix .table-wrap:has(.cold-table),
    #trials .experiment-db-wrap,
    #sales .sales-table-wrap {
      max-height: none !important;
    }

    #overview .command-task-list,
    #overview .command-agenda-list,
    #overview .command-task-strip.embedded .command-task-list {
      max-height: none;
    }

    .modal-backdrop,
    #quickUploadRoot .modal-backdrop,
    #bulkInboxRoot .modal-backdrop {
      overflow: auto;
      overscroll-behavior: contain;
      padding-block: 14px;
    }

    .quick-modal,
    .settings-modal,
    .order-modal,
    .bulk-inbox-modal,
    .trial-focus-modal,
    .trial-detail-modal,
    .profile-modal-panel,
    .account-approval-modal,
    .task-completion-modal {
      overscroll-behavior: contain;
      scrollbar-gutter: stable;
    }

    .trial-detail-modal {
      width: min(1040px, calc(100vw - 28px)) !important;
      height: min(840px, calc(100dvh - 28px)) !important;
      max-height: calc(100dvh - 28px) !important;
      padding: 0 !important;
      overflow: hidden !important;
      display: flex;
      flex-direction: column;
    }

    .trial-detail-modal .trial-detail-header {
      position: sticky;
      top: 0;
      z-index: 8;
      margin: 0;
      padding: 14px 16px;
    }

    .trial-detail-tabs {
      position: static;
      top: auto;
      z-index: 7;
    }

    .trial-detail-body {
      flex: 1 1 auto;
      min-height: 360px;
      overflow: auto;
      padding: 12px 16px;
      scrollbar-gutter: stable;
    }

    .trial-dossier-grid.compact {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .trial-dossier-grid.compact .trial-dossier-section p {
      display: block;
      overflow: visible;
    }

    .trial-experience-layout {
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      gap: 8px;
      align-items: start;
    }

    .trial-main-card,
    .trial-result-summary-card {
      display: grid;
      gap: 8px;
      align-items: start;
      padding: 10px 12px;
      border: 1px solid var(--pfv-line, var(--line));
      border-radius: 8px;
      background: linear-gradient(135deg, rgba(49, 123, 90, .12), rgba(97, 124, 177, .1));
    }

    .trial-result-summary-card {
      grid-template-columns: minmax(0, 1fr) auto;
    }

    .trial-result-actions {
      display: flex;
      align-items: start;
      justify-content: flex-end;
      gap: 8px;
      flex-wrap: wrap;
    }

    .trial-sibling-switcher {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 6px;
      margin-top: 8px;
    }

    .trial-sibling-switcher > span {
      color: var(--muted);
      font-size: 10px;
      font-weight: 900;
      letter-spacing: .04em;
      text-transform: uppercase;
    }

    .trial-sibling-switcher button {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      min-height: 24px;
      padding: 3px 8px;
      border: 1px solid var(--pfv-line, var(--line));
      border-radius: 999px;
      background: var(--pfv-panel, #fff);
      color: var(--ink);
      font-size: 11px;
      font-weight: 850;
      cursor: pointer;
    }

    .trial-sibling-switcher .trial-svg-icon {
      width: 14px;
      height: 14px;
      color: var(--pfv-green-strong, #2f7d56);
    }

    .trial-main-card {
      align-content: start;
      border-left-width: 4px;
    }

    .trial-feature-heading,
    .trial-card-kicker,
    .trial-crop-card-header {
      display: flex;
      align-items: center;
      gap: 10px;
      min-width: 0;
    }

    .trial-feature-heading {
      align-items: flex-start;
    }

    .trial-card-kicker {
      gap: 8px;
    }

    .trial-svg-icon {
      width: 18px;
      height: 18px;
      display: block;
      fill: none;
      stroke: currentColor;
      stroke-width: 1.75;
      stroke-linecap: round;
      stroke-linejoin: round;
      flex: 0 0 auto;
    }

    .trial-hero-icon,
    .trial-card-kicker .trial-svg-icon,
    .trial-crop-icon {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      flex: 0 0 auto;
      border: 1px solid color-mix(in srgb, currentColor 22%, transparent);
      background: color-mix(in srgb, currentColor 9%, #fff);
      color: var(--pfv-green-strong, #2f7d56);
    }

    .trial-hero-icon {
      width: 30px;
      height: 30px;
      border-radius: 999px;
      box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .42);
    }

    .trial-hero-icon .trial-svg-icon {
      width: 16px;
      height: 16px;
    }

    .trial-card-kicker .trial-svg-icon {
      width: 20px;
      height: 20px;
      padding: 4px;
      border-radius: 7px;
    }

    .trial-crop-icon {
      width: 30px;
      height: 30px;
      border-radius: 8px;
    }

    .trial-crop-icon .trial-svg-icon {
      width: 17px;
      height: 17px;
    }

    .signal-water .trial-hero-icon,
    .signal-water .trial-card-kicker .trial-svg-icon,
    .signal-water .trial-crop-icon {
      color: #3f7ea8;
    }

    .signal-heat .trial-hero-icon,
    .signal-heat .trial-card-kicker .trial-svg-icon,
    .signal-heat .trial-crop-icon {
      color: #a8741d;
    }

    .signal-control .trial-hero-icon,
    .signal-control .trial-card-kicker .trial-svg-icon,
    .signal-control .trial-crop-icon {
      color: #697082;
    }

    .signal-opinion .trial-hero-icon,
    .signal-opinion .trial-card-kicker .trial-svg-icon,
    .signal-opinion .trial-crop-icon {
      color: #7d5b91;
    }

    .signal-pending .trial-hero-icon,
    .signal-pending .trial-card-kicker .trial-svg-icon,
    .signal-pending .trial-crop-icon {
      color: #995f45;
    }

    .trial-main-card h3,
    .trial-result-summary-card h3 {
      margin: 2px 0 0;
      color: var(--ink);
      font-size: 14px;
      line-height: 1.3;
    }

    .trial-main-card p {
      margin: 0;
      color: var(--ink);
      font-size: 12px;
      line-height: 1.35;
    }

    .trial-metric-rail {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 6px;
    }

    .trial-brief-main {
      display: grid;
      gap: 10px;
      min-width: 0;
    }

    .trial-metric-card {
      min-width: 0;
      padding: 8px;
      border: 1px solid var(--pfv-line, var(--line));
      border-left-width: 3px;
      border-radius: 8px;
      background: #fff;
    }

    .trial-card-kicker span,
    .trial-metric-card span {
      display: inline-block;
      color: var(--muted);
      font-size: 9px;
      font-weight: 900;
      text-transform: uppercase;
      letter-spacing: .04em;
    }

    .trial-metric-card strong {
      display: block;
      margin-top: 5px;
      color: var(--ink);
      font-size: 11px;
      line-height: 1.25;
      white-space: normal;
    }

    .trial-result-chip-row {
      display: flex;
      flex-wrap: wrap;
      justify-content: flex-end;
      gap: 6px;
      max-width: 390px;
    }

    .trial-result-chip-row span {
      padding: 5px 7px;
      border: 1px solid var(--pfv-line, var(--line));
      border-radius: 999px;
      background: #fff;
      color: var(--ink);
      font-size: 11px;
      font-weight: 900;
      white-space: nowrap;
    }

    .trial-result-signal-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
      gap: 10px;
    }

    .trial-result-signal,
    .trial-result-context,
    .trial-metric-card {
      min-width: 0;
      padding: 13px;
      border: 1px solid var(--pfv-line, var(--line));
      border-left-width: 4px;
      border-radius: 8px;
      background: #fff;
    }

    .trial-result-signal span,
    .trial-result-context span {
      display: inline-block;
      color: var(--muted);
      font-size: 10px;
      font-weight: 900;
      text-transform: uppercase;
      letter-spacing: .04em;
    }

    .trial-result-signal strong,
    .trial-result-context p {
      display: block;
      margin: 6px 0 0;
      color: var(--ink);
      font-size: 13px;
      font-weight: 760;
      line-height: 1.5;
      white-space: normal;
    }

    .trial-signal-photo {
      display: grid;
      grid-template-columns: 58px minmax(0, 1fr);
      align-items: center;
      gap: 8px;
      margin-top: 10px;
      padding: 6px;
      border: 1px solid color-mix(in srgb, currentColor 16%, transparent);
      border-radius: 7px;
      color: inherit;
      text-decoration: none;
      background: rgba(255, 255, 255, .52);
    }

    .trial-signal-photo img {
      width: 58px;
      height: 44px;
      border-radius: 5px;
      object-fit: cover;
      border: 1px solid var(--pfv-line, var(--line));
    }

    .trial-signal-photo span {
      color: var(--ink);
      font-size: 11px;
      font-weight: 900;
      text-transform: none;
      letter-spacing: 0;
    }

    .trial-signal-photo:hover {
      transform: translateY(-1px);
      box-shadow: 0 8px 18px rgba(18, 24, 20, .08);
    }

    .trial-result-context-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
    }

    .trial-result-metric-panel {
      display: grid;
      gap: 10px;
      padding: 14px;
      border: 1px solid var(--pfv-line, var(--line));
      border-radius: 8px;
      background: color-mix(in srgb, var(--panel) 82%, white);
    }

    .trial-result-metric-groups {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
      gap: 10px;
    }

    .trial-result-metric-group {
      min-width: 0;
      padding: 11px;
      border: 1px solid var(--pfv-line, var(--line));
      border-radius: 8px;
      background: var(--panel);
    }

    .trial-result-metric-group h4 {
      margin: 0 0 8px;
      color: var(--ink);
      font-size: 12px;
      font-weight: 900;
    }

    .trial-result-metric-rows {
      display: grid;
      gap: 9px;
    }

    .trial-result-metric-row {
      min-width: 0;
      padding: 9px;
      border-radius: 7px;
      background: color-mix(in srgb, var(--panel) 90%, var(--pfv-green, #2f7a4e));
    }

    .trial-result-metric-title {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: 8px;
      margin-bottom: 7px;
    }

    .trial-result-metric-title strong {
      min-width: 0;
      color: var(--ink);
      font-size: 12px;
      font-weight: 900;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .trial-result-metric-title span {
      color: var(--pfv-green, #2f7a4e);
      font-size: 11px;
      font-weight: 900;
      white-space: nowrap;
    }

    .trial-result-bars {
      display: grid;
      gap: 5px;
    }

    .trial-result-bar-line {
      display: grid;
      grid-template-columns: 58px minmax(56px, 1fr) minmax(70px, auto);
      align-items: center;
      gap: 8px;
      color: var(--muted);
      font-size: 10px;
      font-weight: 850;
    }

    .trial-result-bar-line div {
      height: 7px;
      overflow: hidden;
      border-radius: 999px;
      background: color-mix(in srgb, var(--line) 70%, transparent);
    }

    .trial-result-bar-line i {
      display: block;
      height: 100%;
      border-radius: inherit;
      background: var(--pfv-green, #2f7a4e);
    }

    .trial-result-bar-line.control i {
      background: #8b929f;
    }

    .trial-result-bar-line b {
      color: var(--ink);
      font-size: 10px;
      font-weight: 900;
      text-align: right;
    }

    .trial-result-metric-row p {
      margin: 7px 0 0;
      color: var(--muted);
      font-size: 11px;
      font-weight: 760;
      line-height: 1.35;
    }

    .trial-crop-card-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 10px;
    }

    .trial-crop-card {
      min-height: 136px;
      display: grid;
      align-content: start;
      gap: 8px;
      padding: 14px;
      border: 1px solid var(--pfv-line, var(--line));
      border-left-width: 4px;
      border-radius: 8px;
      background: #fff;
      cursor: pointer;
      transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
    }

    .trial-crop-card:hover,
    .trial-crop-card.active {
      transform: translateY(-1px);
      box-shadow: 0 12px 28px rgba(18, 24, 20, .08);
    }

    .trial-crop-card > span,
    .trial-crop-card-header > span:not(.trial-crop-icon) {
      color: var(--muted);
      font-size: 10px;
      font-weight: 900;
      text-transform: uppercase;
      letter-spacing: .04em;
    }

    .trial-crop-card strong {
      color: var(--ink);
      font-size: 13px;
      line-height: 1.3;
    }

    .trial-crop-card p {
      margin: 0;
      color: var(--ink);
      font-size: 12px;
      line-height: 1.45;
    }

    .trial-setup-fact-row {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 8px;
    }

    .trial-setup-fact {
      min-width: 0;
      padding: 10px;
      border: 1px solid var(--pfv-line, var(--line));
      border-left-width: 4px;
      border-radius: 8px;
      background: #fff;
    }

    .trial-setup-fact span,
    .trial-setup-section-card span {
      display: inline-block;
      color: var(--muted);
      font-size: 10px;
      font-weight: 900;
      text-transform: uppercase;
      letter-spacing: .04em;
    }

    .trial-setup-fact strong {
      display: block;
      margin-top: 5px;
      color: var(--ink);
      font-size: 12px;
      line-height: 1.35;
      white-space: normal;
    }

    .trial-setup-section-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 8px;
    }

    .trial-setup-section-card {
      min-width: 0;
      padding: 9px;
      border: 1px solid var(--pfv-line, var(--line));
      border-left-width: 3px;
      border-radius: 8px;
      background: #fff;
    }

    .trial-setup-section-card p {
      margin: 6px 0 0;
      color: var(--ink);
      font-size: 12px;
      line-height: 1.35;
      white-space: pre-wrap;
    }

    .trial-result-signal.signal-growth,
    .trial-result-context.signal-growth,
    .trial-main-card.signal-growth,
    .trial-metric-card.signal-growth,
    .trial-crop-card.signal-growth,
    .trial-setup-fact.signal-growth,
    .trial-setup-section-card.signal-growth,
    .trial-result-chip-row .signal-growth { border-color: #7db686; background-color: #f1f7f2; }
    .trial-result-signal.signal-heat,
    .trial-result-context.signal-heat,
    .trial-main-card.signal-heat,
    .trial-metric-card.signal-heat,
    .trial-crop-card.signal-heat,
    .trial-setup-fact.signal-heat,
    .trial-setup-section-card.signal-heat,
    .trial-result-chip-row .signal-heat { border-color: #dbb35a; background-color: #fff7e6; }
    .trial-result-signal.signal-water,
    .trial-result-context.signal-water,
    .trial-main-card.signal-water,
    .trial-metric-card.signal-water,
    .trial-crop-card.signal-water,
    .trial-setup-fact.signal-water,
    .trial-setup-section-card.signal-water,
    .trial-result-chip-row .signal-water { border-color: #78a8cf; background-color: #eef6fb; }
    .trial-result-signal.signal-control,
    .trial-result-context.signal-control,
    .trial-main-card.signal-control,
    .trial-metric-card.signal-control,
    .trial-crop-card.signal-control,
    .trial-setup-fact.signal-control,
    .trial-setup-section-card.signal-control,
    .trial-result-chip-row .signal-control { border-color: #9b9fb0; background-color: #f5f6f8; }
    .trial-result-signal.signal-opinion,
    .trial-result-context.signal-opinion,
    .trial-main-card.signal-opinion,
    .trial-metric-card.signal-opinion,
    .trial-result-chip-row .signal-opinion { border-color: #b08ac4; background-color: #f7f1fa; }
    .trial-result-signal.signal-pending,
    .trial-result-context.signal-pending,
    .trial-main-card.signal-pending,
    .trial-metric-card.signal-pending,
    .trial-result-chip-row .signal-pending { border-color: #c18f78; background-color: #fff3ef; }

    body.night-mode .trial-main-card,
    body.night-mode .trial-result-summary-card {
      border-color: var(--pfv-line);
      background: linear-gradient(135deg, rgba(72, 124, 92, .16), rgba(96, 115, 158, .14));
    }

    body.night-mode .trial-result-chip-row span,
    body.night-mode .trial-sibling-switcher button,
    body.night-mode .trial-result-signal,
    body.night-mode .trial-result-context,
    body.night-mode .trial-metric-card,
    body.night-mode .trial-crop-card,
    body.night-mode .trial-setup-fact,
    body.night-mode .trial-setup-section-card,
    body.night-mode .trial-detail-composer-shell {
      border-color: var(--pfv-line);
      background: var(--pfv-panel-soft);
      color: var(--pfv-text);
    }

    body.night-mode .trial-hero-icon,
    body.night-mode .trial-card-kicker .trial-svg-icon,
    body.night-mode .trial-crop-icon {
      border-color: color-mix(in srgb, currentColor 34%, transparent);
      background: color-mix(in srgb, currentColor 16%, var(--pfv-panel-soft));
      box-shadow: none;
    }

    body.night-mode .trial-result-signal.signal-growth,
    body.night-mode .trial-result-context.signal-growth,
    body.night-mode .trial-main-card.signal-growth,
    body.night-mode .trial-metric-card.signal-growth,
    body.night-mode .trial-crop-card.signal-growth,
    body.night-mode .trial-setup-fact.signal-growth,
    body.night-mode .trial-setup-section-card.signal-growth,
    body.night-mode .trial-result-chip-row .signal-growth { border-color: #6a9d76; background-color: rgba(74, 124, 85, .18); }
    body.night-mode .trial-result-signal.signal-heat,
    body.night-mode .trial-result-context.signal-heat,
    body.night-mode .trial-main-card.signal-heat,
    body.night-mode .trial-metric-card.signal-heat,
    body.night-mode .trial-crop-card.signal-heat,
    body.night-mode .trial-setup-fact.signal-heat,
    body.night-mode .trial-setup-section-card.signal-heat,
    body.night-mode .trial-result-chip-row .signal-heat { border-color: #a78445; background-color: rgba(157, 119, 46, .18); }
    body.night-mode .trial-result-signal.signal-water,
    body.night-mode .trial-result-context.signal-water,
    body.night-mode .trial-main-card.signal-water,
    body.night-mode .trial-metric-card.signal-water,
    body.night-mode .trial-crop-card.signal-water,
    body.night-mode .trial-setup-fact.signal-water,
    body.night-mode .trial-setup-section-card.signal-water,
    body.night-mode .trial-result-chip-row .signal-water { border-color: #5f8aa8; background-color: rgba(64, 100, 132, .2); }
    body.night-mode .trial-result-signal.signal-control,
    body.night-mode .trial-result-context.signal-control,
    body.night-mode .trial-main-card.signal-control,
    body.night-mode .trial-metric-card.signal-control,
    body.night-mode .trial-crop-card.signal-control,
    body.night-mode .trial-setup-fact.signal-control,
    body.night-mode .trial-setup-section-card.signal-control,
    body.night-mode .trial-result-chip-row .signal-control { border-color: #747989; background-color: rgba(116, 121, 137, .18); }
    body.night-mode .trial-result-signal.signal-opinion,
    body.night-mode .trial-result-context.signal-opinion,
    body.night-mode .trial-main-card.signal-opinion,
    body.night-mode .trial-metric-card.signal-opinion,
    body.night-mode .trial-result-chip-row .signal-opinion { border-color: #8d719f; background-color: rgba(128, 96, 144, .18); }
    body.night-mode .trial-result-signal.signal-pending,
    body.night-mode .trial-result-context.signal-pending,
    body.night-mode .trial-main-card.signal-pending,
    body.night-mode .trial-metric-card.signal-pending,
    body.night-mode .trial-result-chip-row .signal-pending { border-color: #a87864; background-color: rgba(145, 88, 64, .18); }

    body.night-mode .trial-signal-photo {
      background: rgba(255, 255, 255, .05);
      border-color: var(--pfv-line);
    }

    body.night-mode .trial-signal-photo span {
      color: var(--pfv-text);
    }

    .trial-detail-composer {
      position: static;
      bottom: 0;
      z-index: 7;
      padding: 10px 0 0;
      border-top: 0;
    }

    .trial-detail-composer-shell {
      margin-top: 8px;
      border: 1px solid var(--pfv-line, var(--line));
      border-radius: 8px;
      background: #fff;
    }

    .trial-detail-composer-shell.is-open {
      padding: 6px;
    }

    .trial-detail-composer-shell .trial-inline-composer {
      grid-template-columns: 28px minmax(0, 1fr) 28px;
      gap: 7px;
      align-items: center;
      margin-top: 0;
      padding: 6px;
      border-radius: 999px;
    }

    .trial-detail-composer-shell .trial-inline-composer textarea {
      height: 28px;
      min-height: 28px;
      max-height: 28px;
      padding: 5px 8px;
      font-size: 12px;
      line-height: 1.3;
      resize: none;
    }

    .trial-detail-composer-shell .trial-inline-composer .icon-button {
      width: 28px;
      height: 28px;
      min-height: 28px;
    }

    .trial-detail-composer-shell summary {
      padding: 9px 11px;
      color: var(--ink);
      cursor: pointer;
      font-size: 12px;
      font-weight: 900;
      list-style: none;
    }

    .trial-detail-composer-shell summary::-webkit-details-marker {
      display: none;
    }

    .trial-detail-composer-shell summary::after {
      content: '+';
      float: right;
      color: var(--muted);
    }

    .trial-detail-composer-shell[open] summary::after {
      content: '−';
    }

    .trial-detail-composer-shell .trial-detail-composer {
      padding: 0 10px 10px;
    }

    .trial-detail-composer-shell.is-open .trial-detail-composer {
      padding: 0;
    }

    .trial-danger-zone {
      margin: 8px 0 0;
      padding: 0 2px 2px;
    }

    @media (max-width: 1050px) {
      #appView main {
        min-height: auto;
        padding-bottom: max(64px, env(safe-area-inset-bottom));
      }

      #appView .page {
        min-height: calc(100dvh - 128px);
      }
    }

    @media (max-width: 720px) {
      html {
        scroll-padding-bottom: 72px;
      }

      #appView main {
        overflow-x: hidden;
      }

      .table-wrap,
      .vision-table-wrap,
      .matrix-grid.table-wrap,
      .sales-table-wrap,
      .experiment-db-wrap,
      .cold-lead-table-wrap {
        width: 100%;
        max-width: 100%;
      }

      .trial-dossier-grid.compact,
      .trial-experience-layout,
      .trial-result-signal-grid,
      .trial-result-context-grid,
      .trial-crop-card-grid,
      .trial-setup-section-grid,
      .trial-result-summary-card {
        grid-template-columns: 1fr;
      }

      .trial-metric-rail,
      .trial-setup-fact-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }

      .trial-result-chip-row {
        justify-content: flex-start;
      }

      .trial-result-actions {
        justify-content: flex-start;
      }

      .trial-detail-tabs {
        top: 62px;
      }
    }

    /* Final status palette override: this must stay last so old faded row rules do not win. */
    #matrix .matrix-grid tbody tr.matrix-stage-lead td {
      background: color-mix(in srgb, var(--status-lead-bg) 54%, var(--pfv-panel)) !important;
    }

    #matrix .matrix-grid tbody tr.matrix-stage-evaluating td {
      background: color-mix(in srgb, var(--status-discussion-bg) 52%, var(--pfv-panel)) !important;
    }

    #matrix .matrix-grid tbody tr.matrix-stage-setup td {
      background: color-mix(in srgb, var(--status-setup-bg) 48%, var(--pfv-panel)) !important;
    }

    #matrix .matrix-grid tbody tr.matrix-stage-testing td {
      background: color-mix(in srgb, var(--status-testing-bg) 50%, var(--pfv-panel)) !important;
    }

    #matrix .matrix-grid tbody tr.matrix-stage-awaiting td {
      background: color-mix(in srgb, var(--status-awaiting-bg) 48%, var(--pfv-panel)) !important;
    }

    #matrix .matrix-grid tbody tr.matrix-stage-commercial td {
      background: color-mix(in srgb, var(--status-commercial-bg) 46%, var(--pfv-panel)) !important;
    }

    #matrix .matrix-grid tbody tr.matrix-stage-customer td {
      background: color-mix(in srgb, var(--status-customer-bg) 52%, var(--pfv-panel)) !important;
    }

    #matrix .matrix-grid tbody tr.matrix-stage-dormant td {
      background: color-mix(in srgb, var(--status-dormant-bg) 56%, var(--pfv-panel)) !important;
    }

    #matrix .matrix-grid tbody tr.matrix-stage-neutral td {
      background: var(--pfv-panel) !important;
    }

    #matrix .matrix-grid tbody tr.matrix-stage-lead td:first-child { box-shadow: inset 5px 0 0 var(--status-lead) !important; }
    #matrix .matrix-grid tbody tr.matrix-stage-evaluating td:first-child { box-shadow: inset 5px 0 0 var(--status-discussion) !important; }
    #matrix .matrix-grid tbody tr.matrix-stage-setup td:first-child { box-shadow: inset 5px 0 0 var(--status-setup) !important; }
    #matrix .matrix-grid tbody tr.matrix-stage-testing td:first-child { box-shadow: inset 5px 0 0 var(--status-testing) !important; }
    #matrix .matrix-grid tbody tr.matrix-stage-awaiting td:first-child { box-shadow: inset 5px 0 0 var(--status-awaiting) !important; }
    #matrix .matrix-grid tbody tr.matrix-stage-commercial td:first-child { box-shadow: inset 5px 0 0 var(--status-commercial) !important; }
    #matrix .matrix-grid tbody tr.matrix-stage-customer td:first-child { box-shadow: inset 5px 0 0 var(--status-customer) !important; }
    #matrix .matrix-grid tbody tr.matrix-stage-dormant td:first-child { box-shadow: inset 5px 0 0 var(--status-dormant) !important; }

    #matrix .matrix-stage-select.matrix-stage-lead { background: var(--status-lead-bg) !important; border-color: var(--status-lead) !important; color: var(--status-lead) !important; }
    #matrix .matrix-stage-select.matrix-stage-evaluating { background: var(--status-discussion-bg) !important; border-color: var(--status-discussion) !important; color: var(--status-discussion) !important; }
    #matrix .matrix-stage-select.matrix-stage-setup { background: var(--status-setup-bg) !important; border-color: var(--status-setup) !important; color: var(--status-setup) !important; }
    #matrix .matrix-stage-select.matrix-stage-testing { background: var(--status-testing-bg) !important; border-color: var(--status-testing) !important; color: var(--status-testing) !important; }
    #matrix .matrix-stage-select.matrix-stage-awaiting { background: var(--status-awaiting-bg) !important; border-color: var(--status-awaiting) !important; color: var(--status-awaiting) !important; }
    #matrix .matrix-stage-select.matrix-stage-commercial { background: var(--status-commercial-bg) !important; border-color: var(--status-commercial) !important; color: var(--status-commercial) !important; }
    #matrix .matrix-stage-select.matrix-stage-customer { background: var(--status-customer-bg) !important; border-color: var(--status-customer) !important; color: var(--status-customer) !important; }
    #matrix .matrix-stage-select.matrix-stage-dormant { background: var(--status-dormant-bg) !important; border-color: var(--status-dormant) !important; color: var(--status-dormant) !important; }

    .cold-table tr.cold-status-interested td { background: color-mix(in srgb, var(--status-customer-bg) 52%, var(--pfv-panel)) !important; }
    .cold-table tr.cold-status-needs-info td { background: color-mix(in srgb, var(--status-setup-bg) 50%, var(--pfv-panel)) !important; }
    .cold-table tr.cold-status-trial td { background: color-mix(in srgb, var(--status-testing-bg) 52%, var(--pfv-panel)) !important; }
    .cold-table tr.cold-status-no-answer td { background: color-mix(in srgb, var(--status-lead-bg) 56%, var(--pfv-panel)) !important; }
    .cold-table tr.cold-status-left-voicemail td { background: color-mix(in srgb, var(--status-voicemail-bg) 58%, var(--pfv-panel)) !important; }
    .cold-table tr.cold-status-not-interested td { background: color-mix(in srgb, var(--status-no-bg) 50%, var(--pfv-panel)) !important; }
    .cold-table tr.cold-status-neutral td { background: color-mix(in srgb, var(--status-dormant-bg) 40%, var(--pfv-panel)) !important; }

    .cold-table tr.cold-status-interested td:first-child { box-shadow: inset 5px 0 0 var(--status-customer) !important; }
    .cold-table tr.cold-status-needs-info td:first-child { box-shadow: inset 5px 0 0 var(--status-setup) !important; }
    .cold-table tr.cold-status-trial td:first-child { box-shadow: inset 5px 0 0 var(--status-testing) !important; }
    .cold-table tr.cold-status-no-answer td:first-child { box-shadow: inset 5px 0 0 var(--status-lead) !important; }
    .cold-table tr.cold-status-left-voicemail td:first-child { box-shadow: inset 5px 0 0 var(--status-voicemail) !important; }
    .cold-table tr.cold-status-not-interested td:first-child { box-shadow: inset 5px 0 0 var(--status-no) !important; }
    .cold-table tr.cold-status-neutral td:first-child { box-shadow: inset 5px 0 0 var(--status-dormant) !important; }

    /* Final responsive fit override. Keep this last so density/status passes cannot re-break layout. */
    #appView main {
      max-width: 100%;
      overflow-x: clip;
    }

    .workspace-head,
    #overview .workspace-head {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: center;
      gap: 10px;
    }

    .workspace-actions,
    .command-head-actions,
    #overview .command-head-actions {
      min-width: 0;
      max-width: 100%;
      justify-content: flex-end;
      flex-wrap: wrap;
    }

    .command-head-actions .message-alert-button,
    .command-head-actions .bulk-inbox-button {
      width: 32px;
      height: 32px;
      min-width: 32px;
      min-height: 32px;
      padding: 0;
    }

    .command-message-drawer {
      width: min(420px, calc(100vw - 32px));
      max-height: min(560px, calc(100dvh - 96px));
      overflow: auto;
    }

    #overview .command-work-board {
      grid-template-columns: minmax(0, 1.35fr) minmax(240px, .65fr);
    }

    #overview .command-map-panel .map-wrap {
      height: clamp(360px, 44vh, 560px);
      min-height: 360px;
    }

    #overview .command-map-panel.expanded .map-wrap {
      height: clamp(440px, 62vh, 640px);
      min-height: 440px;
    }

    #matrix .panel > .matrix-toolbar.compact .matrix-main-tools {
      display: grid !important;
      grid-template-columns: auto minmax(150px, 174px) minmax(180px, 1fr) auto auto;
      align-items: center;
      gap: 6px;
    }

    #matrix .panel > .matrix-toolbar.compact .matrix-category-select,
    #matrix .panel > .matrix-toolbar.compact .matrix-search-input,
    #matrix .panel > .matrix-toolbar.compact .accounts-more-menu,
    #matrix .panel > .matrix-toolbar.compact .matrix-selected-actions {
      min-width: 0;
    }

    #matrix .panel > .matrix-toolbar.compact .matrix-category-select,
    #matrix .panel > .matrix-toolbar.compact .matrix-search-input {
      width: 100%;
    }

    #matrix .table-wrap.matrix-grid {
      max-width: 100%;
      overflow-x: auto !important;
      overflow-y: visible;
    }

    #matrix .matrix-grid table {
      min-width: max-content;
    }

    #matrix .accounts-more-popover {
      right: 0;
      max-width: min(360px, calc(100vw - 32px));
    }

    .trial-detail-modal {
      width: min(1080px, calc(100vw - 28px)) !important;
      height: min(780px, calc(100dvh - 28px)) !important;
    }

    .trial-detail-modal .trial-detail-header {
      flex: 0 0 auto;
      padding: 12px 16px;
    }

    .trial-detail-tabs {
      flex: 0 0 auto;
      padding: 7px 16px;
    }

    .trial-detail-body {
      min-height: 0;
      padding: 12px 16px;
    }

    .trial-experience-layout,
    .trial-detail-panel,
    .trial-setup-dossier {
      align-content: start;
    }

    .trial-main-card,
    .trial-result-summary-card,
    .trial-result-signal,
    .trial-result-context,
    .trial-metric-card,
    .trial-crop-card,
    .trial-setup-section-card,
    .trial-setup-fact {
      min-height: 0 !important;
    }

    .trial-metric-rail {
      display: flex;
      flex-wrap: wrap;
      align-items: flex-start;
      align-content: flex-start;
      gap: 6px;
    }

    .trial-metric-rail .trial-metric-card {
      flex: 1 1 128px;
      max-width: 260px;
      align-self: flex-start;
    }

    .trial-result-signal-grid,
    .trial-result-context-grid,
    .trial-crop-card-grid,
    .trial-setup-section-grid {
      grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
      align-items: start;
    }

    .trial-result-summary-card {
      grid-template-columns: minmax(0, 1fr) minmax(180px, auto);
      align-items: start;
    }

    .trial-result-chip-row {
      max-width: 100%;
      justify-content: flex-end;
    }

    .trial-detail-composer {
      flex: 0 0 auto;
      padding: 0 16px 12px;
    }

    @media (max-width: 1180px) {
      #overview .command-work-board,
      .command-layout {
        grid-template-columns: 1fr;
      }

      #matrix .panel > .matrix-toolbar.compact .matrix-main-tools {
        grid-template-columns: auto minmax(150px, 180px) minmax(220px, 1fr) auto;
      }

      #matrix .panel > .matrix-toolbar.compact .matrix-selected-actions {
        grid-column: 1 / -1;
        justify-self: end;
      }
    }

    @media (max-width: 860px) {
      .workspace-head,
      #overview .workspace-head {
        grid-template-columns: minmax(0, 1fr);
        align-items: stretch;
      }

      #overview .workspace-head > div:first-child {
        display: grid;
        gap: 4px;
      }

      #overview .workspace-head p {
        white-space: normal;
      }

      .workspace-actions,
      .command-head-actions,
      #overview .command-head-actions {
        justify-content: flex-start;
      }

      .command-message-drawer {
        left: 0;
        right: auto;
      }

      #matrix .panel > .matrix-toolbar.compact .matrix-main-tools {
        grid-template-columns: auto minmax(0, 1fr) auto;
      }

      #matrix .panel > .matrix-toolbar.compact .matrix-search-input {
        grid-column: 1 / -1;
        order: 4;
      }

      #matrix .panel > .matrix-toolbar.compact .accounts-more-menu,
      #matrix .panel > .matrix-toolbar.compact .matrix-selected-actions {
        justify-self: end;
      }

      .trial-result-summary-card,
      .trial-detail-brief-bar {
        grid-template-columns: 1fr;
      }
    }

    @media (max-width: 620px) {
      main {
        padding-inline: 12px;
      }

      .shell-actions {
        top: 8px;
        right: 10px;
        transform: scale(.92);
        transform-origin: top right;
      }

      #matrix .panel > .matrix-toolbar.compact .matrix-main-tools {
        grid-template-columns: 1fr auto;
      }

      #matrix .panel > .matrix-toolbar.compact .accounts-mode-toggle,
      #matrix .panel > .matrix-toolbar.compact .matrix-category-select,
      #matrix .panel > .matrix-toolbar.compact .matrix-search-input {
        grid-column: 1 / -1;
      }

      #matrix .accounts-mode-toggle {
        width: 100%;
      }

      #matrix .accounts-mode-toggle button {
        flex: 1 1 0;
      }

      .trial-detail-modal {
        width: calc(100vw - 16px) !important;
        height: calc(100dvh - 16px) !important;
        max-height: calc(100dvh - 16px) !important;
      }

      .trial-detail-modal .trial-detail-header,
      .trial-detail-tabs,
      .trial-detail-body,
      .trial-detail-composer {
        padding-inline: 10px;
      }

      .trial-result-signal-grid,
      .trial-result-context-grid,
      .trial-crop-card-grid,
      .trial-setup-section-grid {
        grid-template-columns: 1fr;
      }

      .trial-metric-rail {
        display: grid;
        grid-template-columns: 1fr;
      }

      .trial-metric-rail .trial-metric-card {
        max-width: none;
      }
    }

    /* Responsive fit pass: keep tools visible, prevent overlays, and remove oversized empty areas. */
    #appView main {
      max-width: 100%;
      overflow-x: clip;
    }

    .workspace-head,
    #overview .workspace-head {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: center;
      gap: 10px;
    }

    #overview .workspace-head > div:first-child {
      min-width: 0;
    }

    .workspace-actions,
    .command-head-actions,
    #overview .command-head-actions {
      min-width: 0;
      max-width: 100%;
      justify-content: flex-end;
      flex-wrap: wrap;
    }

    .command-head-actions .message-alert-button,
    .command-head-actions .bulk-inbox-button {
      width: 32px;
      height: 32px;
      min-width: 32px;
      min-height: 32px;
      padding: 0;
    }

    .command-message-alert[open] {
      z-index: 95;
    }

    .command-message-drawer {
      width: min(420px, calc(100vw - 32px));
      max-height: min(560px, calc(100dvh - 96px));
      overflow: auto;
    }

    .command-message-list {
      max-height: 260px;
    }

    #overview .command-work-board {
      grid-template-columns: minmax(0, 1.35fr) minmax(240px, .65fr);
    }

    #overview .command-map-panel .map-wrap {
      height: clamp(360px, 44vh, 560px);
      min-height: 360px;
    }

    #overview .command-map-panel.expanded .map-wrap {
      height: clamp(440px, 62vh, 640px);
      min-height: 440px;
    }

    #matrix .panel > .matrix-toolbar.compact .matrix-main-tools {
      display: grid;
      grid-template-columns: auto minmax(150px, 174px) minmax(180px, 1fr) auto auto;
      align-items: center;
      gap: 6px;
    }

    #matrix .panel > .matrix-toolbar.compact .matrix-category-select,
    #matrix .panel > .matrix-toolbar.compact .matrix-search-input,
    #matrix .panel > .matrix-toolbar.compact .accounts-more-menu,
    #matrix .panel > .matrix-toolbar.compact .matrix-selected-actions {
      min-width: 0;
    }

    #matrix .panel > .matrix-toolbar.compact .matrix-category-select,
    #matrix .panel > .matrix-toolbar.compact .matrix-search-input {
      width: 100%;
    }

    #matrix .table-wrap.matrix-grid {
      max-width: 100%;
      overflow-x: auto !important;
      overflow-y: visible;
    }

    #matrix .matrix-grid table {
      min-width: max-content;
    }

    #matrix .accounts-more-popover {
      right: 0;
      max-width: min(360px, calc(100vw - 32px));
    }

    .trial-detail-modal {
      width: min(1080px, calc(100vw - 28px)) !important;
      height: min(780px, calc(100dvh - 28px)) !important;
    }

    .trial-detail-modal .trial-detail-header {
      flex: 0 0 auto;
      padding: 12px 16px;
    }

    .trial-detail-tabs {
      flex: 0 0 auto;
      padding: 7px 16px;
    }

    .trial-detail-body {
      min-height: 0;
      padding: 12px 16px;
    }

    .trial-experience-layout,
    .trial-detail-panel,
    .trial-setup-dossier {
      align-content: start;
    }

    .trial-main-card,
    .trial-result-summary-card,
    .trial-result-signal,
    .trial-result-context,
    .trial-metric-card,
    .trial-crop-card,
    .trial-setup-section-card,
    .trial-setup-fact {
      min-height: 0 !important;
    }

    .trial-metric-rail {
      grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
      align-items: stretch;
    }

    .trial-result-signal-grid,
    .trial-result-context-grid,
    .trial-crop-card-grid,
    .trial-setup-section-grid {
      grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
      align-items: start;
    }

    .trial-result-summary-card {
      grid-template-columns: minmax(0, 1fr) minmax(180px, auto);
      align-items: start;
    }

    .trial-result-chip-row {
      max-width: 100%;
      justify-content: flex-end;
    }

    .trial-detail-composer {
      flex: 0 0 auto;
      padding: 0 16px 12px;
    }

    @media (max-width: 1180px) {
      #overview .command-work-board,
      .command-layout {
        grid-template-columns: 1fr;
      }

      #matrix .panel > .matrix-toolbar.compact .matrix-main-tools {
        grid-template-columns: auto minmax(150px, 180px) minmax(220px, 1fr) auto;
      }

      #matrix .panel > .matrix-toolbar.compact .matrix-selected-actions {
        grid-column: 1 / -1;
        justify-self: end;
      }
    }

    @media (max-width: 860px) {
      .workspace-head,
      #overview .workspace-head {
        grid-template-columns: minmax(0, 1fr);
        align-items: stretch;
      }

      #overview .workspace-head > div:first-child {
        display: grid;
        gap: 4px;
      }

      #overview .workspace-head p {
        white-space: normal;
      }

      .workspace-actions,
      .command-head-actions,
      #overview .command-head-actions {
        justify-content: flex-start;
      }

      .command-message-drawer {
        left: 0;
        right: auto;
      }

      #matrix .panel > .matrix-toolbar.compact .matrix-main-tools {
        grid-template-columns: auto minmax(0, 1fr) auto;
      }

      #matrix .panel > .matrix-toolbar.compact .matrix-search-input {
        grid-column: 1 / -1;
        order: 4;
      }

      #matrix .panel > .matrix-toolbar.compact .accounts-more-menu,
      #matrix .panel > .matrix-toolbar.compact .matrix-selected-actions {
        justify-self: end;
      }

      .trial-result-summary-card,
      .trial-detail-brief-bar {
        grid-template-columns: 1fr;
      }
    }

    @media (max-width: 620px) {
      main {
        padding-inline: 12px;
      }

      .shell-actions {
        top: 8px;
        right: 10px;
        transform: scale(.92);
        transform-origin: top right;
      }

      #matrix .panel > .matrix-toolbar.compact .matrix-main-tools {
        grid-template-columns: 1fr auto;
      }

      #matrix .panel > .matrix-toolbar.compact .accounts-mode-toggle,
      #matrix .panel > .matrix-toolbar.compact .matrix-category-select,
      #matrix .panel > .matrix-toolbar.compact .matrix-search-input {
        grid-column: 1 / -1;
      }

      #matrix .accounts-mode-toggle {
        width: 100%;
      }

      #matrix .accounts-mode-toggle button {
        flex: 1 1 0;
      }

      .trial-detail-modal {
        width: calc(100vw - 16px) !important;
        height: calc(100dvh - 16px) !important;
        max-height: calc(100dvh - 16px) !important;
      }

      .trial-detail-modal .trial-detail-header,
      .trial-detail-tabs,
      .trial-detail-body,
      .trial-detail-composer {
        padding-inline: 10px;
      }

      .trial-metric-rail,
      .trial-result-signal-grid,
      .trial-result-context-grid,
      .trial-crop-card-grid,
      .trial-setup-section-grid {
        grid-template-columns: 1fr;
      }
    }
*** End of File

    /* Cold Calls account-table alignment and final color tuning. */
    :root {
      --status-testing: #0f5f78;
      --status-testing-bg: #cceaf2;
    }

    body.night-mode {
      --status-testing: #a678e8;
      --status-testing-bg: #102b34;
    }

    #matrix .matrix-grid tbody tr.matrix-stage-testing td,
    .cold-table tr.cold-status-trial td {
      background: color-mix(in srgb, var(--status-testing-bg) 54%, var(--pfv-panel)) !important;
    }

    #matrix .matrix-grid tbody tr.matrix-stage-testing td:first-child,
    .cold-table tr.cold-status-trial td:first-child {
      box-shadow: inset 5px 0 0 var(--status-testing) !important;
    }

    #matrix .matrix-stage-select.matrix-stage-testing,
    body:not(.night-mode) #matrix .matrix-stage-select.matrix-stage-testing,
    body:not(.night-mode) .cold-table tr.cold-status-trial td:nth-child(2) select {
      background: var(--status-testing) !important;
      border-color: var(--status-testing) !important;
      color: #fff !important;
    }

    body.night-mode #matrix .matrix-stage-select.matrix-stage-testing,
    body.night-mode .cold-table tr.cold-status-trial td:nth-child(2) select {
      background: var(--status-testing-bg) !important;
      border-color: var(--status-testing) !important;
      color: var(--status-testing) !important;
    }

    #matrix .cold-table {
      min-width: 100%;
      table-layout: auto;
    }

    #matrix .cold-table thead th {
      height: 28px;
      padding: 7px 8px;
      font-size: 10px;
      letter-spacing: .08em;
    }

    #matrix .cold-table tbody tr {
      height: 48px;
    }

    #matrix .cold-table td {
      height: 48px;
      padding: 5px 8px;
      vertical-align: middle;
      white-space: nowrap;
    }

    #matrix .cold-table th:first-child,
    #matrix .cold-table td:first-child {
      width: 30px;
      min-width: 30px;
      max-width: 30px;
    }

    #matrix .cold-table td:nth-child(2) select {
      width: 126px;
      min-width: 126px;
      height: 30px;
      min-height: 30px;
      border-radius: 7px;
      font-size: 11px;
      font-weight: 900;
      padding: 4px 24px 4px 9px;
    }

    #matrix .cold-identity-cell {
      display: flex;
      align-items: center;
      min-width: 132px;
      max-width: 164px;
    }

    #matrix .cold-identity-cell input,
    #matrix .cold-name-input {
      height: 30px;
      min-height: 30px;
      min-width: 0 !important;
      width: 100%;
      padding: 5px 9px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    #matrix .cold-phone-cell {
      min-width: 136px;
    }

    #matrix .cold-phone-cell input {
      width: 102px;
      min-width: 0 !important;
    }

    #matrix .cold-note-box {
      min-width: 150px;
      max-width: 180px;
      grid-template-columns: minmax(0, 1fr) auto;
    }

    #matrix .cold-table .cold-notes {
      height: 30px;
      min-height: 30px;
      min-width: 0;
      padding: 5px 9px;
    }

    #matrix .cold-date-cell {
      align-items: center;
      display: flex;
      min-width: 98px;
    }

    #matrix .cold-date-cell input {
      width: 92px;
      min-width: 0 !important;
      height: 30px;
      min-height: 30px;
    }

    #matrix .cold-date-cell span {
      display: none;
    }

    #matrix .cold-table input:not([type="checkbox"]),
    #matrix .cold-table textarea {
      border-color: rgba(24, 35, 31, .15);
    }

    /* Cold Calls account-table alignment and final color tuning. */
    :root {
      --status-testing: #0f5f78;
      --status-testing-bg: #cceaf2;
    }

    body.night-mode {
      --status-testing: #a678e8;
      --status-testing-bg: #102b34;
    }

    #matrix .matrix-grid tbody tr.matrix-stage-testing td,
    .cold-table tr.cold-status-trial td {
      background: color-mix(in srgb, var(--status-testing-bg) 54%, var(--pfv-panel)) !important;
    }

    #matrix .matrix-grid tbody tr.matrix-stage-testing td:first-child,
    .cold-table tr.cold-status-trial td:first-child {
      box-shadow: inset 5px 0 0 var(--status-testing) !important;
    }

    #matrix .matrix-stage-select.matrix-stage-testing,
    body:not(.night-mode) #matrix .matrix-stage-select.matrix-stage-testing,
    body:not(.night-mode) .cold-table tr.cold-status-trial td:nth-child(2) select {
      background: var(--status-testing) !important;
      border-color: var(--status-testing) !important;
      color: #fff !important;
    }

    body.night-mode #matrix .matrix-stage-select.matrix-stage-testing,
    body.night-mode .cold-table tr.cold-status-trial td:nth-child(2) select {
      background: var(--status-testing-bg) !important;
      border-color: var(--status-testing) !important;
      color: var(--status-testing) !important;
    }

    #matrix .cold-table {
      min-width: 100%;
      table-layout: auto;
    }

    #matrix .cold-table thead th {
      height: 28px;
      padding: 7px 8px;
      font-size: 10px;
      letter-spacing: .08em;
    }

    #matrix .cold-table tbody tr {
      height: 48px;
    }

    #matrix .cold-table td {
      height: 48px;
      padding: 5px 8px;
      vertical-align: middle;
      white-space: nowrap;
    }

    #matrix .cold-table th:first-child,
    #matrix .cold-table td:first-child {
      width: 30px;
      min-width: 30px;
      max-width: 30px;
    }

    #matrix .cold-table td:nth-child(2) select {
      width: 126px;
      min-width: 126px;
      height: 30px;
      min-height: 30px;
      border-radius: 7px;
      font-size: 11px;
      font-weight: 900;
      padding: 4px 24px 4px 9px;
    }

    #matrix .cold-identity-cell {
      display: flex;
      align-items: center;
      min-width: 132px;
      max-width: 164px;
    }

    #matrix .cold-identity-cell input,
    #matrix .cold-name-input {
      height: 30px;
      min-height: 30px;
      min-width: 0 !important;
      width: 100%;
      padding: 5px 9px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    #matrix .cold-phone-cell {
      min-width: 136px;
    }

    #matrix .cold-phone-cell input {
      width: 102px;
      min-width: 0 !important;
    }

    #matrix .cold-note-box {
      min-width: 150px;
      max-width: 180px;
      grid-template-columns: minmax(0, 1fr) auto;
    }

    #matrix .cold-table .cold-notes {
      height: 30px;
      min-height: 30px;
      min-width: 0;
      padding: 5px 9px;
    }

    #matrix .cold-date-cell {
      align-items: center;
      display: flex;
      min-width: 98px;
    }

    #matrix .cold-date-cell input {
      width: 92px;
      min-width: 0 !important;
      height: 30px;
      min-height: 30px;
    }

    #matrix .cold-date-cell span {
      display: none;
    }

    #matrix .cold-table input:not([type="checkbox"]),
    #matrix .cold-table textarea {
      border-color: rgba(24, 35, 31, .15);
    }

    body:not(.night-mode) #matrix .matrix-stage-select.matrix-stage-lead { background: var(--status-lead) !important; border-color: var(--status-lead) !important; color: #fff !important; }
    body:not(.night-mode) #matrix .matrix-stage-select.matrix-stage-evaluating { background: var(--status-discussion) !important; border-color: var(--status-discussion) !important; color: #fff !important; }
    body:not(.night-mode) #matrix .matrix-stage-select.matrix-stage-setup { background: var(--status-setup) !important; border-color: var(--status-setup) !important; color: #fff !important; }
    body:not(.night-mode) #matrix .matrix-stage-select.matrix-stage-testing { background: var(--status-testing) !important; border-color: var(--status-testing) !important; color: #fff !important; }
    body:not(.night-mode) #matrix .matrix-stage-select.matrix-stage-awaiting { background: var(--status-awaiting) !important; border-color: var(--status-awaiting) !important; color: #fff !important; }
    body:not(.night-mode) #matrix .matrix-stage-select.matrix-stage-commercial { background: var(--status-commercial) !important; border-color: var(--status-commercial) !important; color: #fff !important; }
    body:not(.night-mode) #matrix .matrix-stage-select.matrix-stage-customer { background: var(--status-customer) !important; border-color: var(--status-customer) !important; color: #fff !important; }
    body:not(.night-mode) #matrix .matrix-stage-select.matrix-stage-dormant { background: var(--status-dormant) !important; border-color: var(--status-dormant) !important; color: #fff !important; }

    body:not(.night-mode) .cold-table tr.cold-status-interested td:nth-child(2) select { background: var(--status-customer) !important; border-color: var(--status-customer) !important; color: #fff !important; }
    body:not(.night-mode) .cold-table tr.cold-status-needs-info td:nth-child(2) select { background: var(--status-setup) !important; border-color: var(--status-setup) !important; color: #fff !important; }
    body:not(.night-mode) .cold-table tr.cold-status-trial td:nth-child(2) select { background: var(--status-testing) !important; border-color: var(--status-testing) !important; color: #fff !important; }
    body:not(.night-mode) .cold-table tr.cold-status-no-answer td:nth-child(2) select { background: var(--status-lead) !important; border-color: var(--status-lead) !important; color: #fff !important; }
    body:not(.night-mode) .cold-table tr.cold-status-left-voicemail td:nth-child(2) select { background: var(--status-voicemail) !important; border-color: var(--status-voicemail) !important; color: #fff !important; }
    body:not(.night-mode) .cold-table tr.cold-status-not-interested td:nth-child(2) select { background: var(--status-no) !important; border-color: var(--status-no) !important; color: #fff !important; }
    body:not(.night-mode) .cold-table tr.cold-status-neutral td:nth-child(2) select { background: var(--status-dormant) !important; border-color: var(--status-dormant) !important; color: #fff !important; }

    .cold-filter-chip[data-cold-status-filter="neutral"] {
      background: var(--status-dormant-bg);
      border-color: var(--status-dormant);
      color: var(--status-dormant);
    }

    body:not(.night-mode) .cold-filter-chip.active[data-cold-status-filter="interested"] { background: var(--status-customer); color: #fff; }
    body:not(.night-mode) .cold-filter-chip.active[data-cold-status-filter="needs-info"] { background: var(--status-setup); color: #fff; }
    body:not(.night-mode) .cold-filter-chip.active[data-cold-status-filter="no-answer"] { background: var(--status-lead); color: #fff; }
    body:not(.night-mode) .cold-filter-chip.active[data-cold-status-filter="not-interested"] { background: var(--status-no); color: #fff; }
    body:not(.night-mode) .cold-filter-chip.active[data-cold-status-filter="neutral"],
    body:not(.night-mode) .cold-filter-chip.active[data-cold-status-filter="all"] { background: var(--status-dormant); color: #fff; }

    /* Status color theory pass: darker brand green and clearer workflow color coding. */
    :root {
      --pfv-green: #17633a;
      --pfv-green-hover: #0f4f2d;
      --pfv-green-soft: #dcefe4;
      --pfv-focus: rgba(23, 99, 58, .28);
      --status-lead: #526070;
      --status-lead-bg: #dde4ec;
      --status-discussion: #376f7a;
      --status-discussion-bg: #d7edf0;
      --status-qualified: #2f5f9e;
      --status-qualified-bg: #e2ebf7;
      --status-setup: #946514;
      --status-setup-bg: #f5dfad;
      --status-testing: #0f5f78;
      --status-testing-bg: #cceaf2;
      --status-awaiting: #a34a22;
      --status-awaiting-bg: #f5cdbb;
      --status-commercial: #4338a4;
      --status-commercial-bg: #ddd9ff;
      --status-customer: #0f5132;
      --status-customer-bg: #bfe7ce;
      --status-dormant: #60646c;
      --status-dormant-bg: #dedfe3;
      --status-no: #9f2d2d;
      --status-no-bg: #f1c2c2;
      --status-voicemail: #475569;
      --status-voicemail-bg: #d8dee8;
    }

    body.night-mode {
      --pfv-green: #36a36a;
      --pfv-green-hover: #55c986;
      --pfv-green-soft: #13271b;
      --pfv-focus: rgba(54, 163, 106, .36);
      --status-lead: #b7c1cf;
      --status-lead-bg: #252b34;
      --status-discussion: #8bd2dc;
      --status-discussion-bg: #173238;
      --status-qualified: #7fa8e8;
      --status-qualified-bg: #16233a;
      --status-setup: #e8c86f;
      --status-setup-bg: #342811;
      --status-testing: #a678e8;
      --status-testing-bg: #102b34;
      --status-awaiting: #f0a27d;
      --status-awaiting-bg: #3b2116;
      --status-commercial: #b9b1ff;
      --status-commercial-bg: #24213f;
      --status-customer: #82dfaa;
      --status-customer-bg: #112d1d;
      --status-dormant: #b7bbc4;
      --status-dormant-bg: #25272c;
      --status-no: #f29a9a;
      --status-no-bg: #3a1d1d;
      --status-voicemail: #c3ccd8;
      --status-voicemail-bg: #242b35;
    }

    .button,
    .matrix-note-send,
    .accounts-mode-toggle button.active,
    .phone-call-link,
    #matrix .phone-cell .button,
    #matrix .phone-cell a,
    #matrix .phone-cell button {
      background: var(--pfv-green);
      border-color: var(--pfv-green);
    }

    .button:hover,
    .matrix-note-send:hover,
    .phone-call-link:hover {
      background: var(--pfv-green-hover);
      border-color: var(--pfv-green-hover);
    }

    #matrix .matrix-grid tbody tr.matrix-stage td {
      border-bottom-color: rgba(24, 35, 31, .11);
    }

    #matrix .matrix-grid tbody tr.matrix-stage-lead td {
      background: color-mix(in srgb, var(--status-lead-bg) 54%, var(--pfv-panel));
    }

    #matrix .matrix-grid tbody tr.matrix-stage-evaluating td {
      background: color-mix(in srgb, var(--status-discussion-bg) 52%, var(--pfv-panel));
    }

    #matrix .matrix-grid tbody tr.matrix-stage-setup td {
      background: color-mix(in srgb, var(--status-setup-bg) 48%, var(--pfv-panel));
    }

    #matrix .matrix-grid tbody tr.matrix-stage-testing td {
      background: color-mix(in srgb, var(--status-testing-bg) 50%, var(--pfv-panel));
    }

    #matrix .matrix-grid tbody tr.matrix-stage-awaiting td {
      background: color-mix(in srgb, var(--status-awaiting-bg) 48%, var(--pfv-panel));
    }

    #matrix .matrix-grid tbody tr.matrix-stage-commercial td {
      background: color-mix(in srgb, var(--status-commercial-bg) 46%, var(--pfv-panel));
    }

    #matrix .matrix-grid tbody tr.matrix-stage-customer td {
      background: color-mix(in srgb, var(--status-customer-bg) 52%, var(--pfv-panel));
    }

    #matrix .matrix-grid tbody tr.matrix-stage-dormant td {
      background: color-mix(in srgb, var(--status-dormant-bg) 56%, var(--pfv-panel));
    }

    #matrix .matrix-grid tbody tr.matrix-stage-neutral td {
      background: var(--pfv-panel);
    }

    #matrix .matrix-grid tbody tr.matrix-stage-lead td:first-child { box-shadow: inset 5px 0 0 var(--status-lead); }
    #matrix .matrix-grid tbody tr.matrix-stage-evaluating td:first-child { box-shadow: inset 5px 0 0 var(--status-discussion); }
    #matrix .matrix-grid tbody tr.matrix-stage-setup td:first-child { box-shadow: inset 5px 0 0 var(--status-setup); }
    #matrix .matrix-grid tbody tr.matrix-stage-testing td:first-child { box-shadow: inset 5px 0 0 var(--status-testing); }
    #matrix .matrix-grid tbody tr.matrix-stage-awaiting td:first-child { box-shadow: inset 5px 0 0 var(--status-awaiting); }
    #matrix .matrix-grid tbody tr.matrix-stage-commercial td:first-child { box-shadow: inset 5px 0 0 var(--status-commercial); }
    #matrix .matrix-grid tbody tr.matrix-stage-customer td:first-child { box-shadow: inset 5px 0 0 var(--status-customer); }
    #matrix .matrix-grid tbody tr.matrix-stage-dormant td:first-child { box-shadow: inset 5px 0 0 var(--status-dormant); }

    #matrix .matrix-stage-select {
      border-width: 1px;
      box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28);
      font-weight: 900;
    }

    #matrix .matrix-stage-select.matrix-stage-lead {
      background: var(--status-lead-bg);
      border-color: var(--status-lead);
      color: var(--status-lead);
    }

    #matrix .matrix-stage-select.matrix-stage-evaluating {
      background: var(--status-discussion-bg);
      border-color: var(--status-discussion);
      color: var(--status-discussion);
    }

    #matrix .matrix-stage-select.matrix-stage-setup {
      background: var(--status-setup-bg);
      border-color: var(--status-setup);
      color: var(--status-setup);
    }

    #matrix .matrix-stage-select.matrix-stage-testing {
      background: var(--status-testing-bg);
      border-color: var(--status-testing);
      color: var(--status-testing);
    }

    #matrix .matrix-stage-select.matrix-stage-awaiting {
      background: var(--status-awaiting-bg);
      border-color: var(--status-awaiting);
      color: var(--status-awaiting);
    }

    #matrix .matrix-stage-select.matrix-stage-commercial {
      background: var(--status-commercial-bg);
      border-color: var(--status-commercial);
      color: var(--status-commercial);
    }

    #matrix .matrix-stage-select.matrix-stage-customer {
      background: var(--status-customer-bg);
      border-color: var(--status-customer);
      color: var(--status-customer);
    }

    #matrix .matrix-stage-select.matrix-stage-dormant {
      background: var(--status-dormant-bg);
      border-color: var(--status-dormant);
      color: var(--status-dormant);
    }

    #matrix .matrix-grid tbody tr.matrix-stage input:not([type="checkbox"]),
    #matrix .matrix-grid tbody tr.matrix-stage textarea {
      background: color-mix(in srgb, var(--pfv-panel) 86%, white);
      border-color: rgba(24, 35, 31, .15);
      color: var(--pfv-text);
    }

    .cold-table tr.cold-status-interested td {
      background: color-mix(in srgb, var(--status-customer-bg) 52%, var(--pfv-panel));
    }

    .cold-table tr.cold-status-needs-info td {
      background: color-mix(in srgb, var(--status-setup-bg) 50%, var(--pfv-panel));
    }

    .cold-table tr.cold-status-trial td {
      background: color-mix(in srgb, var(--status-testing-bg) 52%, var(--pfv-panel));
    }

    .cold-table tr.cold-status-no-answer td {
      background: color-mix(in srgb, var(--status-lead-bg) 56%, var(--pfv-panel));
    }

    .cold-table tr.cold-status-left-voicemail td {
      background: color-mix(in srgb, var(--status-voicemail-bg) 58%, var(--pfv-panel));
    }

    .cold-table tr.cold-status-not-interested td {
      background: color-mix(in srgb, var(--status-no-bg) 50%, var(--pfv-panel));
    }

    .cold-table tr.cold-status-neutral td {
      background: color-mix(in srgb, var(--status-dormant-bg) 40%, var(--pfv-panel));
    }

    .cold-table tr.cold-status-interested td:first-child { box-shadow: inset 5px 0 0 var(--status-customer); }
    .cold-table tr.cold-status-needs-info td:first-child { box-shadow: inset 5px 0 0 var(--status-setup); }
    .cold-table tr.cold-status-trial td:first-child { box-shadow: inset 5px 0 0 var(--status-testing); }
    .cold-table tr.cold-status-no-answer td:first-child { box-shadow: inset 5px 0 0 var(--status-lead); }
    .cold-table tr.cold-status-left-voicemail td:first-child { box-shadow: inset 5px 0 0 var(--status-voicemail); }
    .cold-table tr.cold-status-not-interested td:first-child { box-shadow: inset 5px 0 0 var(--status-no); }
    .cold-table tr.cold-status-neutral td:first-child { box-shadow: inset 5px 0 0 var(--status-dormant); }

    .cold-table tr.cold-status-interested td:nth-child(2) select,
    .cold-filter-chip[data-cold-status-filter="interested"] {
      background: var(--status-customer-bg);
      border-color: var(--status-customer);
      color: var(--status-customer);
    }

    .cold-table tr.cold-status-needs-info td:nth-child(2) select,
    .cold-filter-chip[data-cold-status-filter="needs-info"] {
      background: var(--status-setup-bg);
      border-color: var(--status-setup);
      color: var(--status-setup);
    }

    .cold-table tr.cold-status-trial td:nth-child(2) select {
      background: var(--status-testing-bg);
      border-color: var(--status-testing);
      color: var(--status-testing);
    }

    .cold-table tr.cold-status-no-answer td:nth-child(2) select,
    .cold-filter-chip[data-cold-status-filter="no-answer"] {
      background: var(--status-lead-bg);
      border-color: var(--status-lead);
      color: var(--status-lead);
    }

    .cold-table tr.cold-status-left-voicemail td:nth-child(2) select {
      background: var(--status-voicemail-bg);
      border-color: var(--status-voicemail);
      color: var(--status-voicemail);
    }

    .cold-table tr.cold-status-not-interested td:nth-child(2) select,
    .cold-filter-chip[data-cold-status-filter="not-interested"] {
      background: var(--status-no-bg);
      border-color: var(--status-no);
      color: var(--status-no);
    }

    .cold-table tr.cold-status-neutral td:nth-child(2) select,
    .cold-filter-chip[data-cold-status-filter="all"] {
      background: var(--status-dormant-bg);
      border-color: var(--status-dormant);
      color: var(--status-dormant);
    }

    .cold-filter-chip.active {
      box-shadow: inset 0 0 0 2px currentColor;
      font-weight: 900;
    }

    .cold-filter-chip strong {
      color: inherit;
    }

    body.night-mode #matrix .matrix-grid tbody tr.matrix-stage input:not([type="checkbox"]),
    body.night-mode #matrix .matrix-grid tbody tr.matrix-stage textarea,
    body.night-mode .cold-table tr[class*="cold-status-"] input,
    body.night-mode .cold-table tr[class*="cold-status-"] textarea {
      background: rgba(15, 20, 17, .64);
      border-color: rgba(210, 220, 214, .16);
      color: var(--pfv-text);
    }

    /* Accounts density pass: keep the list calm, even, and scannable. */
    #matrix .table-wrap.matrix-grid {
      border-radius: 10px;
      box-shadow: none;
    }

    #matrix .panel > .matrix-toolbar.compact .matrix-main-tools {
      flex-wrap: nowrap;
    }

    #matrix .panel > .matrix-toolbar.compact .accounts-mode-toggle {
      flex: 0 0 auto;
    }

    #matrix .panel > .matrix-toolbar.compact .matrix-category-select {
      flex: 0 0 174px;
    }

    #matrix .panel > .matrix-toolbar.compact .matrix-search-input {
      flex: 1 1 240px;
      min-width: 145px;
    }

    #matrix .panel > .matrix-toolbar.compact .accounts-more-menu,
    #matrix .panel > .matrix-toolbar.compact .matrix-selected-actions {
      flex: 0 0 auto;
    }

    #matrix .matrix-grid table {
      min-width: 100%;
      table-layout: auto;
    }

    #matrix .matrix-grid th {
      height: 28px;
      padding: 7px 8px;
      font-size: 10px;
      letter-spacing: .08em;
    }

    #matrix .matrix-grid tbody tr {
      height: 58px;
    }

    #matrix .matrix-grid td {
      height: 58px;
      padding: 6px 8px;
      vertical-align: middle;
    }

    #matrix .matrix-grid th:first-child,
    #matrix .matrix-grid td:first-child {
      width: 30px;
      min-width: 30px;
      max-width: 30px;
    }

    #matrix .matrix-grid tbody tr.matrix-stage-customer td,
    #matrix .matrix-grid tbody tr.matrix-stage-commercial td,
    #matrix .matrix-grid tbody tr.matrix-stage-testing td {
      background: rgba(74, 151, 95, .055);
    }

    #matrix .matrix-grid tbody tr.matrix-stage-awaiting td,
    #matrix .matrix-grid tbody tr.matrix-stage-setup td {
      background: rgba(205, 154, 55, .085);
    }

    #matrix .matrix-grid tbody tr.matrix-stage-evaluating td,
    #matrix .matrix-grid tbody tr.matrix-stage-lead td {
      background: rgba(103, 116, 135, .055);
    }

    #matrix .matrix-grid tbody tr.matrix-stage-dormant td,
    #matrix .matrix-grid tbody tr.matrix-stage-neutral td {
      background: rgba(103, 116, 135, .045);
    }

    #matrix .matrix-row-tools input[type="checkbox"],
    #matrix .matrix-grid input[type="checkbox"] {
      width: 13px !important;
      min-width: 13px !important;
      height: 13px !important;
      min-height: 13px !important;
      padding: 0;
    }

    #matrix .matrix-company-cell {
      min-width: 166px;
      max-width: 180px;
    }

    #matrix .matrix-company-main {
      gap: 5px;
    }

    #matrix .matrix-company-button strong {
      display: block;
      max-width: 165px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    #matrix .matrix-company-cell span {
      max-width: 165px;
    }

    #matrix .matrix-company-main:has(.matrix-test-button) .matrix-company-button strong,
    #matrix .matrix-company-main:has(.matrix-test-button) + span {
      max-width: 96px;
    }

    #matrix .matrix-test-button {
      min-height: 20px;
      padding: 4px 7px;
      font-size: 9px;
    }

    #matrix .phone-cell {
      align-items: center;
      display: flex;
      gap: 5px;
      min-width: 136px;
      position: relative;
    }

    #matrix .phone-cell input {
      min-width: 0;
      padding-right: 32px;
      width: 132px;
    }

    #matrix .phone-cell .button,
    #matrix .phone-cell a,
    #matrix .phone-cell button {
      align-items: center;
      border-radius: 999px;
      display: inline-flex;
      font-size: 0;
      height: 28px;
      justify-content: center;
      min-height: 28px;
      min-width: 28px;
      padding: 0;
      position: absolute;
      right: 3px;
      top: 50%;
      transform: translateY(-50%);
      width: 28px;
    }

    #matrix .phone-cell .button::before,
    #matrix .phone-cell a::before,
    #matrix .phone-cell button::before {
      content: '☎';
      font-size: 13px;
      line-height: 1;
    }

    #matrix .matrix-sort-head {
      align-items: center;
      background: transparent;
      border: 0;
      color: inherit;
      cursor: pointer;
      display: inline-flex;
      font: inherit;
      gap: 4px;
      justify-content: flex-start;
      letter-spacing: inherit;
      min-height: 20px;
      padding: 0;
      text-transform: inherit;
      width: 100%;
    }

    #matrix .matrix-sort-head span {
      color: var(--muted);
      font-size: 10px;
      min-width: 12px;
    }

    #matrix .matrix-sort-head.active {
      color: var(--text);
    }

    #matrix .matrix-next-task-input {
      border-radius: 7px;
      height: 30px;
      min-height: 30px;
      min-width: 180px;
      padding: 4px 10px;
    }

    #matrix .matrix-stage-select,
    #matrix .matrix-action-cell .matrix-action-select {
      border-radius: 7px;
      height: 30px;
      min-height: 30px;
      min-width: 124px;
      padding: 4px 28px 4px 10px;
    }

    #matrix .matrix-note-composer {
      min-width: 150px;
      max-width: 180px;
    }

    #matrix .matrix-note-composer input {
      background: rgba(255, 255, 255, .52);
      border-color: rgba(37, 50, 43, .12);
      height: 30px;
      min-height: 30px;
      padding: 5px 9px;
    }

    #matrix .matrix-note-send {
      height: 26px;
      min-height: 26px;
      width: 26px;
    }

    #matrix .matrix-date-cell {
      align-items: center;
      display: flex;
      min-width: 98px;
    }

    #matrix .matrix-date-cell input {
      height: 30px;
      min-height: 30px;
      width: 92px;
    }

    #matrix .matrix-date-cell span {
      display: none;
    }

    #matrix .matrix-tag-editor {
      align-items: center;
      display: flex;
      gap: 4px;
      min-width: 120px;
      max-width: 126px;
    }

    #matrix .matrix-tag-list {
      display: flex;
      flex: 1 1 auto;
      flex-wrap: nowrap;
      gap: 4px;
      min-width: 0;
      overflow: hidden;
    }

    #matrix .matrix-tag {
      border-radius: 999px;
      flex: 0 1 auto;
      font-size: 10px;
      height: 24px;
      max-width: 60px;
      overflow: hidden;
      padding: 3px 6px;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    #matrix .matrix-tag button {
      flex: 0 0 auto;
      height: 14px;
      width: 14px;
    }

    #matrix .matrix-tag-more {
      flex: 0 0 auto;
      justify-content: center;
      max-width: 36px;
      min-width: 32px;
    }

    #matrix .matrix-tag-editor input {
      flex: 0 0 28px;
      height: 28px;
      min-height: 28px;
      min-width: 28px;
      padding: 4px;
      text-align: center;
    }

    body.night-mode #matrix .matrix-grid tbody tr.matrix-stage-customer td,
    body.night-mode #matrix .matrix-grid tbody tr.matrix-stage-commercial td,
    body.night-mode #matrix .matrix-grid tbody tr.matrix-stage-testing td {
      background: rgba(101, 117, 139, .12);
    }

    body.night-mode #matrix .matrix-grid tbody tr.matrix-stage-awaiting td,
    body.night-mode #matrix .matrix-grid tbody tr.matrix-stage-setup td {
      background: rgba(205, 154, 55, .12);
    }

    body.night-mode #matrix .matrix-grid tbody tr.matrix-stage-evaluating td,
    body.night-mode #matrix .matrix-grid tbody tr.matrix-stage-lead td,
    body.night-mode #matrix .matrix-grid tbody tr.matrix-stage-dormant td,
    body.night-mode #matrix .matrix-grid tbody tr.matrix-stage-neutral td {
      background: rgba(101, 117, 139, .10);
    }

    /* Final status palette override: keep last so older faded row rules do not win. */
    #matrix .matrix-grid tbody tr.matrix-stage-lead td { background: color-mix(in srgb, var(--status-lead-bg) 54%, var(--pfv-panel)) !important; }
    #matrix .matrix-grid tbody tr.matrix-stage-evaluating td { background: color-mix(in srgb, var(--status-discussion-bg) 52%, var(--pfv-panel)) !important; }
    #matrix .matrix-grid tbody tr.matrix-stage-setup td { background: color-mix(in srgb, var(--status-setup-bg) 48%, var(--pfv-panel)) !important; }
    #matrix .matrix-grid tbody tr.matrix-stage-testing td { background: color-mix(in srgb, var(--status-testing-bg) 50%, var(--pfv-panel)) !important; }
    #matrix .matrix-grid tbody tr.matrix-stage-awaiting td { background: color-mix(in srgb, var(--status-awaiting-bg) 48%, var(--pfv-panel)) !important; }
    #matrix .matrix-grid tbody tr.matrix-stage-commercial td { background: color-mix(in srgb, var(--status-commercial-bg) 46%, var(--pfv-panel)) !important; }
    #matrix .matrix-grid tbody tr.matrix-stage-customer td { background: color-mix(in srgb, var(--status-customer-bg) 52%, var(--pfv-panel)) !important; }
    #matrix .matrix-grid tbody tr.matrix-stage-dormant td { background: color-mix(in srgb, var(--status-dormant-bg) 56%, var(--pfv-panel)) !important; }
    #matrix .matrix-grid tbody tr.matrix-stage-neutral td { background: var(--pfv-panel) !important; }

    #matrix .matrix-grid tbody tr.matrix-stage-lead td:first-child { box-shadow: inset 5px 0 0 var(--status-lead) !important; }
    #matrix .matrix-grid tbody tr.matrix-stage-evaluating td:first-child { box-shadow: inset 5px 0 0 var(--status-discussion) !important; }
    #matrix .matrix-grid tbody tr.matrix-stage-setup td:first-child { box-shadow: inset 5px 0 0 var(--status-setup) !important; }
    #matrix .matrix-grid tbody tr.matrix-stage-testing td:first-child { box-shadow: inset 5px 0 0 var(--status-testing) !important; }
    #matrix .matrix-grid tbody tr.matrix-stage-awaiting td:first-child { box-shadow: inset 5px 0 0 var(--status-awaiting) !important; }
    #matrix .matrix-grid tbody tr.matrix-stage-commercial td:first-child { box-shadow: inset 5px 0 0 var(--status-commercial) !important; }
    #matrix .matrix-grid tbody tr.matrix-stage-customer td:first-child { box-shadow: inset 5px 0 0 var(--status-customer) !important; }
    #matrix .matrix-grid tbody tr.matrix-stage-dormant td:first-child { box-shadow: inset 5px 0 0 var(--status-dormant) !important; }

    #matrix .matrix-stage-select.matrix-stage-lead { background: var(--status-lead-bg) !important; border-color: var(--status-lead) !important; color: var(--status-lead) !important; }
    #matrix .matrix-stage-select.matrix-stage-evaluating { background: var(--status-discussion-bg) !important; border-color: var(--status-discussion) !important; color: var(--status-discussion) !important; }
    #matrix .matrix-stage-select.matrix-stage-setup { background: var(--status-setup-bg) !important; border-color: var(--status-setup) !important; color: var(--status-setup) !important; }
    #matrix .matrix-stage-select.matrix-stage-testing { background: var(--status-testing-bg) !important; border-color: var(--status-testing) !important; color: var(--status-testing) !important; }
    #matrix .matrix-stage-select.matrix-stage-awaiting { background: var(--status-awaiting-bg) !important; border-color: var(--status-awaiting) !important; color: var(--status-awaiting) !important; }
    #matrix .matrix-stage-select.matrix-stage-commercial { background: var(--status-commercial-bg) !important; border-color: var(--status-commercial) !important; color: var(--status-commercial) !important; }
    #matrix .matrix-stage-select.matrix-stage-customer { background: var(--status-customer-bg) !important; border-color: var(--status-customer) !important; color: var(--status-customer) !important; }
    #matrix .matrix-stage-select.matrix-stage-dormant { background: var(--status-dormant-bg) !important; border-color: var(--status-dormant) !important; color: var(--status-dormant) !important; }

    .cold-table tr.cold-status-interested td { background: color-mix(in srgb, var(--status-customer-bg) 52%, var(--pfv-panel)) !important; }
    .cold-table tr.cold-status-needs-info td { background: color-mix(in srgb, var(--status-setup-bg) 50%, var(--pfv-panel)) !important; }
    .cold-table tr.cold-status-trial td { background: color-mix(in srgb, var(--status-testing-bg) 52%, var(--pfv-panel)) !important; }
    .cold-table tr.cold-status-no-answer td { background: color-mix(in srgb, var(--status-lead-bg) 56%, var(--pfv-panel)) !important; }
    .cold-table tr.cold-status-left-voicemail td { background: color-mix(in srgb, var(--status-voicemail-bg) 58%, var(--pfv-panel)) !important; }
    .cold-table tr.cold-status-not-interested td { background: color-mix(in srgb, var(--status-no-bg) 50%, var(--pfv-panel)) !important; }
    .cold-table tr.cold-status-neutral td { background: color-mix(in srgb, var(--status-dormant-bg) 40%, var(--pfv-panel)) !important; }

    .cold-table tr.cold-status-interested td:first-child { box-shadow: inset 5px 0 0 var(--status-customer) !important; }
    .cold-table tr.cold-status-needs-info td:first-child { box-shadow: inset 5px 0 0 var(--status-setup) !important; }
    .cold-table tr.cold-status-trial td:first-child { box-shadow: inset 5px 0 0 var(--status-testing) !important; }
    .cold-table tr.cold-status-no-answer td:first-child { box-shadow: inset 5px 0 0 var(--status-lead) !important; }
    .cold-table tr.cold-status-left-voicemail td:first-child { box-shadow: inset 5px 0 0 var(--status-voicemail) !important; }
    .cold-table tr.cold-status-not-interested td:first-child { box-shadow: inset 5px 0 0 var(--status-no) !important; }
    .cold-table tr.cold-status-neutral td:first-child { box-shadow: inset 5px 0 0 var(--status-dormant) !important; }
    /* Final responsive fit override. Keep this last so density/status passes cannot re-break layout. */
    #appView main {
      max-width: 100%;
      overflow-x: clip;
    }

    .workspace-head,
    #overview .workspace-head {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: center;
      gap: 10px;
    }

    .workspace-actions,
    .command-head-actions,
    #overview .command-head-actions {
      min-width: 0;
      max-width: 100%;
      justify-content: flex-end;
      flex-wrap: wrap;
    }

    .command-head-actions .message-alert-button,
    .command-head-actions .bulk-inbox-button {
      width: 32px;
      height: 32px;
      min-width: 32px;
      min-height: 32px;
      padding: 0;
    }

    .command-message-drawer {
      width: min(420px, calc(100vw - 32px));
      max-height: min(560px, calc(100dvh - 96px));
      overflow: auto;
    }

    #overview .command-work-board {
      grid-template-columns: minmax(0, 1.35fr) minmax(240px, .65fr);
    }

    #overview .command-map-panel .map-wrap {
      height: clamp(360px, 44vh, 560px);
      min-height: 360px;
    }

    #overview .command-map-panel.expanded .map-wrap {
      height: clamp(440px, 62vh, 640px);
      min-height: 440px;
    }

    #matrix .panel > .matrix-toolbar.compact .matrix-main-tools {
      display: grid !important;
      grid-template-columns: auto minmax(150px, 174px) minmax(180px, 1fr) auto auto;
      align-items: center;
      gap: 6px;
    }

    #matrix .panel > .matrix-toolbar.compact .matrix-category-select,
    #matrix .panel > .matrix-toolbar.compact .matrix-search-input,
    #matrix .panel > .matrix-toolbar.compact .accounts-more-menu,
    #matrix .panel > .matrix-toolbar.compact .matrix-selected-actions {
      min-width: 0;
    }

    #matrix .panel > .matrix-toolbar.compact .matrix-category-select,
    #matrix .panel > .matrix-toolbar.compact .matrix-search-input {
      width: 100%;
    }

    #matrix .table-wrap.matrix-grid {
      max-width: 100%;
      overflow-x: auto !important;
      overflow-y: visible;
    }

    #matrix .matrix-grid table {
      min-width: max-content;
    }

    #matrix .accounts-more-popover {
      right: 0;
      max-width: min(360px, calc(100vw - 32px));
    }

    .trial-detail-modal {
      width: min(1080px, calc(100vw - 28px)) !important;
      height: min(780px, calc(100dvh - 28px)) !important;
    }

    .trial-detail-modal .trial-detail-header {
      flex: 0 0 auto;
      padding: 12px 16px;
    }

    .trial-detail-tabs {
      flex: 0 0 auto;
      padding: 7px 16px;
    }

    .trial-detail-body {
      min-height: 0;
      padding: 12px 16px;
    }

    .trial-experience-layout,
    .trial-detail-panel,
    .trial-setup-dossier {
      align-content: start;
    }

    .trial-main-card,
    .trial-result-summary-card,
    .trial-result-signal,
    .trial-result-context,
    .trial-metric-card,
    .trial-crop-card,
    .trial-setup-section-card,
    .trial-setup-fact {
      min-height: 0 !important;
    }

    .trial-metric-rail {
      grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
      align-items: stretch;
    }

    .trial-result-signal-grid,
    .trial-result-context-grid,
    .trial-crop-card-grid,
    .trial-setup-section-grid {
      grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
      align-items: start;
    }

    .trial-result-summary-card {
      grid-template-columns: minmax(0, 1fr) minmax(180px, auto);
      align-items: start;
    }

    .trial-result-chip-row {
      max-width: 100%;
      justify-content: flex-end;
    }

    .trial-detail-composer {
      flex: 0 0 auto;
      padding: 0 16px 12px;
    }

    @media (max-width: 1180px) {
      #overview .command-work-board,
      .command-layout {
        grid-template-columns: 1fr;
      }

      #matrix .panel > .matrix-toolbar.compact .matrix-main-tools {
        grid-template-columns: auto minmax(150px, 180px) minmax(220px, 1fr) auto;
      }

      #matrix .panel > .matrix-toolbar.compact .matrix-selected-actions {
        grid-column: 1 / -1;
        justify-self: end;
      }
    }

    @media (max-width: 860px) {
      .workspace-head,
      #overview .workspace-head {
        grid-template-columns: minmax(0, 1fr);
        align-items: stretch;
      }

      #overview .workspace-head > div:first-child {
        display: grid;
        gap: 4px;
      }

      #overview .workspace-head p {
        white-space: normal;
      }

      .workspace-actions,
      .command-head-actions,
      #overview .command-head-actions {
        justify-content: flex-start;
      }

      .command-message-drawer {
        left: 0;
        right: auto;
      }

      #matrix .panel > .matrix-toolbar.compact .matrix-main-tools {
        grid-template-columns: auto minmax(0, 1fr) auto;
      }

      #matrix .panel > .matrix-toolbar.compact .matrix-search-input {
        grid-column: 1 / -1;
        order: 4;
      }

      #matrix .panel > .matrix-toolbar.compact .accounts-more-menu,
      #matrix .panel > .matrix-toolbar.compact .matrix-selected-actions {
        justify-self: end;
      }

      .trial-result-summary-card,
      .trial-detail-brief-bar {
        grid-template-columns: 1fr;
      }
    }

    @media (max-width: 620px) {
      main {
        padding-inline: 12px;
      }

      .shell-actions {
        top: 8px;
        right: 10px;
        transform: scale(.92);
        transform-origin: top right;
      }

      #matrix .panel > .matrix-toolbar.compact .matrix-main-tools {
        grid-template-columns: 1fr auto;
      }

      #matrix .panel > .matrix-toolbar.compact .accounts-mode-toggle,
      #matrix .panel > .matrix-toolbar.compact .matrix-category-select,
      #matrix .panel > .matrix-toolbar.compact .matrix-search-input {
        grid-column: 1 / -1;
      }

      #matrix .accounts-mode-toggle {
        width: 100%;
      }

      #matrix .accounts-mode-toggle button {
        flex: 1 1 0;
      }

      .trial-detail-modal {
        width: calc(100vw - 16px) !important;
        height: calc(100dvh - 16px) !important;
        max-height: calc(100dvh - 16px) !important;
      }

      .trial-detail-modal .trial-detail-header,
      .trial-detail-tabs,
      .trial-detail-body,
      .trial-detail-composer {
        padding-inline: 10px;
      }

      .trial-metric-rail,
      .trial-result-signal-grid,
      .trial-result-context-grid,
      .trial-crop-card-grid,
      .trial-setup-section-grid {
        grid-template-columns: 1fr;
      }
    }
    /* Last-word experiment fit fix: prevent setup/result fact rails from stretching to viewport height. */
    .trial-detail-modal .trial-metric-rail {
      display: flex !important;
      flex-wrap: wrap;
      align-items: flex-start !important;
      align-content: flex-start !important;
      gap: 6px;
      height: auto !important;
      min-height: 0 !important;
      max-height: none !important;
      overflow: visible !important;
    }

    .trial-detail-modal .trial-metric-rail .trial-metric-card {
      flex: 1 1 128px;
      max-width: 260px;
      align-self: flex-start !important;
    }

    @media (max-width: 620px) {
      .trial-detail-modal .trial-metric-rail {
        display: grid !important;
        grid-template-columns: 1fr;
      }

      .trial-detail-modal .trial-metric-rail .trial-metric-card {
        max-width: none;
      }
    }

    /* User Profile workspace */
    .user-profile-shell {
      display: flex;
      flex-direction: column;
      gap: 16px;
      width: 100%;
      min-width: 0;
    }

    .user-profile-hero {
      display: grid;
      grid-template-columns: auto minmax(0, 1fr) minmax(220px, 320px);
      gap: 18px;
      align-items: center;
      padding: 18px;
      border: 1px solid var(--border);
      border-radius: 18px;
      background: var(--panel);
      box-shadow: var(--shadow-soft);
    }

    .user-profile-avatar {
      width: 68px;
      height: 68px;
      border-radius: 18px;
      display: grid;
      place-items: center;
      background: var(--accent);
      color: #222223;
      font-weight: 900;
      letter-spacing: .04em;
    }

    .user-profile-headline h2 {
      margin: 2px 0 8px;
      font-size: clamp(24px, 3vw, 36px);
      line-height: 1.05;
    }

    .user-profile-meta {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      color: var(--muted);
      font-weight: 700;
      font-size: 13px;
    }

    .user-profile-meta span {
      border: 1px solid var(--border);
      border-radius: 999px;
      padding: 5px 10px;
      background: var(--soft);
    }

    .user-profile-status-card {
      display: flex;
      flex-direction: column;
      gap: 8px;
      padding: 14px;
      border-radius: 14px;
      border: 1px solid var(--border);
      background: var(--soft);
    }

    .user-profile-status-card p {
      margin: 0;
      color: var(--muted);
      line-height: 1.45;
      font-size: 13px;
    }

    .user-profile-tabs {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
      padding: 6px;
      border: 1px solid var(--border);
      border-radius: 14px;
      background: var(--panel);
      width: fit-content;
      max-width: 100%;
    }

    .user-profile-tabs button {
      border: 0;
      background: transparent;
      border-radius: 10px;
      padding: 8px 12px;
      color: var(--muted);
      font-weight: 850;
      cursor: pointer;
    }

    .user-profile-tabs button.active,
    .user-profile-tabs button:hover {
      background: var(--accent);
      color: #222223;
    }

    .user-profile-overview,
    .user-profile-two-column,
    .settings-card-grid {
      display: grid;
      gap: 16px;
    }

    .user-profile-two-column {
      grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .user-profile-section,
    .settings-card {
      border: 1px solid var(--border);
      border-radius: 16px;
      background: var(--panel);
      padding: 16px;
      min-width: 0;
      box-shadow: var(--shadow-soft);
    }

    .user-profile-section .section-head {
      margin-bottom: 12px;
    }

    .user-profile-metrics {
      display: grid;
      grid-template-columns: repeat(6, minmax(130px, 1fr));
      gap: 10px;
    }

    .profile-mini-metrics {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 10px;
      margin-bottom: 12px;
    }

    .profile-mini-metrics div {
      border: 1px solid var(--border);
      border-radius: 12px;
      background: var(--soft);
      padding: 12px;
    }

    .profile-mini-metrics strong {
      display: block;
      font-size: 20px;
    }

    .profile-mini-metrics span,
    .profile-list-row span {
      display: block;
      color: var(--muted);
      font-size: 12px;
      font-weight: 750;
    }

    .profile-list {
      display: grid;
      gap: 8px;
    }

    .profile-list.compact {
      margin-top: 12px;
      padding-top: 12px;
      border-top: 1px solid var(--border);
    }

    .profile-list-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      min-width: 0;
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 10px 12px;
      background: var(--soft);
    }

    .profile-list-row strong,
    .profile-list-row div {
      min-width: 0;
    }

    .profile-list-row.warning {
      border-color: rgba(181, 118, 23, .45);
      background: rgba(181, 118, 23, .1);
    }

    .user-profile-map-panel .map-wrap {
      height: clamp(420px, 48vh, 620px);
      min-height: 420px;
      border-radius: 14px;
    }

    .settings-card-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .user-settings-form {
      display: grid;
      gap: 14px;
    }

    .settings-card h4 {
      margin: 0 0 12px;
    }

    .settings-card label,
    .settings-check {
      display: grid;
      gap: 6px;
      margin-bottom: 10px;
      font-weight: 800;
      color: var(--text);
    }

    .settings-check {
      grid-template-columns: auto 1fr;
      align-items: center;
    }

    .profile-definition-list {
      display: grid;
      grid-template-columns: max-content minmax(0, 1fr);
      gap: 8px 14px;
      margin: 12px 0 0;
    }

    .profile-definition-list dt {
      color: var(--muted);
      font-weight: 850;
    }

    .profile-definition-list dd {
      margin: 0;
      font-weight: 750;
      min-width: 0;
      overflow-wrap: anywhere;
    }

    .coming-soon-card {
      background: linear-gradient(180deg, var(--panel), var(--soft));
    }

    .integration-list {
      display: grid;
      gap: 10px;
    }

    .integration-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      min-width: 0;
      border: 1px solid var(--border);
      border-radius: 14px;
      background: var(--soft);
      padding: 12px;
    }

    .integration-row div:first-child {
      min-width: 0;
    }

    .integration-row strong,
    .integration-row span {
      display: block;
    }

    .integration-row span {
      color: var(--muted);
      font-size: 12px;
      font-weight: 750;
      line-height: 1.45;
    }

    .muted-pill {
      background: var(--soft);
      color: var(--muted);
    }

    [data-theme="night"] .user-profile-hero,
    [data-theme="night"] .user-profile-section,
    [data-theme="night"] .settings-card {
      background: var(--panel);
    }

    [data-theme="night"] .user-profile-meta span,
    [data-theme="night"] .user-profile-status-card,
    [data-theme="night"] .profile-mini-metrics div,
    [data-theme="night"] .profile-list-row,
    [data-theme="night"] .integration-row {
      background: rgba(255,255,255,.035);
    }

    @media (max-width: 1200px) {
      .user-profile-metrics {
        grid-template-columns: repeat(4, minmax(130px, 1fr));
      }
    }

    @media (max-width: 900px) {
      .user-profile-hero {
        grid-template-columns: auto minmax(0, 1fr);
      }

      .user-profile-status-card {
        grid-column: 1 / -1;
      }

      .user-profile-two-column,
      .settings-card-grid {
        grid-template-columns: 1fr;
      }

      .user-profile-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }

      .profile-mini-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }
    }

    @media (max-width: 620px) {
      .user-profile-hero {
        grid-template-columns: 1fr;
      }

      .user-profile-avatar {
        width: 56px;
        height: 56px;
      }

      .user-profile-tabs {
        width: 100%;
      }

      .user-profile-tabs button {
        flex: 1 1 auto;
      }

      .user-profile-metrics,
      .profile-mini-metrics {
        grid-template-columns: 1fr;
      }

      .profile-list-row,
      .integration-row {
        align-items: flex-start;
        flex-direction: column;
      }
    }

    .evidence-modal {
      max-width: min(860px, calc(100vw - 32px));
    }

    .evidence-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 14px;
      margin-top: 16px;
    }

    .evidence-grid h3 {
      font-size: 12px;
      letter-spacing: .08em;
      margin: 0 0 8px;
      text-transform: uppercase;
      color: var(--muted);
    }

    .evidence-row {
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 11px 12px;
      margin-bottom: 8px;
      background: var(--panel);
    }

    .evidence-row div {
      display: flex;
      justify-content: space-between;
      gap: 10px;
      align-items: baseline;
    }

    .evidence-row strong {
      font-size: 13px;
      line-height: 1.25;
    }

    .evidence-row span {
      color: var(--muted);
      font-size: 11px;
      white-space: nowrap;
    }

    .evidence-row p {
      color: var(--muted);
      font-size: 12px;
      line-height: 1.45;
      margin: 7px 0 0;
    }

    @media (max-width: 720px) {
      .evidence-grid {
        grid-template-columns: 1fr;
      }
    }

/* Prospects-list layout (Josh 2026-07-30): the Name column was enormous for content
   like "4-B Cattle" while Notes truncated to a fragment. Name bounded, Notes given the
   freed width; the note SUBSTANCE renders as a readable line above the type-a-note box
   (provenance prefix stripped in DISPLAY ONLY — see coldNoteSubstance). A well-chosen
   fixed set beats a column manager here, deliberately. */
.cold-table .cold-identity-cell { max-width: 190px; }
.cold-table .cold-name-input { max-width: 170px; }
.cold-table .cold-notes-cell { width: 38%; min-width: 260px; }
.cold-note-stack { display: flex; flex-direction: column; gap: 3px; }
.cold-note-display {
  font-size: 12.5px; line-height: 1.35; color: var(--ink, #222223);
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  word-break: break-word;
}
body.night-mode .cold-note-display { color: var(--night-ink, #e8e8e6); }

/* ── F3 prospect row redesign (Josh, 2026-07-30) ──────────────────────── */
.cold-status-cell { min-width: 150px; }
.cold-status-cell .cold-last-contact {
  display: block; font-size: 0.72rem; opacity: 0.65; margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.cold-identity-cell .cold-identity-sub {
  display: block; font-size: 0.72rem; opacity: 0.7; line-height: 1.25;
  max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cold-identity-cell .cold-identity-crop { opacity: 0.85; }
/* Status colors — semantic, kept under the monochrome decree's stage-color
   exception. Families: dead ends = red family, voicemail/no-answer = amber
   family, live interest = green family, info = teal, unset = neutral. */
.cold-status-select { border-left: 4px solid transparent; }
.cold-status-select.b-interested { border-left-color: #15803d; color: #15803d; }
.cold-status-select.b-trial { border-left-color: #166534; color: #166534; }
.cold-status-select.b-needs-info { border-left-color: #0e7490; color: #0e7490; }
.cold-status-select.b-left-voicemail { border-left-color: #b45309; color: #b45309; }
.cold-status-select.b-no-answer { border-left-color: #d97706; color: #d97706; }
.cold-status-select.b-not-interested { border-left-color: #b3261e; color: #b3261e; }
.cold-status-select.b-bad-number { border-left-color: #7f1d1d; color: #7f1d1d; }
.cold-status-select.b-not-relevant { border-left-color: #6b7280; color: #6b7280; }
.cold-status-select.b-neutral { border-left-color: color-mix(in srgb, currentColor 25%, transparent); }
@media (prefers-color-scheme: dark) {
  .cold-status-select.b-interested { color: var(--t-emerald-lift); border-left-color: var(--t-emerald-lift); }
  .cold-status-select.b-trial { color: #34d399; border-left-color: #34d399; }
  .cold-status-select.b-needs-info { color: #22d3ee; border-left-color: #22d3ee; }
  .cold-status-select.b-left-voicemail { color: #fbbf24; border-left-color: #fbbf24; }
  .cold-status-select.b-no-answer { color: #f59e0b; border-left-color: #f59e0b; }
  .cold-status-select.b-not-interested { color: #f87171; border-left-color: #f87171; }
  .cold-status-select.b-bad-number { color: #ef4444; border-left-color: #ef4444; }
  .cold-status-select.b-not-relevant { color: #9ca3af; border-left-color: #9ca3af; }
}

/* ── Phone hardening (Josh's production phone screenshots, 2026-07-30;
      guarded by tests/e2e/mobile-layout.spec.mjs) ─────────────────────── */
@media (max-width: 640px) {
  /* belt over the hero fix: no residual bleed may ever give the PAGE a
     sideways scroll (scrollable tables scroll inside their own wrap) */
  html, body { overflow-x: clip; }
  /* popovers anchor to the VIEWPORT on the phone — anchored to their summary
     they hung 95px off the left edge (measured) */
  .matrix-tool-popover {
    position: fixed !important;
    left: 12px !important; right: 12px !important; width: auto !important;
    top: calc(64px + env(safe-area-inset-top)) !important;
    max-height: 70dvh;
  }
  /* Donna is a FULL-SCREEN sheet on the phone. The floating desktop card put
     the composer under Safari's toolbar — "Nothing filed yet — type below"
     with nothing below (Josh's screenshot). The sheet owns the viewport and
     the composer sits above the safe area, always visible. */
  #donnaDock.open {
    position: fixed !important; inset: 0 !important;
    width: 100vw !important; height: 100dvh !important; max-height: none !important;
    border-radius: 0 !important; z-index: 130 !important;
    display: flex !important; flex-direction: column !important;
    background: var(--p-card, #101214);
  }
  #donnaDock.open .capture-thread-root {
    /* the OLD phone layout (phase4, loads later) floats this as a fixed card
       at bottom:150px and parks the bar at the top — the sheet re-grounds it
       with ID strength (2026-07-30, the guard now fails on the card anatomy) */
    position: static !important; inset: auto !important;
    left: auto !important; right: auto !important; top: auto !important; bottom: auto !important;
    width: 100% !important; max-width: none !important; transform: none !important;
    flex: 1 1 auto; min-height: 0; display: flex !important;
    margin: 0 !important; border-radius: 0 !important;
  }
  #donnaDock.open .capture-thread {
    width: 100% !important; max-width: none !important; height: 100% !important;
    border: 0 !important; border-radius: 0 !important; box-shadow: none !important;
  }
  #donnaDock.open .capture-thread { flex: 1; display: flex; flex-direction: column; min-height: 0; max-height: none; }
  #donnaDock.open .thread-scroll { flex: 1; max-height: none; min-height: 0; }
  #donnaDock.open .capture-bar,
  #donnaDock.open .capture-bar.bar-hidden {
    display: flex !important;
    position: sticky !important; bottom: 0 !important;
    left: 0 !important; right: 0 !important; top: auto !important;
    width: 100% !important; max-width: none !important; transform: none !important;
    margin: 0 !important; box-sizing: border-box;
    align-items: flex-end; gap: 6px;
    padding: 8px 10px calc(10px + env(safe-area-inset-bottom)) !important;
  }
  /* the input OWNS the row — the desktop pill styles collapsed it to 12px
     wide (caught by the sheet guard, not by eyes) */
  #donnaDock.open .capture-bar textarea {
    flex: 1 1 auto !important; width: 100% !important; min-width: 0 !important;
  }
  #donnaDock.open .capture-footer { display: none; }
  /* the drawer shows where you are */
  .phone-menu button.active { font-weight: 650; color: var(--t-emerald-lift); }
}
@media (max-width: 640px) {
  /* the popover fits the phone; its CONTENTS must too — sections were built
     477px wide on a 390px screen (measured). General constraint over
     whack-a-class: EVERY descendant caps at the popover's width and rows wrap. */
  .matrix-tool-popover * {
    max-width: 100% !important; min-width: 0 !important; box-sizing: border-box;
  }
  .matrix-tool-popover .accounts-more-section,
  .matrix-tool-popover .accounts-more-actions,
  .matrix-tool-popover .matrix-tab-row,
  .matrix-tool-popover .stage-manager { width: 100% !important; flex-wrap: wrap; }
  .matrix-tool-popover .accounts-filter-fields { display: grid; grid-template-columns: 1fr; width: 100% !important; }
}

/* ── Phone round 2 (Josh's screenshots, 2026-07-30 evening) ───────────── */
@media (max-width: 640px) {
  /* pinch zooms; the +/- buttons hid under the menu button and earned nothing */
  #overview .map-controls { display: none !important; }
  /* the stats strip rides the SAME bottom row as the message icon: smaller,
     one line, left of the bubble */
  #overview .dash-stats-strip {
    position: fixed !important;
    left: 10px !important; right: 84px !important;
    bottom: calc(14px + env(safe-area-inset-bottom)) !important;
    top: auto !important;
    font-size: 0.72rem !important; padding: 6px 10px !important;
    white-space: nowrap; overflow-x: auto; border-radius: 999px;
    max-width: none !important;
  }
  #overview .dash-stats-strip .dash-stat strong { font-size: 0.78rem !important; }
  /* THE CHAT IS ChatGPT/Claude ON THE PHONE (Josh, 2026-07-30: "exactly like
     ChatGPT or Claude — buttons and everything"). The grammar of both apps:
     a slim centered header, user turns as right-aligned bubbles, the
     assistant as full-width plain text with a small role label, and a
     rounded composer bar with the send button INSIDE it. */
  /* ChatGPT-black (Josh's reference shots, 2026-07-30 22:58): TRUE black
     canvas throughout the messaging, gray user bubbles on it, and the
     composer as a floating pill. */
  #donnaDock.open { background: #000 !important; }
  #donnaDock.open .capture-thread { background: #000 !important; }
  #donnaDock.open .thread-scroll { background: #000 !important; }
  #donnaDock.open .thread-head {
    padding: calc(12px + env(safe-area-inset-top)) 16px 12px !important;
    font-size: 1.02rem !important; font-weight: 650;
    display: flex; align-items: center; justify-content: center; position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: #000 !important;
  }
  #donnaDock.open .thread-head .thread-close {
    position: absolute; right: 10px; top: 50%;
    transform: translateY(calc(-50% + env(safe-area-inset-top) / 2));
    width: 36px; height: 36px; font-size: 1.2rem;
  }
  #donnaDock.open .thread-scroll { padding: 14px 16px calc(14px + 4px); }
  #donnaDock.open .thread-exchange { margin: 14px 0 !important; }
  /* the USER: a right-aligned bubble. The agent thread nests the user's turn
     INSIDE .thread-kind-assistant (capture-bar.js:1041) — so this rule must
     outrank the assistant plain-text rule below, and that rule must exclude
     .thread-user. This exact specificity fight rendered Josh's words as bare
     text on build b7475fb (his 10:57 screenshot). */
  #donnaDock.open .thread-exchange .thread-bubble.thread-user,
  #donnaDock.open .thread-bubble.thread-user {
    font-size: 1rem !important; line-height: 1.45 !important;
    padding: 10px 14px !important; border-radius: 18px !important;
    border-bottom-right-radius: 6px !important;
    max-width: 82% !important; margin-left: auto;
    background: #2a2a2e !important; color: #f2f2f4 !important; border: 0 !important;
  }
  /* DONNA: full-width plain text, no bubble chrome — the Claude reading
     layout. :not(.thread-user) is load-bearing — see the user rule above. */
  #donnaDock.open .thread-exchange.thread-kind-assistant .thread-bubble:not(.thread-user),
  #donnaDock.open .thread-bubble.thread-system {
    font-size: 1.02rem !important; line-height: 1.55 !important;
    padding: 2px 0 !important; max-width: 100% !important;
    background: transparent !important; border: 0 !important;
    color: rgba(255, 255, 255, 0.92) !important;
  }
  #donnaDock.open .thread-source-tag {
    display: block; font-size: 0.7rem; letter-spacing: 0.08em;
    text-transform: uppercase; opacity: 0.55; margin-bottom: 4px;
  }
  #donnaDock.open .thread-timestamp { font-size: 0.7rem; opacity: 0.4; text-align: center; }
  /* THE COMPOSER: one rounded field, buttons living INSIDE it — plus on the
     left, mic/voice then the filled send circle on the right */
  #donnaDock.open .capture-bar,
  #donnaDock.open .capture-bar.bar-hidden {
    background: #000 !important; border-top: 0 !important;
  }
  /* the pill: the BAR is transparent black; the INPUT is the rounded vessel
     with the buttons riding flush beside it — the ChatGPT composer shape */
  #donnaDock.open .capture-bar textarea {
    background: #17181c !important; border: 1px solid #2a2a2e !important;
    border-radius: 24px !important;
  }
  #donnaDock.open .capture-bar > * { align-self: center; }
  #donnaDock.open .capture-bar {
    border-radius: 0 !important;
  }
  #donnaDock.open .capture-bar::before { display: none !important; }
  #donnaDock.open .capture-bar textarea {
    font-size: 1rem !important; min-height: 44px; max-height: 30dvh;
    background: #1d1f24 !important; border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 22px !important; padding: 11px 14px !important;
    color: rgba(255, 255, 255, 0.95) !important;
  }
  #donnaDock.open .capture-icon-btn {
    width: 40px !important; height: 40px !important; min-height: 40px !important;
    border-radius: 50% !important; background: transparent !important;
    border: 0 !important; color: rgba(255, 255, 255, 0.75) !important;
    font-size: 1.3rem;
  }
  #donnaDock.open .capture-send {
    width: 40px !important; height: 40px !important; min-height: 40px !important;
    border-radius: 50% !important; font-size: 1.15rem;
    /* 2026 recolor (Josh): ink action, not green — the chat canvas is black,
       so the send circle is the white action fill */
    background: #f5f5f4 !important; color: #161617 !important; border: 0 !important;
  }
  #donnaDock.open .capture-send:disabled { opacity: 0.35; }
}

/* ── Phone top strip + FAB round (Josh, 2026-07-31 00:5x, Google Maps
   reference shot): the search becomes a Google-style solid pill spanning the
   top; the menu button grows to ChatGPT's size; the message launcher becomes
   a real green FAB with the Donna spark. body-prefixed selectors on purpose —
   phase4/paper load AFTER this sheet (the load-order scar). ─────────────── */
@media (max-width: 640px) {
  /* the ChatGPT-size menu circle */
  body .map-menu-btn {
    width: 46px !important; height: 46px !important;
    top: calc(12px + env(safe-area-inset-top)) !important; left: 12px !important;
    border: 0 !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
  }
  body .map-menu-btn svg { width: 24px !important; height: 24px !important; }
  body.night-mode .map-menu-btn { background: #232529 !important; color: #f2f2f4 !important; }
  body:not(.night-mode) .map-menu-btn { background: #ffffff !important; color: #202124 !important; }
  /* the Google-style search pill: from the menu circle to the right edge */
  body #overview .dash-map-hero .map-search {
    left: 68px !important; right: 12px !important;
    top: calc(12px + env(safe-area-inset-top)) !important;
    width: auto !important;
  }
  body #overview .map-search input {
    height: 46px !important; border: 0 !important; border-radius: 999px !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28) !important;
  }
  body.night-mode #overview .map-search input {
    background: #232529 !important; color: #f2f2f4 !important;
  }
  body:not(.night-mode) #overview .map-search input {
    background: #ffffff !important; color: #202124 !important;
  }
  body #overview .map-filter-inline { top: 50%; transform: translateY(-50%); right: 8px; }
  /* the rotating tips line fights the taller pill for space — off on phones */
  body #overview .dash-map-hero .map-search-tips { display: none !important; }
  /* the message launcher is a real FAB — 2026 recolor (Josh): the monochrome
     ACTION fill (black in day / white in night), neutral shadow. The green
     era (lime, then emerald) is retired on controls. */
  body #threadBadgeRootFixed .message-alert-button {
    width: 58px !important; height: 58px !important; min-height: 58px !important;
    border-radius: 50% !important; border: 0 !important;
    background: var(--t-action) !important; color: var(--t-action-ink) !important;
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.32) !important;
  }
  body #threadBadgeRootFixed .review-bell { width: 26px !important; height: 26px !important; stroke: var(--t-action-ink) !important; }
  body #threadBadgeRootFixed .badge-dot {
    background: var(--t-action-ink) !important; border: 2px solid var(--t-action);
    width: 11px; height: 11px;
  }
  /* the FAB has no business floating over the open chat sheet */
  body.donna-sheet-open #threadBadgeRootFixed,
  body:has(#donnaDock.open) #threadBadgeRootFixed { display: none !important; }
}

/* ── iOS focus-zoom kill (Josh, 2026-07-31 00:4x: "when I click search on the
   top of dashboard it brings the screen in and it gets stuck") ───────────
   iOS Safari auto-zooms the PAGE toward any focused field whose text is
   smaller than 16px — and with the map swallowing pinch gestures, zooming
   back out is nearly impossible. The map search sat at 0.85rem (13.6px).
   The rule, not the instance: on phones, EVERY text-entry control renders
   at 16px minimum, so focusing one never triggers the zoom at all. */
@media (max-width: 640px) {
  input, select, textarea { font-size: 16px !important; }
}

/* ── Phone chat: clean-professional round (Josh, 2026-07-30 ~23:00: "get rid
   of the Donna at the top left… make message box bigger… clean professional",
   with his ChatGPT home screen as the reference) ───────────────────────── */
@media (max-width: 640px) {
  /* no header bar at all: the title goes, the border goes, and the close
     button floats alone in the top-right corner like ChatGPT's chrome */
  #donnaDock.open .thread-head {
    border-bottom: 0 !important; padding: 0 !important;
    position: static !important; height: 0 !important; overflow: visible;
  }
  #donnaDock.open .thread-head > span { display: none !important; }
  #donnaDock.open .thread-head .thread-close {
    position: fixed !important;
    top: calc(10px + env(safe-area-inset-top)) !important; right: 12px !important;
    transform: none !important;
    width: 38px !important; height: 38px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.08) !important;
    color: rgba(255, 255, 255, 0.85) !important; border: 0 !important;
    z-index: 40;
  }
  /* thread clears the floating close so the first message never hides under it */
  #donnaDock.open .thread-scroll {
    padding-top: calc(56px + env(safe-area-inset-top)) !important;
  }
  /* the message box is BIGGER: taller resting height, larger type, more air */
  #donnaDock.open .capture-bar textarea {
    min-height: 52px !important; font-size: 1.05rem !important;
    padding: 14px 16px !important; border-radius: 26px !important;
  }
  #donnaDock.open .capture-bar {
    padding: 10px 12px calc(12px + env(safe-area-inset-bottom)) !important;
    gap: 8px !important;
  }
  #donnaDock.open .capture-send,
  #donnaDock.open .capture-icon-btn {
    width: 44px !important; height: 44px !important; min-height: 44px !important;
  }
}

/* ── Phone chat polish round (Josh's stamped a8efb23 screenshots) ───────── */
@media (max-width: 640px) {
  /* the floating menu button has no business inside the chat sheet */
  body.donna-sheet-open .map-menu-btn { display: none !important; }
  body:has(#donnaDock.open) .map-menu-btn { display: none !important; }
  /* header: centered wordmark, like the apps he named */
  #donnaDock.open .thread-head {
    display: flex !important; align-items: center !important;
    justify-content: center !important; text-align: center !important;
    letter-spacing: 0.06em;
  }
  /* empty state: centered and calm, not a whisper in the corner */
  #donnaDock.open .thread-scroll { display: flex; flex-direction: column; }
  #donnaDock.open .thread-scroll > .muted {
    margin: auto !important; text-align: center !important;
    font-size: 1rem !important; opacity: 0.5 !important; padding: 0 24px;
  }
  /* the user's own words are ALWAYS a bubble, whatever wrapper the thread
     mode uses. Keyed on .thread-user ONLY: batch exchanges nest Donna's
     system bubbles beside the user's, and the agent thread nests the user's
     bubble inside .thread-kind-assistant — wrapper-based selectors got BOTH
     of those wrong (Josh's 10:57 bare-text screenshot). The extra
     .thread-exchange variant outranks the assistant plain-text rule. */
  #donnaDock.open [class*="thread-user"],
  #donnaDock.open .thread-exchange .thread-bubble.thread-user,
  #donnaDock.open .thread-bubble.thread-user {
    background: #2a2a2e !important; color: #f2f2f4 !important; border: 0 !important;
    border-radius: 18px !important; border-bottom-right-radius: 6px !important;
    padding: 10px 14px !important; max-width: 82% !important;
    margin-left: auto !important; align-self: flex-end !important;
    font-size: 1rem !important; line-height: 1.45 !important;
  }
  #donnaDock.open .thread-bubble.thread-user p {
    background: transparent !important; padding: 0 !important; margin: 0 !important;
  }
}

/* ── Prospect row: the promoted-row trail chip (Josh workflow ruling,
   2026-07-31: a status change NEVER hides the row; the chip shows where the
   lead now also lives) ─────────────────────────────────────────────────── */
.cold-moved-link {
  display: block; margin-top: 3px; padding: 1px 8px;
  border: 0; border-radius: 999px; cursor: pointer;
  font-size: 0.68rem; line-height: 1.6; text-align: center;
  background: rgba(27, 133, 82, 0.16); color: var(--t-emerald-lift);
}
.cold-moved-link:hover { background: rgba(27, 133, 82, 0.28); }
body:not(.night-mode) .cold-moved-link { background: rgba(22, 101, 52, 0.12); color: #166534; }

/* ── Dormant + Archive (designs (e)/(f), Josh approved 2026-07-31) ─────── */
.cold-status-select.b-dormant { background: rgba(129, 108, 226, 0.22); color: #b3a6f0; border-color: rgba(129, 108, 226, 0.45); }
.cold-table tr.cold-status-dormant td { background: rgba(129, 108, 226, 0.10); }
body:not(.night-mode) .cold-status-select.b-dormant { background: rgba(94, 72, 190, 0.14); color: #4a3a9e; }
.cold-wake-label {
  display: flex; align-items: center; gap: 5px; margin-top: 3px;
  font-size: 0.68rem; opacity: 0.85;
}
.cold-wake-label .cold-wake-input {
  min-width: 0 !important; width: auto !important;
  font-size: 0.78rem !important; padding: 1px 4px;
}
.cold-archive-link {
  display: block; margin-top: 3px; padding: 1px 8px;
  border: 0; border-radius: 999px; cursor: pointer;
  font-size: 0.68rem; line-height: 1.6; text-align: center;
  background: rgba(255, 255, 255, 0.08); color: rgba(255, 255, 255, 0.65);
}
body:not(.night-mode) .cold-archive-link { background: rgba(0, 0, 0, 0.07); color: rgba(0, 0, 0, 0.55); }
tr .cold-archive-link:hover { background: rgba(177, 75, 75, 0.3); color: #fff; }

/* ── Tap-to-call (Josh's first strike, 2026-07-31 morning): one thumb, one
   dial. The input EDITS; the green circle CALLS; nothing logs on tap. ──── */
.tel-call-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; min-width: 34px; min-height: 34px !important;
  border-radius: 50%; margin-left: 6px; flex: 0 0 auto;
  background: rgba(27, 133, 82, 0.15); color: var(--t-emerald-lift);
  text-decoration: none;
}
.tel-call-btn svg { width: 17px; height: 17px; }
.tel-call-btn:hover { background: rgba(27, 133, 82, 0.3); }
body:not(.night-mode) .tel-call-btn { background: rgba(22, 101, 52, 0.1); color: #166534; }
.cold-phone-cell { display: flex; align-items: center; }
.cold-phone-cell input { flex: 1 1 auto; min-width: 90px !important; }
@media (max-width: 640px) {
  /* a thumb target, per the ruling: 44px on the phone */
  .tel-call-btn { width: 44px; height: 44px; min-width: 44px; min-height: 44px !important; }
  .tel-call-btn svg { width: 21px; height: 21px; }
}

/* ── Inline add row (Josh, 2026-07-31: spreadsheet-fast, one write path) ── */
.cold-draft-row td { padding: 8px !important; background: rgba(27, 133, 82, 0.07); }
.cold-draft-grid { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cold-draft-grid input, .cold-draft-grid select {
  flex: 1 1 120px; min-width: 110px !important; padding: 7px 9px;
}
.cold-draft-grid input[data-draft-field="company"] { flex: 1.4 1 150px; }
.cold-draft-grid button { flex: 0 0 auto; }

/* the sort seats a new row wherever it belongs — the flash shows WHERE */
.cold-row-flash td { animation: coldRowFlash 2.4s ease-out; }
@keyframes coldRowFlash {
  0%, 45% { background: rgba(27, 133, 82, 0.35); }
  100% { background: transparent; }
}
@media (prefers-reduced-motion: reduce) { .cold-row-flash td { animation: none; background: rgba(27, 133, 82, 0.2); } }

/* ── Prospects toolbar, calm version (Josh 2026-07-31: "that area is ugly
   right now") — one bare +, search, More, and a scoreboard that reads at a
   glance without owning the row ─────────────────────────────────────────── */
.cold-plus {
  width: 34px; height: 34px; min-height: 34px !important; padding: 0 !important;
  border-radius: 50% !important; font-size: 1.15rem; line-height: 1;
}
.cold-scoreboard {
  margin-left: auto; padding: 4px 12px; border-radius: 8px;
  font-variant-numeric: tabular-nums; font-size: 0.8rem; letter-spacing: 0.04em;
  background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(27, 133, 82, 0.25);
}
.cold-scoreboard strong { color: var(--t-emerald-lift); font-size: 1.05rem; }
.cold-scoreboard em { font-style: normal; opacity: 0.5; padding: 0 2px; }
body:not(.night-mode) .cold-scoreboard { background: rgba(0, 0, 0, 0.06); }
.cold-primary-tools { display: flex; align-items: center; gap: 8px; }
.cold-filter-menu { position: relative; display: inline-block; }
.cold-filter-menu > summary { list-style: none; cursor: pointer; }
.cold-filter-menu > summary::-webkit-details-marker { display: none; }
.cold-filter-panel {
  position: absolute; z-index: 30; top: calc(100% + 6px); left: 0;
  display: flex; flex-direction: column; gap: 4px; min-width: 180px;
  padding: 8px; border-radius: 12px;
  background: var(--soft, #1b1d21); border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.4);
}
.cold-filter-panel .cold-filter-chip { width: 100%; text-align: left; }

/* ── Row stacks + call options + filter-panel controls (Josh 2026-07-31) ── */
.cold-identity-cell { display: flex; flex-direction: column; gap: 2px; }
.cold-company-input, .cold-place-input {
  font-size: 0.78rem !important; opacity: 0.85;
  min-width: 110px !important; padding: 2px 6px;
  background: transparent; border-color: transparent;
}
.cold-company-input:focus, .cold-place-input:focus { border-color: var(--line, #444); opacity: 1; }
.cold-call-menu { position: relative; display: inline-block; }
.cold-call-menu > summary { list-style: none; cursor: pointer; display: inline-flex; }
.cold-call-menu > summary::-webkit-details-marker { display: none; }
.cold-call-options {
  position: absolute; z-index: 40; top: calc(100% + 4px); right: 0;
  display: flex; flex-direction: column; min-width: 150px;
  border-radius: 12px; overflow: hidden;
  background: var(--soft, #1b1d21); border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.45);
}
.cold-call-options a {
  padding: 11px 14px; text-decoration: none; color: inherit; font-size: 0.9rem;
}
.cold-call-options a:hover { background: rgba(27, 133, 82, 0.14); }
.cold-filter-divider { height: 1px; margin: 4px 0; background: rgba(255, 255, 255, 0.12); }
.cold-filter-panel .matrix-inline-field { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; }
.cold-filter-panel .matrix-inline-field input, .cold-filter-panel .matrix-inline-field select { flex: 1; min-width: 0 !important; }
@media (max-width: 640px) {
  .cold-call-options a { padding: 14px 16px; }   /* thumb-size choices */
}

/* ── Round 4: minimum toolbar + professional stacks (Josh 2026-07-31) ──── */
.cold-one-line {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.cold-one-line .cold-search-label { flex: 1 1 190px; max-width: 320px; }
.cold-filter-icon {
  display: inline-flex; align-items: center; gap: 6px;
  width: auto; padding: 6px 9px !important; border-radius: 999px;
}
.cold-filter-icon svg { width: 15px; height: 15px; }
.cold-filter-icon.active { color: var(--t-emerald-lift); }
.cold-filter-active-name { font-size: 0.75rem; }
/* the two row stacks read as ONE type system: top line steady, sub quiet */
.cold-name-input {
  font-weight: 600; font-size: 0.88rem !important;
  background: transparent; border-color: transparent; padding: 2px 6px;
}
.cold-name-input:focus { border-color: var(--line, #444); }
.cold-place-line {
  font-size: 0.78rem; opacity: 0.8; padding: 2px 6px; line-height: 1.35;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px;
}
.cold-crop-line { opacity: 0.55; font-size: 0.72rem; }
/* a flexed TD leaves the table's row-height contract — the 'funky box'
   Josh screenshotted. The TD stays a cell; the STACK inside it flexes. */
.cold-status-cell { vertical-align: middle; }
.cold-status-stack { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.cold-status-stack .cold-last-contact { font-size: 0.72rem; opacity: 0.6; padding-left: 2px; }

/* ── Round 5: hard LEFT alignment + fixed column rhythm (Josh: "left
   aligned… it needs to look clean") ─────────────────────────────────────── */
.cold-table { table-layout: fixed; width: 100%; }
.cold-table th, .cold-table td { text-align: left !important; vertical-align: middle; }
.cold-table th:nth-child(1), .cold-table td:nth-child(1) { width: 21%; }
.cold-table th:nth-child(2), .cold-table td:nth-child(2) { width: 17%; }
.cold-table th:nth-child(3), .cold-table td:nth-child(3) { width: 17%; }
.cold-table th:nth-child(4), .cold-table td:nth-child(4) { width: 15%; }
.cold-table th:nth-child(5), .cold-table td:nth-child(5) { width: 30%; }
.cold-table .cold-identity-cell input,
.cold-table .cold-name-input, .cold-table .cold-company-input {
  width: 100%; min-width: 0 !important; text-align: left; display: block;
}
.cold-place-line { display: block; max-width: none; }
.cold-status-select {
  min-width: 0 !important; width: auto; max-width: 100%;
  font-size: 0.8rem !important; padding: 3px 20px 3px 8px !important;
}
.cold-phone-cell { justify-content: flex-start; }
.cold-phone-cell input { text-align: left; }
@media (max-width: 640px) {
  .cold-table { table-layout: auto; }   /* the phone keeps its scroll layout */
}

/* the probe's verdict (2026-07-31): the F3-era align-items:center survived
   into the flex-COLUMN stacks — which centers children HORIZONTALLY. Every
   stack pins hard left; children take the full line. */
.cold-table .cold-identity-cell, .cold-table .cold-place-cell,
.cold-table .cold-status-stack {
  align-items: flex-start !important; text-align: left !important;
}
.cold-table .cold-identity-cell > *, .cold-table .cold-place-cell > * {
  width: 100%; text-align: left;
}

/* ── Exceptional pass (Josh: "9.5 or 10... buttons are funny clicking") ── */
/* every tap answers the finger — pressed state across the app's controls */
.button:active, .tel-call-btn:active, .cold-note-send:active,
.capture-send:active, .cold-filter-chip:active, .matrix-tab:active,
.cold-plus:active, .message-alert-button:active {
  transform: scale(0.95);
}
.button, .tel-call-btn, .cold-note-send, .capture-send,
.cold-filter-chip, .matrix-tab, .cold-plus, .message-alert-button {
  transition: transform 0.08s ease, background 0.15s ease;
}
/* the body-level call menu (never clipped by the table scroll) */
#callOptsRoot .cold-call-options { position: fixed; }
/* scoreboard: progress to goal, and the goal-hit celebration */
.cold-scoreboard { display: inline-flex; flex-direction: column; gap: 3px; min-width: 74px; }
.cold-score-nums { display: flex; align-items: baseline; }
.cold-score-bar {
  display: block; height: 3px; border-radius: 2px; overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
}
.cold-score-bar b { display: block; height: 100%; background: var(--t-emerald); border-radius: 2px; transition: width 0.4s ease; }
.cold-scoreboard.goal-hit { border-color: var(--t-emerald-lift); box-shadow: 0 0 12px rgba(27, 133, 82, 0.35); }
.cold-scoreboard.goal-hit strong { text-shadow: 0 0 8px rgba(27, 133, 82, 0.6); }
/* row hover carries the eye across the row */
.cold-table tbody tr:hover td { background: rgba(27, 133, 82, 0.045) !important; }
/* phone digits line up */
.cold-phone-cell input { font-variant-numeric: tabular-nums; }

/* ── PHONE CARDS (the metric-9 build): at phone width each prospect is a
   CARD — name, place, a thumb call button, status, note. The table grammar
   dissolves; the call-block grammar takes over. ───────────────────────── */
@media (max-width: 640px) {
  /* grid-on-<tr> is a quirk minefield: the probe showed the grid PLACING
     children correctly while the table engine still owned the tr's height
     (44px box, 190px of children, rows overlapping). Plain block flow +
     an anchored phone cell is deterministic in every engine. */
  #cold .cold-table, #cold .cold-table tbody { display: block; width: 100%; }
  #cold .cold-table thead { display: none; }
  #cold .cold-table tbody tr {
    display: block; position: relative; width: 100%; box-sizing: border-box;
    padding: 12px 10px; height: auto !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  #cold .cold-table td { display: block; width: auto !important; min-width: 0; border: 0 !important; padding: 0 !important; }
  #cold .cold-table td:nth-child(1), #cold .cold-table td:nth-child(2) { margin-right: 150px; }
  #cold .cold-table td:nth-child(2) { margin-top: 3px; }
  #cold .cold-table td:nth-child(3) {
    position: absolute; top: 12px; right: 10px; width: 140px;
  }
  #cold .cold-table td:nth-child(4) { margin-top: 8px; }
  #cold .cold-table td:nth-child(5) { margin-top: 6px; }
  #cold .cold-phone-cell { flex-direction: column; align-items: flex-end; gap: 6px; }
  #cold .cold-phone-cell input { text-align: right; font-size: 16px !important; width: 130px; }
  #cold .tel-call-btn { width: 48px; height: 48px; min-width: 48px; min-height: 48px !important; }
  #cold .tel-call-btn svg { width: 22px; height: 22px; }
  #cold .cold-status-stack { flex-direction: row; align-items: center; gap: 10px; flex-wrap: wrap; }
  #cold .cold-note-stack { width: 100%; }
  #cold .cold-draft-row { display: block; }
}

/* Call Back — the between state (Josh 2026-07-31): amber family, dated */
.cold-status-select.b-callback { background: rgba(224, 169, 74, 0.2); color: #e0a94a; border-color: rgba(224, 169, 74, 0.45); }
.cold-table tr.cold-status-callback td { background: rgba(224, 169, 74, 0.07); }
body:not(.night-mode) .cold-status-select.b-callback { background: rgba(180, 120, 30, 0.14); color: #8a5d10; }

/* the bridge to the full pipeline (promoted rows only) */
.cold-donna-file {
  align-self: flex-start; margin-top: 2px; padding: 2px 9px;
  border: 0; border-radius: 999px; cursor: pointer;
  font-size: 0.7rem; background: rgba(27, 133, 82, 0.12); color: var(--t-emerald-lift);
}
.cold-donna-file:hover { background: rgba(27, 133, 82, 0.25); }
body:not(.night-mode) .cold-donna-file { background: rgba(22, 101, 52, 0.1); color: #166534; }
