/* Race Control 192.16.9 — all phone presentation lives here.
   Landscape canvases at least 900px wide use the desktop layout. */
@media (min-width:900px) and (max-width:1100px) and (max-height:600px) {
  html:not(.phone-layout) .cv2-wrap .cv2-gauge { height:170px; }
  html:not(.phone-layout) .cv2-wrap .cv2-pillar { height:140px; min-height:140px; overflow:hidden; }
  html:not(.phone-layout) .cv2-wrap .cv2-pplain { display:none; }
  html:not(.phone-layout) .cv2-wrap .cv2-pcov { display:none; }
}
@media (max-width:640px), (max-height:640px) {
  /* Correction 02: approved compact cockpit, project and portfolio phone views. */
  html.phone-layout .cv2-gaugebox.phone-cockpit-gauge { display:flex; flex-direction:column; align-items:stretch; width:100%; padding:2px 8px 8px; }
  html.phone-layout .cv2-gaugebox.phone-cockpit-gauge .cv2-gauge { width:100%; height:auto; max-height:none; aspect-ratio:780/404; }
  html.phone-layout .cv2-gauge #num, html.phone-layout .cv2-gauge #pct { display:none; }
  html.phone-layout .phone-dial-value { order:2; margin-top:-9px; color:#f5b301; text-align:center; font:800 48px/1 Montserrat,sans-serif!important; font-variant-numeric:tabular-nums; }
  html.phone-layout .phone-dial-caption { order:3; margin:4px 0 6px; color:#9fb5d3; text-align:center; font:700 12px/1.25 Montserrat,sans-serif!important; letter-spacing:.04em; }
  html.phone-layout .cv2-gaugebox.phone-cockpit-gauge .cv2-hchips { order:4; display:flex; flex-wrap:wrap; justify-content:center; width:100%; gap:5px; margin:0; }
  html.phone-layout .cv2-gaugebox.phone-cockpit-gauge .cv2-scale { order:5; margin:5px 0 0; color:#8199b8; font-size:12px; line-height:1.35; letter-spacing:0; }

  html.phone-layout .cv2-pillar.phone-pillar-order { display:flex; flex-direction:column; min-height:0; height:auto; text-align:left; }
  html.phone-layout .cv2-pillar .cv2-pname { order:1; font-size:12px; text-transform:uppercase; }
  html.phone-layout .cv2-pillar .cv2-pvalue { order:2; margin:0; font-size:26px!important; font-weight:800; line-height:1.1; }
  html.phone-layout .cv2-pillar .cv2-ptrack { order:3; height:5px; margin:4px 0; }
  html.phone-layout .cv2-pillar .cv2-pmeta { order:4; display:block; margin:2px 0 4px; color:#a7bcda; font-size:12px; font-weight:500; line-height:1.25; }
  html.phone-layout .cv2-pillar .cv2-kpi-breakdown,
  html.phone-layout .cv2-pillar .cv2-resident { order:5; }
  html.phone-layout .cv2-pillar .cv2-pplain { order:6; max-height:none; margin:2px 0 4px; color:#a7bcda; font-size:12px; line-height:1.25; }
  html.phone-layout .cv2-pillar [data-pillar-kpi] .cv2-resident-line { font-size:12px; }
  html.phone-layout .cw-crow .lb { overflow-wrap:normal!important; word-break:normal!important; hyphens:none!important; }

  html.phone-layout .phone-grid-card .phone-grid-deal-row { display:grid; grid-template-columns:minmax(0,1fr) max-content; align-items:start; gap:8px; }
  html.phone-layout .phone-grid-deal-row > span { min-width:0; overflow-wrap:normal; word-break:normal; hyphens:none; }
  html.phone-layout .phone-grid-deal-row > strong { min-width:max-content; max-width:none; color:#a7bcda; font-size:12px; line-height:1.3; text-align:right; white-space:nowrap; overflow-wrap:normal; word-break:normal; hyphens:none; }

  html.phone-layout .pk-wrap, html.phone-layout .pk-hd, html.phone-layout .pk-sect, html.phone-layout .pk-panel,
  html.phone-layout .pk-band, html.phone-layout .pk-cols, html.phone-layout .pk-funnel, html.phone-layout .pk-stage,
  html.phone-layout .pk-mini, html.phone-layout .pk-kpi, html.phone-layout .pk-chip { min-width:0!important; max-width:100%!important; }
  html.phone-layout .pk-wrap { width:calc(100% - 2px)!important; margin-right:2px; overflow:visible; }
  html.phone-layout .pk-hd { flex-wrap:wrap; }
  html.phone-layout .pk-spring { min-width:0; max-width:100%; }
  html.phone-layout .pk-chips { min-width:0; max-width:100%; flex-wrap:wrap; }
  html.phone-layout .pk-chip { white-space:normal; overflow-wrap:anywhere; }
  html.phone-layout .pk-stage .val, html.phone-layout .pk-mini .n, html.phone-layout .pk-kpi .big { min-width:0; max-width:100%; white-space:normal; overflow-wrap:anywhere; word-break:normal; }
  html.phone-layout .pk-table { table-layout:fixed; border-collapse:collapse; }
  html.phone-layout .pk-table tr { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:4px; width:100%; min-width:0; padding:6px 4px; }
  html.phone-layout .pk-table td { min-width:0; max-width:100%; padding:3px 1px; overflow-wrap:normal; word-break:normal; }
  html.phone-layout .pk-table td:first-child { grid-column:1/-1; min-height:44px; padding:5px; }
  html.phone-layout .pk-table td:nth-child(7) { display:none; }

  html.phone-layout .cb-table .cb-project-row { min-height:52px; height:52px; scroll-snap-type:x mandatory; scrollbar-width:none; }
  html.phone-layout .cb-table .cb-project-row::-webkit-scrollbar { display:none; }
  html.phone-layout .cb-table .cb-project-row td { min-height:52px; height:52px; flex-basis:82px; padding:4px; overflow-wrap:normal; scroll-snap-align:start; }
  html.phone-layout .cb-table .cb-project-row td.cb-proj { display:flex; flex-direction:column; justify-content:center; align-items:stretch; flex-basis:calc(100% - 94px); max-width:calc(100% - 94px); white-space:normal; font-size:12px; line-height:1.15; }
  html.phone-layout .cb-table .cb-project-row td:nth-child(2) { flex-basis:82px; left:calc(100% - 94px); min-height:52px; height:52px; }
  html.phone-layout .cb-table .cb-project-row .cb-chip { min-width:58px; padding:3px; font-size:14px; }
  html.phone-layout .cb-table .cb-project-row .cb-chase { display:inline; font-size:12px; }
  html.phone-layout .cb-table .cb-project-row .phone-compliance-state { display:block; color:#1e7a44; font-size:12px; font-weight:800; }
  html.phone-layout .cb-table .phone-mini-bar { display:block; width:70px; max-width:100%; height:4px; margin-top:3px; border-radius:4px; background:#e3e9f2; overflow:hidden; }
  html.phone-layout .cb-table .phone-mini-bar i { display:block; width:var(--phone-score,0%); height:100%; background:#618fb4; }
  html.phone-layout .cb-table tr.cb-total { display:block; width:100%; min-height:54px; height:auto; }
  html.phone-layout .cb-table tr.cb-total td { display:flex; flex-direction:column; align-items:flex-start; gap:2px; width:100%; min-height:54px; padding:7px 9px; }
  html.phone-layout .phone-total-title { color:#21486c; font-size:14px; font-weight:800; line-height:1.25; }
  html.phone-layout .phone-total-stats { color:#607386; font-size:12px; font-weight:500; line-height:1.25; }
  html.phone-layout .phone-total-history { color:#145a95; text-decoration:underline; }

  html.phone-layout .phone-day-strip { display:flex; flex-wrap:nowrap; gap:6px; max-width:100%; overflow-x:auto; overscroll-behavior-x:contain; padding:3px 0 8px; }
  html.phone-layout .phone-day-strip .cases-day { flex:0 0 64px; min-width:64px; min-height:56px; padding:7px 4px; }
  html.phone-layout .phone-day-strip .cases-day.today { border-color:#145a95; background:#eaf2f9; box-shadow:inset 0 0 0 1px #145a95; }
  html.phone-layout #page-deals .deals-team-cards, html.phone-layout #page-deals .deals-service-cards { display:flex!important; flex-direction:column; gap:4px; width:100%; padding:8px 10px; }
  html.phone-layout #page-deals .deals-team-card { display:grid; grid-template-columns:minmax(0,1fr) 48px; align-items:center; gap:5px 8px; width:100%; min-height:48px; padding:6px 8px; }
  html.phone-layout #page-deals .deals-team-name { min-width:0; font-size:12px; white-space:normal; }
  html.phone-layout #page-deals .deals-team-count { grid-column:2; grid-row:1; font-size:18px; text-align:right; }
  html.phone-layout #page-deals .deals-team-bar { grid-column:1/-1; width:100%; }
  html.phone-layout #page-deals .deals-creator-list { display:flex; flex-direction:column; gap:4px; }
  html.phone-layout #page-deals .deals-calendar-wrap { overflow-x:auto; }
  html.phone-layout #page-deals .deals-calendar { display:block; width:max-content; min-width:0; }
  html.phone-layout #page-deals .deals-calendar thead { display:none; }
  html.phone-layout #page-deals .deals-calendar tbody, html.phone-layout #page-deals .deals-calendar tr { display:flex; width:max-content; }
  html.phone-layout #page-deals .deals-calendar tr { align-items:stretch; gap:4px; margin:4px 0; }
  html.phone-layout #page-deals .deals-calendar td { display:block; flex:0 0 58px; width:58px; min-width:58px; padding:0; }
  html.phone-layout #page-deals .deals-calendar td:first-child { display:none; }
  html.phone-layout #page-deals .deals-calendar td:last-child { display:block; flex:0 0 66px; width:66px; min-width:66px; }
  html.phone-layout #page-deals .deals-week-total { display:flex; flex-direction:column; align-items:center; justify-content:center; min-height:56px; border:1px solid var(--deals-line,#dce5ec); border-radius:7px; background:var(--deals-panel2,#f5f8fb); font-size:14px; }
  html.phone-layout #page-deals .phone-deals-day-label, html.phone-layout #page-deals .phone-deals-week-label { display:block; font-size:12px; line-height:1.2; color:var(--deals-mut,#607386); }
  html.phone-layout #page-deals .deals-cal-cell { min-height:56px; height:auto; border:1px solid var(--deals-line,#dce5ec); }
  html.phone-layout #page-deals .deals-cal-num { font-size:14px; }
  html.phone-layout #page-deals .deals-cal-status { font-size:12px; }
  html.phone-layout #page-cases .cases-category-list { display:flex; flex-direction:column; gap:4px; }
  html.phone-layout #page-cases .cases-category { display:grid; grid-template-columns:minmax(0,1fr) 56px; min-height:48px; }
  html.phone-layout #page-variations .var-who { grid-template-columns:minmax(0,1fr) 64px 60px; min-height:44px; }
  html.phone-layout #page-variations .var-building-calendar { max-width:100%; overflow-x:auto!important; }
  html.phone-layout #page-variations .var-building-calendar table { width:max-content; min-width:0; }
  html.phone-layout #page-variations .var-building-calendar td { min-width:56px; }
  html.phone-layout #page-grid .tg-wrap { width:100%; max-width:100%; overflow:visible; }
  html.phone-layout #page-grid table.tg-table { display:block; width:100%!important; min-width:0!important; max-width:100%; overflow:visible; }
  html.phone-layout #page-grid .tg-table thead { display:none; }
  html.phone-layout #page-grid .tg-table tbody { display:block; width:100%; }
  html.phone-layout #page-grid .tg-table tbody tr:not(.tg-band):not(.tg-rehead) { display:flex; align-items:stretch; width:100%; min-width:0; height:52px; min-height:52px; overflow-x:auto; scroll-snap-type:x mandatory; scrollbar-width:none; border-bottom:1px solid #e3e9f2; }
  html.phone-layout #page-grid .tg-table tbody tr::-webkit-scrollbar { display:none; }
  html.phone-layout #page-grid .tg-table tbody tr:not(.tg-band):not(.tg-rehead) td { display:flex; flex:0 0 84px; align-items:center; justify-content:center; min-width:0; min-height:52px; height:52px; padding:4px; font-size:12px; scroll-snap-align:start; }
  html.phone-layout #page-grid .tg-table tbody tr:not(.tg-band):not(.tg-rehead) td.tg-proj { position:sticky; left:0; z-index:3; flex-basis:calc(100% - 94px); max-width:calc(100% - 94px); flex-direction:column; align-items:stretch; justify-content:center; background:#fff; color:#22303c; font-size:12px; line-height:1.15; white-space:normal; }
  html.phone-layout #page-grid .tg-table tbody tr:not(.tg-band):not(.tg-rehead) td:nth-child(2) { position:sticky; left:calc(100% - 94px); z-index:3; flex-basis:84px; flex-direction:column; background:#fff; }
  html.phone-layout #page-grid .tg-table tbody tr:not(.tg-band):not(.tg-rehead) td:nth-child(2)::after { content:'↔'; display:block; color:#607386; font-size:12px; line-height:1; }
  html.phone-layout #page-grid .tg-table .tg-c { min-width:58px; font-size:14px; }
  html.phone-layout #page-grid .tg-table .phone-score-state { display:block; color:#607386; font-size:12px; font-weight:800; }
  html.phone-layout #page-grid .tg-table .tg-proj .phone-mini-bar { display:block; width:64px; max-width:100%; height:4px; margin-top:3px; border-radius:4px; background:#e3e9f2; overflow:hidden; }
  html.phone-layout #page-grid .tg-table .tg-proj .phone-mini-bar i { display:block; height:100%; width:var(--phone-score,0%); background:#618fb4; }
  html.phone-layout #page-grid .tg-table tbody tr.tg-band { display:block; width:100%; height:auto; min-height:44px; }
  html.phone-layout #page-grid .tg-table tbody tr.tg-band td { display:block; width:100%; min-height:44px; padding:10px; font-size:12px; }
  html.phone-layout #page-grid .tg-table tbody tr.phone-tg-total { display:block; height:auto; min-height:54px; }
  html.phone-layout #page-grid .tg-table tbody tr.phone-tg-total td { display:flex; flex-direction:column; align-items:flex-start; justify-content:center; gap:2px; width:100%; height:auto; min-height:54px; padding:7px 9px; }
  html.phone-layout #page-grid .phone-tg-total-title { color:#21486c; font-size:14px; font-weight:800; line-height:1.25; }
  html.phone-layout #page-grid .phone-tg-total-stats { color:#607386; font-size:12px; font-weight:500; line-height:1.25; }
}

/* Follow the project-specific renderer styles so the phone crew cards keep five columns. */
@media (max-width:640px), (max-height:640px) {
  html.phone-layout .pk-table tr { grid-template-columns:repeat(5,minmax(0,1fr))!important; }
  html.phone-layout .pk-table td:nth-child(7) { display:none!important; }
}
@media (max-width:640px) {
  html.phone-layout .occ-wrap { width:100%; min-width:0; display:flex; flex-wrap:wrap; gap:10px; padding:10px; }
  html.phone-layout .occ-wrap .cv2-donut, html.phone-layout .occ-wrap .cw-donut,
  html.phone-layout .occ-wrap .tw-donut, html.phone-layout .occ-wrap .pk-donut { margin:0 auto; }
  html.phone-layout .occ-tiles { flex:1 1 100%; width:100%; min-width:0!important; grid-template-columns:repeat(2,minmax(0,1fr))!important; }
  html.phone-layout .occ-tile { min-width:0; }
  html.phone-layout .occ-tile .k { overflow-wrap:anywhere; }
  html.phone-layout .occ-not-fed { font-size:10px; }
  html.phone-layout .occ-wrap .cv2-donut .p, html.phone-layout .occ-wrap .cw-donut .p,
  html.phone-layout .occ-wrap .tw-donut .p, html.phone-layout .occ-wrap .pk-donut .p { font-size:14px!important; line-height:1!important; }
  html.phone-layout .occ-wrap .cv2-donut .l, html.phone-layout .occ-wrap .cw-donut .l,
  html.phone-layout .occ-wrap .tw-donut .l, html.phone-layout .occ-wrap .pk-donut .l { font-size:8px!important; line-height:1!important; white-space:nowrap; }
  html.phone-layout .occ-ring-note { display:block; font-size:8px!important; line-height:1!important; white-space:nowrap!important; }

  html.phone-layout .occ-caption { padding:8px 10px; }
  html.phone-layout .lt-columns, html.phone-layout .lt-row { grid-template-columns:40px minmax(0,1fr) 40px 42px!important; column-gap:3px; }
  html.phone-layout .lt-columns { font-size:9px!important; letter-spacing:0; }
  html.phone-layout .lt-columns span, html.phone-layout .lt-pos { white-space:nowrap; }
  html.phone-layout .lt-name { font-size:12px!important; }
  html.phone-layout .lt-day { font-size:10px!important; }
  html.phone-layout .lt-mtd { font-size:15px!important; }
  html.phone-layout .lt-projection { font-size:9px!important; padding-left:46px; }
  html.phone-layout .lt-info { font-size:10px!important; }

}

@media (max-width:640px) {
  html.phone-layout #page-project-detail .pk-wrap { width:calc(100vw - 32px)!important; max-width:calc(100vw - 32px)!important; margin-left:0!important; margin-right:12px!important; }
  html.phone-layout #page-project-detail .pk-cols { width:100%!important; max-width:100%!important; grid-template-columns:minmax(0,1fr)!important; }
  html.phone-layout #page-project-detail .pk-cols > div { width:100%; min-width:0!important; max-width:100%!important; }
  html.phone-layout #page-project-detail .pk-cols .pk-sect,
  html.phone-layout #page-project-detail .pk-cols .pk-panel,
  html.phone-layout #page-project-detail .pk-cols .pk-band { width:100%; min-width:0!important; max-width:100%!important; }
  html.phone-layout #page-project-detail .pk-cols .pk-table { width:100%!important; max-width:100%!important; table-layout:fixed; }
  html.phone-layout #page-project-detail .pk-og { width:100%; max-width:100%; min-width:0; grid-template-columns:repeat(2,minmax(0,1fr)); }
  html.phone-layout #page-project-detail .pk-oc { min-width:0; max-width:100%; }
  html.phone-layout #page-project-detail .pk-oc .n, html.phone-layout #page-project-detail .pk-oc .k { min-width:0; max-width:100%; overflow-wrap:anywhere; }
}

@media (max-width:640px), (max-height:640px) {
  html.phone-layout { --phone-top:56px; --phone-bottom:64px; overflow-x:hidden; }
  html.phone-layout body { overflow-x:hidden; }
  html.phone-layout *, html.phone-layout *::before, html.phone-layout *::after { box-sizing:border-box; }
  html.phone-layout a, html.phone-layout button, html.phone-layout [role="button"],
  html.phone-layout [onclick], html.phone-layout input, html.phone-layout select,
  html.phone-layout textarea, html.phone-layout [tabindex]:not([tabindex="-1"]) {
    min-width:36px; min-height:36px;
  }
  html.phone-layout .topbar { display:flex!important; height:calc(var(--phone-top) + env(safe-area-inset-top)); padding:env(safe-area-inset-top) 10px 0; gap:8px; overflow:visible; background:var(--phone-panel,#fff); color:var(--phone-ink,#14263d); border-bottom:1px solid var(--phone-line,#dce5ec); box-shadow:0 2px 12px rgba(0,0,0,.12); }
  html.phone-layout .topbar.rc-topbar-hidden { display:flex!important; }
  html.phone-layout .hamburger { display:grid!important; place-items:center; width:44px; height:44px; min-width:44px; margin:0; color:inherit; border:1px solid var(--phone-line,#dce5ec); border-radius:11px; background:var(--phone-card,#f5f8fb); font-size:23px; }
  html.phone-layout .topbar-brand, html.phone-layout .topbar-subtitle, html.phone-layout .topbar-separator, html.phone-layout .topbar-week, html.phone-layout .topbar-user { display:none!important; }
  html.phone-layout .phone-top-title { display:flex; flex:1; min-width:0; align-items:center; gap:7px; line-height:1.1; }
  html.phone-layout .phone-mark { display:grid; place-items:center; flex:0 0 32px; width:32px; height:32px; border-radius:8px; background:linear-gradient(135deg,#21486c,#145a95); color:#fff; font:800 10px Montserrat,sans-serif; }
  html.phone-layout .phone-title-copy { display:block; min-width:0; }
  html.phone-layout .phone-title-copy small { display:block; color:var(--phone-muted,#66809a); font-size:10px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; }
  html.phone-layout .phone-title-copy strong { display:block; color:var(--phone-ink,#14263d); font:800 14px/1.2 Montserrat,sans-serif; white-space:normal; overflow-wrap:anywhere; }
  html.phone-layout .phone-week { flex:0 0 auto; padding:6px 8px; border:1px solid var(--phone-line,#dce5ec); border-radius:999px; color:var(--phone-ink,#14263d); background:var(--phone-card,#f5f8fb); font:800 12px Montserrat,sans-serif; }
  html.phone-layout .phone-avatar { display:grid; place-items:center; flex:0 0 34px; width:34px; height:34px; border-radius:50%; background:#3b82f6; color:white; font:800 12px Montserrat,sans-serif; }
  html.phone-layout .bottom-nav { display:block!important; position:fixed; left:0; right:0; bottom:0; z-index:1100; height:calc(var(--phone-bottom) + env(safe-area-inset-bottom)); padding:0 4px env(safe-area-inset-bottom); overflow:hidden; background:var(--phone-panel,#fff); border-top:1px solid var(--phone-line,#dce5ec); box-shadow:0 -4px 18px rgba(0,0,0,.12); }
  html.phone-layout .bottom-nav-inner { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); width:100%; height:var(--phone-bottom); min-width:0; }
  html.phone-layout .bottom-nav-item { min-width:0; min-height:44px; padding:5px 1px; gap:2px; color:var(--phone-muted,#66809a); font:700 10px/1.2 Montserrat,sans-serif; letter-spacing:0; text-align:center; border-radius:10px; }
  html.phone-layout .bottom-nav-item .bn-icon { margin:0; font-size:20px; line-height:1; }
  html.phone-layout button.bottom-nav-item { border:0; background:transparent; cursor:pointer; }
  html.phone-layout .bottom-nav-item.active { color:var(--phone-gold,#c98f00); background:color-mix(in srgb,var(--phone-gold,#c98f00) 10%,transparent); }
  html.phone-layout .main-content, html.phone-layout .main-content.rc-fullwidth, html.phone-layout .main-content.sidebar-collapsed { display:flex; flex-direction:column; width:100%; min-width:0; margin:calc(var(--phone-top) + env(safe-area-inset-top)) 0 0!important; padding:10px 10px calc(var(--phone-bottom) + env(safe-area-inset-bottom) + 20px)!important; overflow:visible; }
  html.phone-layout .main-content > .page { order:1; min-width:0; max-width:100%; }
  html.phone-layout .main-content > .main-footer { order:2; position:relative; width:100%; padding:16px 8px; font-size:12px; line-height:1.4; letter-spacing:.08em; }
  html.phone-layout .main-content > :not(.page):not(.main-footer) { order:0; }
  html.phone-layout .page.active { animation:phone-enter .22s ease both; }
  html.phone-layout .page, html.phone-layout .card, html.phone-layout .cb-board { max-width:100%; min-width:0; }
  html.phone-layout .sidebar { display:none!important; }
  html.phone-layout .sidebar-backdrop { display:none!important; }
  html.phone-layout .phone-overlay { position:fixed; inset:0; z-index:1300; background:rgba(2,8,20,.58); display:none; }
  html.phone-layout .phone-overlay.open { display:block; }
  html.phone-layout .phone-panel { position:fixed; inset:0; z-index:1301; display:none; flex-direction:column; background:var(--phone-panel,#fff); color:var(--phone-ink,#14263d); padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom); overflow-y:auto; }
  html.phone-layout .phone-panel.open { display:flex; animation:phone-enter .2s ease both; }
  html.phone-layout .phone-panel[data-kind=drawer] { right:auto; width:min(360px,90vw); box-shadow:16px 0 40px rgba(0,0,0,.22); }
  html.phone-layout .phone-panel-head { position:sticky; top:0; z-index:1; display:flex; align-items:center; gap:12px; min-height:56px; padding:6px 14px; background:var(--phone-panel,#fff); border-bottom:1px solid var(--phone-line,#dce5ec); }
  html.phone-layout .phone-panel-head b { flex:1; font:800 18px Montserrat,sans-serif; }
  html.phone-layout .phone-close { display:grid; place-items:center; width:44px; height:44px; border:1px solid var(--phone-line,#dce5ec); border-radius:12px; background:var(--phone-card,#f5f8fb); color:inherit; font-size:24px; }
  html.phone-layout .phone-panel-body { padding:8px 14px 28px; }
  html.phone-layout .phone-menu-group { margin:16px 0; }
  html.phone-layout .phone-menu-group h3 { margin:0 0 7px; color:var(--phone-muted,#66809a); font:800 12px Montserrat,sans-serif; letter-spacing:.09em; text-transform:uppercase; }
  html.phone-layout .phone-menu-group a, html.phone-layout .phone-menu-group button { display:flex; align-items:center; gap:12px; width:100%; min-height:46px; padding:8px 11px; border:0; border-bottom:1px solid var(--phone-line,#dce5ec); background:transparent; color:inherit; text-align:left; text-decoration:none; font:700 14px/1.3 'Segoe UI',sans-serif; }
  html.phone-layout .phone-menu-group .phone-menu-icon { width:24px; text-align:center; font-size:18px; }
  html.phone-layout .phone-menu-foot { padding:14px 2px; color:var(--phone-muted,#66809a); font-size:12px; line-height:1.5; }
  html.phone-layout .live-sync-status, html.phone-layout .toast, html.phone-layout [role=alert].toast { position:fixed!important; left:5%!important; right:5%!important; top:auto!important; bottom:calc(var(--phone-bottom) + env(safe-area-inset-bottom) + 8px)!important; width:90%!important; max-width:none!important; z-index:1200; }
  html.phone-layout .phone-telemetry-toast { position:fixed; left:5%; bottom:calc(var(--phone-bottom) + env(safe-area-inset-bottom) + 8px); z-index:1200; display:flex; align-items:center; justify-content:center; gap:8px; width:90%; min-height:44px; padding:9px 12px; border:1px solid #d8b45a; border-radius:12px; background:#0f1d33; color:#f5b301; font:800 12px Montserrat,sans-serif; box-shadow:0 12px 28px rgba(0,0,0,.25); animation:phone-enter .22s ease both; }
  html.phone-layout table { max-width:100%; }
  html.phone-layout .table-responsive, html.phone-layout .cb-table-wrap, html.phone-layout .deals-table-wrap, html.phone-layout .market-share-scroll { max-width:100%; overflow-x:auto; overscroll-behavior-x:contain; }
  html.phone-layout .table-responsive::after, html.phone-layout .deals-table-wrap::after, html.phone-layout .market-share-scroll::after { content:'Swipe for more ↔'; display:block; position:sticky; left:0; width:max-content; padding:3px 7px; font-size:12px; color:var(--phone-muted,#66809a); }

  /* Project header and eight full-label tabs */
  html.phone-layout .building-view-header { position:sticky; top:calc(var(--phone-top) + env(safe-area-inset-top)); z-index:900; display:flex; flex-direction:column; gap:0; height:auto; min-height:0; margin:0 -10px 8px; padding:7px 10px 0; background:#0f1d33; border-bottom:1px solid #223a60; color:#eaf0fb; overflow:visible; }
  html.phone-layout .building-view-meta { display:none; }
  html.phone-layout .phone-project-head { display:flex; flex-wrap:wrap; align-items:center; gap:5px 8px; width:100%; min-height:48px; padding-bottom:6px; }
  html.phone-layout .phone-project-head img { width:44px; height:30px; object-fit:contain; flex:none; }
  html.phone-layout .phone-project-head .name { min-width:0; flex:1; }
  html.phone-layout .phone-project-head strong { display:block; font:800 15px/1.12 Montserrat,sans-serif; white-space:normal; }
  html.phone-layout .phone-project-head small { display:block; margin-top:2px; color:#9fb5d3; font-size:12px; line-height:1.2; }
  html.phone-layout .phone-project-head .speed { flex:0 0 auto; max-width:47%; color:#f5b301; text-align:right; }
  html.phone-layout .phone-project-head .speed b { display:block; font:800 13px/1.15 Montserrat,sans-serif; white-space:nowrap; }
  html.phone-layout .phone-project-head .speed small { color:#9fb5d3; font:800 12px/1.1 Montserrat,sans-serif; }
  html.phone-layout .phone-project-meta { display:flex; flex-basis:100%; flex-wrap:wrap; gap:4px; }
  html.phone-layout .phone-project-meta span { display:block; padding:3px 6px; border:1px solid #294364; border-radius:7px; color:#9fb5d3; font:700 12px/1.1 Montserrat,sans-serif; }
  html.phone-layout .building-view-tabs { display:flex; width:calc(100% + 20px); height:auto; min-height:48px; min-width:0; margin:0 -10px; padding:3px 10px 6px; gap:5px; overflow-x:auto; overflow-y:hidden; scroll-snap-type:x mandatory; scrollbar-width:none; border:0; border-radius:0; background:#0f1d33; mask-image:linear-gradient(90deg,#000 88%,transparent); }
  html.phone-layout .building-view-tabs::-webkit-scrollbar { display:none; }
  html.phone-layout .building-view-tabs button { flex:0 0 auto; min-width:max-content; min-height:44px; padding:8px 12px; border:1px solid #223a60; border-radius:10px; background:#132540; color:#afc1da; font:700 12px/1.1 Montserrat,sans-serif; scroll-snap-align:center; }
  html.phone-layout .building-view-tabs button.on { background:#f5b301; border-color:#f5b301; color:#1a1200; }
  html.phone-layout .project-detail-fit-body { transform:none!important; width:100%!important; height:auto!important; }
  html.phone-layout .cv2-wrap, html.phone-layout .cw-wrap, html.phone-layout .pg-wrap, html.phone-layout .pk-wrap { width:100%; min-width:0; margin:0; padding:10px; border-radius:14px; }
  html.phone-layout .cv2-head, html.phone-layout .cw-head, html.phone-layout .pk-hd { margin:0 0 8px; }
  html.phone-layout .cv2-head .cv2-car, html.phone-layout .cv2-head .cv2-htxt { display:none; }
  html.phone-layout .cv2-hspring { margin:0; width:100%; }
  html.phone-layout .cw-date, html.phone-layout .pk-datebar { width:100%; min-height:44px; display:flex; align-items:stretch; border-radius:11px; overflow:hidden; }
  html.phone-layout .cw-date button, html.phone-layout .pk-datebar button { min-height:44px; min-width:72px; flex:1; font-size:12px; }
  html.phone-layout .cw-date input, html.phone-layout .pk-datebar input { width:0; min-width:0; max-width:100%; min-height:44px; box-sizing:border-box; flex:1.35 1 0%; font-size:12px; }
  html.phone-layout .cv2-hchips { display:flex; flex-wrap:wrap; width:100%; gap:5px; margin-top:5px; }
  html.phone-layout .cv2-hchips .cv2-chip { font-size:12px; line-height:1.2; }
  html.phone-layout .cv2-main { display:flex; flex-direction:column; gap:10px; }
  html.phone-layout .cv2-col { width:100%; min-width:0; gap:10px; }
  html.phone-layout .lt-info summary { min-height:44px; }
  html.phone-layout .cv2-centre { order:1; }
  html.phone-layout .cv2-left { order:2; }
  html.phone-layout .cv2-right { order:3; display:flex; flex-direction:column; }
  html.phone-layout .cv2-insights-panel { order:4; }
  html.phone-layout .cv2-gaugebox { padding:2px 8px 6px; }
  html.phone-layout .cv2-centre .cv2-h { display:none; }
  html.phone-layout .cv2-lites { display:none; }
  html.phone-layout .cv2-gauge { height:126px; max-height:126px; }
  html.phone-layout .cv2-scale { font-size:12px; letter-spacing:0; }
  html.phone-layout .cv2-pillars { display:grid; grid-template-columns:repeat(2,minmax(0,1fr))!important; gap:7px; padding:5px 7px 8px; }
  html.phone-layout .cv2-pillar { min-height:164px; height:auto; padding:7px; text-align:left; }
  html.phone-layout .cv2-pname { font-size:12px; white-space:normal; letter-spacing:.03em; }
  html.phone-layout .cv2-pplain { max-height:none; overflow:visible; font-size:12px; line-height:1.2; }
  html.phone-layout .cv2-pvalue { font-size:25px; }
  html.phone-layout .cv2-pcov, html.phone-layout .cv2-pmeta, html.phone-layout .cv2-preason { font-size:12px; }
  html.phone-layout .cv2-ptrack { margin:4px 0; }
  html.phone-layout .cv2-resident-line { flex-wrap:wrap; white-space:normal; font-size:12px; }
  html.phone-layout .cv2-resident-line span, html.phone-layout .cv2-resident-line b { overflow:visible; font-size:12px; }
  html.phone-layout .cv2-kpi-status, html.phone-layout .cv2-kpi-more { font-size:12px; }
  html.phone-layout .phone-counts { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:5px; margin:5px 7px 7px; }
  html.phone-layout .phone-count { min-width:0; border:1px solid rgba(120,165,220,.18); border-radius:10px; background:#132540; padding:6px 3px; text-align:center; }
  html.phone-layout .phone-count b { display:block; color:#f5b301; font:800 16px Montserrat,sans-serif; white-space:nowrap; }
  html.phone-layout .phone-count small { display:block; color:#a7bcda; font-size:12px; }
  html.phone-layout .cv2-left > .cw-panel:first-child { flex:auto; }
  html.phone-layout .cw-crag, html.phone-layout .cw-crag.cw-crag-classic { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:5px; padding:6px; }
  html.phone-layout .cw-crow { display:flex; align-items:flex-start; gap:5px; min-width:0; padding:5px; border:1px solid rgba(120,165,220,.13); border-radius:8px; font-size:12px; }
  html.phone-layout .cw-crow .lb { min-width:0; flex:1; font-size:12px; overflow-wrap:anywhere; }
  html.phone-layout .cw-crow .lb { white-space:normal!important; overflow:visible!important; text-overflow:clip!important; }
  html.phone-layout .cw-crow .t { display:block; flex:0 0 auto; max-width:48%; white-space:normal; text-align:right; font-size:12px; }
  html.phone-layout .cw-crow .t span { display:block; white-space:normal; font-size:12px; }
  html.phone-layout .cw-crow .b { font-size:12px; }
  html.phone-layout .cw-leg, html.phone-layout .cw-subnote, html.phone-layout .cv2-gridmeta, html.phone-layout .cv2-gridfoot { font-size:12px; }
  html.phone-layout .cv2-grid .cw-grow { grid-template-columns:30px minmax(0,1fr) 42px 42px; }
  html.phone-layout .cv2-proj, html.phone-layout .cv2-pace { font-size:12px; white-space:normal; }
  html.phone-layout .cv2-insights { height:auto; max-height:none; overflow:visible; display:block; padding:9px; }
  html.phone-layout .cv2-insight { overflow:visible; margin-bottom:8px; }
  html.phone-layout .cv2-insight .k, html.phone-layout .cv2-insight .s { font-size:12px; line-height:1.45; }
  html.phone-layout .cv2-panel, html.phone-layout .cw-panel { border-radius:13px; }
  html.phone-layout .cv2-h, html.phone-layout .cw-h { font-size:12px; }
  html.phone-layout .cv2-og .cv2-oc .k, html.phone-layout .cv2-note, html.phone-layout .cw-note { font-size:12px; }
  html.phone-layout .tw-ovl { padding:0; }
  html.phone-layout .tw-ovlbox { width:100vw; height:100dvh; max-height:none; border-radius:0; overflow:auto; padding-bottom:env(safe-area-inset-bottom); }
  html.phone-layout .tw-ovlhd { top:0; padding-top:calc(10px + env(safe-area-inset-top)); }
  html.phone-layout .tw-x { display:grid; place-items:center; min-width:44px; min-height:44px; font-size:24px; }
  html.phone-layout .tw-krow, html.phone-layout .tw-kdesc, html.phone-layout .tw-kcount, html.phone-layout .tw-ka, html.phone-layout .tw-ksource { font-size:12px; }

  /* GRID: values are copied from the rendered table into one department card per column. */
  html.phone-layout .pg-head { display:flex; flex-wrap:wrap; align-items:flex-start; gap:7px; }
  html.phone-layout .pg-title b { font-size:19px; white-space:normal; }
  html.phone-layout .pg-index { font-size:12px; }
  html.phone-layout .pg-head .cw-date { order:3; margin:0; }
  html.phone-layout .pg-head .cw-date button { color:#b4c8df!important; }
  html.phone-layout .pg-head .cw-date button.on { color:#1a1200!important; background:#f5b301!important; }
  html.phone-layout .pg-hidden-note { display:flex; flex-wrap:wrap; font-size:12px; }
  html.phone-layout .pg-hidden-note button { min-width:70px; min-height:44px; margin-left:auto; }
  html.phone-layout .pg-scroll { display:none; }
  html.phone-layout .phone-grid-cards { display:flex; flex-direction:column; gap:9px; }
  html.phone-layout .phone-grid-project-summary,html.phone-layout .phone-grid-card { padding:12px; border:1px solid rgba(120,165,220,.22); border-radius:13px; background:#122540; color:#eef4fc; }
  html.phone-layout .phone-grid-card h3 { display:flex; justify-content:space-between; align-items:baseline; gap:8px; margin:0 0 8px; font:800 15px Montserrat,sans-serif; }
  html.phone-layout .phone-grid-card h3 span { color:#46e084; white-space:nowrap; font-size:19px; }
  html.phone-layout .phone-grid-card h3 span:first-child { color:#eef4fc; white-space:normal; font-size:15px; }
  html.phone-layout .building-view-tools { min-width:0; flex-wrap:wrap; }
  html.phone-layout .building-view-tools > * { min-width:0; max-width:100%; }
  html.phone-layout .building-view-tools [data-race-engineer-start] { flex:0 1 auto; max-width:100%; }
  html.phone-layout .phone-grid-row { display:flex; justify-content:space-between; gap:9px; padding:6px 0; border-top:1px solid rgba(120,165,220,.13); font-size:12px; }
  html.phone-layout .phone-grid-row strong { text-align:right; }
  html.phone-layout .phone-grid-row strong b { display:block; font-size:13px; }
  html.phone-layout .phone-grid-row strong small { display:block; max-width:132px; color:#a7bcda; font-size:12px; font-weight:500; line-height:1.2; }
  html.phone-layout .phone-grid-row .pg-value { font-size:14px; }
  html.phone-layout .pg-foot { font-size:12px; }

  /* Paddock: stage cards, a two-line team row, and full-width supporting cards. */
  html.phone-layout .pk-hd { gap:8px; }
  html.phone-layout .pk-car { width:70px; }
  html.phone-layout .pk-mark { font-size:18px; }
  html.phone-layout .pk-sub, html.phone-layout .pk-band, html.phone-layout .pk-chip { font-size:12px; }
  html.phone-layout .pk-spring { width:100%; margin:0; align-items:stretch; }
  html.phone-layout .pk-datebar { width:100%; }
  html.phone-layout .pk-chips { justify-content:flex-start; }
  html.phone-layout .pk-funnel, html.phone-layout .pk-cols { display:grid; grid-template-columns:1fr; min-width:0; }
  html.phone-layout .pk-stage { min-width:0; padding:12px; }
  html.phone-layout .pk-stage .val { font-size:25px; overflow-wrap:anywhere; }
  html.phone-layout .pk-stage .lbl, html.phone-layout .pk-stage .gate, html.phone-layout .pk-stage .note, html.phone-layout .pk-drow .dab, html.phone-layout .pk-drow .dval { font-size:12px; }
  html.phone-layout .pk-arrow { display:none; }
  html.phone-layout .pk-panel, html.phone-layout .pk-sect { min-width:0; }
  html.phone-layout .pk-table, html.phone-layout .pk-table tbody { display:block; width:100%; }
  html.phone-layout .pk-table thead { display:none; }
  html.phone-layout .pk-table tr { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:3px; padding:8px; border-bottom:1px solid rgba(120,165,220,.18); }
  html.phone-layout .pk-table td { display:block; padding:3px; text-align:center; min-width:0; font-size:12px; overflow-wrap:anywhere; border:0; }
  html.phone-layout .pk-table td:first-child { grid-column:1/-1; text-align:left; font-size:14px; }
  html.phone-layout .pk-table td:not(:first-child)::before { content:attr(data-phone-label); display:block; color:#a7bcda; font-size:12px; }
  html.phone-layout .pk-kv, html.phone-layout .pk-mini .cap, html.phone-layout .pk-foot, html.phone-layout .pk-foot2 { font-size:12px; }

  /* Cases, Deals and Variations share the approved two-up stat treatment. */
  html.phone-layout .cases-heroes, html.phone-layout .cases-manage-tiles, html.phone-layout .cases-standards,
  html.phone-layout .deals-heroes, html.phone-layout .deals-building-tiles, html.phone-layout .deals-team-cards,
  html.phone-layout .var-heroes, html.phone-layout .var-insight-tiles { display:grid!important; grid-template-columns:repeat(2,minmax(0,1fr))!important; gap:8px!important; }
  html.phone-layout .cases-hero, html.phone-layout .deals-hero, html.phone-layout .var-hero { min-width:0!important; width:auto!important; padding:10px!important; overflow:visible!important; }
  html.phone-layout .cases-v, html.phone-layout .deals-hero-v, html.phone-layout .var-v { font-size:28px!important; white-space:normal!important; overflow:visible!important; overflow-wrap:anywhere; line-height:1.1; }
  html.phone-layout .cases-k, html.phone-layout .deals-hero-k, html.phone-layout .var-k { font-size:12px!important; line-height:1.25; }
  html.phone-layout .cases-d, html.phone-layout .deals-hero-d, html.phone-layout .var-d { font-size:12px!important; line-height:1.35; }
  html.phone-layout .cases-rail, html.phone-layout .deals-rail, html.phone-layout .var-filters { display:flex; flex-wrap:nowrap; overflow-x:auto; scroll-snap-type:x mandatory; max-width:100%; gap:6px; }
  html.phone-layout .cases-filter, html.phone-layout .deals-filter, html.phone-layout .var-chip { flex:0 0 auto; min-height:34px; font-size:12px; scroll-snap-align:start; }
  html.phone-layout .cases-calendar, html.phone-layout .deals-calendar-wrap, html.phone-layout .var-building-calendar { max-width:100%; overflow-x:auto; }
  html.phone-layout .cases-cal, html.phone-layout .deals-calendar { min-width:0!important; width:100%; }
  html.phone-layout .cases-cal td, html.phone-layout .deals-calendar td { padding:2px!important; }
  html.phone-layout .cases-day, html.phone-layout .deals-cal-cell { min-width:40px; min-height:44px; font-size:12px; }
  html.phone-layout .var-circuit-scroll { overflow:visible; }
  html.phone-layout .var-circuit-track { display:flex; flex-direction:column; width:100%; min-width:0; }
  html.phone-layout .var-circuit-node { width:100%; min-width:0; }
  html.phone-layout .deals-main, html.phone-layout .cases-main, html.phone-layout .var-lower { display:grid; grid-template-columns:1fr; min-width:0; }
  html.phone-layout .deals-panel, html.phone-layout .cases-panel, html.phone-layout .var-panel { min-width:0; max-width:100%; }
  /* Keep the populated building pages in the approved order: filters, summary
     tiles, then the supporting calendar and detail panels. */
  html.phone-layout #page-cases.cases-building .cases-wrap { display:flex; flex-direction:column; }
  html.phone-layout #page-cases.cases-building .cases-heroes { order:2; }
  html.phone-layout #page-cases.cases-building .cases-building-summary { order:3; }
  html.phone-layout #page-cases.cases-building .cases-main { order:4; }
  html.phone-layout #page-cases.cases-building .cases-building-calendar { order:5; }
  html.phone-layout #page-variations.var-building .var-wrap { display:flex; flex-direction:column; }
  html.phone-layout #page-variations.var-building .var-insights { order:3; }
  html.phone-layout #page-variations.var-building .var-heroes { order:4; }
  html.phone-layout #page-variations.var-building .var-circuit { order:5; }
  html.phone-layout #page-variations.var-building .var-gates { order:6; }
  html.phone-layout #page-variations.var-building .var-note:not(.var-vat-note) { order:7; }
  html.phone-layout #page-variations.var-building .var-lower { order:8; }
  html.phone-layout #page-deals.deals-building .deals-building-window.phone-window-top { display:flex; flex-wrap:nowrap; overflow-x:auto; max-width:100%; gap:6px; padding:10px 12px; margin:0 0 10px; border:1px solid var(--deals-line,#dce5ec); border-radius:10px; background:var(--deals-panel,#fff); }
  html.phone-layout .deals-team-name { white-space:normal; overflow:visible; font-size:12px; }
  html.phone-layout .deals-team-count { font-size:23px; }
  html.phone-layout .market-share-table th:first-child, html.phone-layout .market-share-table td:first-child { position:sticky; left:0; z-index:2; background:var(--deals-panel,#fff); }
  html.phone-layout .market-share-table th:nth-child(2), html.phone-layout .market-share-table td:nth-child(2) { position:sticky; left:120px; z-index:2; background:var(--deals-panel,#fff); }

  /* Compliance: every project name and headline score are visible at rest. */
  html.phone-layout .cb-board { padding:10px; }
  html.phone-layout .cb-header h1 { font-size:21px; }
  html.phone-layout .cb-header p, html.phone-layout .cb-fresh, html.phone-layout .cb-ch span { font-size:12px; }
  html.phone-layout .cb-date { display:flex; width:100%; }
  html.phone-layout .cb-date button, html.phone-layout .cb-date input { min-height:44px; font-size:12px; }
  html.phone-layout .cb-tiles { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; }
  html.phone-layout .cb-tile { min-width:0; padding:10px; }
  html.phone-layout .cb-l, html.phone-layout .cb-s { font-size:12px; }
  html.phone-layout .cb-v { font-size:25px; overflow-wrap:anywhere; }
  html.phone-layout .cb-table-wrap { overflow:visible; }
  html.phone-layout .cb-board table.cb-table { display:block; width:100%; max-width:100%; min-width:0; overflow:visible; }
  html.phone-layout .cb-table thead { display:none; }
  html.phone-layout .cb-table tbody { display:block; width:100%; }
  html.phone-layout .cb-table tr.cb-project-row { display:flex; align-items:stretch; width:100%; min-width:0; overflow-x:auto; scroll-snap-type:x mandatory; border-bottom:1px solid #e3e9f2; }
  html.phone-layout .cb-table .cb-project-row td { display:flex; align-items:center; flex:0 0 90px; min-height:54px; min-width:0; padding:6px; border:0; font-size:12px; overflow-wrap:anywhere; scroll-snap-align:start; }
  html.phone-layout .cb-table .cb-project-row td:first-child { position:sticky; left:0; z-index:3; flex-basis:calc(100% - 102px); max-width:calc(100% - 102px); background:#fff; color:#22303c; padding-left:8px; white-space:normal; }
  html.phone-layout .cb-table .cb-project-row td:nth-child(2) { position:sticky; left:calc(100% - 102px); z-index:3; flex-basis:90px; background:#fff; justify-content:center; flex-direction:column; }
  html.phone-layout .cb-table .cb-project-row td:nth-child(2)::after { content:'↔'; display:block; font-size:12px; color:#6f8299; }
  html.phone-layout .cb-table .cb-project-row .cb-chip { font-size:14px; min-width:58px; }
  html.phone-layout .cb-table .cb-project-row .cb-chase { font-size:12px; }
  html.phone-layout .cb-table .cb-band, html.phone-layout .cb-table .cb-total, html.phone-layout .cb-table .cb-rehead { display:block; width:100%; }
  html.phone-layout .cb-table .cb-band td, html.phone-layout .cb-table .cb-total td, html.phone-layout .cb-table .cb-rehead td { display:block; width:100%; font-size:12px; }
  html.phone-layout .cb-table .cb-rehead { display:none; }
  html.phone-layout .cb-detail { width:100vw; max-width:none; height:100dvh; max-height:none; margin:0; border-radius:0; padding-bottom:env(safe-area-inset-bottom); }
  html.phone-layout .cb-detail-head { position:sticky; top:0; z-index:2; padding-top:calc(12px + env(safe-area-inset-top)); background:#fff; }
  html.phone-layout .cb-detail-head button { min-width:44px; min-height:44px; font-size:24px; }

  /* Race Control wallboard retains its figures and uses the approved order. */
  html.phone-layout #page-racecontrol { padding:0; }
  html.phone-layout .rc-wrap { width:100%; height:auto!important; min-height:0; overflow:visible; transform:none!important; zoom:1!important; }
  html.phone-layout .rc-header { min-height:66px; height:auto; padding:8px; flex-wrap:wrap; }
  html.phone-layout .rc-title { font-size:17px; }
  html.phone-layout .rc-session { flex-wrap:wrap; gap:5px; }
  html.phone-layout .rc-session span, html.phone-layout .rc-clock { font-size:12px; }
  html.phone-layout .rc-body { display:flex; flex-direction:column; height:auto; overflow:visible; }
  html.phone-layout .rc-center { order:1; width:100%; min-width:0; height:auto; overflow:visible; }
  html.phone-layout .rc-tower { order:2; width:100%; height:auto; min-height:0; overflow:visible; }
  html.phone-layout .rc-telemetry { order:3; width:100%; height:auto; overflow:visible; zoom:1!important; }
  html.phone-layout .rc-track-area { display:flex; flex-direction:column; height:auto; min-height:0; padding:7px; }
  html.phone-layout .rc-track-name { position:relative; top:auto; left:auto; transform:none; max-width:100%; margin:0 auto 7px; }
  html.phone-layout .rc-center-stats { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); width:100%; gap:6px; order:0; }
  html.phone-layout .rc-stat-box { min-height:62px; padding:8px; }
  html.phone-layout .rc-stat-val { font-size:22px; }
  html.phone-layout .rc-stat-label { font-size:12px; }
  html.phone-layout .rc-track-svg { width:100%; max-width:100%; height:auto; max-height:230px; object-fit:contain; order:1; }
  html.phone-layout .rc-fastest-badge { position:absolute; left:50%; bottom:8px; transform:translateX(-50%); z-index:2; max-width:90%; white-space:normal; font-size:12px; }
  html.phone-layout .rc-pitwall { width:100%; min-width:0; }
  html.phone-layout .rc-series-strip { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:5px; }
  html.phone-layout .rc-series-strip > * { min-width:0; font-size:12px; overflow-wrap:anywhere; }
  html.phone-layout .rc-sc-name, html.phone-layout .rc-sc-meta, html.phone-layout .rc-sc-val { font-size:12px; line-height:1.2; white-space:normal; overflow:visible; }
  html.phone-layout .rc-intel-strip { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:5px; }
  html.phone-layout .rc-intel-strip > :last-child { grid-column:1/-1; }
  html.phone-layout .rc-ib { min-width:0; padding:8px; }
  html.phone-layout .rc-ib-label, html.phone-layout .rc-ib-val { font-size:12px; overflow-wrap:anywhere; }
  html.phone-layout .rc-tower-header, html.phone-layout .rc-legend { font-size:12px; }
  html.phone-layout .rc-tower, html.phone-layout .rc-tower-list { max-height:none; height:auto; overflow:visible; }
  html.phone-layout .rc-driver { display:grid; grid-template-columns:22px 25px 27px minmax(0,1fr) 54px 38px; column-gap:3px; min-height:44px; height:auto; max-height:none; padding:5px; overflow:visible; }
  html.phone-layout .rc-name { white-space:normal!important; overflow:visible!important; text-overflow:clip!important; font-size:12px; line-height:1.2; }
  html.phone-layout .rc-pos, html.phone-layout .rc-car-num, html.phone-layout .rc-score, html.phone-layout .rc-delta { font-size:12px; }
  html.phone-layout .rc-badges-cell { display:flex; flex-direction:column; gap:2px; }
  html.phone-layout #page-racecontrol .rc-badge,
  html.phone-layout #page-showcase .rc-badge { font-size:12px!important; animation:none!important; transform:none!important; }
  html.phone-layout .rc-sector { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); }
  html.phone-layout .rc-ticker { height:42px; overflow:hidden; }
  html.phone-layout .rc-ticker-item { font-size:12px; }
  html.phone-layout .rc-telem-title, html.phone-layout .rc-gauge-name, html.phone-layout .rc-gauge-target, html.phone-layout .rc-sector-label { font-size:12px; }

  /* Race, Pit Wall, Departments, Safety Car and other portfolio surfaces. */
  html.phone-layout #race-calendar-chips { display:flex!important; flex-wrap:nowrap!important; overflow-x:auto; scroll-snap-type:x mandatory; gap:5px; }
  html.phone-layout #race-calendar-chips button { flex:0 0 auto; min-height:44px; min-width:max-content; scroll-snap-align:center; }
  html.phone-layout .series-race-block { width:100%; min-width:0; }
  html.phone-layout .series-race-block > div:first-child { flex-wrap:wrap; }
  html.phone-layout .series-race-block table { display:block; width:100%; max-width:100%; overflow-x:auto; }
  html.phone-layout #page-dashboard .eos-tier-toggle { display:flex; flex-wrap:wrap; }
  html.phone-layout #page-dashboard .eos-tier-btn { min-height:44px; font-size:12px; }
  html.phone-layout #page-dashboard .page-title, html.phone-layout #page-departments .page-title { font-size:18px; }
  html.phone-layout #page-dashboard .card, html.phone-layout #page-departments .card { min-width:0; overflow-wrap:anywhere; }
  html.phone-layout #page-departments .dept-overview-card, html.phone-layout #dept-overview-grid > * { min-width:0; max-width:100%; }
  html.phone-layout #page-grid .grid-stat, html.phone-layout #page-grid .safety-stat { min-width:0; }
  html.phone-layout #page-grid .red-lights, html.phone-layout #page-grid .start-lights { position:relative!important; top:auto!important; left:auto!important; right:auto!important; margin:8px 0; }
  html.phone-layout #page-grid .tg-tiles { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; }
  html.phone-layout #page-grid .tg-tile { min-width:0; padding:10px; }
  html.phone-layout #page-grid .tg-tile .tg-l, html.phone-layout #page-grid .tg-tile .tg-s { font-size:12px; }
  html.phone-layout #page-grid .tg-tile .tg-v { font-size:25px; overflow-wrap:anywhere; }
  html.phone-layout #page-grid .tg-wrap { overflow:visible; }
  html.phone-layout #page-grid table.tg-table { display:block; width:100%; max-width:100%; min-width:0; overflow:visible; }
  html.phone-layout #page-grid .tg-table thead { display:none; }
  html.phone-layout #page-grid .tg-table tbody { display:block; width:100%; }
  html.phone-layout #page-grid .tg-table tr:not(.tg-band):not(.tg-subtot):not(.tg-grand):not(.tg-rehead) { display:flex; align-items:stretch; width:100%; overflow-x:auto; scroll-snap-type:x mandatory; border-bottom:1px solid #e3e9f2; }
  html.phone-layout #page-grid .tg-table tr:not(.tg-band):not(.tg-subtot):not(.tg-grand):not(.tg-rehead) td { display:flex; flex:0 0 85px; align-items:center; min-width:0; min-height:54px; padding:6px; font-size:12px; border:0; scroll-snap-align:start; }
  html.phone-layout #page-grid .tg-table tr:not(.tg-band):not(.tg-subtot):not(.tg-grand):not(.tg-rehead) td:first-child { position:sticky; left:0; z-index:3; flex-basis:calc(100% - 100px); max-width:calc(100% - 100px); padding-left:8px; background:#fff; white-space:normal; overflow-wrap:anywhere; }
  html.phone-layout #page-grid .tg-table tr:not(.tg-band):not(.tg-subtot):not(.tg-grand):not(.tg-rehead) td:nth-child(2) { position:sticky; left:calc(100% - 100px); z-index:3; flex-basis:88px; display:flex; flex-direction:column; justify-content:center; background:#fff; }
  html.phone-layout #page-grid .tg-table tr:not(.tg-band):not(.tg-subtot):not(.tg-grand):not(.tg-rehead) td:nth-child(2)::after { content:'↔'; display:block; font-size:12px; color:#6f8299; }
  html.phone-layout #page-grid .tg-table tr.tg-band, html.phone-layout #page-grid .tg-table tr.tg-subtot, html.phone-layout #page-grid .tg-table tr.tg-grand { display:block; width:100%; }
  html.phone-layout #page-grid .tg-table tr.tg-band td, html.phone-layout #page-grid .tg-table tr.tg-subtot td, html.phone-layout #page-grid .tg-table tr.tg-grand td { display:block; width:100%; font-size:12px; }
  html.phone-layout #page-grid .tg-table tr.tg-rehead { display:none; }
  html.phone-layout #page-grid .phone-mini-bar { display:block; width:68px; max-width:100%; height:5px; margin-top:3px; border-radius:4px; background:#e3e9f2; overflow:hidden; }
  html.phone-layout #page-grid .phone-mini-bar i { display:block; height:100%; width:var(--phone-score,0%); background:#618fb4; }
  html.phone-layout #page-grid .tg-ov { padding:0; }
  html.phone-layout #page-grid .tg-md { width:100vw; height:100dvh; max-height:none; border-radius:0; overflow:auto; }
  html.phone-layout .page-title, html.phone-layout .card-title { line-height:1.3; }
  html.phone-layout .page-title { overflow-wrap:anywhere; }
  html.phone-layout .main-content table:not(.cb-table):not(.pk-table) { max-width:100%; }
  @keyframes phone-enter { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:translateY(0); } }
}

@media (min-width:641px) and (max-height:640px) {
  html.phone-layout { --phone-bottom:48px; }
  html.phone-layout a, html.phone-layout button, html.phone-layout [role="button"],
  html.phone-layout [onclick], html.phone-layout input, html.phone-layout select,
  html.phone-layout textarea, html.phone-layout [tabindex]:not([tabindex="-1"]) {
    min-width:44px; min-height:44px;
  }
  html.phone-layout .bottom-nav-item { flex-direction:row; gap:7px; font-size:12px; }
  html.phone-layout .bottom-nav-item .bn-icon { font-size:18px; }
  html.phone-layout .building-view-header { padding-top:2px; }
  html.phone-layout .phone-project-head { display:none; }
  html.phone-layout .cv2-main { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); align-items:start; }
  html.phone-layout .cv2-centre { grid-column:1/-1; }
  html.phone-layout .cv2-centre > .cv2-panel { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); }
  html.phone-layout .cv2-centre .cv2-h { grid-column:1/-1; }
  html.phone-layout .cv2-head { display:none; }
  html.phone-layout .cv2-centre .cv2-gaugebox { grid-column:1; }
  html.phone-layout .phone-land-controls { display:flex; flex-direction:column; gap:5px; }
  html.phone-layout .phone-land-controls .cw-date { width:100%; }
  html.phone-layout .phone-land-controls .cv2-hchips { width:100%; margin:0; }
  html.phone-layout .phone-land-controls .cv2-chip { font-size:12px; }
  html.phone-layout .cv2-centre .cv2-pillars { grid-column:2; }
  html.phone-layout .cv2-centre .phone-counts { grid-column:2; }
  html.phone-layout .cv2-left, html.phone-layout .cv2-right { grid-column:auto; }
  html.phone-layout .cv2-insights-panel { grid-column:1/-1; }
  html.phone-layout .cw-crag, html.phone-layout .cw-crag.cw-crag-classic { grid-template-columns:repeat(3,minmax(0,1fr)); }
  html.phone-layout .pk-cols { grid-template-columns:repeat(2,minmax(0,1fr)); }
  html.phone-layout .rc-series-strip { grid-template-columns:repeat(3,minmax(0,1fr)); }
}

@media (max-width:640px), (max-height:640px) {
  @media (prefers-reduced-motion:reduce) {
    html.phone-layout .page.active, html.phone-layout .phone-panel.open, html.phone-layout .cv2-gauge, html.phone-layout .rc-ticker-scroll { animation:none!important; transition:none!important; }
  }
}

/* 192.16.5 (Claude): approved corner cells and Deals/Cases/Variations day strip. Phone only. */
@media (max-width:640px), (max-height:640px) {
  html.phone-layout .cw-crow { display:grid!important; grid-template-columns:10px minmax(0,1fr); grid-template-areas:"dot lb" ". t"; column-gap:6px; row-gap:3px; align-items:start; }
  html.phone-layout .cw-crow .cw-dot { grid-area:dot; margin-top:5px; }
  html.phone-layout .cw-crow .lb { grid-area:lb; font-weight:700; line-height:1.25; overflow-wrap:normal!important; word-break:normal!important; hyphens:none!important; }
  html.phone-layout .cw-crow .t { grid-area:t; display:flex!important; flex-wrap:wrap; gap:0 6px; max-width:none!important; text-align:left!important; line-height:1.3; }
  html.phone-layout .cw-crow .t span { display:inline!important; white-space:nowrap!important; }
  html.phone-layout .cw-crow .t .cv2-win { color:#9fb5d3; }

  html.phone-layout .rc-week-calendar .rc-week-row { display:flex!important; flex-wrap:nowrap; gap:6px; max-width:100%; overflow-x:auto; overscroll-behavior-x:contain; scrollbar-width:none; padding:2px 0 4px; }
  html.phone-layout .rc-week-calendar .rc-week-row::-webkit-scrollbar { display:none; }
  html.phone-layout .rc-week-calendar .rc-week-row + .rc-week-row { margin-top:6px; }
  html.phone-layout .rc-week-calendar .rc-calendar-blank { display:none!important; }
  html.phone-layout .rc-week-calendar .rc-calendar-day { flex:0 0 64px; min-width:64px; min-height:56px; padding:5px 4px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:1px; }
  html.phone-layout .rc-week-calendar .rc-calendar-day .phone-rc-wd { font-size:12px; font-weight:700; opacity:.8; }
  html.phone-layout .rc-week-calendar .rc-calendar-day .rc-day-date { font-size:12px; white-space:nowrap; }
  html.phone-layout .rc-week-calendar .rc-calendar-day .rc-day-count { font-size:18px; font-weight:800; line-height:1.1; }
  html.phone-layout .rc-week-calendar .rc-calendar-total { flex:1 0 136px; min-width:136px; min-height:56px; padding:5px 8px; }
  html.phone-layout .rc-week-calendar .rc-calendar-total .rc-week-name, html.phone-layout .rc-week-calendar .rc-calendar-total .rc-week-range { white-space:nowrap; font-size:12px; }
  html.phone-layout .rc-week-calendar .rc-calendar-total .rc-week-average { display:block; white-space:nowrap; font-size:12px; }
}
@media (min-width:641px) and (max-height:640px) {
  html.phone-layout .cw-crag, html.phone-layout .cw-crag.cw-crag-classic { grid-template-columns:repeat(3,minmax(0,1fr)); }
}

/* ===== 192.16.7 phone design layer (Claude) =====
   business owner 16 Oct: the phone looked like large print. Cause: blanket rules forced every text to
   be at least as big as its parent and every control to finger size, and words were allowed to
   break anywhere. This layer restores hierarchy from the approved mock-up: compact system font,
   small caps labels, big numbers, slim chips, words never broken. Strive banner kept as is.
   Phone only; desktop/TV untouched. */
@media (max-width:640px), (max-height:640px) {
  html.phone-layout body { font-family:"Segoe UI",Inter,system-ui,-apple-system,Roboto,Arial,sans-serif!important; -webkit-font-smoothing:antialiased; -webkit-text-size-adjust:100%; text-size-adjust:100%; }
  html.phone-layout body *:not(.topbar):not(.topbar *):not(svg):not(svg *):not(.cv2-gauge *):not(.phone-dial-value) { font-family:inherit!important; }
  html.phone-layout body * { overflow-wrap:break-word!important; word-break:normal!important; hyphens:none!important; }
  html.phone-layout .phone-grid-deal-row > strong, html.phone-layout .cw-crow .lb, html.phone-layout .cw-crow .t span { overflow-wrap:normal!important; }
  html.phone-layout th { white-space:nowrap!important; font-size:10.5px!important; letter-spacing:.06em; }

  /* chips, filters, segmented buttons: slim like the mock */
  html.phone-layout .pill, html.phone-layout .chip, html.phone-layout [class*="-chip"], html.phone-layout [class*="chip-"],
  html.phone-layout .cv2-chip, html.phone-layout .deals-chip, html.phone-layout .deals-window button, html.phone-layout .deals-service button {
    min-height:32px!important; padding:5px 11px!important; font-size:12px!important; line-height:1.2!important; border-radius:999px; }

  /* Projects (Garage): one compact card row per project, no table */
  html.phone-layout .garage-table, html.phone-layout .garage-table tbody { display:block!important; width:100%!important; min-width:0!important; }
  html.phone-layout .garage-table colgroup, html.phone-layout .garage-table thead { display:none!important; }
  html.phone-layout .garage-table tr { display:grid!important; grid-template-columns:22px 58px repeat(5,minmax(0,1fr)); grid-template-areas:"pos car name name name name name" "pos car ov ov ov ov ov" "st st p1 p2 p3 p4 wow"; column-gap:6px; row-gap:4px; align-items:center; padding:10px 10px 9px; border-bottom:1px solid var(--light-gray,#e3e9f2); }
  html.phone-layout .garage-table td { display:block!important; padding:0!important; border:0!important; min-width:0; text-align:left!important; }
  html.phone-layout .garage-table td:nth-child(1) { grid-area:pos; align-self:center; text-align:center!important; font-size:15px!important; }
  html.phone-layout .garage-table td:nth-child(2) { grid-area:car; }
  html.phone-layout .garage-table td:nth-child(2) img { width:56px!important; }
  html.phone-layout .garage-table td:nth-child(3) { grid-area:name; font-size:13.5px!important; font-weight:700!important; text-transform:none; }
  html.phone-layout .garage-table td:nth-child(4) { grid-area:ov; }
  html.phone-layout .garage-table td:nth-child(4) span { min-width:0!important; font-size:12.5px!important; white-space:nowrap; }
  html.phone-layout .garage-table td:nth-child(5) { grid-area:p1; } html.phone-layout .garage-table td:nth-child(6) { grid-area:p2; }
  html.phone-layout .garage-table td:nth-child(7) { grid-area:p3; } html.phone-layout .garage-table td:nth-child(8) { grid-area:p4; }
  html.phone-layout .garage-table td:nth-child(9) { grid-area:wow; }
  html.phone-layout .garage-table td:nth-child(10) { grid-area:st; font-size:10px!important; }
  html.phone-layout .garage-table td:nth-child(n+5):nth-child(-n+9) { text-align:center!important; font-size:12px!important; }
  html.phone-layout .garage-table td:nth-child(n+5):nth-child(-n+9)::before { display:block; font-size:9.5px; font-weight:700; letter-spacing:.08em; color:#8a99b3; margin-bottom:1px; }
  html.phone-layout .garage-table td:nth-child(5)::before { content:"COMP"; } html.phone-layout .garage-table td:nth-child(6)::before { content:"OPS"; }
  html.phone-layout .garage-table td:nth-child(7)::before { content:"RES"; } html.phone-layout .garage-table td:nth-child(8)::before { content:"COMM"; }
  html.phone-layout .garage-table td:nth-child(9)::before { content:"WOW"; }

  /* market share and other small data tables: tidy, scroll inside the card if needed */
  html.phone-layout .market-share-table th, html.phone-layout .market-share-table td { padding:7px 6px!important; }
  html.phone-layout .market-share-table td { font-size:13px!important; }
}
@media (max-width:640px), (max-height:640px) {
  html.phone-layout .garage-table td:first-child[style*="145A95"] { writing-mode:vertical-rl; transform:rotate(180deg); font-size:10px!important; letter-spacing:.12em; }
  html.phone-layout #project-grid [style*="border-radius:8px"][style*="font-family"] { flex-wrap:wrap; }
}
@media (max-width:640px), (max-height:640px) {
  /* project header: compact like the approved design */
  html.phone-layout .building-view-header .badge { font-size:11px!important; line-height:1.2!important; padding:3px 8px!important; border-radius:999px!important; min-height:0!important; }
  html.phone-layout .building-view-tabs { min-height:42px!important; padding-top:2px!important; padding-bottom:5px!important; }
  html.phone-layout .building-view-tabs button { min-height:34px!important; padding:6px 11px!important; font-size:12.5px!important; border-radius:9px!important; }
  html.phone-layout .cw-date, html.phone-layout .pk-datebar { min-height:38px!important; }
  html.phone-layout .cw-date button, html.phone-layout .pk-datebar button, html.phone-layout .cw-date input, html.phone-layout .pk-datebar input { min-height:38px!important; font-size:12.5px!important; }
  html.phone-layout .cv2-chip, html.phone-layout .cv2-hchips .cv2-chip { font-size:11px!important; padding:3px 9px!important; min-height:0!important; border-radius:999px!important; }
  html.phone-layout .money-vat-note { font-size:10.5px!important; margin:0 0 6px!important; }
}
@media (max-width:640px), (max-height:640px) {
  html.phone-layout .phone-project-meta { gap:4px!important; margin-top:2px; }
  html.phone-layout .phone-project-meta span { padding:2px 8px!important; border-radius:999px!important; font-size:11px!important; font-weight:600!important; line-height:1.35!important; }
  html.phone-layout .phone-project-head strong { font-size:16px!important; font-weight:800!important; }
  html.phone-layout .phone-project-head .speed b { font-size:14px!important; }
}
@media (max-width:640px), (max-height:640px) {
  html.phone-layout .cv2-pillars { align-items:start!important; }
  html.phone-layout .cv2-pillar { height:auto!important; }
  html.phone-layout .cw-crow .lb { font-size:12.5px!important; }
  html.phone-layout .cw-crow .t, html.phone-layout .cw-crow .t span { font-size:11.5px!important; }
}
@media (max-width:640px), (max-height:640px) {
  /* tiny inline sizes written for the TV wall: lift to the 10 px phone floor */
  html.phone-layout body [style*="font-size:6px"], html.phone-layout body [style*="font-size:7px"], html.phone-layout body [style*="font-size:8px"],
  html.phone-layout body [style*="font-size:9px"], html.phone-layout body [style*="font-size:9.5px"], html.phone-layout body [style*="font-size: 8px"],
  html.phone-layout body [style*="font-size: 9px"], html.phone-layout body [style*="font-size:0.5"], html.phone-layout body [style*="font-size:0.6"] { font-size:10px!important; }
}
@media (max-width:640px), (max-height:640px) {
  html.phone-layout .deals-filter, html.phone-layout .cases-filter, html.phone-layout .var-chip,
  html.phone-layout #page-deals button, html.phone-layout #page-cases button, html.phone-layout #page-variations button { min-height:36px!important; }
  html.phone-layout .cw-tag, html.phone-layout .cv2-tag, html.phone-layout .tw-kq, html.phone-layout .lt-meta, html.phone-layout .occ-caption,
  html.phone-layout .occ-ring-note, html.phone-layout .occ-wrap .l { font-size:10px!important; }
}

/* ===== 192.16.8 Deals market share on the phone (Claude) =====
   The table already fits the phone width, so the second column must not stick at 120px:
   it was sliding over "Outside companies" and hiding those numbers. Headings may wrap
   onto two lines between words; nothing is cut off. Phone only. */
@media (max-width:640px), (max-height:640px) {
  html.phone-layout .market-share-table th:nth-child(2), html.phone-layout .market-share-table td:nth-child(2) { position:static!important; left:auto!important; }
  html.phone-layout .market-share-table thead th { white-space:normal!important; overflow-wrap:normal!important; line-height:1.2; vertical-align:bottom; }
  html.phone-layout .market-share-table thead th:nth-child(1) { width:30%!important; }
  html.phone-layout .market-share-table thead th:nth-child(2) { width:16%!important; }
  html.phone-layout .market-share-table thead th:nth-child(3) { width:24%!important; }
  html.phone-layout .market-share-table thead th:nth-child(4) { width:30%!important; }
  html.phone-layout .market-share-scroll::after { display:none!important; }
}

/* ===== 192.16.9 Deals Created on | Job date (Claude) =====
   The switch leads the filter strip so it is visible without swiping. The explanation and
   Entered late lines keep the same height in both settings, so nothing below them moves. Phone only. */
@media (max-width:640px), (max-height:640px) {
  html.phone-layout #page-deals .deals-rail .deals-date-group,
  html.phone-layout #page-deals .deals-building-window .deals-date-group { order:-1; flex:0 0 auto; flex-wrap:nowrap; }
  html.phone-layout #page-deals.deals-building .deals-date-block { margin:0 0 10px; }
  html.phone-layout #page-deals .deals-late-line { gap:2px 8px; }
  html.phone-layout #page-deals .deals-late-overlay { padding:8px; }
  html.phone-layout #page-deals .deals-late-box { max-height:86vh; }
}
