/* desktop.css — the signed-in app in a desktop browser (1024px and wider).
   Added 2026-09-18 at the owner's request: on a desktop the app was the phone
   layout centred in a wide window — a floating tab bar over the content, a hero
   filling the top third, 8–12px labels and phone buttons in a sea of space.
   This layer gives the wide screen its own shape:
   - a left navigation rail replaces the floating tab bar;
   - content fills the width beside the rail;
   - screen headers sit left, one size, with the description under the title;
   - labels, buttons and table headers scale up (12/13/14px tokens);
   - the three big dialogs widen.
   Every rule is scoped to the signed-in app: body:not(.auth-active) and not
   the transaction portal (which keeps its own desktop layout). The sign-in
   page and the signer page are untouched. Linked last, after topbar.css.
   Nothing here applies under 1024px. */

@media (min-width: 1024px) {
  /* Tokens rise for the signed-in app only (legibility.css floors read them). */
  body:not(.auth-active):not(.transaction-portal) {
    --rcr-label: 12px;
    --rcr-label-lg: 13px;
    --rcr-body-sm: 14px;
    --rcr-rail: 236px;
  }

  /* ---------------------------------------------------------- the rail */
  body:not(.auth-active):not(.transaction-portal) .app-nav:not([hidden]) {
    position: fixed;
    left: 0;
    top: var(--rcr-header-h, 64px);
    bottom: 0;
    width: var(--rcr-rail);
    height: auto;
    transform: none;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 4px;
    padding: 18px 14px;
    border: 0;
    border-right: 1px solid var(--line);
    border-radius: 0;
    background: var(--card, #fff);
    box-shadow: none;
    backdrop-filter: none;
    z-index: 30;
    overflow: auto;
  }

  body:not(.auth-active):not(.transaction-portal) .app-nav button {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    align-items: center;
    justify-items: start;
    gap: 12px;
    flex: 0 0 auto;
    width: 100%;
    height: 44px;
    min-height: 44px;
    padding: 0 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    text-align: left;
  }

  body:not(.auth-active):not(.transaction-portal) .app-nav button:hover {
    background: var(--stone);
    color: var(--ink);
  }

  body:not(.auth-active):not(.transaction-portal) .app-nav button.active {
    background: rgba(159, 23, 28, .08);
    color: var(--red);
  }

  body:not(.auth-active):not(.transaction-portal) .app-nav svg {
    width: 22px;
    height: 22px;
    stroke-width: 1.7;
  }

  body:not(.auth-active):not(.transaction-portal) .app-nav span {
    font: 700 13px/1.2 "Manrope", sans-serif;
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  /* ---------------------------------------------------------- the page */
  /* The gutter follows the rail. Set it for the signed-in app and remove it
     while the nav is hidden; an engine without :has() keeps the gutter, which
     degrades to space rather than to a rail over the content. */
  body:not(.auth-active):not(.transaction-portal) main {
    padding-left: var(--rcr-rail);
  }

  body:not(.auth-active):not(.transaction-portal):has(#appNav[hidden]) main {
    padding-left: 0;
  }

  body:not(.auth-active):not(.transaction-portal) .workspace,
  body:not(.auth-active):not(.transaction-portal) #agentView.workspace,
  body:not(.auth-active):not(.transaction-portal) #clientView.workspace {
    max-width: none;
    padding: 28px 40px 56px;
  }

  body:not(.auth-active):not(.transaction-portal) .topbar {
    padding-left: 24px;
    padding-right: 20px;
  }

  /* Screen header: left, one size, the description under the title. */
  body:not(.auth-active):not(.transaction-portal) .screen-header,
  body:not(.auth-active):not(.transaction-portal) .screen-header.is-return-visit {
    max-width: none;
    margin: 2px 0 26px;
    padding: 0;
    text-align: left;
  }

  body:not(.auth-active):not(.transaction-portal) .screen-header h1,
  body:not(.auth-active):not(.transaction-portal) .screen-header.is-return-visit h1 {
    font-size: clamp(32px, 2.6vw, 42px);
    line-height: 1.05;
    letter-spacing: -.03em;
    margin: 4px 0 6px;
  }

  body:not(.auth-active):not(.transaction-portal) .screen-header > p:last-child,
  body:not(.auth-active):not(.transaction-portal) .screen-header.is-return-visit > p:last-child {
    display: block;
    max-width: 820px;
    margin: 0;
    font-size: 15px;
    line-height: 1.55;
  }

  /* ---------------------------------------------------------- controls */
  body:not(.auth-active):not(.transaction-portal) .primary,
  body:not(.auth-active):not(.transaction-portal) .secondary {
    min-height: 44px;
    padding: 0 20px;
    font-size: var(--rcr-label-lg);
    letter-spacing: .02em;
  }

  /* Inline row utilities keep their shape; only the type steps up. */
  body:not(.auth-active):not(.transaction-portal) .text-button,
  body:not(.auth-active):not(.transaction-portal) .link-button {
    font-size: var(--rcr-label-lg);
    letter-spacing: .02em;
  }

  /* Both floor lists use :where() so they weigh the same and source order
     decides: labels first, then the reading text that must stay one step up. */
  body:not(.auth-active):not(.transaction-portal) :is(#agentView, #clientView) :where(
    .agent-dashboard-metrics span, .agent-dashboard-metrics small,
    .broker-metrics span, .broker-metrics small,
    .stat span, .stat small,
    .hub-section > .section-heading > small,
    .free-plan-note span, .pro-badge, .pro-offer-copy small, .website-addon-actions small,
    .listing-attribution dt,
    .contact-action-grid a, .contact-action-grid button,
    .hub-module .link-button,
    th, thead span,
    .transaction-table th, .transaction-list-header span,
    .transaction-row p, .transaction-row small,
    .listing-toolbar label, .listing-toolbar span, .listing-toolbar select,
    .transaction-list-toolbar span, .transaction-list-toolbar label,
    .transaction-file-head span, .transaction-file-next small, .transaction-file-alerts,
    .transaction-file-side, .transaction-file-address, .transaction-file-next strong,
    .property-card small,
    .contact p, .managed-row p, .request-row p, .task-row p,
    .record-actions .text-button,
    small, dt, dd, .favorite
  ) {
    font-size: var(--rcr-label);
  }

  /* Secondary reading text in rows: one step above labels. */
  body:not(.auth-active):not(.transaction-portal) :is(#agentView, #clientView) :where(article p, .panel > p, .saved-search p, .property-meta, .contact p, .managed-row p, .request-row p, .task-row p) {
    font-size: var(--rcr-body-sm);
    line-height: 1.5;
  }

  body:not(.auth-active):not(.transaction-portal) :is(#agentView, #clientView) :is(.stat strong, .agent-dashboard-metrics strong, .broker-metrics strong) {
    font-size: 36px;
  }

  body:not(.auth-active):not(.transaction-portal) :is(#agentView, #clientView) .transaction-row h3 { font-size: 15px; }

  /* ---------------------------------------------------------- grids */
  body:not(.auth-active):not(.transaction-portal) .agent-dashboard-metrics { gap: 16px; }
  body:not(.auth-active):not(.transaction-portal) .agent-dashboard-grid { gap: 20px; }
  body:not(.auth-active):not(.transaction-portal) .property-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }

  /* ---------------------------------------------------------- the three big dialogs */
  body:not(.auth-active):not(.transaction-portal) #supportDialog,
  body:not(.auth-active):not(.transaction-portal) #notificationDialog,
  body:not(.auth-active):not(.transaction-portal) #hubManagerDialog {
    width: min(820px, calc(100vw - 64px)) !important;
    max-width: 820px !important;
  }
}

@media (min-width: 1500px) {
  body:not(.auth-active):not(.transaction-portal) .agent-dashboard-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body:not(.auth-active):not(.transaction-portal) .workspace,
  body:not(.auth-active):not(.transaction-portal) #agentView.workspace,
  body:not(.auth-active):not(.transaction-portal) #clientView.workspace { padding: 32px 56px 64px; }
  body:not(.auth-active):not(.transaction-portal) :is(#agentView, #clientView) :is(.stat strong, .agent-dashboard-metrics strong, .broker-metrics strong) { font-size: 40px; }
}
