/* Independent mobile presentation. Keep EVERY rule inside this viewport gate.
   No device names, user-agent guesses, desktop density or page zoom are used.
   The same forms/data remain mounted when a foldable phone changes width. */
@media screen and (max-width: 1023px) {
  :root { --fm-screen-unit:1px; --fm-tile-hover-scale:1 !important; --fm-tile-hover-lift:0px !important; -webkit-text-size-adjust:100%; text-size-adjust:100%; }
  body { min-width:0; width:100%; }
  :is(main,section,article,aside,form,nav,header,footer) { min-width:0; }
  :is(input:not([type=checkbox]):not([type=radio]),select,textarea) { min-width:0; max-width:100%; font-size:16px !important; }
  :is(button,a,input,select,textarea) { touch-action:manipulation; }
  :is(button,a):focus-visible { outline:2px solid #8ad9ff; outline-offset:3px; }
  :is(.shell,.account-main,.shop-main) { max-width:100%; }

  /* CRM: one compact top bar, thumb navigation, and a focused section menu. */
  .crm-theme #crm-root .app-shell>.sidebar,
  .crm-theme #crm-root .app-shell>.scrim,
  .crm-theme .main-shell>.crm-return-nav,
  .crm-theme .main-shell>.topbar { display:none; }
  .crm-theme :is(.app-shell,.main-shell,.crm-body-grid,.employee-workspace) { width:100%; min-width:0; max-width:100%; margin-left:0; }
  .crm-theme .main-shell { --fm-return-height:52px !important; padding-bottom:calc(60px + env(safe-area-inset-bottom)); }
  .fm-display-launcher { display:none; }
  .crm-theme .toast { bottom:calc(68px + env(safe-area-inset-bottom)); max-width:calc(100vw - 28px); }
  .crm-theme .crm-body-grid { display:block; padding:0; }
  .crm-theme .crm-body-grid>main { width:100%; max-width:none; padding:12px max(12px,env(safe-area-inset-right)) 20px max(12px,env(safe-area-inset-left)); }
  .fm-mobile-appbar { position:sticky; top:0; z-index:35; display:flex; align-items:center; gap:5px; min-height:52px; padding:3px max(8px,env(safe-area-inset-right)) 3px max(8px,env(safe-area-inset-left)); background:linear-gradient(110deg,#13243bf5,#233e59f5); border-bottom:1px solid #729cb544; backdrop-filter:blur(16px); -webkit-backdrop-filter:blur(16px); }
  .fm-mobile-appbar>button { display:grid; place-items:center; flex:none; width:44px; height:44px; border:1px solid #8ab4d333; border-radius:14px; color:#d0e5f8; background:#8bb5e00a; }
  .fm-mobile-appbar>button:disabled { opacity:.4; }
  .fm-mobile-brand { display:flex; align-items:center; gap:6px; min-width:0; flex:1; color:#e6f4ff; }
  .fm-mobile-brand img { width:28px; height:28px; object-fit:contain; flex:none; }
  .fm-mobile-brand>span { min-width:0; }
  .fm-mobile-brand small { display:block; color:#95b7d2; font-size:12px; letter-spacing:1.5px; line-height:1.2; }
  .fm-mobile-brand strong { display:block; font-size:14px; font-weight:550; line-height:1.4; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .fm-mobile-dock { position:fixed; z-index:40; bottom:0; left:0; right:0; display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:4px; padding:3px max(8px,env(safe-area-inset-right)) calc(3px + env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left)); background:linear-gradient(120deg,#112239f7,#1c344cf7); border-top:1px solid #7eb5d54a; backdrop-filter:blur(18px); -webkit-backdrop-filter:blur(18px); box-shadow:0 -8px 28px #0003; }
  .fm-mobile-dock button { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; min-width:0; min-height:44px; padding:2px; border-radius:11px; color:#a7bed4; font-size:12px; line-height:1.25; }
  .fm-mobile-dock button svg { width:18px; height:18px; flex:none; }
  .fm-mobile-dock button[aria-current],.fm-mobile-dock button[aria-expanded=true] { background:linear-gradient(145deg,#287abb3d,#25706d26); color:#9be5ff; box-shadow:inset 0 0 0 1px #60c4f64d; }
  .crm-theme .fm-mobile-menu.crm-modal { padding:18px; border-radius:22px; background:linear-gradient(135deg,#182e46,#102037); border-color:#79bbdd55; gap:0; }
  .fm-mobile-menu-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:12px; }
  .fm-mobile-menu-head h2 { font-size:1.1rem; line-height:1.4; }
  .fm-mobile-menu-head .icon-btn { width:44px; height:44px; flex:none; }
  .fm-mobile-menu nav section { margin-bottom:20px; }
  .fm-mobile-menu nav h3 { color:#8cb0cc; font-size:12px; letter-spacing:1px; margin:0 0 10px; }
  .fm-mobile-menu-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  .fm-mobile-menu-grid button { display:flex; align-items:center; gap:10px; min-height:56px; min-width:0; padding:12px; text-align:left; border:1px solid #759fc333; border-radius:13px; background:#76a8cd08; color:#d7e6f4; font-size:14px; line-height:1.4; overflow-wrap:anywhere; }
  .fm-mobile-menu-grid button svg { color:#8bceef; flex:none; }
  .fm-mobile-menu-grid button[aria-current] { color:#c5f6ff; border-color:#64cbed80; background:#338dcc29; }
  .fm-mobile-menu-tools { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; padding-top:16px; border-top:1px solid #759fc333; }
  .fm-mobile-menu-tools :is(button,a) { display:flex; gap:8px; align-items:center; min-height:44px; min-width:0; margin:0; padding:8px; font-size:14px; white-space:normal; text-align:left; border-radius:10px; color:#b1cfe4; }
  .fm-mobile-menu-tools svg { flex:none; }
  .fm-mobile-menu-tools button:disabled { opacity:.4; }
  .fm-mobile-administration { margin-top:18px; font-size:14px; color:#a2bdd3; }
  .fm-mobile-administration summary,.fm-mobile-administration a { display:block; padding:12px 4px; min-height:44px; }
  .fm-mobile-administration summary { cursor:pointer; }

  /* Forms, cards and local scroll regions must shrink to their own column. */
  .crm-theme :is(.page-head,.head-actions,.table-tools,.section-head,.report-toolbar,.draft-toolbar,.calendar-controls,.tool-group) { min-width:0; max-width:100%; flex-wrap:wrap; gap:10px; }
  .crm-theme .page-head { display:flex; flex-direction:column; align-items:stretch; margin-bottom:12px; }
  .crm-theme .page-head h1 { font-size:clamp(1.25rem,3.6vw,1.75rem); line-height:1.4; overflow-wrap:anywhere; }
  .crm-theme .page-head p { font-size:14px; line-height:1.55; }
  .crm-theme .title-row { flex-wrap:wrap; min-width:0; gap:8px; }
  .crm-theme :is(.head-actions,.dialog-footer) { display:flex; flex-wrap:wrap; gap:8px; }
  .crm-theme .head-actions>* { flex:1 1 170px; min-width:0; max-width:100%; width:auto; }
  .crm-theme :is(.primary,.secondary,.text-button,.icon-btn) { min-height:44px; white-space:normal; }
  .crm-theme :is(.primary,.secondary) { font-size:14px; padding:10px 14px; }
  .crm-theme :is(.field,.field>*,.form-grid>*,.metrics>*,.panel,.search,.search input,.tool-group>*,.order-side,.order-main) { min-width:0; max-width:100%; }
  .crm-theme :is(input:not([type=checkbox]):not([type=radio]),select,textarea),.bank-search input,.bank-operations-tools select { font-size:16px !important; }
  .crm-theme :is(input:not([type=checkbox]):not([type=radio]),select) { min-height:44px; }
  .crm-theme :is(.form-grid,.draft-fields) { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .crm-theme .field.wide { grid-column:1/-1; }
  .crm-theme :is(.dashboard-grid,.order-layout,.settings-layout,.order-info-grid,.erp-columns) { grid-template-columns:minmax(0,1fr); }
  .crm-theme .search { flex:1 1 100%; width:100%; max-width:none; }
  .crm-theme .tool-group { width:100%; }
  .crm-theme .tool-group>* { flex:1 1 140px; }
  .crm-theme :is(.table-wrap,.hub-table-wrap,.client-table-wrap,.print-preview-pages,.media-table-wrap) { max-width:100%; overflow-x:auto; overscroll-behavior-x:contain; -webkit-overflow-scrolling:touch; }
  .crm-theme .order-tab-workspace>.order-tab-list { top:var(--fm-return-height,52px); display:flex; flex-wrap:nowrap; overflow-x:auto; max-width:100%; gap:6px; padding:8px; scrollbar-width:thin; scroll-padding-inline:8px; }
  .crm-theme .order-tab-list>button { flex:none; min-height:44px; padding:9px 12px; font-size:14px; }
  .crm-theme .order-tab-workspace { min-width:0; }
  .crm-theme .segmented { display:flex; max-width:100%; flex-wrap:wrap; }
  .crm-theme .segmented button { min-height:44px; white-space:normal; font-size:14px; }
  .crm-theme :is(.metrics,.warehouse-summary,.damage-metrics) { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
  .crm-theme .metric { padding:12px; }
  .crm-theme .metric>strong { font-size:clamp(1.15rem,3.2vw,1.6rem); overflow-wrap:anywhere; }
  .crm-theme .metric-label { font-size:14px; line-height:1.4; }
  .crm-theme :is(.metric>span:last-child,.footnote) { font-size:12px; line-height:1.5; }
  .crm-theme :is(.order-tiles,.warehouse-stock-tiles,.order-service-grid) { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .crm-theme :is(.board,.schedule) { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); max-width:100%; overflow:visible; }
  .crm-theme :is(.board-col,.bay) { min-width:0; width:auto; }
  .crm-theme .bay-body { height:auto; }
  .crm-theme .crm-modal { scroll-padding-block:20px; }
  .crm-theme .dialog-head { gap:12px; }
  .crm-theme .dialog-head h2 { font-size:1.125rem; line-height:1.4; overflow-wrap:anywhere; }

  /* Owner dashboard: a separate mobile rhythm, with two columns on Fold. */
  .crm-theme .crm-screen-switcher { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; margin-bottom:14px; }
  .crm-theme .crm-screen-switcher>span,.crm-theme .crm-screen-switcher button small { display:none; }
  .crm-theme .crm-screen-switcher button { min-width:0; min-height:44px; padding:9px 6px; gap:6px; font-size:14px; white-space:normal; line-height:1.4; }
  .crm-theme .crm-screen-switcher button svg { flex:none; }
  .crm-theme .crm-home { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .crm-theme .crm-home .home-widget { grid-column:auto; padding:14px; border-radius:16px; min-width:0; }
  .crm-theme .crm-home :is(.home-hero,.home-orders,.home-shortcuts) { grid-column:1/-1; }
  .crm-theme .home-hero-copy { flex-wrap:wrap; gap:14px; margin-block:10px; }
  .crm-theme .home-hero-copy p { font-size:14px; }
  .crm-theme .home-hero-stats { grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
  .crm-theme .home-hero-stats>button { padding:12px; }
  .crm-theme .home-hero-stats>button>span { font-size:14px; flex-wrap:wrap; }
  .crm-theme .home-hero-stats small { font-size:12px; }
  .crm-theme .home-widget-head { flex-wrap:wrap; gap:8px; margin-bottom:10px; }
  .crm-theme .home-widget-head h2 { font-size:16px; }
  .crm-theme :is(.home-widget-open,.home-footer-link) { min-height:44px; font-size:14px; }
  .crm-theme :is(.home-stage-grid span,.home-order-title strong,.home-mini-list strong,.home-stock-list>a,.home-empty) { font-size:14px; }
  .crm-theme :is(.home-order-title small,.home-mini-list small,.home-weather-source) { font-size:12px; }
  .crm-theme .home-shortcuts { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .crm-theme .home-shortcuts>a { padding:14px; gap:10px; }
  .crm-theme .home-shortcuts strong { font-size:14px; overflow-wrap:anywhere; }
  .crm-theme .home-shortcuts small { font-size:12px; }
  .crm-theme .owner-banks,.crm-theme .owner-media { max-width:100%; min-width:0; padding:16px; border-radius:18px; }
  .crm-theme :is(.bank-masthead,.media-heading,.bank-panel-head,.media-panel-head,.bank-operation,.bank-notice,.media-message,.media-youtube-state) { flex-wrap:wrap; gap:10px; }
  .crm-theme :is(.bank-account-grid,.media-platforms) { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .crm-theme :is(.bank-analytics-grid,.media-main-grid) { grid-template-columns:minmax(0,1fr); }
  .crm-theme .bank-operation-amount { min-width:0; max-width:100%; overflow-wrap:anywhere; }
  .crm-theme :is(.bank-orbit,.process-ring-wrap) { max-width:100%; }
  .crm-theme :is(.bank-masthead p,.bank-panel-note,.bank-empty p,.bank-insight p,.media-empty p) { font-size:14px; line-height:1.6; }

  /* Public pages retain the brand, but use a compact header and content flow. */
  :root.fm-iphone body[data-fm-liquid].home-page .header-inner,body[data-fm-liquid].home-page .header-inner { display:grid; grid-template-columns:minmax(0,1fr) 44px 44px; grid-template-areas:'brand account menu' 'contacts contacts contacts'; height:auto; gap:4px 8px; padding-block:6px; }
  body[data-fm-liquid].home-page .header-inner>.brand { grid-area:brand; justify-self:start; min-width:0; }
  body[data-fm-liquid].home-page .header-inner .brand-logo { width:clamp(120px,30vw,160px); max-width:100%; height:auto; }
  body[data-fm-liquid].home-page .header-inner>.nav,body[data-fm-liquid].home-page .header-actions>.socials,body[data-fm-liquid].home-page .header-cta { display:none; }
  body[data-fm-liquid].home-page .header-inner>.header-actions { grid-area:account; display:block; position:static; width:44px; height:44px; }
  body[data-fm-liquid].home-page .header .account-link { position:static; display:grid; place-items:center; width:44px; height:44px; min-height:44px; padding:0; border-radius:14px; }
  body[data-fm-liquid].home-page .header .account-link span { display:none; }
  body[data-fm-liquid].home-page .header-inner>.menu-toggle { grid-area:menu; display:flex; width:44px; height:44px; border:1px solid #668eb84d; border-radius:14px; background:#759fdc0a; flex-direction:column; align-items:center; justify-content:center; gap:6px; }
  body[data-fm-liquid].home-page .menu-toggle span { width:18px; height:1px; background:#cfe8fa; }
  body[data-fm-liquid].home-page .header-contacts { grid-area:contacts; display:flex; justify-content:space-between; flex-wrap:wrap; gap:4px 12px; width:100%; }
  body[data-fm-liquid].home-page .header-contact { display:flex; gap:6px; align-items:center; min-width:0; min-height:26px; }
  body[data-fm-liquid].home-page .contact-label { flex-basis:auto; font-size:12px; }
  body[data-fm-liquid].home-page .contact-label-full { display:none; }
  body[data-fm-liquid].home-page .contact-label-short { display:inline; }
  body[data-fm-liquid].home-page .contact-number { font-size:12px; white-space:nowrap; }
  body[data-fm-liquid].home-page .mobile-nav:not([hidden]) { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; padding:8px 12px 12px; max-height:65dvh; overflow-y:auto; }
  body[data-fm-liquid].home-page .mobile-nav a:not([hidden]) { display:flex; align-items:center; min-height:38px; padding:7px 8px; font-size:12px; line-height:1.35; overflow-wrap:anywhere; border:1px solid #759fc333; border-radius:12px; }
  :root.fm-iphone body[data-fm-liquid].home-page .shell,body[data-fm-liquid].home-page .shell { width:calc(100% - 28px); max-width:calc(100% - 28px); }
  body[data-fm-liquid].home-page .hero { min-height:0; }
  body[data-fm-liquid].home-page .hero-content { display:grid; grid-template-columns:minmax(0,1fr); gap:16px; padding:12px 0 14px; }
  body[data-fm-liquid].home-page .hero-copy { max-width:100%; }
  body[data-fm-liquid].home-page .hero-copy>.eyebrow { font-size:10px; letter-spacing:.07em; line-height:1.4; }
  body[data-fm-liquid].home-page .hero-divider { display:none; }
  /* Keep the h1 available to assistive technology; only the film is visible. */
  body[data-fm-liquid].home-page .hero-reel .hero-brand-headline { position:absolute; width:1px; height:1px; margin:0; padding:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
  body[data-fm-liquid].home-page .hero-reel { margin:10px 0; }
  body[data-fm-liquid].home-page .hero-reel-media { opacity:1; visibility:visible; transition:none; }
  body[data-fm-liquid].home-page .hero-reel [data-hero-next] { display:none; }
  body[data-fm-liquid].home-page .hero-reel-controls { gap:6px; margin-top:4px; }
  body[data-fm-liquid].home-page .hero-reel-controls[hidden] { display:none; }
  body[data-fm-liquid].home-page .hero-reel-control { min-width:44px; min-height:36px; border-radius:10px; padding:6px 10px; }
  body[data-fm-liquid].home-page .hero-description { font-size:13px; line-height:1.45; }
  body[data-fm-liquid].home-page .hero-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin-top:10px; }
  body[data-fm-liquid].home-page .hero-actions .button { min-width:0; min-height:36px; padding:7px 10px; font-size:12px; line-height:1.35; gap:6px; }
  body[data-fm-liquid].home-page .equipment-carousel { display:none; }
  body[data-fm-liquid].home-page .equipment-slide { gap:6px; }
  body[data-fm-liquid].home-page .equipment-slide img { object-fit:contain; transform:none; }
  body[data-fm-liquid].home-page .equipment-slide figcaption { min-height:42px; padding:0 4px; }
  body[data-fm-liquid].home-page .equipment-slide h2 { font-size:15px; line-height:1.25; }
  body[data-fm-liquid].home-page .equipment-type { font-size:10px; margin-bottom:4px; }
  body[data-fm-liquid].home-page .equipment-slide figcaption p { font-size:12px; margin-top:4px; }
  body[data-fm-liquid].home-page .equipment-controls { display:flex; flex-wrap:nowrap; gap:4px; margin-top:6px; }
  body[data-fm-liquid].home-page :is(.equipment-arrow,.equipment-play) { width:36px; height:36px; min-height:36px; margin:0; flex:none; }
  body[data-fm-liquid].home-page .equipment-dots { display:flex; flex:1; justify-content:center; gap:0; min-width:0; max-width:210px; }
  body[data-fm-liquid].home-page .equipment-dots button { width:auto; flex:1; min-width:0; max-width:30px; height:36px; padding:4px; }
  body[data-fm-liquid].home-page .hero-bottom { position:static; padding-block:4px 12px; font-size:9px; letter-spacing:.08em; gap:12px; }
  body[data-fm-liquid].home-page .hero-bottom a { font-size:11px; gap:8px; }
  body[data-fm-liquid].home-page .section { padding-block:28px; }
  body[data-fm-liquid].home-page .section-heading { display:block; margin-bottom:16px; }
  body[data-fm-liquid].home-page .section-kicker { margin-bottom:10px; font-size:10px; }
  body[data-fm-liquid].home-page .section-heading h2 { font-size:clamp(23px,5.4vw,30px); line-height:1.15; overflow-wrap:anywhere; }
  body[data-fm-liquid].home-page .section-note { margin-top:10px; max-width:none; font-size:13px; line-height:1.45; }
  body[data-fm-liquid].home-page .section-heading.services-heading { display:grid; gap:10px 12px; }
  body[data-fm-liquid].home-page .services-heading>.services-approach-link { min-height:44px; padding:8px 10px; font-size:12px; }
  body[data-fm-liquid].home-page .services-heading>.section-note { margin:0; }
  body[data-fm-liquid].home-page .category-inner { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; padding:10px 0; overflow:visible; }
  body[data-fm-liquid].home-page .category-inner a { min-width:0; min-height:36px; padding:6px; font-size:11px; line-height:1.3; white-space:normal; text-align:center; letter-spacing:0; gap:4px; overflow-wrap:anywhere; }
  body[data-fm-liquid].home-page .category-inner i { display:none; }
  :root.fm-iphone body[data-fm-liquid].home-page .services-grid,body[data-fm-liquid].home-page .services-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  body[data-fm-liquid].home-page .service { min-width:0; min-height:0; padding:0; border-radius:12px; overflow:hidden; }
  body[data-fm-liquid].home-page .service-art { aspect-ratio:16/9; max-height:112px; }
  body[data-fm-liquid].home-page .service-top { display:none; }
  body[data-fm-liquid].home-page .service-body { margin:8px 10px 6px; }
  body[data-fm-liquid].home-page .service h3 { font-size:14px; line-height:1.3; min-height:2.6em; margin:0; letter-spacing:-.01em; overflow-wrap:anywhere; }
  /* Full descriptions and prices stay in the existing service dialog. */
  body[data-fm-liquid].home-page .service-body p { display:none; }
  body[data-fm-liquid].home-page .service-more { align-self:stretch; width:auto; max-width:none; margin:0 10px 8px; padding:5px 0 0; border:0; border-top:1px solid #87b7dd30; border-radius:0; background:none; box-shadow:none; font-size:11px; line-height:1.4; gap:4px; }
  body[data-fm-liquid].home-page .service-more span { padding:0; border:0; }
  body[data-fm-liquid].home-page .pricing-note { margin-top:12px; font-size:12px; }
  body[data-fm-liquid].home-page .steps { grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px 12px; padding-top:0; }
  body[data-fm-liquid].home-page .steps li { min-width:0; padding-top:12px; }
  body[data-fm-liquid].home-page .steps h3 { font-size:16px; line-height:1.3; margin:10px 0 8px; overflow-wrap:anywhere; }
  body[data-fm-liquid].home-page .steps p { font-size:13px; line-height:1.5; }
  body[data-fm-liquid].home-page .brand-banner { grid-template-columns:minmax(0,1fr); gap:18px; padding-block:28px; }
  body[data-fm-liquid].home-page .brand-banner h2 { font-size:26px; }
  body[data-fm-liquid].home-page .brand-banner p:not(.eyebrow) { margin:12px 0 16px; font-size:14px; }
  body[data-fm-liquid].home-page .brand-composition { padding:28px 18px 24px; }
  body[data-fm-liquid].home-page .footer { padding-block:24px 16px; }
  body[data-fm-liquid].home-page :is(.footer-inner,.footer-bottom) { flex-wrap:wrap; gap:10px; }
  body[data-fm-liquid].home-page .footer-bottom { margin-top:18px; }

  /* On an unfolded phone the same compact cards can use four columns. */
  @media (min-width:620px) {
    body[data-fm-liquid].home-page .hero-content { grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }
    body[data-fm-liquid].home-page .equipment-carousel { height:300px; }
    :root.fm-iphone body[data-fm-liquid].home-page .services-grid,body[data-fm-liquid].home-page .services-grid { grid-template-columns:repeat(4,minmax(0,1fr)); }
    body[data-fm-liquid].home-page .category-inner { grid-template-columns:repeat(5,minmax(0,1fr)); }
  }
  :is(.account-header,.shop-header,.video-header) { flex-wrap:wrap; height:auto; min-height:56px; gap:6px; padding-block:8px; }
  :is(.account-header nav,.shop-header nav,.video-sidebar nav,.profile-tabs) { display:flex; min-width:0; max-width:100%; overflow-x:auto; flex-wrap:nowrap; gap:6px; scrollbar-width:thin; }
  :is(.account-header nav,.shop-header nav,.video-sidebar nav,.profile-tabs)>a { flex:none; min-height:36px; padding:7px 9px; white-space:nowrap; font-size:12px; }
  :is(.account-header nav,.shop-header nav) { flex-basis:100%; }
  .video-layout { display:block; }
  .video-sidebar { position:static; width:100%; padding:8px 14px; }
  .video-main { margin:0; min-width:0; max-width:100%; padding:12px; }
  .video-search { order:3; width:100%; max-width:none; flex-basis:100%; }
  .video-watch-layout,.social-layout { grid-template-columns:minmax(0,1fr); }
  .social-sidebar { position:static; }
  .profile-identity { flex-wrap:wrap; gap:10px; }
  :is(.profile-name,.profile-identity-actions) { min-width:0; max-width:100%; }
  :is(.account-form,.shop-form) { grid-template-columns:minmax(0,1fr); }
  /* Shared phone spacing across the shop, video library, account and guides. */
  body:not(.crm-theme) .shell { width:calc(100% - 28px); max-width:calc(100% - 28px); }
  :is(.account-header,.shop-header) nav { justify-content:flex-start; }
  .social-page .account-header { min-height:56px; gap:6px; padding-block:8px; }
  .social-page .account-header nav { gap:6px; }
  .social-page .account-header nav a { min-height:36px; padding:7px 9px; font-size:12px; }
  :is(.account-main,.social-page .account-main) { padding-block:18px 32px; }
  .account-main>h1 { font-size:26px; margin:8px 0 16px; }
  .account-card { padding:16px 14px; border-radius:14px; }
  .account-card h2 { font-size:20px; }
  .account-card p { font-size:14px; line-height:1.5; }
  .account-fields { gap:12px; }
  .account-fields label { gap:6px; font-size:14px; }
  .account-fields input { padding:10px 12px; min-height:44px; }
  .account-form-actions { gap:10px; margin-top:18px; }
  .account-welcome>p { margin:12px 0 16px; }
  .profile-photo-editor { gap:12px; margin-block:16px; }
  :is(.profile-avatar,.profile-settings .profile-avatar) { width:64px; height:64px; font-size:24px; }
  .profile-cover { height:130px; }
  .profile-identity { padding-inline:14px; }
  .profile-name h1 { font-size:24px; }
  .profile-identity-actions { padding-top:8px; }
  .profile-stats { flex-wrap:wrap; gap:8px 18px; }
  .profile-stats strong { font-size:18px; }
  .profile-tabs { padding-inline:12px; gap:8px; }
  .profile-body { gap:12px; margin-top:14px; }
  .social-sidebar nav a { min-height:36px; padding:7px 9px; font-size:12px; }
  .account-footer { gap:10px; padding-block:18px; font-size:12px; }
  .shop-main { padding-bottom:32px; }
  .shop-heading { padding:18px 0; }
  .shop-heading h1 { font-size:28px; }
  .shop-heading .eyebrow { margin-bottom:8px; }
  .shop-heading>div>p:last-child { font-size:13px; margin-top:10px; }
  .shop-kind-tabs { gap:6px; margin-bottom:14px; }
  .shop-kind-tabs button { padding:10px 8px; gap:6px; font-size:12px; }
  .shop-tools { gap:8px; margin-bottom:16px; }
  .shop-search input { padding-block:11px; }
  .shop-product-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  .shop-product-photo { aspect-ratio:16/11; }
  .shop-product-photo img { padding:10px; }
  .shop-product-placeholder { min-height:0; height:100%; gap:8px; }
  .shop-product-info { padding:10px; }
  .shop-product-category { margin-bottom:6px; font-size:11px; }
  .shop-product-name { font-size:14px; line-height:1.35; }
  .shop-product-bottom { padding-top:10px; gap:6px; flex-wrap:wrap; }
  .shop-product-bottom>div { min-width:0; max-width:100%; }
  .shop-product-bottom>div strong { font-size:16px; white-space:normal; overflow-wrap:anywhere; }
  .shop-product-bottom>button { width:100%; justify-content:center; min-height:40px; padding:8px; }
  .shop-availability { margin-top:8px; font-size:12px; }
  .video-brand { flex-basis:140px; }
  .video-brand img { width:140px; height:46px; }
  .video-header { padding:6px 12px; }
  .video-main>h1 { font-size:24px; margin-bottom:12px; }
  .video-section-top { gap:8px; margin-bottom:12px; }
  .video-channel-banner { margin-bottom:14px; }
  .video-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px 8px; }
  .video-card-copy { padding:7px 1px 0; }
  .video-card h2 { font-size:14px; line-height:1.35; margin-bottom:4px; }
  .video-card p { font-size:12px; line-height:1.4; }
  .hub-grid { gap:10px; margin-block:14px; }
  .hub-card { padding:14px; border-radius:14px; }
  .hub-card h2 { font-size:20px; margin-bottom:12px; }
  .hub-card p { font-size:14px; line-height:1.55; }
  .book-intro { padding:28px 0; }
  .book-intro h1 { font-size:40px; margin:16px 0 18px; }
  .book-intro .book-subtitle { font-size:15px; }
  .book-section { padding-block:28px; }
  .book-title { gap:14px; margin-bottom:18px; }
  .book-title h2 { font-size:25px; }
  .book-chips { margin-top:18px; gap:6px; }
  .public-navy-theme .book-chips a { min-height:36px; padding:7px 10px; font-size:12px; }

  /* Compact journal chrome, without reducing fields or changing saved entries. */
  .crm-theme .work-journal { gap:10px; }
  .crm-theme .work-journal .section-head { padding:12px; gap:10px; }
  .crm-theme .work-journal .work-chain { gap:8px; padding-inline:12px; }
  .crm-theme .work-journal .work-chain>button { min-height:104px; padding:12px; }
  .crm-theme :is(.workday-groups.is-tiles,.workday-groups.is-rows,.work-entries) { gap:10px; padding:12px; }
  .crm-theme :is(.work-entry-summary,.work-entry-details) { padding:12px; }
  .crm-theme .workday-group-head { padding:12px 12px 8px; }
  .crm-theme .workday-group-counts { padding:0 12px 12px; }
  dialog { max-width:calc(100vw - 24px); max-height:calc(100dvh - 24px); }
  .dialog-content { padding:20px 14px; }
  .dialog-content h2 { font-size:25px; padding-right:28px; }
}

@media screen and (max-width: 619px) {
  .crm-theme :is(.form-grid,.draft-fields,.executor-row,.order-tiles,.warehouse-stock-tiles,.order-service-grid,.board,.schedule,.bank-account-grid,.media-platforms) { grid-template-columns:minmax(0,1fr); }
  .crm-theme .field { grid-column:1; }
  .crm-theme .crm-home { grid-template-columns:minmax(0,1fr); }
  .crm-theme .crm-home .home-widget { grid-column:1/-1; padding:12px; }
  .crm-theme .home-hero-copy { flex-direction:column; align-items:stretch; }
  .crm-theme .home-hero-stats { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .crm-theme .home-hero-stats>button:last-child { grid-column:1/-1; }
  .crm-theme .home-stage-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .crm-theme .home-shortcuts { grid-template-columns:minmax(0,1fr); }
  .crm-theme .bank-expenses,.crm-theme .bank-stats { display:grid; grid-template-columns:minmax(0,1fr); }
  .crm-theme .bank-stats .bank-panel:last-child { grid-column:auto; }
  .crm-theme .bank-operation-account { max-width:100%; text-align:left; }
  .crm-theme .bank-operation-amount { margin-left:auto; }
  .crm-theme .calendar-controls { display:grid; grid-template-columns:44px minmax(0,1fr) 44px; width:100%; }
  .crm-theme .calendar-controls>.secondary { grid-column:1/-1; }
  .crm-theme .calendar-controls input { width:100%; }
  .crm-theme .fm-mobile-menu-grid { gap:6px; }
  .crm-theme .fm-mobile-menu-grid button { padding:10px; gap:8px; }
  .crm-theme .fm-mobile-menu-grid button svg { width:18px; }
  .crm-theme .fm-mobile-menu.crm-modal { padding:14px; }
  body[data-fm-liquid].home-page .header-contacts { gap:2px 8px; }
  body[data-fm-liquid].home-page .contact-label { display:none; }
  body[data-fm-liquid].home-page .contact-number { font-size:12px; }
}

/* Wide foldable viewports must not fall into the old 901px desktop gap. */
@media screen and (min-width: 901px) and (max-width: 1023px) {
  .crm-theme :is(.responsive-table,.responsive-table tbody,.responsive-table tr,.responsive-table td) { display:block; width:100%; min-width:0; white-space:normal; }
  .crm-theme .responsive-table thead,.crm-theme .draft-lines thead { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
  .crm-theme .responsive-table tr { padding:14px; border-bottom:1px solid var(--line); }
  .crm-theme .responsive-table td { padding:8px 0; border:0; overflow-wrap:anywhere; }
  .crm-theme .responsive-table td[data-label]:not([data-label=""])::before { content:attr(data-label); display:block; margin-bottom:6px; font-size:14px; color:var(--muted); }
  .crm-theme .responsive-table .clip-text { max-width:none; white-space:normal; }
  .crm-theme .responsive-table .row-actions { flex-wrap:wrap; }
  .crm-theme :is(.draft-lines,.draft-lines tbody) { display:block; min-width:0; width:100%; }
  .crm-theme .draft-lines tr { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; padding:16px; border-bottom:1px solid var(--line); }
  .crm-theme .draft-lines td { display:block; width:auto; min-width:0; padding:0; white-space:normal; }
  .crm-theme .draft-lines td:first-child,.crm-theme .draft-lines td:nth-child(2),.crm-theme .draft-lines td:last-child { grid-column:1/-1; }
  .crm-theme .draft-lines td::before { content:attr(data-label); display:block; margin-bottom:6px; font-size:14px; color:var(--muted); }
  .crm-theme .draft-lines td:last-child::before { display:none; }
}

/* Mobile CRM density. No desktop selectors or presentation rules escape this gate. */
@media screen and (max-width:1023px) {
  .crm-theme .crm-body-grid>main { padding-top:10px; }
  .crm-theme .crm-screen-switcher { gap:5px; margin-bottom:10px; }
  .crm-theme .crm-screen-switcher button { min-height:36px; padding:6px; gap:4px; font-size:.75rem; }
  .crm-theme :is(.owner-banks,.owner-media) { padding:10px; border-radius:14px; }
  .crm-theme :is(.bank-masthead,.media-heading) { gap:10px; margin-bottom:12px; }
  .crm-theme :is(.bank-masthead h2,.media-heading h2) { font-size:1.375rem; margin:6px 0; }
  .crm-theme :is(.bank-masthead p,.media-panel-head p) { font-size:.75rem; line-height:1.45; }
  .crm-theme :is(.bank-masthead-actions,.media-heading-actions) { flex-direction:row; flex-wrap:wrap; justify-content:flex-start; align-items:center; gap:6px; margin-top:8px; max-width:100%; }
  .crm-theme :is(.bank-btn,.media-control) { min-height:36px; padding:7px 9px; font-size:.75rem; gap:5px; white-space:normal; }
  .crm-theme :is(.bank-panel,.media-glass) { padding:12px; border-radius:12px; }
  .crm-theme :is(.bank-panel h3,.owner-media h3) { font-size:1rem; margin:4px 0; }
  .crm-theme :is(.bank-analytics-grid,.bank-flow-column,.media-main-grid) { gap:10px; margin-bottom:10px; }
  .crm-theme :is(.media-kicker,.media-eyebrow,.bank-eyebrow) { font-size:.6875rem; letter-spacing:.06em; }

  /* Home: short counters, dense order rows, paired small widgets. */
  .crm-theme .crm-home { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  .crm-theme .crm-home .home-widget { padding:10px; border-radius:13px; min-height:0; }
  .crm-theme .crm-home :is(.home-hero,.home-weather,.home-orders,.home-reports,.home-shortcuts) { grid-column:1/-1; }
  .crm-theme .crm-home :is(.home-stock,.home-schedule,.home-tasks) { grid-column:auto; }
  .crm-theme .home-widget-head { gap:6px; margin-bottom:8px; }
  .crm-theme .home-widget-head h2 { font-size:.875rem; gap:6px; }
  .crm-theme .home-widget-head h2 svg { width:16px; height:16px; }
  .crm-theme :is(.home-widget-open,.home-footer-link) { min-height:32px; font-size:.75rem; gap:5px; }
  .crm-theme .home-footer-link { padding-top:8px; flex-wrap:wrap; }
  .crm-theme .home-hero-top { gap:6px; flex-wrap:wrap; }
  .crm-theme .home-eyebrow { font-size:.625rem; letter-spacing:.07em; }
  .crm-theme .home-hero-top time { font-size:1rem; }
  .crm-theme .crm-home .home-hero-copy { margin:8px 0 10px; gap:8px; }
  .crm-theme .home-hero-copy h2 { font-size:1.25rem; line-height:1.2; }
  .crm-theme .home-hero-copy p { font-size:.75rem; line-height:1.4; }
  .crm-theme .home-hero-copy .primary { align-self:flex-start; min-height:36px; padding:7px 10px; font-size:.75rem; }
  .crm-theme .crm-home .home-hero .home-hero-stats { grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; }
  .crm-theme .crm-home .home-hero .home-hero-stats>button { padding:9px 10px; border-radius:10px; }
  .crm-theme .home-hero-stats>button>span { font-size:.75rem; gap:5px; }
  .crm-theme .home-hero-stats>button>strong { font-size:1.5rem; margin:5px 0; letter-spacing:-.02em; }
  .crm-theme .home-hero-stats>button:last-child { grid-column:1/-1; }
  .crm-theme .home-hero-stats>button>.home-money { font-size:1.375rem; margin:5px 0; padding:0; }
  .crm-theme .home-hero-stats small { font-size:.75rem; line-height:1.35; }
  .crm-theme .crm-home .home-hero .home-attention { margin-top:10px; font-size:.75rem; line-height:1.4; }
  .crm-theme .home-stage-grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; margin-bottom:8px; }
  .crm-theme .home-stage-grid>button { padding:7px; gap:4px; }
  .crm-theme .home-stage-grid span { font-size:.75rem; }
  .crm-theme .home-stage-grid strong { font-size:1rem; }
  .crm-theme .crm-home .home-order-list { gap:6px; }
  .crm-theme .crm-home .home-order-list>button { display:grid; grid-template-columns:28px minmax(0,1fr) auto; gap:4px 7px; padding:8px; }
  .crm-theme .home-car-icon { width:28px; height:28px; grid-row:1/3; }
  .crm-theme .home-car-icon svg { width:18px; }
  .crm-theme .home-order-title { min-width:0; grid-column:2; }
  .crm-theme .home-order-title strong { font-size:.875rem; line-height:1.35; }
  .crm-theme .home-order-title small { margin-top:2px; font-size:.75rem; }
  .crm-theme .home-order-list .badge { grid-column:2; margin:0; max-width:100%; justify-self:start; font-size:.6875rem; padding:2px 5px; }
  .crm-theme .home-order-list>button>svg { grid-column:3; grid-row:1/3; }
  .crm-theme .home-cash-value { font-size:1.5rem; letter-spacing:-.02em; }
  .crm-theme .home-period { margin:4px 0 8px; }
  .crm-theme .home-cash-caption { font-size:.75rem; margin-top:5px; }
  .crm-theme .home-cash-bars { gap:12px; margin:14px 0; }
  .crm-theme .home-cash-bars>a>span:first-child { font-size:.75rem; gap:6px; margin-bottom:6px; }
  .crm-theme .home-stat-link { gap:6px; }
  .crm-theme .home-stat-link>strong { font-size:1.75rem; }
  .crm-theme .home-stat-link>span { font-size:.75rem; }
  .crm-theme .home-stock-state { margin-top:8px; font-size:.75rem; line-height:1.4; }
  .crm-theme .crm-home :is(.home-stock-list,.home-mini-list) { margin:10px 0; gap:6px; }
  .crm-theme .crm-home :is(.home-stock-list>a,.home-mini-list>a,.home-mini-list>button) { padding:7px; gap:6px; flex-wrap:wrap; }
  .crm-theme :is(.home-stock-list>a,.home-mini-list strong) { font-size:.8125rem; }
  .crm-theme .home-mini-list small { font-size:.75rem; margin-top:2px; }
  .crm-theme .home-empty { font-size:.75rem; line-height:1.45; padding:8px 0; }
  .crm-theme .home-shortcuts { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  .crm-theme .home-shortcuts>a { padding:10px; gap:7px; }
  .crm-theme .home-shortcut-icon { width:28px; height:28px; border-radius:8px; }
  .crm-theme .home-shortcut-icon svg { width:17px; }
  .crm-theme .home-shortcuts strong { font-size:.8125rem; }
  .crm-theme .home-shortcuts small { font-size:.75rem; line-height:1.35; }
  .crm-theme .home-weather-rich .home-weather-current { min-height:70px; }
  .crm-theme .home-weather-rich .home-weather-reading>strong { font-size:2.5rem; }
  .crm-theme .home-weather-rich .home-weather-reading>span { font-size:.75rem; }
  .crm-theme .home-weather-animation { width:82px; height:75px; }
  .crm-theme .home-weather-animation>.weather-scene { transform:scale(.6); }
  .crm-theme .home-weather-rich .home-weather-facts { font-size:.75rem; margin:2px 0 6px; gap:10px; }
  .crm-theme .home-weather-rich .home-forecast-toolbar { padding-top:6px; margin-bottom:6px; gap:6px; }
  .crm-theme .home-weather-rich .home-forecast-grid>button { padding:6px 3px; gap:2px; }
  .crm-theme .home-weather-rich .home-forecast-grid>button>svg { width:18px; height:18px; margin:0; }
  .crm-theme .home-weather-rich .home-forecast-detail { min-height:36px; padding-top:6px; }
  .crm-theme .home-weather-rich .home-weather-source { font-size:.6875rem; margin-top:6px; }

  /* Pulse: two instruments plus a short full-width time card on a phone. */
  .crm-theme .process-telemetry { padding:12px; border-radius:14px; }
  .crm-theme .telemetry-header { gap:10px; margin-bottom:12px; }
  .crm-theme .telemetry-header h2 { font-size:1.375rem; margin:6px 0; letter-spacing:-.03em; }
  .crm-theme .telemetry-header p { font-size:.75rem; line-height:1.4; }
  .crm-theme .telemetry-header-controls { gap:7px; flex-direction:row; flex-wrap:wrap; align-items:center; }
  .crm-theme .telemetry-live { font-size:.6875rem; }
  .crm-theme .telemetry-period { width:auto; padding:3px; }
  .crm-theme .telemetry-period button { min-height:32px; padding:5px 10px; font-size:.75rem; }
  .crm-theme .telemetry-main { gap:10px; margin-bottom:12px; }
  .crm-theme .telemetry-instruments { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  .crm-theme .telemetry-instrument { display:flex; padding:8px; gap:4px; border-radius:11px; }
  .crm-theme .telemetry-ring { max-width:96px; grid-row:auto; }
  .crm-theme .pulse-ring .pulse-ring-center strong { font-size:1.125rem; }
  .crm-theme .pulse-ring .pulse-ring-center[data-long=true] strong { font-size:.8125rem; }
  .crm-theme .pulse-ring .pulse-ring-center small { font-size:.625rem; line-height:1.15; }
  .crm-theme .telemetry-instrument>p { text-align:center; margin:0 0 3px; min-height:0; font-size:.75rem; line-height:1.3; }
  .crm-theme .telemetry-ring-legend { gap:2px; width:100%; }
  .crm-theme .process-telemetry .pulse-ring-legend>button { padding:4px 2px; min-height:28px; gap:4px; font-size:.75rem; }
  .crm-theme .pulse-ring-legend b { font-size:.75rem; }
  .crm-theme .telemetry-instrument:last-child { grid-column:1/-1; display:grid; grid-template-columns:92px minmax(0,1fr); gap:2px 10px; }
  .crm-theme .telemetry-instrument:last-child .telemetry-ring { grid-row:1/3; }
  .crm-theme .telemetry-instrument:last-child>p { text-align:left; align-self:end; }
  .crm-theme .telemetry-instrument:last-child .telemetry-ring-legend { align-self:start; margin:0; }
  .crm-theme .telemetry-rhythm { padding:10px; }
  .crm-theme .telemetry-chart-title { gap:7px; }
  .crm-theme .telemetry-chart-title h3 { font-size:.875rem; }
  .crm-theme .telemetry-chart-title p { font-size:.6875rem; margin-top:4px; }
  .crm-theme .telemetry-chart { margin-top:8px; min-height:0; max-height:none; }
  .crm-theme .telemetry-chart>svg { min-height:0; max-height:none; }
  .crm-theme .telemetry-chart-readout { gap:6px 10px; font-size:.75rem; padding-top:5px; }
  .crm-theme .telemetry-chart-readout b { font-size:.75rem; }
  .crm-theme .telemetry-stages-head { gap:7px; margin-bottom:8px; }
  .crm-theme .telemetry-status-key { gap:8px; font-size:.6875rem; }
  .crm-theme .process-telemetry .telemetry-stage-flow { grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; }
  .crm-theme .telemetry-stage-flow>button { padding:7px; border-radius:8px; }
  .crm-theme .telemetry-stage-flow strong { font-size:.75rem; margin:5px 0; }
  .crm-theme .telemetry-stage-number { font-size:1.125rem; gap:3px; }
  .crm-theme .telemetry-stage-number small { font-size:.625rem; min-height:0; }
  .crm-theme .telemetry-stage-bar { margin-top:5px; }
  .crm-theme .telemetry-bottom { margin-top:12px; gap:12px; }
  .crm-theme .telemetry-focus-heading { margin-bottom:6px; }
  .crm-theme .telemetry-focus-list { gap:6px; }
  .crm-theme .telemetry-focus-list>div { padding:7px; }
  .crm-theme .telemetry-team-bars { gap:6px; }
  .crm-theme .telemetry-team-bars>button { padding:7px; }
  .crm-theme .telemetry-footnote { padding-top:8px; margin-top:10px; gap:8px; font-size:.6875rem; }

  /* Media and Instagram keep all metrics, with much less framing. */
  .crm-theme .media-toolbar { gap:7px; margin-bottom:12px; }
  .crm-theme .media-platforms { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin-bottom:12px; }
  .crm-theme .media-platform { padding:10px; border-radius:11px; }
  .crm-theme .media-platform-top { flex-direction:row; align-items:center; gap:6px; }
  .crm-theme .media-platform-top>span:nth-child(2) { min-width:0; overflow-wrap:anywhere; }
  .crm-theme .media-platform-top strong { font-size:.8125rem; }
  .crm-theme .media-platform-top small { font-size:.6875rem; }
  .crm-theme .media-mark { width:28px; height:28px; border-radius:8px; }
  .crm-theme .media-mark svg { width:17px; height:17px; }
  .crm-theme .media-card-value { font-size:1.5rem; margin-top:10px; overflow-wrap:anywhere; }
  .crm-theme .media-audience-label { font-size:.75rem; }
  .crm-theme .media-card-bottom { margin-top:8px; padding-top:6px; font-size:.6875rem; line-height:1.4; }
  .crm-theme .media-period button { min-height:32px; padding:5px 8px; font-size:.75rem; }
  .crm-theme .media-date { font-size:.75rem; flex-wrap:wrap; gap:4px; }
  .crm-theme .media-chart { min-height:150px; margin-top:8px; }
  .crm-theme .media-chart-empty { padding:14px 8px; }
  .crm-theme .media-chart-empty>span { width:38px; height:38px; margin-bottom:8px; }
  .crm-theme .media-chart-empty p { font-size:.75rem; }
  .crm-theme .media-chart-axis { margin:6px 0 12px; }
  .crm-theme .media-orbit { width:140px; }
  .crm-theme .media-orbit strong { font-size:1.75rem; }
  .crm-theme .media-orbit-note { font-size:.75rem; margin-bottom:8px; }
  .crm-theme .media-totals { gap:8px; padding-top:10px; }
  .crm-theme .media-table-wrap { margin:12px 0 0; }
  .crm-theme .owner-media table .media-video-row td { padding:10px 12px; }
  .crm-theme .media-public-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin-top:12px; }
  .crm-theme .media-public-kpis>div { padding:10px; gap:6px; border-radius:10px; }
  .crm-theme .media-public-kpis strong { font-size:1.25rem; overflow-wrap:anywhere; }
  .crm-theme .media-public-kpis :is(span,small) { font-size:.75rem; }
  .crm-theme .media-public-kpis>div:last-child:nth-child(odd) { grid-column:1/-1; }
  .crm-theme .media-message { padding:9px; font-size:.75rem; margin-bottom:10px; }
  .crm-theme .media-data-note { font-size:.75rem; margin-top:10px; }
  .crm-theme .ig-report { padding:10px; border-radius:13px; }
  .crm-theme .ig-report-heading { gap:8px; margin-bottom:12px; }
  .crm-theme .ig-profile { gap:9px; }
  .crm-theme .ig-profile-icon { width:38px; height:38px; border-radius:11px; }
  .crm-theme .ig-profile-icon svg { width:23px; }
  .crm-theme .ig-report h2 { font-size:1.25rem; margin:3px 0; }
  .crm-theme .ig-report-actions { gap:8px; }
  .crm-theme .ig-period-bar { gap:7px; padding:9px 0; margin-bottom:12px; }
  .crm-theme .ig-report .ig-action { min-height:34px; padding:6px 9px; gap:5px; font-size:.75rem; }
  .crm-theme :is(.ig-metrics,.ig-explorer-metrics) { grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; margin-bottom:12px; }
  .crm-theme .ig-flow-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; margin-bottom:12px; }
  .crm-theme .ig-flow-net { grid-column:1/-1; }
  .crm-theme .ig-report .ig-metric { padding:10px !important; border-radius:10px; min-height:0; }
  .crm-theme .ig-report .ig-metric>span { font-size:.75rem; line-height:1.35; gap:5px; flex-wrap:wrap; }
  .crm-theme .ig-report .ig-metric>strong { font-size:1.375rem; line-height:1.25; margin:6px 0; letter-spacing:-.025em; }
  .crm-theme .ig-report .ig-metric small { font-size:.6875rem; line-height:1.4; }
  .crm-theme .ig-report .ig-movement-preview>svg { height:36px; }
  .crm-theme .ig-report .ig-movement-empty { min-height:36px; font-size:.75rem !important; }
  .crm-theme .ig-movement-dates { font-size:.6875rem; }
  .crm-theme .ig-report .ig-movement-notice { margin:0 0 12px; }
  .crm-theme .ig-report .ig-tab-list { gap:14px !important; margin-bottom:12px; }
  .crm-theme .ig-report .ig-tab-list button { min-height:38px; padding:7px 0; font-size:.8125rem; }
  .crm-theme :is(.ig-overview-grid,.ig-audience-grid,.ig-content-grid,.ig-social-grid) { gap:10px; }
  .crm-theme .ig-report .ig-card { padding:10px; border-radius:11px; }
  .crm-theme .ig-card-heading { gap:7px; margin-bottom:10px; }
  .crm-theme .ig-report h3 { font-size:1rem; }
  .crm-theme .ig-report :is(.ig-card-heading p,.ig-note) { font-size:.75rem; line-height:1.45; }
  .crm-theme .ig-report .ig-note { margin-top:8px; }
  .crm-theme .ig-report .ig-switch { flex-wrap:wrap; }
  .crm-theme .ig-report .ig-switch button { min-height:32px; padding:5px 7px; font-size:.75rem; }
  .crm-theme .ig-chart-toolbar { gap:8px; margin-bottom:8px; }
  .crm-theme .ig-chart-toolbar>div>span { font-size:1.25rem; }
  .crm-theme .ig-trend>svg { min-height:130px; }
  .crm-theme .ig-chart-access { gap:6px; margin-top:6px; }
  .crm-theme .ig-report .ig-chart-access label { font-size:.75rem; gap:5px; }
  .crm-theme .ig-report .ig-chart-access>span { font-size:.6875rem; line-height:1.45; }
  .crm-theme .ig-breakdown { gap:10px; }
  .crm-theme .ig-ring { width:132px; flex-basis:auto; }
  .crm-theme .ig-ring>div { padding:26px; }
  .crm-theme .ig-ring strong { font-size:1.125rem; }
  .crm-theme .ig-ring span { font-size:.6875rem; }
  .crm-theme .ig-bars { gap:7px; }
  .crm-theme .ig-report .ig-bar-row { padding:8px; }
  .crm-theme .ig-bar-row>div:first-child { flex-wrap:wrap; gap:5px 8px; font-size:.75rem; margin-bottom:5px; }
  .crm-theme .ig-bar-row strong { font-size:.75rem; }
  .crm-theme .ig-bar-row small { margin-left:7px; min-width:0; }
  /* Keep the reserved readout rows: selecting a sector must not shift the page. */
  .crm-theme .ig-report .ig-selection { grid-template-rows:1.25rem 1.25rem 2.125rem; gap:4px; padding:5px 0; }
  .crm-theme .ig-report .ig-selection>strong,.crm-theme .ig-report .ig-selection>span { font-size:.75rem; line-height:1.25rem; }
  .crm-theme .ig-report .ig-selection>.ig-action { min-height:32px; }
  .crm-theme .ig-report .ig-activity-stats { grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; padding-top:10px; margin-top:12px; }
  .crm-theme .ig-report .ig-activity-stats>button { padding:8px; gap:5px; }
  .crm-theme .ig-report .ig-activity-stats span { font-size:.75rem; }
  .crm-theme .ig-report .ig-activity-stats strong { font-size:1.125rem; }
  .crm-theme .ig-report .ig-post-ranking { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
  .crm-theme .ig-empty { min-height:120px; padding:14px; gap:7px; }
  .crm-theme .ig-data-details { padding:10px; margin-top:12px; }
  .crm-theme .ig-content-tools { gap:8px; margin-bottom:12px; }
  .crm-theme .ig-report-footer { margin-top:12px; padding-top:10px; gap:7px; }

  /* Finance: two accounts per row and a compact chart without losing sums. */
  .crm-theme .bank-source { gap:6px 10px; padding:4px 0 10px; font-size:.75rem; }
  .crm-theme .bank-scopebar { gap:6px; margin-bottom:10px; }
  .crm-theme .bank-scopebar .bank-btn { min-width:0; flex:1 1 85px; min-height:36px; padding:7px; font-size:.75rem; gap:4px; }
  .crm-theme .bank-scopebar small { font-size:.6875rem; padding:1px 4px; }
  .crm-theme .bank-account-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin-bottom:12px; }
  .crm-theme .bank-account { padding:10px; border-radius:11px; }
  .crm-theme .bank-account-top { gap:6px; margin-bottom:10px; min-height:26px; font-size:.8125rem; }
  .crm-theme .bank-mark { width:24px; height:24px; border-radius:7px; }
  .crm-theme .bank-account strong { font-size:1.125rem; line-height:1.3; letter-spacing:-.02em; overflow-wrap:anywhere; }
  .crm-theme .bank-account-top span small { margin-top:3px; font-size:.6875rem; }
  .crm-theme .bank-account-select>span:last-child,.crm-theme .bank-account>span:not(.bank-account-top) { font-size:.6875rem; margin-top:5px; }
  .crm-theme .bank-account-foot { font-size:.6875rem; line-height:1.4; margin-top:8px; padding-top:7px; flex-wrap:wrap; gap:4px; }
  .crm-theme .bank-linked-cards { gap:4px; margin-top:8px; }
  .crm-theme .bank-linked-cards>span { padding:4px 6px; font-size:.6875rem; gap:4px; }
  .crm-theme .bank-filterbar { gap:7px; margin-bottom:10px; }
  .crm-theme .bank-segments button { padding:5px 9px; min-height:32px; font-size:.75rem; }
  .crm-theme .bank-period { font-size:.75rem; }
  .crm-theme .bank-period button { width:36px; height:36px; }
  .crm-theme .bank-period label { min-width:0; }
  .crm-theme .bank-select { min-width:0; max-width:100%; }
  .crm-theme .bank-select select { max-width:100%; }
  .crm-theme .bank-expenses { display:grid; grid-template-columns:minmax(0,1fr); gap:8px; }
  .crm-theme .bank-orbit { width:180px; max-width:100%; margin:0 auto; }
  .crm-theme .bank-orbit-center { gap:5px; }
  .crm-theme .bank-orbit-center strong { font-size:.9375rem; white-space:normal; overflow-wrap:anywhere; }
  .crm-theme .bank-category-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; }
  .crm-theme .bank-category-grid button { padding:7px; gap:5px; flex-wrap:wrap; }
  .crm-theme .bank-category-grid :is(span,b) { font-size:.75rem; }
  .crm-theme .bank-category-grid small { font-size:.6875rem; overflow-wrap:anywhere; }
  .crm-theme .bank-panel-note { font-size:.75rem; line-height:1.45; margin-top:8px; }
  .crm-theme .bank-stats { grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; }
  .crm-theme .bank-stats .bank-panel { padding:10px; }
  .crm-theme .bank-stats .bank-panel:last-child { grid-column:1/-1; display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:5px; align-items:center; }
  .crm-theme .bank-stats .bank-panel:last-child small { grid-column:1/-1; }
  .crm-theme .bank-stats .bank-panel>span { font-size:.75rem; }
  .crm-theme .bank-stats strong,.crm-theme .bank-stats .bank-panel:last-child strong { font-size:1.125rem; margin:6px 0; }
  .crm-theme .bank-stats small { font-size:.6875rem; line-height:1.4; }
  .crm-theme .bank-flow { min-height:0; padding:12px; }
  .crm-theme .bank-chart { min-height:135px; height:135px; flex:none; gap:6px; margin-top:6px; }
  .crm-theme .bank-chart-readout { flex-wrap:wrap; gap:5px 8px; min-height:34px; margin-top:7px; font-size:.75rem; }
  .crm-theme .bank-flow-footer { margin-top:8px; padding-top:8px; font-size:.6875rem; }
  .crm-theme .bank-insight { gap:8px; padding:10px; }
  .crm-theme .bank-insight p { font-size:.75rem; line-height:1.45; }
  .crm-theme .bank-operations { margin-top:12px; }
  .crm-theme .bank-operations-tools { margin-top:12px; gap:7px; }
  .crm-theme .bank-operation { padding:10px 0; gap:6px; }
  .crm-theme .bank-operation-description strong { font-size:.8125rem; }
  .crm-theme .bank-operation-description span { font-size:.6875rem; margin-top:3px; }
  .crm-theme .bank-operation-amount { font-size:.875rem; max-width:100%; }
  .crm-theme .bank-operation-account { font-size:.75rem; }
  .crm-theme .bank-empty { padding:18px 8px; }
  .crm-theme .bank-bottom { margin-top:12px; font-size:.6875rem; }
  .crm-theme .report-toolbar { gap:8px; margin-bottom:12px; }
  .crm-theme .report-toolbar :is(.segmented button,.secondary) { min-height:36px; padding:7px 10px; font-size:.8125rem; }
  .crm-theme .metrics { gap:8px; }
  .crm-theme .metric { padding:10px; }
  .crm-theme .metric>strong { font-size:1.125rem; }
  .crm-theme .metric-label { font-size:.8125rem; }
  .crm-theme .erp-finance { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; padding-inline:12px; }

  /* Use an unfolded phone's extra width while preserving the same data/actions. */
  @media (min-width:620px) {
    .crm-theme .crm-home :is(.home-hero,.home-weather,.home-reports) { grid-column:auto; }
    .crm-theme .home-stage-grid { grid-template-columns:repeat(5,minmax(0,1fr)); }
    .crm-theme .telemetry-instruments { grid-template-columns:repeat(3,minmax(0,1fr)); }
    .crm-theme .telemetry-instrument:last-child { grid-column:auto; display:flex; }
    .crm-theme .telemetry-instrument:last-child>p { text-align:center; align-self:stretch; }
    .crm-theme .telemetry-bottom { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .crm-theme .process-telemetry .telemetry-stage-flow { grid-template-columns:repeat(6,minmax(0,1fr)); }
    .crm-theme :is(.media-platforms,.ig-metrics,.bank-account-grid) { grid-template-columns:repeat(4,minmax(0,1fr)); }
    .crm-theme .ig-flow-metrics { grid-template-columns:repeat(3,minmax(0,1fr)); }
    .crm-theme .ig-flow-net { grid-column:auto; }
    .crm-theme .ig-report .has-ring { flex-direction:row; }
    .crm-theme .ig-ring { flex:0 0 132px; }
    .crm-theme .bank-expenses { grid-template-columns:180px minmax(0,1fr); }
    .crm-theme .bank-expenses :is(.bank-panel-head,.bank-panel-note) { grid-column:1/-1; }
    .crm-theme .bank-category-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .crm-theme .bank-stats { grid-template-columns:repeat(3,minmax(0,1fr)); }
    .crm-theme .bank-stats .bank-panel:last-child { grid-column:auto; display:block; }
  }
}

/* Mobile paint budget: keep the neon edges and depth without sampling every
   scrolling surface through a separate blur. Native scrolling has no FPS cap. */
@media screen and (max-width: 1023px) {
  body[data-fm-liquid] {
    background-attachment:scroll !important;
    --fm-liquid-shadow:inset 0 1px 1px #ddecff52,0 3px 5px #0009,0 10px 16px -8px #000b;
    --fm-tile-rest-shadow:inset 0 1px 1px #e5f6ff70,0 3px 0 #030b12,0 10px 16px -6px #000d;
    --fm-tile-lift-shadow:inset 0 1px 1px #effaff80,0 4px 0 #030b12,0 14px 20px -8px #000d;
  }
  body[data-fm-liquid] :is(button,a,input,select,textarea,.glass,.panel,.metric,
    .order-service-category,.order-service-item,.board-card,.catalog-card,
    .warehouse-summary>div,.erp-stock-grid article,[data-slot=card],
    .header,.category-bar,.crm-navy-nav,.sidebar,.workspace-nav,.topbar,
    .crm-return-nav,.order-tab-list,.fm-mobile-appbar,.fm-mobile-dock) {
    -webkit-backdrop-filter:none !important;
    backdrop-filter:none !important;
  }
  /* Opaque bases keep moving content from showing through the fixed bars. */
  body[data-fm-liquid] :is(.header,.category-bar,.crm-navy-nav,.workspace-nav,
    .fm-mobile-appbar,.fm-mobile-dock) { background-color:#101f30; }
  body[data-fm-liquid] :is(.fm-mobile-appbar,.fm-mobile-dock) {
    background-image:linear-gradient(120deg,#14273d,#213b53);
  }
  body[data-fm-liquid].home-page .hero-reel-backdrop { display:none; }
  body[data-fm-liquid].home-page .hero-reel-media {
    background:linear-gradient(#08121d66,#08121d66),var(--hero-poster,url('/assets/finmotors-hero-poster-01f8f3e1ba83.jpg')) center/cover,#08121d;
  }
  /* Keep cached forms/data mounted; an inactive full-page panel needs no
     layout or composited slide layer while the user scrolls another page. */
  .crm-theme .crm-screen-page:not(.is-active) { display:none; transition:none; }
  .crm-theme .crm-screen-page:not(.is-active) * { animation-play-state:paused !important; }
  @media (prefers-reduced-motion:no-preference) {
  .crm-theme .crm-screen-page.is-active { transition:opacity .14s ease-out; }
  /* Do not tween large shadow/filter buffers. The existing selected/pressed
     glow still applies immediately; only the small movement is animated. */
  body[data-fm-liquid] :is(button,a.button,.metric,.order-service-category,
    .order-service-item,.board-card,.home-widget,.ig-card,.ig-metric,
    .bank-card,.pulse-sector-motion) {
    transition-property:transform,opacity !important;
    transition-duration:.12s !important;
    transition-timing-function:ease-out !important;
  }
  body[data-fm-liquid] .field :is(input,select,textarea):focus {
    transition-property:border-color,background-color !important;
  }
  }
  body[data-fm-liquid] .field :is(input,select,textarea):focus { animation:none !important; }
}

/* Compact phone cards and detail surfaces. Keep content at its natural height:
   no page zoom, clipped prices, hidden actions or desktop density changes. */
@media screen and (max-width: 1023px) {
  .crm-theme #crm-root .crm-body-grid>main { padding:8px max(8px,env(safe-area-inset-right)) 16px max(8px,env(safe-area-inset-left)); }
  .crm-theme #crm-root .page-head { gap:6px; margin-bottom:8px; }
  .crm-theme #crm-root .page-head h1 { font-size:20px; line-height:1.25; }
  .crm-theme #crm-root .page-head p { margin-block:4px; line-height:1.4; }
  .crm-theme :is(.section-head,.table-tools,.dialog-head,.dialog-footer) { padding:10px; gap:8px; }
  .crm-theme .section-head h2 { font-size:15px; line-height:1.35; }
  .crm-theme .section-head>div>p { margin-top:4px; line-height:1.4; }
  .crm-theme .padded { padding:10px; }
  .crm-theme .form-body { padding:10px; }
  .crm-theme .empty { padding:22px 12px; }
  .crm-theme .empty-icon { width:40px; height:40px; margin-bottom:10px; border-radius:12px; }
  .crm-theme .empty-icon svg { width:22px; height:22px; }
  .crm-theme .empty p { margin-bottom:12px; }
  .crm-theme .padded>.section-head { padding:0; }
  .crm-theme :is(.head-actions,.tool-group,.row-actions,.draft-toolbar) { gap:6px; }
  .crm-theme .head-actions>* { flex:1 1 auto; }
  .crm-theme :is(.primary,.secondary,.text-button) { padding:7px 9px; font-size:14px; line-height:1.3; }
  .crm-theme :is(.primary,.secondary,.icon-btn) { min-height:40px; }
  .crm-theme .field { gap:5px; }
  .crm-theme .field>span { font-size:13px; line-height:1.35; }
  .crm-theme :is(.form-grid,.draft-fields) { gap:9px; }
  .crm-theme :is(.draft-fields,.draft-service-fields,.draft-total) { padding:10px; }
  .crm-theme :is(.field input,.field select,.field textarea) { padding:8px 9px; }
  .crm-theme .field textarea { min-height:68px; }
  .crm-theme .dialog-footer { gap:6px; }
  .crm-theme .dialog-footer>button { flex:1 1 120px; margin:0; }
  .crm-theme .draft-toolbar { margin-bottom:10px; }
  .crm-theme .draft-sync-status { gap:6px; margin-bottom:10px; font-size:12px; }
  .crm-theme .draft-total { gap:6px; }
  .crm-theme .draft-total>strong { font-size:18px; overflow-wrap:anywhere; }
  .crm-theme .draft-total>small { font-size:12px; line-height:1.4; }

  /* Two orders side by side on narrow phones, more on an unfolded screen. */
  .crm-theme #crm-root .order-tiles { grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; padding:4px 8px 10px; }
  .crm-theme #crm-root .order-tiles .order-tile { min-height:0; padding:9px; gap:5px; border-radius:12px; justify-content:flex-start; }
  .crm-theme #crm-root .order-tile .order-tile-title { gap:5px; font-size:14px; line-height:1.3; }
  .crm-theme #crm-root .order-tile-title>svg { width:16px; height:16px; }
  .crm-theme #crm-root .order-tile .order-tile-vehicle { font-size:12px; line-height:1.3; }
  .crm-theme #crm-root .order-tile .order-tile-number { gap:4px; font-size:13px; line-height:1.3; font-weight:700; }
  .crm-theme #crm-root .order-tile-number .badge { padding:2px 5px; font-size:12px; font-weight:500; line-height:1.25; }
  .crm-theme #crm-root .order-tile>strong.order-tile-price { font-size:clamp(14px,3.7vw,18px); line-height:1.3; white-space:normal; overflow-wrap:anywhere; }
  .crm-theme #crm-root .order-list-views .order-view-tabs { margin:8px 8px 0; max-width:calc(100% - 16px); padding:3px; gap:3px; }
  .crm-theme #crm-root .order-view-tabs [role=tab] { min-height:36px; padding:6px; gap:4px; font-size:12px; }
  .crm-theme #crm-root .drilldown-list>.tabs { gap:3px; padding:4px; flex-wrap:wrap; }
  .crm-theme #crm-root .drilldown-list>.tabs button { padding:7px 8px; font-size:12px; min-height:36px; }
  .crm-theme #crm-root .order-list-views .table-tools { padding:8px; gap:6px; }
  .crm-theme #crm-root .order-list-views .tool-group { gap:6px; }

  /* Open orders: shorter tabs, two-column facts and compact service tiles. */
  .crm-theme .order-tab-workspace>.order-tab-list { padding:5px; gap:3px; }
  .crm-theme .order-tab-list>button { min-height:36px; padding:7px 9px; font-size:13px; }
  .crm-theme .order-detail-fields { grid-template-columns:repeat(2,minmax(0,1fr)); padding:10px; gap:10px 8px; }
  .crm-theme .order-detail-fields dt { margin-bottom:3px; font-size:12px; line-height:1.35; }
  .crm-theme .order-detail-fields dd { font-size:14px; line-height:1.4; }
  .crm-theme .order-tab-panel>.panel+.panel,.crm-theme .order-tab-panel>.order-info-grid+.panel { margin-top:10px; }
  .crm-theme :is(.order-info-grid,.order-side) { gap:10px; }
  .crm-theme :is(.complaint,.files-section,.comments,.timeline) { padding:10px; }
  .crm-theme .complaint p { margin-block:6px; font-size:14px; line-height:1.4; }
  .crm-theme .order-side .side-fields { padding:10px; gap:10px; }
  .crm-theme .side-fields>div>span,.crm-theme .side-fields label>span { margin-bottom:3px; }
  .crm-theme .totals { padding:10px; width:100%; max-width:none; }
  .crm-theme .totals>div { gap:12px; margin-bottom:7px; font-size:14px; line-height:1.35; }
  .crm-theme .totals>div>* { min-width:0; overflow-wrap:anywhere; }
  .crm-theme .totals strong { text-align:right; }
  .crm-theme .total-due { margin-top:9px; padding-top:9px; }
  .crm-theme .totals .text-button { min-height:30px; padding:3px 6px; font-size:12px; }
  .crm-theme .order-contract-link { padding:12px; gap:8px; }
  .crm-theme .order-service-browser { padding:10px; }
  .crm-theme .order-service-toolbar { margin-bottom:10px; gap:6px; }
  .crm-theme .order-service-path { gap:5px; font-size:12px; }
  .crm-theme .order-service-path>strong { font-size:14px; }
  .crm-theme .order-service-search { padding-inline:8px; }
  .crm-theme .order-service-grid.category-grid,.crm-theme .order-service-grid.item-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; }
  .crm-theme .order-service-grid :is(.order-service-category,.order-service-item) { min-height:0; padding:9px; gap:5px; border-radius:12px; }
  .crm-theme .order-service-grid article.order-service-item { padding:8px; gap:6px; }
  .crm-theme .order-service-open { min-height:0; padding:0; gap:5px; }
  .crm-theme .order-service-grid button>strong { font-size:14px; line-height:1.3; }
  .crm-theme .order-service-grid button>b { font-size:14px; line-height:1.3; margin-top:4px; white-space:normal; }
  .crm-theme :is(.order-service-icon,.order-service-icon.small) { width:28px; height:28px; border-radius:8px; }
  .crm-theme .order-service-icon svg { width:18px; height:18px; }
  .crm-theme :is(.order-service-count,.order-service-quantity,.order-service-grid button>small) { font-size:12px; line-height:1.3; }
  .crm-theme .order-service-selection { margin-bottom:8px; gap:8px; font-size:12px; }
  .crm-theme .order-service-selection strong { font-size:14px; }
  .crm-theme .order-service-note { margin-top:10px; font-size:12px; line-height:1.4; }
  .crm-theme .order-work-statuses { gap:5px; }
  .crm-theme .order-work-statuses .order-work-status { padding:6px; gap:5px; }
  .crm-theme .order-work-status :is(b,small) { font-size:12px; line-height:1.3; }
  .crm-theme .order-work-status svg { width:14px; height:14px; }
  .crm-theme .order-work-unassigned { min-height:26px; font-size:12px; }
  .crm-theme .order-work-legend { gap:6px 10px; padding:10px 10px 0; font-size:12px; }
  .crm-theme .order-service-detail { padding:10px; gap:8px; }
  .crm-theme .order-service-detail h2 { font-size:18px; line-height:1.3; }
  .crm-theme .order-service-detail p { font-size:14px; line-height:1.4; }
  .crm-theme .order-service-detail-numbers { grid-template-columns:1fr; gap:6px; padding:10px 0; }
  .crm-theme .order-service-detail-numbers span { display:flex; justify-content:space-between; align-items:baseline; gap:10px; font-size:13px; }
  .crm-theme .order-service-detail-numbers strong { font-size:14px; margin-top:0; text-align:right; }
  .crm-theme .order-service-executors h3 { font-size:14px; margin-bottom:8px; }
  .crm-theme .draft-service-fields { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .crm-theme .draft-service-fields>.field:not(.wide) { grid-column:auto; }
  .crm-theme .draft-service-fields>.wide { grid-column:1/-1; }
  .crm-theme .draft-service-amount { gap:4px; font-size:12px; }
  .crm-theme .draft-service-amount strong { font-size:16px; }

  /* The same compact spacing in the journal, warehouse and detail panels. */
  .crm-theme :is(.work-journal,.employee-page .work-journal) { gap:8px; padding:0; }
  .crm-theme .work-journal .section-head { padding:10px; gap:8px; }
  .crm-theme :is(.work-entries,.workday-groups.is-tiles,.workday-groups.is-rows) { padding:8px; gap:8px; }
  .crm-theme .work-entry-summary { padding:10px; gap:9px; }
  .crm-theme .work-card-main { gap:5px; }
  .crm-theme .work-card-title { font-size:14px; line-height:1.35; }
  .crm-theme .work-card-progress { gap:5px; }
  .crm-theme .work-card-bottom { gap:5px; padding-top:7px; }
  .crm-theme .work-entry-card.is-expanded>.work-entry-summary { padding:10px; gap:8px; }
  .crm-theme .work-entry-card.is-expanded>.work-entry-details { padding:10px; }
  .crm-theme .work-detail-dashboard { gap:12px; }
  .crm-theme .work-detail-person { gap:8px; }
  .crm-theme .work-detail-portrait .staff-avatar.large { width:64px; height:64px; border-radius:14px; }
  .crm-theme .work-detail-portrait .staff-avatar>svg { width:30px; height:30px; }
  .crm-theme .work-detail-identity h3 { font-size:16px; margin:3px 0; }
  .crm-theme .work-detail-identity .text-button { margin-top:4px; }
  .crm-theme .work-detail-order { padding:9px; gap:4px 8px; }
  .crm-theme .work-detail-order>strong { font-size:20px; }
  .crm-theme .work-employee-numbers { margin:9px 0; gap:5px; }
  .crm-theme .work-employee-numbers>div { padding:7px; }
  .crm-theme .work-employee-numbers strong { margin-top:3px; font-size:14px; }
  .crm-theme .work-employee-charts { gap:10px; }
  .crm-theme .work-detail-control { padding-top:10px; }
  .crm-theme .work-detail-dates { gap:5px; margin-bottom:9px; }
  .crm-theme .work-detail-actions { grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; }
  .crm-theme .work-detail-actions>button { padding:7px; font-size:12px; }
  .crm-theme .warehouse-stock-tiles { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; padding:4px 8px 10px; }
  .crm-theme .warehouse-stock-tile { padding:9px; gap:7px; min-height:0; border-radius:12px; }
  .crm-theme .warehouse-stock-tile h3 { font-size:14px; line-height:1.35; }
  .crm-theme .warehouse-stock-tile .inventory-photo-thumbnail .inventory-photo-button { height:84px; padding:7px; }
  .crm-theme .warehouse-stock-tile .inventory-photo-empty.inventory-photo-thumbnail { min-height:84px; }
  .crm-theme .warehouse-stock-tile .inventory-photo-caption { font-size:12px; }
  .crm-theme .warehouse-stock-tile { -webkit-backdrop-filter:none; backdrop-filter:none; }
  .crm-theme :is(.warehouse-tile-caption,.warehouse-tile-oem>span,.warehouse-tile-stock span,.warehouse-tile-details) { font-size:12px; line-height:1.35; }
  .crm-theme .warehouse-tile-oem>strong { font-size:13px; }
  .crm-theme .warehouse-tile-stock { padding-top:7px; gap:6px; }
  .crm-theme .warehouse-tile-stock>div { gap:3px; }
  .crm-theme .warehouse-tile-stock strong { font-size:14px; }
  .crm-theme .warehouse-tile-price { font-size:16px; }
  .crm-theme .warehouse-tile-actions { gap:6px; padding-top:7px; }
  .crm-theme .responsive-table tr { padding:9px; }
  .crm-theme .responsive-table td { padding-block:5px; }
  .crm-theme .responsive-table td[data-label]:not([data-label=""])::before { margin-bottom:3px; }

  /* Public pages share the denser rhythm, preserving the complete content. */
  body[data-fm-liquid].home-page .section { padding-block:22px; }
  body[data-fm-liquid].home-page .section-head { margin-bottom:14px; }
  body[data-fm-liquid].home-page .service-art { max-height:88px; }
  body[data-fm-liquid].home-page .service-body { margin:6px 8px 4px; }
  body[data-fm-liquid].home-page .service h3 { min-height:0; }
  body[data-fm-liquid].home-page .service-more { margin:0 8px 6px; }
  body[data-fm-liquid].home-page .steps { gap:10px; }
  body[data-fm-liquid].home-page .steps li { padding-top:8px; }
  body[data-fm-liquid].home-page .steps h3 { margin:6px 0; font-size:15px; }
  body[data-fm-liquid].home-page .brand-banner { gap:12px; padding-block:22px; }
  body[data-fm-liquid].home-page .footer { padding-block:18px 12px; }
  :is(.account-card,.hub-card) { padding:12px 10px; }
  :is(.account-main>h1,.shop-heading h1,.video-main>h1) { font-size:24px; margin-bottom:10px; }
  :is(.account-card h2,.hub-card h2) { font-size:18px; margin-bottom:8px; }
  :is(.account-fields,.hub-grid,.profile-body) { gap:9px; }
  .account-form-actions { margin-top:12px; gap:6px; }
  .profile-cover { height:108px; }
  .profile-identity { padding-inline:10px; gap:8px; }
  .profile-name h1 { font-size:21px; }
  .profile-body { margin-top:10px; }
  .shop-heading { padding:12px 0; }
  .shop-tools { margin-bottom:10px; }
  .shop-product-photo { aspect-ratio:16/9; }
  .shop-product-info { padding:8px; }
  .shop-product-bottom { padding-top:7px; }
  .video-grid { gap:10px 8px; }
  .video-card-copy { padding-top:5px; }
  .hub-grid { margin-block:10px; }
  .book-intro { padding-block:22px; }
  .book-intro h1 { font-size:32px; margin:12px 0; }
  .book-section { padding-block:22px; }
  .book-title { margin-bottom:12px; }
  .book-title h2 { font-size:22px; }
  .dialog-content { padding:14px 10px; }
  .dialog-content h2 { font-size:22px; }

  @media (min-width:480px) {
    .crm-theme .form-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .crm-theme .form-grid>.field:not(.wide) { grid-column:auto; }
    .crm-theme .form-grid>.wide { grid-column:1/-1; }
    .crm-theme .work-entries.is-tiles { grid-template-columns:repeat(2,minmax(0,1fr)); }
  }
  @media (min-width:620px) {
    .crm-theme #crm-root .order-tiles { grid-template-columns:repeat(3,minmax(0,1fr)); }
    .crm-theme .order-service-grid.category-grid,.crm-theme .order-service-grid.item-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
    .crm-theme .warehouse-stock-tiles { grid-template-columns:repeat(3,minmax(0,1fr)); }
  }
  @media (min-width:840px) {
    .crm-theme #crm-root .order-tiles { grid-template-columns:repeat(4,minmax(0,1fr)); }
    .crm-theme .order-service-grid.category-grid,.crm-theme .order-service-grid.item-grid { grid-template-columns:repeat(4,minmax(0,1fr)); }
    .crm-theme .warehouse-stock-tiles { grid-template-columns:repeat(4,minmax(0,1fr)); }
  }
}

/* Journal phone grid: two cards on a narrow phone, four on an unfolded one.
   Rows/timeline remain explicit alternatives; opened detail spans the grid. */
@media screen and (max-width: 1023px) {
  .crm-theme :is(.work-journal,.workday-dialog) { --fm-journal-columns:2; }
  .crm-theme .work-journal { gap:6px; padding-bottom:8px; }
  .crm-theme .work-journal .section-head { padding:8px; gap:6px; }
  .crm-theme .work-journal .work-journal-head { padding:4px 0 !important; gap:6px; }
  .crm-theme .work-journal .section-head :is(h2,h3) { font-size:15px; line-height:1.3; margin:0; }
  .crm-theme .work-journal .section-head p { margin-top:3px; font-size:12px; line-height:1.35; }
  .crm-theme .work-journal-head>.work-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); width:100%; gap:6px; }
  .crm-theme .work-journal-head>.work-actions button { min-width:0; padding:7px; font-size:13px; }
  .crm-theme .work-instruction { padding:6px 8px; gap:2px; }
  .crm-theme .work-instruction :is(strong,span) { font-size:12px; line-height:1.35; }
  .crm-theme .work-journal :is(.work-warning,.work-saved) { margin:0; padding:6px; gap:5px; font-size:12px; line-height:1.4; }
  .crm-theme .work-journal .work-warning>svg { flex:none; width:16px; height:16px; }
  .crm-theme :is(.work-journal,.workday-dialog) .work-stat-note { font-size:12px; line-height:1.4; }
  .crm-theme .work-journal .work-filters { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; align-items:end; }
  .crm-theme .work-filters>.field { min-width:0; max-width:none; grid-column:auto; }
  .crm-theme .work-filters>button { min-width:0; margin:0; }
  .crm-theme .work-list>.work-filters { padding:0 6px 6px; }
  .crm-theme .work-list>.work-filters>.field:first-child { grid-column:1/-1; }
  .crm-theme :is(.journal-view,.work-view-toggle) { gap:3px; padding:3px; border-radius:9px; }
  .crm-theme :is(.journal-view>button,.work-view-toggle button) { min-height:36px; padding:6px 8px; gap:4px; font-size:12px; }
  .crm-theme .work-list-tools { gap:6px; width:auto; max-width:100%; }
  .crm-theme .work-list-tools>.secondary { padding:7px; font-size:12px; min-height:36px; }

  /* Attendance and workday: the same 2/4 grid, including the expanded board. */
  .crm-theme .attendance-toolbar { padding:0 6px 6px; }
  .crm-theme .attendance-people { padding:0 6px 6px; gap:5px; }
  .crm-theme .attendance-people.is-tiles { grid-template-columns:repeat(var(--fm-journal-columns),minmax(0,1fr)); }
  .crm-theme .attendance-person { padding:6px; gap:4px; border-radius:10px; }
  .crm-theme .attendance-person-link { gap:5px; align-items:flex-start; }
  .crm-theme .attendance-person-link .staff-avatar { width:24px; height:24px; border-radius:8px; }
  .crm-theme .attendance-person-link strong { font-size:14px; line-height:1.3; }
  .crm-theme .attendance-person-link small { margin-top:3px; font-size:12px; line-height:1.3; }
  .crm-theme .attendance-person :is(b,summary,p) { font-size:12px; line-height:1.35; overflow-wrap:anywhere; }
  .crm-theme .attendance-person p { margin-top:5px; }
  .crm-theme .attendance-person>button:not(.attendance-person-link) { padding:6px; font-size:12px; }
  .crm-theme .attendance-people.is-rows>.attendance-person { padding:6px; gap:4px; }
  .crm-theme .workday-board .section-head { padding:6px; gap:6px; }
  .crm-theme .workday-board .section-head p { font-size:12px; line-height:1.35; margin-top:3px; }
  .crm-theme .workday-board .section-head .work-actions { gap:5px; }
  .crm-theme .workday-board .work-actions>.field { flex:1 1 130px; min-width:0; }
  .crm-theme .workday-board .work-actions :is(.secondary,.text-button) { padding:7px; font-size:12px; }
  .crm-theme .workday-toolbar { padding:0 6px 6px; gap:6px; }
  .crm-theme .workday-toolbar .tabs { width:100%; gap:3px; }
  .crm-theme .workday-toolbar .tabs>button { padding:7px; min-height:36px; font-size:12px; flex:1; white-space:normal; }
  .crm-theme .workday-key { font-size:12px; gap:8px; }
  .crm-theme .workday-groups.is-tiles { grid-template-columns:repeat(var(--fm-journal-columns),minmax(0,1fr)); gap:5px; padding:6px; }
  .crm-theme .workday-groups.is-rows { grid-template-columns:minmax(0,1fr); gap:5px; padding:6px; }
  .crm-theme .workday-groups.is-tiles>.workday-group:has(.workday-group-toggle[aria-expanded=true]) { grid-column:1/-1; }
  .crm-theme .workday-group-head { padding:6px 6px 4px; gap:5px; }
  .crm-theme .workday-group-toggle { gap:5px; align-items:flex-start; }
  .crm-theme .workday-group-toggle strong { font-size:14px; line-height:1.3; }
  .crm-theme .workday-group-toggle small { font-size:12px; line-height:1.3; }
  .crm-theme .workday-group-toggle>.staff-avatar,.crm-theme .workday-group-toggle>.detail-state-marker { width:24px; height:24px; border-radius:8px; }
  .crm-theme .workday-group-toggle>.detail-state-marker svg { width:16px; height:16px; }
  .crm-theme .workday-group-toggle>svg:last-child { width:14px; height:14px; }
  .crm-theme .workday-group-head>.workday-assign { min-height:32px; padding:4px 6px; font-size:12px; }
  .crm-theme .workday-group-counts { gap:3px 6px; padding:0 6px 6px; font-size:12px; line-height:1.35; }
  .crm-theme .workday-group-counts>span { min-width:0; gap:3px; white-space:normal; overflow-wrap:anywhere; }
  .crm-theme .workday-operation-list { gap:5px; padding:0 6px 6px; }
  .crm-theme .workday-groups.is-tiles .workday-operation-list { grid-template-columns:repeat(var(--fm-journal-columns),minmax(0,1fr)); }
  .crm-theme .workday-operation { padding:6px; gap:4px; border-radius:9px; }
  .crm-theme .workday-operation>.staff-avatar { width:24px; height:24px; border-radius:7px; }
  .crm-theme .workday-operation-main strong { font-size:14px; line-height:1.3; }
  .crm-theme .workday-operation-main small,.crm-theme .workday-operation-state small { font-size:12px; line-height:1.3; margin-top:3px; overflow-wrap:anywhere; }
  .crm-theme :is(.workday-operation-state,.workday-operation-time) { font-size:12px; line-height:1.3; min-width:0; overflow-wrap:anywhere; }
  .crm-theme .workday-groups.is-tiles .workday-operation { grid-template-columns:24px minmax(0,1fr); gap:4px; align-content:start; }
  .crm-theme .workday-groups.is-tiles :is(.workday-operation-state,.workday-operation-time) { grid-column:1/-1; }
  .crm-theme .workday-service-grid,.crm-theme .workday-groups.is-tiles .workday-service-grid { grid-template-columns:repeat(var(--fm-journal-columns),minmax(0,1fr)); gap:5px; margin-top:6px; }
  .crm-theme .workday-services { padding:4px 6px 6px; font-size:12px; }
  .crm-theme .workday-services .workday-service-card { min-height:0; margin:0; padding:6px; gap:4px; border-radius:9px; }
  .crm-theme .workday-service-plus { width:24px; height:24px; }
  .crm-theme .workday-service-plus svg { width:15px; height:15px; }
  .crm-theme .workday-service-text { gap:3px; }
  .crm-theme .workday-service-text strong { font-size:14px; line-height:1.3; }
  .crm-theme .workday-service-text small { font-size:12px; }
  .crm-theme .workday-canvas { min-width:620px; }
  .crm-theme :is(.workday-axis,.workday-lane) { grid-template-columns:130px minmax(420px,1fr); gap:8px; padding-inline:8px; }
  .crm-theme .workday-axis { padding-block:8px; font-size:12px; }
  .crm-theme .workday-lane { min-height:48px; }
  .crm-theme .workday-label { padding-block:6px; }
  .crm-theme .workday-label strong { font-size:13px; line-height:1.3; }
  .crm-theme .workday-label small { font-size:12px; line-height:1.3; }

  /* Overview, stages and employee statistics. */
  .crm-theme .work-overview { grid-template-columns:minmax(0,1fr); gap:6px; }
  .crm-theme .work-donut-panel { padding:8px; gap:8px; justify-content:flex-start; }
  .crm-theme .work-donut { width:72px; height:72px; }
  .crm-theme .work-donut>div { width:56px; height:56px; }
  .crm-theme .work-donut strong { font-size:21px; }
  .crm-theme .work-donut span { font-size:12px; }
  .crm-theme .work-legend { min-width:0; max-width:none; gap:2px; }
  .crm-theme .work-legend button { padding:3px 0; min-height:28px; gap:8px; }
  .crm-theme .work-state { font-size:12px; gap:4px; white-space:normal; line-height:1.3; }
  .crm-theme .work-numbers { padding:8px; gap:8px; }
  .crm-theme .work-numbers>div,.crm-theme .work-numbers>button { gap:6px; min-width:0; }
  .crm-theme .work-numbers svg { width:16px; height:16px; }
  .crm-theme .work-numbers span { font-size:12px; line-height:1.35; min-width:0; }
  .crm-theme .work-numbers strong { margin-top:3px; font-size:17px; overflow-wrap:anywhere; }
  .crm-theme .work-journal .work-chain { grid-template-columns:repeat(var(--fm-journal-columns),minmax(0,1fr)); padding:0 6px 6px; gap:5px; }
  .crm-theme .work-journal .work-chain>button { min-height:0; padding:6px 20px 6px 6px; gap:3px; }
  .crm-theme .work-chain .work-step { width:22px; height:22px; margin-bottom:0; font-size:12px; }
  .crm-theme .work-chain strong { font-size:14px; line-height:1.3; }
  .crm-theme .work-chain :is(small,em) { font-size:12px; line-height:1.3; }
  .crm-theme .work-chain>button>svg { width:13px; height:13px; top:11px; right:5px; }
  .crm-theme .work-blockers { display:grid; grid-template-columns:repeat(var(--fm-journal-columns),minmax(0,1fr)); padding:6px; gap:5px; }
  .crm-theme .work-blockers>h3 { grid-column:1/-1; font-size:15px; margin:0 0 4px; }
  .crm-theme .work-blockers>div { display:block; min-width:0; padding:6px; border:1px solid var(--line); border-radius:9px; }
  .crm-theme .work-blockers>div:last-child { border:1px solid var(--line); padding-bottom:6px; }
  .crm-theme .work-blockers>div>svg { float:left; width:14px; height:14px; margin:2px 5px 2px 0; }
  .crm-theme .work-blockers strong { font-size:14px; line-height:1.3; overflow-wrap:anywhere; }
  .crm-theme .work-blockers :is(small,p,b) { font-size:12px; line-height:1.35; }
  .crm-theme .work-blockers small { margin-block:4px; }
  .crm-theme .work-blockers p { margin-block:5px; }
  .crm-theme .work-blockers b { display:block; width:auto; margin:0; }
  .crm-theme .work-team-table>summary { padding:8px; font-size:14px; }
  .crm-theme .work-team-table .responsive-table { display:block; min-width:0; }
  .crm-theme .work-team-table .responsive-table tbody { display:grid; grid-template-columns:repeat(var(--fm-journal-columns),minmax(0,1fr)); gap:5px; padding:0 6px 6px; }
  .crm-theme .work-team-table .responsive-table tr { display:block; width:auto; padding:6px; min-width:0; border:1px solid var(--line); border-radius:9px; }
  .crm-theme .work-team-table .responsive-table td { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:start; gap:4px; padding:3px 0; font-size:13px; line-height:1.3; }
  .crm-theme .work-team-table .responsive-table td::before { font-size:12px; line-height:1.3; margin:0; }
  .crm-theme .work-team-table .responsive-table td:first-child { display:block; padding-top:0; }
  .crm-theme .work-team-table .text-button { font-size:14px; padding:4px 0; min-height:32px; }
  .crm-theme .work-team-table table small { margin-top:3px; font-size:12px; line-height:1.3; }

  /* All operations use natural height; only an explicitly opened card spans. */
  .crm-theme .work-journal .work-entries.is-tiles { grid-template-columns:repeat(var(--fm-journal-columns),minmax(0,1fr)); gap:5px; padding:6px; }
  .crm-theme .work-journal .work-entries.is-rows { grid-template-columns:minmax(0,1fr); gap:5px; padding:6px; }
  .crm-theme .work-entry.work-entry-card { border-radius:11px; }
  .crm-theme .work-journal .work-entry-summary { min-height:0; padding:6px; gap:5px; }
  .crm-theme .work-journal .work-card-main { gap:3px; }
  .crm-theme .work-card-state { gap:3px 6px; }
  .crm-theme .work-card-state>span:last-child { font-size:12px; line-height:1.3; }
  .crm-theme .work-card-person { gap:5px; align-items:flex-start; font-size:12px; line-height:1.3; }
  .crm-theme .work-card-person .staff-avatar { width:22px; height:22px; border-radius:7px; }
  .crm-theme .work-card-person>span:last-child { min-width:0; overflow-wrap:anywhere; }
  .crm-theme .work-card-order { font-size:12px; line-height:1.3; }
  .crm-theme .work-card-progress { gap:3px; font-size:12px; line-height:1.3; }
  .crm-theme .work-card-progress-title { gap:5px; overflow-wrap:anywhere; }
  .crm-theme .work-card-step-strip { gap:3px; height:4px; }
  .crm-theme .work-card-bottom { padding-top:4px; gap:3px; font-size:12px; line-height:1.3; }
  .crm-theme .work-card-bottom>span { gap:4px; }
  .crm-theme .work-card-open { font-size:12px; }
  .crm-theme .work-entry-card.is-expanded { grid-column:1/-1; }
  .crm-theme .work-entry-card.is-expanded>.work-entry-summary { grid-template-columns:minmax(0,1fr) auto; height:auto; padding:6px; gap:5px; }
  .crm-theme .work-entry-card.is-expanded .work-card-title { font-size:14px; line-height:1.3; }
  .crm-theme .work-entry-card.is-expanded>.work-entry-details { padding:6px; }
  .crm-theme .work-detail-dashboard { gap:7px; }
  .crm-theme .work-detail-employee { padding-top:8px; }
  .crm-theme .work-detail-notes { margin-top:7px; gap:5px; }
  .crm-theme .work-detail-notes>p { padding:6px 8px; font-size:13px; line-height:1.4; }
  .crm-theme .work-detail-history { margin-top:8px; padding-top:6px; gap:6px; }
  .crm-theme .work-entry-details>.detail-card { margin:8px 0; padding:6px; }
  .crm-theme .detail-overview { gap:6px; align-items:flex-start; }
  .crm-theme .detail-overview h4 { margin-block:3px; font-size:14px; line-height:1.3; }
  .crm-theme .detail-overview p { font-size:12px; line-height:1.35; margin-block:3px; }
  .crm-theme .detail-overview>.detail-state-marker { width:36px; height:36px; }
  .crm-theme .detail-overview>.detail-state-marker svg { width:22px; height:22px; }
  .crm-theme .detail-status-grid { grid-template-columns:repeat(var(--fm-journal-columns,2),minmax(0,1fr)); gap:5px; margin:8px 0 6px; }
  .crm-theme .detail-status-step { padding:6px; border-radius:9px; }
  .crm-theme .detail-status-heading { gap:5px; margin-bottom:6px; align-items:flex-start; }
  .crm-theme .detail-status-heading h5 { font-size:14px; line-height:1.3; }
  .crm-theme .detail-status-heading>div { min-width:0; overflow-wrap:anywhere; }
  .crm-theme .detail-status-heading .detail-state-marker { width:24px; height:24px; }
  .crm-theme .detail-status-heading .detail-state-marker svg { width:15px; height:15px; }
  .crm-theme .detail-state-choices { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:4px; }
  .crm-theme .detail-state-choice { min-width:0; min-height:36px; padding:6px 4px; gap:3px; border-radius:8px; font-size:12px; }
  .crm-theme .detail-state-choice:last-child { grid-column:1/-1; }
  .crm-theme .detail-step-times { margin-top:6px; gap:3px; }
  .crm-theme .detail-step-times small { font-size:12px; line-height:1.3; overflow-wrap:anywhere; }
  .crm-theme .work-form-body { padding:8px; gap:8px; }
  .crm-theme .work-form-grid { gap:6px !important; }
  .crm-theme .work-form-body>p,.crm-theme .work-form-body>small { font-size:12px; line-height:1.4; }
  .crm-theme .work-form-body .work-time-field { padding:7px; }
  .crm-theme .detail-setup-state { padding:6px; gap:6px; }

  .crm-theme .work-journal .work-detail-person { gap:6px; }
  .crm-theme .work-journal .work-detail-portrait .staff-avatar.large { width:56px; height:56px; border-radius:12px; }
  .crm-theme .work-journal .work-detail-portrait .staff-avatar>svg { width:26px; height:26px; }
  .crm-theme .work-journal .work-detail-order { padding:7px; gap:3px 6px; }
  .crm-theme .work-journal .work-employee-numbers { margin:7px 0; gap:4px; }
  .crm-theme .work-journal .work-employee-numbers>div { padding:6px; }
  .crm-theme .work-journal .work-employee-charts { gap:8px; }
  .crm-theme .work-journal .work-insight-empty { padding:10px 8px; margin:6px 0 !important; }
  .crm-theme .work-journal .work-detail-control { padding-top:8px; }
  .crm-theme .work-journal .work-current-duration { margin:8px 0; gap:6px; }
  .crm-theme .work-journal .work-current-duration strong { margin-top:3px; }
  .crm-theme .work-journal .work-detail-dates { gap:4px; margin-bottom:7px; }

  @media (min-width:620px) {
    .crm-theme :is(.work-journal,.workday-dialog) { --fm-journal-columns:4; }
    .crm-theme .work-journal-head>.work-actions { width:auto; }
    .crm-theme .work-journal>.work-filters,.crm-theme .work-list>.work-filters { grid-template-columns:repeat(4,minmax(0,1fr)); }
    .crm-theme .work-list>.work-filters>.field:first-child { grid-column:span 2; }
    .crm-theme .work-overview { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .crm-theme .workday-toolbar .tabs { width:auto; }
  }
}

/* Compact mobile defect assessment. The desktop layout and printable act keep
   their original dimensions; controls edit the same mounted fields. */
@media screen and (max-width: 1023px) {
  .crm-theme .main-shell .crm-body-grid .order-tab-workspace>.order-tab-list { top:var(--fm-return-height,52px); }
  .crm-theme :is(.damage-workspace,.damage-panel) {
    --damage-mobile-columns:2;
    --damage-card-shadow:inset 0 1px 0 #d8f3ff40,0 3px 8px #0006;
  }
  .crm-theme .damage-workspace { gap:10px; }
  .crm-theme .damage-panel { padding:10px; min-width:0; }
  .crm-theme .damage-start { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; padding:8px 10px; }
  .crm-theme .damage-start>* { min-width:0; width:auto; }
  .crm-theme .damage-start .damage-order-field { grid-column:1/-1; min-width:0; gap:5px; }
  .crm-theme .damage-start button { font-size:14px; gap:5px; }
  .crm-theme .damage-order-field .fm-order-picker-trigger { padding:8px 10px; border-radius:10px; }
  .crm-theme .damage-workspace>.panel>.footnote { margin:0; padding:0 10px 10px; }
  .crm-theme .damage-workspace .damage-list { gap:7px; padding:4px 8px 10px; }
  .crm-theme .damage-workspace[data-layout=tiles] .damage-list { grid-template-columns:repeat(var(--damage-mobile-columns),minmax(0,1fr)); }
  .crm-theme .damage-workspace .damage-summary-row { padding:9px; gap:6px; min-height:0; border-radius:11px; backdrop-filter:none; -webkit-backdrop-filter:none; }
  .crm-theme .damage-workspace[data-layout=tiles] .damage-summary-row { grid-template-rows:auto auto auto; align-content:start; }
  .crm-theme .damage-workspace .damage-summary-row strong { font-size:14px; line-height:1.3; }
  .crm-theme .damage-workspace .damage-summary-row small { margin-top:3px; font-size:12px; line-height:1.3; }
  .crm-theme .damage-workspace[data-layout=tiles] .damage-summary-row>div:nth-child(2)>strong { font-size:15px; }
  .crm-theme .damage-workspace .damage-summary-row>div:last-child>strong { font-size:12px; font-weight:500; }
  .crm-theme :is(.damage-workspace,.damage-panel) .damage-view-toolbar { gap:6px; }
  .crm-theme .damage-panel>.damage-view-toolbar { margin-bottom:10px; padding:6px 8px; border-radius:10px; }
  .crm-theme :is(.damage-workspace,.damage-panel) .damage-view-toolbar>span { font-size:12px; line-height:1.3; }
  .crm-theme :is(.damage-workspace,.damage-panel) .damage-view-switch button { min-height:36px; padding:6px 8px; gap:5px; font-size:13px; }
  .crm-theme .damage-panel .contract-intro { gap:8px; margin-bottom:8px; }
  .crm-theme .damage-panel .contract-intro>svg { width:20px; height:20px; }
  .crm-theme .damage-panel .contract-intro h2 { font-size:16px; line-height:1.3; }
  .crm-theme .damage-panel :is(.contract-intro p,.contract-help,.form-note,.field-note) { margin:6px 0 10px; font-size:13px; line-height:1.4; overflow-wrap:anywhere; }
  .crm-theme .damage-panel .damage-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; }
  .crm-theme .damage-metrics>div { padding:8px; min-width:0; border-radius:10px; }
  .crm-theme .damage-metrics :is(span,small) { font-size:12px; line-height:1.35; }
  .crm-theme .damage-metrics strong { margin-top:5px; font-size:16px; line-height:1.3; overflow-wrap:anywhere; }
  .crm-theme .damage-metrics small { margin-top:3px; }
  .crm-theme .damage-metrics>div:last-child { grid-column:1/-1; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-items:center; gap:3px 8px; }
  .crm-theme .damage-metrics>div:last-child strong { margin:0; text-align:right; }
  .crm-theme .damage-metrics>div:last-child small { grid-column:1/-1; }
  .crm-theme .damage-panel .damage-tabs { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:5px; padding:0; margin:10px 0; overflow:visible; }
  .crm-theme .damage-panel .damage-tabs button { display:flex; align-items:center; justify-content:flex-start; min-width:0; min-height:44px; padding:6px 8px; gap:6px; border-radius:9px; font-size:14px; line-height:1.25; white-space:normal; text-align:left; }
  .crm-theme .damage-mobile-icon[hidden] { display:inline-flex; flex:none; color:#8bd7ff; }
  .crm-theme .damage-panel :is(.damage-section-head,.damage-item-head) { gap:8px; margin:10px 0 8px; }
  .crm-theme .damage-panel .damage-section-head h3 { min-width:0; font-size:14px; line-height:1.3; }
  .crm-theme .damage-panel .damage-section-head>button { flex:none; gap:4px; padding:6px 8px; }
  .crm-theme .damage-panel .damage-entry-list { gap:7px; margin:8px 0 12px; }
  .crm-theme .damage-panel[data-items-layout=tiles] .damage-entry-list { grid-template-columns:repeat(var(--damage-mobile-columns),minmax(0,1fr)); gap:7px; }
  .crm-theme .damage-panel .damage-parts-columns { display:none; }
  .crm-theme .damage-panel .damage-entry { border-radius:11px; backdrop-filter:none; -webkit-backdrop-filter:none; }
  .crm-theme .damage-panel .damage-entry>summary { grid-template-columns:22px minmax(0,1fr); min-height:0; padding:9px 28px 9px 9px; gap:5px 7px; align-items:start; }
  .crm-theme .damage-panel .damage-entry>summary>span { grid-column:2; text-align:left; font-size:13px; line-height:1.3; }
  .crm-theme .damage-panel .damage-entry>summary>span:first-child { grid-column:1; grid-row:1; display:flex; align-items:center; justify-content:center; width:22px; min-height:22px; border:1px solid #7dc8f344; border-radius:7px; background:#209adc22; color:#b6eaff; font-size:12px; }
  .crm-theme .damage-panel .damage-entry>summary strong { font-size:14px; line-height:1.3; padding-right:0; }
  .crm-theme .damage-panel .damage-entry>summary small { margin-top:3px; font-size:12px; line-height:1.3; }
  .crm-theme .damage-panel .damage-entry>summary .damage-entry-total { font-size:14px; line-height:1.3; }
  .crm-theme .damage-panel .damage-entry>summary::after { top:16px; right:11px; }
  .crm-theme .damage-panel .damage-entry[open]>summary::after { top:19px; }
  .crm-theme .damage-panel .damage-entry[open]>.damage-part-summary>span:nth-child(3),
  .crm-theme .damage-panel .damage-entry[open]>.damage-part-summary>span:nth-child(4) { display:none; }
  .crm-theme .damage-panel[data-items-layout=tiles] .damage-entry:not([open])>summary { grid-template-columns:22px minmax(0,1fr); min-height:0; padding:9px; gap:5px 6px; }
  .crm-theme .damage-panel[data-items-layout=tiles] .damage-entry:not([open])>summary>span { grid-column:1/-1; align-self:start; text-align:left; }
  .crm-theme .damage-panel[data-items-layout=tiles] .damage-entry:not([open])>summary>span:first-child { grid-column:1; }
  .crm-theme .damage-panel[data-items-layout=tiles] .damage-entry:not([open])>.damage-part-summary>span:nth-child(4) { grid-column:2; grid-row:1; padding-right:15px; align-self:center; font-size:12px; }
  .crm-theme .damage-panel[data-items-layout=tiles] .damage-entry:not([open])>summary>span:last-child { font-size:14px; line-height:1.3; }
  .crm-theme .damage-panel[data-items-layout=tiles] .damage-entry:not([open])>.damage-part-summary .damage-part-number small { font-size:12px; }
  .crm-theme .damage-panel .damage-entry-body { padding:9px; }
  .crm-theme .damage-panel .damage-item-head { margin:0 0 8px; }
  .crm-theme .damage-panel .damage-item-head strong { min-width:0; font-size:14px; line-height:1.35; overflow-wrap:anywhere; }
  .crm-theme .damage-panel .damage-item-head .icon-btn { flex:none; width:40px; min-height:40px; }
  .crm-theme .damage-panel .form-grid { grid-template-columns:repeat(2,minmax(0,1fr)); align-items:end; gap:8px; margin:8px 0; }
  .crm-theme .damage-panel .form-grid>.field { grid-column:auto; }
  .crm-theme .damage-panel .form-grid>.wide,
  .crm-theme .damage-panel .form-grid>[data-damage-field=name],
  .crm-theme .damage-panel .form-grid>[data-damage-field=supplier],
  .crm-theme .damage-panel .form-grid>.field:has(.fm-date-input) { grid-column:1/-1; }
  .crm-theme .damage-panel .field textarea { min-height:60px; padding:7px 8px; line-height:1.35; }
  .crm-theme .damage-panel .damage-eta { margin:8px 0 0; font-size:13px; line-height:1.4; }
  .crm-theme .damage-panel .damage-readonly-fields { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  .crm-theme .damage-panel .damage-readonly-fields dt { font-size:12px; line-height:1.3; }
  .crm-theme .damage-panel .damage-readonly-fields dd { margin-top:3px; font-size:14px; line-height:1.35; }
  .crm-theme .damage-panel .damage-readonly-fields>div:first-child,
  .crm-theme .damage-panel .damage-readonly-fields>div:nth-child(n+5) { grid-column:1/-1; }
  .crm-theme .damage-panel .damage-empty { margin:8px 0; padding:10px 0; font-size:14px; line-height:1.4; }
  .crm-theme .damage-panel .damage-photo-choice { min-height:44px; padding:6px 0; gap:7px; font-size:13px; line-height:1.35; overflow-wrap:anywhere; }
  .crm-theme .damage-panel .damage-photo-choice input { flex:none; }
  .crm-theme .damage-panel .damage-footer { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; padding-top:10px; margin-top:12px; }
  .crm-theme .damage-panel .damage-footer>button { min-width:0; min-height:44px; margin:0; gap:5px; padding:7px; font-size:14px; line-height:1.3; }
  .crm-theme .damage-panel .damage-footer>.pdf-download { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); grid-column:1/-1; min-width:0; gap:6px; }
  .crm-theme .damage-panel .damage-footer .pdf-download>:is(button,a) { min-width:0; min-height:44px; padding:7px; gap:5px; font-size:14px; line-height:1.3; }
  .crm-theme .damage-panel .damage-footer .pdf-download>:is(small,.error-box) { grid-column:1/-1; min-width:0; max-width:none; font-size:12px; line-height:1.35; }
  .crm-theme .damage-print-preview { padding:10px; }
  .crm-theme .damage-print-preview .print-preview-toolbar { gap:8px; flex-wrap:wrap; margin-bottom:10px; }
  .crm-theme .damage-print-preview .print-preview-toolbar>div { flex-basis:100%; }
  .crm-theme .damage-print-preview .print-preview-toolbar h1 { font-size:20px; }

  @media (min-width:620px) {
    .crm-theme :is(.damage-workspace,.damage-panel) { --damage-mobile-columns:4; }
    .crm-theme .damage-panel .damage-tabs { grid-template-columns:repeat(4,minmax(0,1fr)); }
    .crm-theme .damage-panel .damage-metrics { grid-template-columns:repeat(3,minmax(0,1fr)); }
    .crm-theme .damage-metrics>div:last-child { grid-column:auto; display:block; }
    .crm-theme .damage-metrics>div:last-child strong { margin-top:5px; text-align:left; }
    .crm-theme .damage-panel .form-grid>.field:has(.fm-date-input) { grid-column:auto; }
  }
}

/* The forecast owns one bounded scroll area. An unbounded inner scroller with
   overscroll containment consumes touch gestures before the outer dialog can scroll. */
@media screen and (max-width: 1023px) {
  .crm-theme .weather-day-dialog.crm-modal,dialog.bw-weather-details[open] {
    --fm-weather-top:max(12px,env(safe-area-inset-top));
    --fm-weather-bottom:max(12px,env(safe-area-inset-bottom));
    --fm-weather-left:max(12px,env(safe-area-inset-left));
    --fm-weather-right:max(12px,env(safe-area-inset-right));
    position:fixed;
    inset:var(--fm-weather-top) var(--fm-weather-right) var(--fm-weather-bottom) var(--fm-weather-left) !important;
    margin:auto !important;
    display:flex;
    flex-direction:column;
    gap:0;
    box-sizing:border-box;
    width:min(720px,calc(100vw - var(--fm-weather-left) - var(--fm-weather-right))) !important;
    max-width:calc(100vw - var(--fm-weather-left) - var(--fm-weather-right)) !important;
    height:calc(100dvh - var(--fm-weather-top) - var(--fm-weather-bottom)) !important;
    max-height:calc(100dvh - var(--fm-weather-top) - var(--fm-weather-bottom)) !important;
    min-height:0;
    overflow:hidden !important;
  }
  .weather-day-dialog>.dialog-head,.bw-weather-details>.bw-dialog-head { position:static; flex:0 0 auto; min-width:0; margin:0; }
  .weather-day-dialog>.dialog-head>div,.bw-weather-details>.bw-dialog-head>h2 { min-width:0; flex:1; overflow-wrap:anywhere; }
  .weather-day-dialog>.dialog-head .weather-day-note { margin:4px 0 0; }
  .weather-day-dialog>.dialog-head>button,.bw-weather-details>.bw-dialog-head>button { flex:none; width:44px; min-height:44px; }
  .weather-day-dialog>.weather-day-scroll,.bw-weather-details>.bw-dialog-body {
    flex:1 1 0%;
    min-height:0;
    min-width:0;
    overflow-y:auto;
    overflow-x:hidden;
    overscroll-behavior-y:contain;
    -webkit-overflow-scrolling:touch;
    scroll-padding-block:12px;
    scrollbar-width:thin;
  }
}

/* Client lists and the customer's service area have their own phone density. */
@media screen and (max-width: 1023px) {
  .mobile-clients,.account-clients,#hub-root[data-path="/account/service"] { --fm-client-columns:2; }
  .crm-theme .mobile-clients-toolbar { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:6px; padding:0 8px 8px; }
  .crm-theme .mobile-clients-toolbar>span { font-size:12px; color:var(--muted); }
  .crm-theme .mobile-clients .record-view-toggle { padding:3px; gap:3px; border-radius:10px; }
  .crm-theme .mobile-clients .record-view-toggle>button { min-height:40px; padding:6px 8px; gap:4px; font-size:13px; }
  .crm-theme .mobile-client-grid { display:grid; grid-template-columns:repeat(var(--fm-client-columns),minmax(0,1fr)); align-items:start; gap:7px; padding:0 8px 10px; }
  .crm-theme .mobile-client-grid[data-record-view=rows] { grid-template-columns:minmax(0,1fr); }
  .crm-theme .mobile-client-card { min-width:0; border:1px solid #72b6df55; border-radius:11px; background:linear-gradient(145deg,#17364c,#111f33); box-shadow:inset 0 1px #ccf4ff26,0 3px 8px #0004; }
  .crm-theme .mobile-client-card>summary { display:grid; grid-template-columns:26px minmax(0,1fr) 15px; gap:5px; align-items:center; padding:9px; cursor:pointer; list-style:none; min-height:44px; border-radius:10px; }
  .crm-theme .mobile-client-card>summary::-webkit-details-marker { display:none; }
  .crm-theme .mobile-client-card>summary:focus-visible { outline:2px solid #8ad9ff; outline-offset:2px; }
  .crm-theme .mobile-client-card>summary>.avatar { width:26px; height:26px; border-radius:8px; font-size:12px; background:#208ecc2b; color:#b6eaff; }
  .crm-theme .mobile-client-card>summary>strong { min-width:0; font-size:14px; line-height:1.3; overflow-wrap:anywhere; }
  .crm-theme .mobile-client-chevron { color:#90cdec; }
  .crm-theme .mobile-client-contact { grid-column:1/-1; font-size:12px; line-height:1.3; overflow-wrap:anywhere; color:#bed7e5; }
  .crm-theme .mobile-client-counts { grid-column:1/-1; display:flex; flex-wrap:wrap; gap:4px 8px; color:#a6c5d9; font-size:12px; line-height:1.3; }
  .crm-theme .mobile-client-counts>span { display:inline-flex; align-items:center; gap:4px; }
  .crm-theme .mobile-client-card[open] { grid-column:1/-1; border-color:#63ccf2; }
  .crm-theme .mobile-client-card[open]>summary { border-bottom:1px solid #72b6df33; }
  .crm-theme .mobile-client-card[open] .mobile-client-chevron { transform:rotate(180deg); }
  .crm-theme .mobile-client-body { padding:9px; min-width:0; }
  .crm-theme .mobile-client-links { display:flex; flex-wrap:wrap; gap:5px 12px; }
  .crm-theme .mobile-client-links>a { display:flex; align-items:center; gap:6px; min-width:0; min-height:40px; font-size:14px; overflow-wrap:anywhere; color:#a9e5ff; }
  .crm-theme .mobile-client-links svg { flex:none; }
  .crm-theme .mobile-client-body dl { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin:6px 0 10px; }
  .crm-theme .mobile-client-body dl>div { min-width:0; }
  .crm-theme .mobile-client-body dt { color:var(--muted); font-size:12px; line-height:1.3; }
  .crm-theme .mobile-client-body dd { margin:4px 0 0; font-size:14px; line-height:1.4; white-space:pre-wrap; overflow-wrap:anywhere; }
  .crm-theme .mobile-client-body dd>span { display:block; margin-bottom:4px; }
  .crm-theme .mobile-client-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; }
  .crm-theme .mobile-client-actions>button { min-width:0; min-height:44px; font-size:14px; padding:7px; gap:5px; }
  .crm-theme form[data-editor-kind=client] .form-body { padding:10px; }
  .crm-theme form[data-editor-kind=client] .form-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  .crm-theme form[data-editor-kind=client] .form-grid>.field { grid-column:auto; }
  .crm-theme form[data-editor-kind=client] .form-grid>.wide { grid-column:1/-1; }
  .crm-theme form[data-editor-kind=client] textarea { min-height:64px; }
  .crm-theme form[data-editor-kind=client] .dialog-footer { padding:8px 10px; gap:6px; }

  /* Existing table rows become labelled tiles, with all values retained. */
  .account-clients .client-table-wrap,#hub-root[data-path="/account/service"] .hub-table-wrap { overflow:visible; min-width:0; }
  .account-clients .client-table,#hub-root[data-path="/account/service"] .hub-table { display:block; width:100%; min-width:0; }
  .account-clients .client-table>thead,#hub-root[data-path="/account/service"] .hub-table>thead { position:absolute; width:1px; height:1px; margin:-1px; overflow:hidden; clip-path:inset(50%); }
  .account-clients .client-table>tbody,#hub-root[data-path="/account/service"] .hub-table>tbody { display:grid; grid-template-columns:repeat(var(--fm-client-columns),minmax(0,1fr)); gap:7px; align-items:start; }
  .account-clients .client-table>tbody>tr,#hub-root[data-path="/account/service"] .hub-table>tbody>tr { display:grid; align-content:start; gap:5px; min-width:0; padding:9px; border:1px solid #6cadd94d; border-radius:11px; background:linear-gradient(145deg,#17364c,#111f33); box-shadow:inset 0 1px #ccf4ff26,0 3px 8px #0003; }
  .account-clients .client-table td,#hub-root[data-path="/account/service"] .hub-table td { display:block; width:auto; min-width:0; max-width:none; padding:0; border:0; font-size:14px; line-height:1.35; white-space:normal; overflow-wrap:anywhere; }
  .account-clients .client-table td::before,#hub-root[data-path="/account/service"] .hub-table td::before { content:attr(data-label); display:block; font-size:12px; line-height:1.3; color:#9fbed3; margin-bottom:2px; }
  .account-clients .client-table td:first-child,#hub-root[data-path="/account/service"] .hub-table td:first-child { font-weight:600; }
  #hub-root[data-path="/account/service"] .hub-table a { display:inline-flex; align-items:center; min-height:40px; color:#a9e5ff; }
  .account-clients .account-card-heading { gap:8px; flex-wrap:wrap; margin-bottom:10px; }
  .account-clients .account-card-heading h2 { font-size:17px; }
  .account-clients .account-badge { padding:4px 7px; font-size:12px; }
  .account-clients .account-pagination { margin-top:10px; gap:6px; flex-wrap:wrap; }
  .account-clients .account-pagination a { min-height:40px; padding:7px 9px; font-size:13px; }

  /* The client portal stays isolated from community and administration pages. */
  #hub-root[data-path="/account/service"] { min-width:0; }
  #hub-root[data-path="/account/service"] .hub-nav { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:5px; margin:8px 0; }
  #hub-root[data-path="/account/service"] .hub-nav>a { display:flex; align-items:center; min-height:40px; padding:6px 8px; border:1px solid #648bab40; border-radius:9px; background:#11283d; font-size:13px; line-height:1.3; }
  #hub-root[data-path="/account/service"] .hub-card { padding:10px; border-radius:12px; margin-block:8px; }
  #hub-root[data-path="/account/service"] .hub-card h2 { font-size:16px; line-height:1.3; margin-bottom:8px; }
  #hub-root[data-path="/account/service"] .hub-card h3 { font-size:14px; line-height:1.3; margin:8px 0 4px; }
  #hub-root[data-path="/account/service"] .hub-card p { font-size:14px; line-height:1.4; margin-block:6px; }
  #hub-root[data-path="/account/service"] .hub-grid { gap:7px; margin-block:8px; }
  #hub-root[data-path="/account/service"] .hub-grid>.hub-card { margin:0; }
  #hub-root[data-path="/account/service"] .hub-form { gap:8px; }
  #hub-root[data-path="/account/service"] .hub-form label { gap:4px; font-size:13px; line-height:1.35; }
  #hub-root[data-path="/account/service"] .hub-form :is(input,select,textarea) { min-height:44px; padding:8px; }
  #hub-root[data-path="/account/service"] .hub-form textarea { min-height:68px; }
  #hub-root[data-path="/account/service"] .hub-form button { min-height:44px; padding:7px 9px; font-size:14px; }
  #hub-root[data-path="/account/service"] .hub-msg:empty { min-height:0; margin:0; }
  #hub-root[data-path="/account/service"] .repair-stages { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:5px; padding:6px 0; margin-block:8px; overflow:visible; }
  #hub-root[data-path="/account/service"] .repair-stages li { min-width:0; padding:6px; border-radius:8px; font-size:12px; line-height:1.3; overflow-wrap:anywhere; }
  #hub-root[data-path="/account/service"] .hub-details { padding:8px 0; }
  #hub-root[data-path="/account/service"] .hub-details>summary { min-height:40px; padding:6px 0; font-size:14px; line-height:1.4; }

  @media (min-width:620px) {
    .mobile-clients,.account-clients,#hub-root[data-path="/account/service"] { --fm-client-columns:4; }
    #hub-root[data-path="/account/service"] .hub-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
    #hub-root[data-path="/account/service"] .hub-grid .hub-table>tbody { grid-template-columns:repeat(2,minmax(0,1fr)); }
    #hub-root[data-path="/account/service"] .repair-stages { grid-template-columns:repeat(4,minmax(0,1fr)); }
  }
}

/* One compact link strip on phones. Labels and the original desktop markup
   remain available; role-gated links retain their native hidden attribute. */
@media screen and (max-width:1023px) {
  :root body[data-fm-liquid] [data-mobile-icon-nav]:not([hidden]) {
    display:flex; flex-direction:row; flex-wrap:nowrap; align-items:center; justify-content:center;
    width:100%; max-width:100%; min-width:0; gap:2px; padding:4px;
    margin:0; max-height:none; overflow:visible; box-sizing:border-box;
  }
  :root body[data-fm-liquid] [data-mobile-icon-nav]>a:not([hidden]) {
    position:relative; display:flex; flex:1 1 0; align-items:center; justify-content:center;
    width:auto; min-width:0; max-width:44px; height:40px; min-height:40px;
    margin:0; padding:0; gap:0; border-radius:9px; box-sizing:border-box;
  }
  :root body[data-fm-liquid] [data-mobile-icon-nav] .fm-mobile-nav-icon {
    display:grid !important; place-items:center; flex:none; width:18px; height:18px;
  }
  :root body[data-fm-liquid] [data-mobile-icon-nav] .fm-mobile-nav-icon>svg {
    display:block; width:18px; height:18px; margin:0; flex:none;
  }
  :root body[data-fm-liquid] [data-mobile-icon-nav] .fm-mobile-nav-label {
    position:absolute; width:1px; height:1px; padding:0; margin:-1px;
    overflow:hidden; clip-path:inset(50%); white-space:nowrap; border:0;
  }
  :root body[data-fm-liquid] [data-mobile-icon-nav]>a>svg { display:none; }
  :root body[data-fm-liquid] [data-mobile-icon-nav]>a:focus-visible {
    outline:2px solid #76ecff; outline-offset:1px;
  }
}

/* All nine services fit in one mobile row, with FinMotors M-palette accents. */
@media screen and (max-width:1023px) {
  body[data-fm-liquid].home-page .category-inner[data-service-icon-nav] {
    display:grid; grid-template-columns:repeat(9,minmax(0,1fr));
    width:min(680px,calc(100% - 24px)); max-width:100%; gap:4px;
    padding:7px 0; margin-inline:auto; overflow:visible;
  }
  body[data-fm-liquid].home-page [data-service-icon-nav]>a {
    --service-accent:#58c8ff; --service-tint:#58c8ff24; --service-edge:#58c8ff66;
    position:relative; display:flex; align-items:center; justify-content:center;
    min-width:0; width:100%; height:44px; min-height:44px; padding:3px; gap:0;
    color:var(--service-accent); border:1px solid var(--service-edge); border-radius:10px;
    background:radial-gradient(ellipse at 50% 0,var(--service-tint),transparent 78%),linear-gradient(145deg,#20344c,#101c2e);
    box-shadow:0 5px 9px -5px #000c,inset 0 1px #d6eeff29,inset 0 -1px #0004;
    transition:background .18s,border-color .18s,box-shadow .18s;
  }
  body[data-fm-liquid].home-page [data-service-icon-nav]>a:is([data-open=paint],[data-open=polish],[data-open=tuning]) {
    --service-accent:#839eff; --service-tint:#315dff30; --service-edge:#527aff80;
  }
  body[data-fm-liquid].home-page [data-service-icon-nav]>a:is([data-open=pdr],[data-open=protect],[data-open=armature]) {
    --service-accent:#ff677e; --service-tint:#f52e4f25; --service-edge:#ff526c66;
  }
  body[data-fm-liquid].home-page [data-service-icon-nav]>a::after {
    content:""; position:absolute; bottom:4px; left:35%; right:35%; height:2px;
    border-radius:2px; background:var(--service-accent); opacity:.8;
  }
  body[data-fm-liquid].home-page [data-service-icon-nav] .fm-service-nav-icon {
    display:grid!important; place-items:center; width:22px; height:22px; flex:none;
    filter:drop-shadow(0 1px 4px var(--service-tint));
  }
  body[data-fm-liquid].home-page [data-service-icon-nav] .fm-service-nav-icon>svg {display:block;width:22px;height:22px}
  body[data-fm-liquid].home-page [data-service-icon-nav] .fm-service-nav-label {
    position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden;
    clip-path:inset(50%); white-space:nowrap; border:0;
  }
  body[data-fm-liquid].home-page [data-service-icon-nav]>a:is(:active,:focus-visible) {
    color:#f0faff; border-color:var(--service-accent); background:linear-gradient(145deg,var(--service-tint),#1b2a43);
    box-shadow:0 0 0 1px var(--service-edge),0 0 13px var(--service-tint),inset 0 1px #effaff55;
    outline:2px solid var(--service-accent); outline-offset:1px;
  }
  @media(hover:hover) and (pointer:fine) {
    body[data-fm-liquid].home-page [data-service-icon-nav]>a:hover {color:#f0faff;border-color:var(--service-accent);box-shadow:0 0 12px var(--service-tint),inset 0 1px #effaff55}
  }
  @media(forced-colors:active) {
    body[data-fm-liquid].home-page [data-service-icon-nav]>a {color:ButtonText;border-color:ButtonText;background:ButtonFace;box-shadow:none}
    body[data-fm-liquid].home-page [data-service-icon-nav]>a::after {background:ButtonText}
  }
}

/* Compact parts warehouse and public header, limited to mobile layouts. */
@media screen and (max-width:1023px) {
  :root.fm-iphone body[data-fm-liquid].home-page .header-inner,
  body[data-fm-liquid].home-page .header-inner {
    grid-template-columns:minmax(74px,1fr) minmax(112px,auto) 36px 36px;
    grid-template-areas:'brand contacts account menu';
    align-items:center;gap:4px;padding-block:3px;min-height:54px;
  }
  body[data-fm-liquid].home-page .header-inner>.brand {position:relative;width:clamp(76px,23vw,110px);height:40px;min-height:0;padding:0}
  body[data-fm-liquid].home-page .header-inner .brand-logo {position:static;transform:none;width:100%;height:auto;max-height:40px;object-fit:contain}
  body[data-fm-liquid].home-page .header-inner>.header-actions {width:36px;height:36px}
  body[data-fm-liquid].home-page .header .account-link,
  body[data-fm-liquid].home-page .header-inner>.menu-toggle {width:36px;height:36px;min-height:36px;padding:0;border-radius:11px}
  body[data-fm-liquid].home-page .header .account-link img {width:24px;height:24px;object-fit:cover}
  body[data-fm-liquid].home-page .header-contacts {display:grid;grid-template-columns:minmax(0,1fr);gap:0;max-width:none;margin:0;padding:0;border:0;align-self:center}
  body[data-fm-liquid].home-page .header-contact {min-height:24px;gap:0;justify-content:flex-start;padding:0;line-height:1.2}
  body[data-fm-liquid].home-page .contact-label {display:none}
  body[data-fm-liquid].home-page .contact-number {font-size:11px;line-height:1.2;letter-spacing:0}

  .crm-theme .warehouse-workspace .warehouse-stock-tiles {grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;padding:5px 6px 8px;align-items:start}
  .crm-theme .warehouse-workspace .warehouse-stock-tile {min-width:0;padding:6px 5px;gap:5px;border-radius:9px}
  .crm-theme .warehouse-workspace .warehouse-tile-caption {display:grid;grid-template-columns:minmax(0,1fr);gap:2px;font-size:9px;line-height:1.25}
  .crm-theme .warehouse-workspace .warehouse-tile-caption>span:last-child {text-align:left;font-size:8px}
  .crm-theme .warehouse-workspace .warehouse-stock-tile h3 {font-size:11px;line-height:1.3;overflow-wrap:anywhere}
  .crm-theme .warehouse-workspace .warehouse-tile-title {min-height:40px;line-height:1.3;padding:0}
  .crm-theme .warehouse-workspace .warehouse-stock-tile .inventory-photo-thumbnail .inventory-photo-button {height:52px;min-height:44px;padding:4px}
  .crm-theme .warehouse-workspace .warehouse-stock-tile .inventory-photo-empty.inventory-photo-thumbnail {min-height:52px;gap:3px;padding:4px;border-radius:6px;font-size:8px;line-height:1.25}
  .crm-theme .warehouse-workspace .warehouse-stock-tile .inventory-photo-empty svg {width:15px;height:15px}
  .crm-theme .warehouse-workspace .warehouse-stock-tile .inventory-photo-kind {font-size:7px;top:2px;left:2px;padding:1px 2px}
  .crm-theme .warehouse-workspace .warehouse-stock-tile .inventory-photo-expand {right:2px;bottom:2px;padding:1px}
  .crm-theme .warehouse-workspace .warehouse-stock-tile .inventory-photo-expand svg {width:12px;height:12px}
  .crm-theme .warehouse-workspace .warehouse-stock-tile .inventory-photo-caption {font-size:9px;line-height:1.25;gap:2px}
  .crm-theme .warehouse-workspace .warehouse-tile-oem {gap:2px}
  .crm-theme .warehouse-workspace .warehouse-tile-oem>span {font-size:8px;line-height:1.2}
  .crm-theme .warehouse-workspace .warehouse-tile-oem>strong {font-size:10px;line-height:1.3;letter-spacing:0}
  .crm-theme .warehouse-workspace .warehouse-tile-stock {grid-template-columns:minmax(0,1fr);padding-top:5px;gap:4px}
  .crm-theme .warehouse-workspace .warehouse-tile-stock>div {gap:1px}
  .crm-theme .warehouse-workspace .warehouse-tile-stock span {font-size:9px;line-height:1.2}
  .crm-theme .warehouse-workspace .warehouse-tile-stock strong {font-size:11px;line-height:1.3}
  .crm-theme .warehouse-workspace .warehouse-tile-price {font-size:11px;line-height:1.3}
  .crm-theme .warehouse-workspace .warehouse-tile-details {font-size:9px;line-height:1.3}
  .crm-theme .warehouse-workspace .warehouse-tile-details summary {min-height:32px;padding:4px 0;overflow-wrap:anywhere}
  .crm-theme .warehouse-workspace .warehouse-tile-details dl {margin-top:6px;gap:4px}
  .crm-theme .warehouse-workspace .warehouse-tile-details dl>div {gap:4px}
  .crm-theme .warehouse-workspace .warehouse-stock-tile:not([data-warehouse-collapsed=true]):has(.warehouse-tile-details[open]) {grid-column:1/-1}
  .crm-theme .warehouse-workspace .warehouse-stock-tile:not([data-warehouse-collapsed=true]):has(.warehouse-tile-details[open]) .warehouse-tile-details {font-size:12px}
  .crm-theme .warehouse-workspace .warehouse-tile-actions {display:grid;grid-template-columns:minmax(0,1fr);gap:3px;padding-top:5px}
  .crm-theme .warehouse-workspace .warehouse-tile-actions>button {min-height:32px;padding:4px 2px;font-size:9px;line-height:1.25;width:100%;white-space:normal;overflow-wrap:anywhere}

  .crm-theme .warehouse-movements>.section-head {padding:9px 10px;gap:4px}
  .crm-theme .warehouse-movements>.section-head h2 {font-size:13px;line-height:1.3}
  .crm-theme .warehouse-movements>.section-head>span {font-size:10px;line-height:1.3}
  .crm-theme .warehouse-movements .record-view-toolbar {padding:6px}
  .crm-theme .warehouse-movements .record-view-toggle>button {min-height:36px;font-size:11px;padding:5px 8px;gap:4px}
  .crm-theme .warehouse-movements .records-table {width:100%;min-width:0;white-space:normal}
  .crm-theme .warehouse-movements .records-table>thead {position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip-path:inset(50%)}
  .crm-theme .warehouse-movements .records-table>tbody>tr>td {font-size:11px;line-height:1.3;overflow-wrap:anywhere}
  .crm-theme .warehouse-movements .records-table>tbody>tr>td::before {font-size:9px;line-height:1.2;margin-bottom:2px}
  .crm-theme .warehouse-movements .records-table>tbody>tr>td small {font-size:9px;line-height:1.25;margin-top:3px;overflow-wrap:anywhere}
  .crm-theme .warehouse-movements .record-table-view[data-record-view=rows] .records-table {display:block}
  .crm-theme .warehouse-movements .record-table-view[data-record-view=rows] .records-table>tbody {display:grid;grid-template-columns:minmax(0,1fr);gap:0}
  .crm-theme .warehouse-movements .record-table-view[data-record-view=rows] .records-table>tbody>tr {display:grid;grid-template-columns:76px minmax(0,1fr) 44px;gap:4px 8px;padding:8px;width:auto}
  .crm-theme .warehouse-movements .record-table-view[data-record-view=rows] .records-table>tbody>tr>td {display:block;width:auto;min-width:0;padding:0;border:0;white-space:normal}
  .crm-theme .warehouse-movements .record-table-view[data-record-view=rows] .records-table>tbody>tr>td::before {display:none}
  .crm-theme .warehouse-movements .record-table-view[data-record-view=rows] .records-table>tbody>tr>td:first-child {grid-column:1;grid-row:1/3;color:#a9c6dc;font-size:10px}
  .crm-theme .warehouse-movements .record-table-view[data-record-view=rows] .records-table>tbody>tr>td:nth-child(2) {grid-column:2;grid-row:1}
  .crm-theme .warehouse-movements .record-table-view[data-record-view=rows] .records-table>tbody>tr>td:nth-child(3) {grid-column:3;grid-row:1/3;text-align:right;font-size:13px;font-weight:600}
  .crm-theme .warehouse-movements .record-table-view[data-record-view=rows] .records-table>tbody>tr>td:nth-child(4) {grid-column:2;grid-row:2;color:#a9c6dc;font-size:10px}
  .crm-theme .warehouse-movements .record-table-view[data-record-view=tiles]>[data-slot=table-container] {padding:6px}
  .crm-theme .warehouse-movements .record-table-view[data-record-view=tiles] .records-table>tbody {grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}
  .crm-theme .warehouse-movements .record-table-view[data-record-view=tiles] .records-table>tbody>tr {grid-template-columns:minmax(0,1fr);gap:5px;padding:6px 5px;border-radius:9px}
  .crm-theme .warehouse-movements .record-table-view[data-record-view=tiles] .records-table>tbody>tr>td {font-size:10px;line-height:1.3;padding:0;border:0}
  .crm-theme .warehouse-movements .record-table-view[data-record-view=tiles] .records-table>tbody>tr>td:nth-child(2) {order:-1;font-size:11px;font-weight:600}
  .crm-theme .warehouse-movements .record-table-view[data-record-view=tiles] .records-table>tbody>tr>td:is(:first-child,:nth-child(2))::before {display:none}
}

@media screen and (max-width:1023px) {
  /* Expanded content needs a readable row while the closed cards stay compact. */
  .crm-theme .warehouse-workspace .warehouse-stock-tile[data-warehouse-collapsed=false] {grid-column:1/-1;padding:12px;gap:10px}
  .crm-theme .warehouse-workspace .warehouse-stock-tile[data-warehouse-collapsed=false] h3 {font-size:14px;line-height:1.4}
  .crm-theme .warehouse-workspace .warehouse-stock-tile[data-warehouse-collapsed=false] :is(.warehouse-tile-caption,.warehouse-tile-caption>span:last-child,.warehouse-tile-oem>span,.warehouse-tile-stock span,.warehouse-tile-details) {font-size:12px;line-height:1.4}
  .crm-theme .warehouse-workspace .warehouse-stock-tile[data-warehouse-collapsed=false] :is(.warehouse-tile-oem>strong,.warehouse-tile-stock strong,.warehouse-tile-price) {font-size:14px;line-height:1.4}
  .crm-theme .warehouse-workspace .warehouse-stock-tile[data-warehouse-collapsed=false] .warehouse-tile-stock {grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .crm-theme .warehouse-workspace .warehouse-stock-tile[data-warehouse-collapsed=false] :is(.warehouse-tile-actions>button,.warehouse-tile-disclosure,.warehouse-tile-details summary) {min-height:44px;font-size:13px;line-height:1.4}
  .crm-theme .warehouse-workspace .warehouse-stock-tile[data-warehouse-collapsed=true] {position:relative;padding-bottom:19px;cursor:pointer}
  .crm-theme .warehouse-workspace .warehouse-stock-tile[data-warehouse-collapsed=true] .warehouse-tile-title {min-height:0}
  .crm-theme .warehouse-workspace .warehouse-stock-tile[data-warehouse-collapsed=true] .warehouse-tile-oem>span {display:none}
  .crm-theme .warehouse-workspace .warehouse-stock-tile .warehouse-tile-disclosure {display:flex;align-items:center;justify-content:center;gap:4px;width:100%;min-height:32px;padding:4px;border:1px solid #85bde333;border-radius:7px;font-size:10px;line-height:1.3;color:#b7dfff;background:#87c9ed0b;box-shadow:none;cursor:pointer}
  .crm-theme .warehouse-workspace .warehouse-stock-tile[data-warehouse-collapsed=true] .warehouse-tile-disclosure {position:absolute;inset:0;z-index:2;height:100%;min-height:44px;align-items:flex-end;justify-content:center;padding:0 0 3px;border:0;border-radius:inherit;background:transparent}
  .crm-theme .warehouse-workspace .warehouse-stock-tile .warehouse-tile-disclosure:focus-visible {outline:2px solid #70d6ff;outline-offset:2px}
  .crm-theme .warehouse-workspace .warehouse-stock-tile[data-warehouse-collapsed=true]:has(.warehouse-tile-disclosure:active) {border-color:#70d6ff;background:linear-gradient(145deg,#24465b,#14293e)}
}

/* Narrow phones: fixed icon controls and vehicle summaries that unfold. */
@media screen and (max-width:1023px) {
  .crm-theme :is(.mobile-vehicles,.warehouse-workspace) .record-view-label,
  .crm-theme .warehouse-view-switch .warehouse-view-label,
  .crm-theme .warehouse-export>span {display:none}
  .crm-theme :is(.mobile-vehicles,.warehouse-workspace) .record-view-toggle {flex:none;flex-wrap:nowrap;gap:2px;padding:3px}
  .crm-theme :is(.mobile-vehicles,.warehouse-workspace) .record-view-toggle>button {flex:0 0 40px;width:40px;min-width:40px;height:40px;min-height:40px;padding:8px;gap:0;white-space:nowrap}
  .crm-theme :is(.mobile-vehicles,.warehouse-workspace) .record-view-toggle>button>svg {flex:none;width:18px;height:18px}
  .crm-theme .warehouse-workspace .warehouse-stock-tools {display:grid;grid-template-columns:minmax(0,1fr) auto 44px;align-items:center;gap:8px 6px;padding:8px}
  .crm-theme .warehouse-stock-tools>.search {grid-column:1/-1;min-width:0;width:100%;max-width:none;margin:0}
  .crm-theme .warehouse-stock-tools>.search input {width:100%;min-width:0}
  .crm-theme .warehouse-stock-tools>select {grid-column:1;width:100%;min-width:0;height:44px;min-height:44px;max-height:44px;padding:8px 24px 8px 8px;text-overflow:ellipsis;white-space:nowrap;align-self:center}
  .crm-theme .warehouse-stock-tools>.warehouse-view-switch {grid-column:2;display:flex;flex:none;flex-wrap:nowrap;align-items:center;gap:2px;width:88px;min-width:88px;height:44px;margin:0;padding:2px;border-radius:12px}
  .crm-theme .warehouse-stock-tools>.warehouse-view-switch>button {display:grid;place-items:center;flex:0 0 40px;width:40px;min-width:40px;max-width:40px;height:38px;min-height:38px;margin:0;padding:8px;gap:0;white-space:nowrap;line-height:1}
  .crm-theme .warehouse-stock-tools>.warehouse-view-switch>button>svg {flex:none;width:18px;height:18px}
  .crm-theme .warehouse-stock-tools>.warehouse-export {grid-column:3;display:grid;place-items:center;flex:none;width:44px;min-width:44px;height:44px;min-height:44px;margin:0;padding:8px;gap:0}

  .crm-theme .mobile-vehicles {width:100%;min-width:0}
  .crm-theme .mobile-vehicles-toolbar {display:flex;align-items:center;justify-content:space-between;gap:8px;padding:6px 8px;color:#a9c4d9;font-size:12px}
  .crm-theme .mobile-vehicle-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:start;gap:8px;padding:6px 8px 10px}
  .crm-theme .mobile-vehicle-card {min-width:0;max-width:100%;border:1px solid #75b4dc60;border-top-color:#aedafa85;border-radius:13px;background:linear-gradient(145deg,#193d53,#111f33);color:#e2eef7;box-shadow:inset 0 1px #c8eaff21,0 4px 11px #0004}
  .crm-theme .mobile-vehicle-card>summary {position:relative;display:flex;flex-direction:column;align-items:flex-start;gap:7px;min-width:0;min-height:156px;padding:12px;list-style:none;cursor:pointer;touch-action:manipulation}
  .mobile-vehicle-card>summary::-webkit-details-marker {display:none}
  .mobile-vehicle-card>summary::marker {content:''}
  .crm-theme .mobile-vehicle-icon {flex:none;color:#7bceff}
  .crm-theme .mobile-vehicle-chevron {position:absolute;top:14px;right:10px;color:#8eb5d0}
  .crm-theme .mobile-vehicle-card>summary>strong {display:block;max-width:100%;padding:0;font-size:14px;line-height:1.35;overflow-wrap:anywhere}
  .crm-theme .mobile-vehicle-year {color:#adc2d4;font-size:12px;line-height:1.3}
  .crm-theme .mobile-vehicle-plate {display:block;max-width:100%;margin-top:auto;padding:3px 6px;border:1px solid #90bce24d;border-radius:5px;background:#aecdfa0b;font-size:12px;line-height:1.35;overflow-wrap:anywhere}
  .crm-theme .mobile-vehicle-card>summary:focus-visible {outline:2px solid #8bdcff;outline-offset:2px;border-radius:inherit}
  .crm-theme .mobile-vehicle-card[open] {grid-column:1/-1;border-color:#78caff}
  .crm-theme .mobile-vehicle-card[open]>summary {min-height:0;display:grid;grid-template-columns:24px minmax(0,1fr);gap:5px 8px;padding-right:32px}
  .crm-theme .mobile-vehicle-card[open] .mobile-vehicle-icon {grid-row:1/4;align-self:start}
  .crm-theme .mobile-vehicle-card[open]>summary>:is(strong,.mobile-vehicle-year,.mobile-vehicle-plate) {grid-column:2;justify-self:start}
  .crm-theme .mobile-vehicle-card[open] .mobile-vehicle-chevron {transform:rotate(180deg)}
  .crm-theme .mobile-vehicle-body {padding:0 12px 12px}
  .crm-theme .mobile-vehicle-body>dl {display:grid;gap:10px;margin:0;padding:12px 0;border-top:1px solid #79b9e132;font-size:14px;line-height:1.45}
  .crm-theme .mobile-vehicle-body>dl>div {display:grid;grid-template-columns:76px minmax(0,1fr);gap:8px;min-width:0}
  .crm-theme .mobile-vehicle-body dt {margin:0;color:#96b7cf}
  .crm-theme .mobile-vehicle-body dd {margin:0;min-width:0;white-space:normal;overflow-wrap:anywhere}
  .crm-theme .mobile-vehicle-body dd.mono {font-size:13px}
  .crm-theme .mobile-vehicle-actions {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .crm-theme .mobile-vehicle-actions>button {display:flex;align-items:center;justify-content:center;gap:6px;min-width:0;min-height:44px;padding:8px;font-size:13px}
  .crm-theme .mobile-vehicle-actions>button>svg {flex:none}
  .crm-theme .mobile-vehicle-grid[data-record-view=rows] {grid-template-columns:minmax(0,1fr)}
  .crm-theme .mobile-vehicle-grid[data-record-view=rows] .mobile-vehicle-card:not([open])>summary {min-height:0;display:grid;grid-template-columns:24px minmax(0,1fr);gap:5px 8px;padding-right:32px}
  .crm-theme .mobile-vehicle-grid[data-record-view=rows] .mobile-vehicle-icon {grid-row:1/4;align-self:start}
  .crm-theme .mobile-vehicle-grid[data-record-view=rows] summary>:is(strong,.mobile-vehicle-year,.mobile-vehicle-plate) {grid-column:2;justify-self:start}
}

/* Employee photos fill the compact card; the name and photo share one target. */
@media screen and (max-width:1023px) {
  .crm-theme .record-table-view[data-employee-directory][data-record-view=tiles] .records-table>tbody {align-items:start}
  .crm-theme .record-table-view[data-employee-directory][data-record-view=tiles] .records-table>tbody>tr {padding:4px;gap:4px}
  .crm-theme .record-table-view[data-employee-directory][data-record-view=tiles] .person {width:100%;gap:0}
  .crm-theme .record-table-view[data-employee-directory][data-record-view=tiles] .person .employee-name-link {display:flex;flex-direction:column;align-items:center;gap:5px;min-height:44px;width:100%;padding:0;text-align:center}
  .crm-theme .record-table-view[data-employee-directory][data-record-view=tiles] .employee-name-link>span:last-child {display:block;width:100%;padding:0 2px;line-height:1.3;overflow-wrap:anywhere}
  .crm-theme .record-table-view[data-employee-directory][data-record-view=tiles] .records-table>tbody>tr>td:first-child {padding-bottom:4px}
  .crm-theme .record-table-view[data-employee-directory][data-record-view=rows] .employee-name-link {display:inline-flex;align-items:center;gap:8px}

  .crm-theme .record-table-view[data-employee-directory][data-record-view=tiles] .person .staff-avatar:has(>img),
  .crm-theme .attendance[data-employee-detail=false] .attendance-people.is-tiles .attendance-person-link .staff-avatar:has(>img),
  .crm-theme .workday-groups[data-workday-group=people].is-tiles>.workday-group[data-expanded=false] .workday-group-toggle>.staff-avatar:has(>img),
  .crm-theme .process-telemetry .telemetry-team-bars .staff-avatar:has(>img) {position:relative;display:block;width:100%;max-width:100%;height:auto;aspect-ratio:4/5;flex:none;border-radius:8px;overflow:hidden;background:#102237}
  .crm-theme .record-table-view[data-employee-directory][data-record-view=tiles] .person .staff-avatar>img,
  .crm-theme .attendance[data-employee-detail=false] .attendance-people.is-tiles .attendance-person-link .staff-avatar>img,
  .crm-theme .workday-groups[data-workday-group=people].is-tiles>.workday-group[data-expanded=false] .workday-group-toggle>.staff-avatar>img,
  .crm-theme .process-telemetry .telemetry-team-bars .staff-avatar>img {position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:cover;object-position:center 35%}
  .crm-theme .attendance[data-employee-detail=false] .attendance-people.is-tiles .attendance-person-link {width:100%;align-items:stretch;padding:0;gap:4px}
  .crm-theme .workday-groups[data-workday-group=people].is-tiles>.workday-group[data-expanded=false] .workday-group-head:has(.staff-avatar>img) {display:grid;grid-template-columns:minmax(0,1fr)}
  .crm-theme .workday-groups[data-workday-group=people].is-tiles>.workday-group[data-expanded=false] .workday-group-toggle:has(.staff-avatar>img) {width:100%;align-items:stretch;padding:0;gap:4px}

  .crm-theme .employee-page .employee-profile:has(>.staff-avatar>img) {display:grid;grid-template-columns:clamp(112px,40vw,200px) minmax(0,1fr);gap:8px 12px;padding:12px;align-items:start}
  .crm-theme .employee-page .employee-profile:has(>.staff-avatar>img)>div {display:contents}
  .crm-theme .employee-page .employee-profile>.staff-avatar.large:has(>img) {grid-column:1;grid-row:1/3;position:relative;display:block;width:100%;max-width:100%;height:auto;aspect-ratio:4/5;border-radius:12px}
  .crm-theme .employee-page .employee-profile>.staff-avatar.large>img {position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:cover;object-position:center 35%}
  .crm-theme .employee-page .employee-profile:has(>.staff-avatar>img)>div>h2 {grid-column:2;grid-row:1;align-self:end;margin:0;font-size:20px;line-height:1.25;overflow-wrap:anywhere}
  .crm-theme .employee-page .employee-profile:has(>.staff-avatar>img)>div>p {grid-column:2;grid-row:2;margin:0;font-size:14px;line-height:1.4;overflow-wrap:anywhere}
  .crm-theme .employee-page .employee-profile:has(>.staff-avatar>img)>div>:not(h2):not(p) {grid-column:1/-1;min-width:0;margin-top:4px}
  .crm-theme .employee-page .employee-profile:has(>.staff-avatar>img) .employee-terms {gap:5px}
  .crm-theme .employee-page .employee-profile:has(>.staff-avatar>img) .employee-terms>span {padding:4px 6px;font-size:12px;line-height:1.35}
  .crm-theme .employee-page .employee-profile:has(>.staff-avatar>img)>div>small {font-size:12px;line-height:1.4}
}

@media screen and (max-width:1023px) {
  .crm-theme .employee-page .employee-profile>.staff-avatar.large:has(>img) {grid-row:1}
  .crm-theme .employee-page .employee-profile:has(>.staff-avatar>img)>div>.employee-profile-identity {grid-column:2;grid-row:1;margin:0;align-self:start}
  .crm-theme .employee-page .employee-profile .employee-profile-identity h2 {margin:0 0 6px;font-size:24px;line-height:1.2;overflow-wrap:anywhere}
  .crm-theme .employee-page .employee-profile .employee-profile-identity>p {margin:0;font-size:14px;line-height:1.4;color:#b6d2e5;overflow-wrap:anywhere}
  .crm-theme .employee-page .employee-profile .employee-personal-details {gap:9px;margin-top:14px}
  .crm-theme .employee-page .employee-profile .employee-personal-details dt {gap:4px;font-size:11px;line-height:1.35;color:#9fbdd3}
  .crm-theme .employee-page .employee-profile .employee-personal-details dd {margin:3px 0 0;font-size:13px;line-height:1.4;color:#edf6ff}
  .crm-theme .employee-page .employee-profile .employee-personal-details dd>a {display:inline-block;max-width:100%;padding-block:4px;color:#ade0ff}
  .crm-theme .employee-page .employee-profile .employee-personal-add {min-height:30px;padding:4px 0;font-size:13px;line-height:1.3}
}
