/* Merge step 1 (18 Nov 2026): the owner's combined screens (merge1.js). One tab row per screen
   (plain sentence-case text tabs) with the page's one primary action on the right, in the v4 finish
   (10-80-10-plan-v4.md). Every rule sits under html.m1-on, which merge1.js sets only on the owner's
   desktop with PORTAL_V4 on (tpDock4.on()). Off, none of this applies. */
@media (min-width: 769px) {
  html.m1-on {
    --m1-ink: #111; --m1-mute: #6E6E68; --m1-line: #E3E3DC;
  }

  /* ---- the tab row ------------------------------------------------------------------------- */
  html.m1-on .m1-head { display: flex; align-items: stretch; gap: 16px; height: 44px; margin: 0 0 22px; border-bottom: 1px solid var(--m1-line); }
  html.m1-on .m1-head[hidden] { display: none; }
  html.m1-on .m1-tabs { display: flex; gap: 22px; min-width: 0; flex: 1 1 auto; overflow-x: auto; scrollbar-width: none; }
  html.m1-on .m1-tabs::-webkit-scrollbar { display: none; }
  html.m1-on .m1-tab {
    position: relative; display: inline-flex; align-items: center; height: 100%; padding: 0; white-space: nowrap;
    font: 400 14px/1 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif; color: var(--m1-mute); text-decoration: none; cursor: pointer;
  }
  html.m1-on .m1-tab.is-on { color: var(--m1-ink); font-weight: 600; }
  html.m1-on .m1-tab.is-on::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 1px; background: var(--m1-ink); }
  @media (hover: hover) { html.m1-on .m1-tab:hover { color: var(--m1-ink); } }
  html.m1-on .m1-tab:focus-visible { outline: 2px solid #8A6D00; outline-offset: 2px; border-radius: 4px; }
  html.m1-on .m1-act {
    flex: 0 0 auto; align-self: center; margin: 0 0 4px; height: 30px; padding: 0 12px; border: 0; border-radius: 7px; background: var(--m1-ink); color: #fff;
    font: 600 13px/30px -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif; white-space: nowrap; cursor: pointer;
  }
  @media (hover: hover) { html.m1-on .m1-act:hover { background: #2a2a28; } }
  /* Pages that draw edge to edge (the request list) still line the row up with the toolbar title. */
  html.m1-on[data-d2-view="requests"] .m1-head { margin: 24px 28px 22px; }
  html.m1-on #view-requests .on-page.is-desk { padding: 0 28px 28px; }
  /* Pay's own top row held only its tabs: gone with them. */
  html.m1-on #view-payroll .py-top:not(:has(> :not(.py-seg):not(.py-grow))) { display: none; }

  /* ---- v4 finish on the combined screens: no accent rails where the words already say it --------- */
  html.m1-on #view-clients .cb-desk .cb-card { border-left: 1px solid var(--cb-line, #E3E3DC); }
  html.m1-on #view-payroll .py .py-run.is-you, html.m1-on #view-leave .py .py-need { border-left-color: transparent; }
  html.m1-on #view-team .pp .pp-tr.is-sel { border-left-color: transparent; }

  /* ---- what the tab row replaces on each page (its own tabs, its title, its one button) ------------ */
  html.m1-on #view-clients .cb-top .cb-seg:has([data-cb-mode]),
  html.m1-on #view-clients .cb-detailsbar,
  html.m1-on #view-clients [data-cb-newclient],
  html.m1-on #view-payroll .py-seg,
  html.m1-on #ch-revseg, html.m1-on #view-revenue .ch-seg, html.m1-on #view-owed .ch-seg,
  html.m1-on #view-team [data-pp-wrapups], html.m1-on #view-team [data-pp-invite],
  html.m1-on #view-requests [data-on-newreq],
  html.m1-on #view-social [data-bz-studio],
  html.m1-on #view-leads [data-bz-lnew],
  html.m1-on :is(#view-requests, #view-eod, #view-compliance, #view-blog_insights, #view-aiassist) .on-top > .on-title { display: none !important; }
  /* A row left with nothing in it takes no room. */
  html.m1-on #view-clients .cb-top:not(:has(.cb-seg:not(:has([data-cb-mode])))) { display: none; }
  html.m1-on :is(#view-requests, #view-eod, #view-compliance, #view-blog_insights, #view-aiassist) .on-top:not(:has(> :not(.on-title):not(.on-grow):not([data-on-newreq]))) { display: none; }

  /* ---- Chats beside the bell ---------------------------------------------------------------------- */
  html.m1-on .m1-chats {
    position: relative; display: inline-flex; align-items: center; gap: 5px; height: var(--d2-btn-h, 30px); padding: 0 8px; border: 0; border-radius: 7px; background: none;
    color: #4a4a45; font: 500 13px -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif; cursor: pointer; flex: 0 0 auto;
  }
  html.m1-on .m1-chats.is-on { background: rgba(0, 0, 0, .06); color: var(--m1-ink); }
  @media (hover: hover) { html.m1-on .m1-chats:hover { background: rgba(0, 0, 0, .05); } }
  html.m1-on .m1-chats-n { color: var(--m1-mute); font-weight: 400; }
  html.m1-on .m1-chats-n::before { content: '('; } html.m1-on .m1-chats-n::after { content: ')'; }
  html.m1-on .m1-chats-n[hidden] { display: none; }
  html.m1-on.v5-tb-s .m1-chats span:not(.m1-chats-n) { display: none; }

  /* ---- the account menu's Library label ----------------------------------------------------------- */
  html.m1-on .m1-mlabel { padding: 8px 12px 2px; font: 400 12px -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif; color: var(--m1-mute); }
}

/* Team › People: the roster beside the dock. With the dock open the page is far narrower than the window
   (tidy5.js's html.v5-cw-m / v5-cw-s), and the six-column roster beside its 360px card ran its columns
   into each other. Narrow: the person card goes under the roster; very narrow: In since and Clients go. */
@media (min-width: 769px) {
  html.m1-on #view-team .pp .pp-tr > * { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  html.m1-on.v5-cw-m #view-team .pp .pp-grid:not(.is-phone) { grid-template-columns: minmax(0, 1fr); }
  html.m1-on.v5-cw-s #view-team .pp .pp-tr { grid-template-columns: 1.3fr 1.2fr 1fr 1.1fr; }
  html.m1-on.v5-cw-s #view-team .pp .pp-tr > :nth-child(3), html.m1-on.v5-cw-s #view-team .pp .pp-tr > :nth-child(6) { display: none; }
}
