/* Material 3 component layer. Active only under html[data-theme="m3"] (Android shell).
   Markup and logic are shared with the PWA; this file only restyles. Tokens: m3-tokens.css. */

html[data-theme="m3"] body{background:var(--md-sys-color-surface);color:var(--md-sys-color-on-surface);font:var(--md-sys-typescale-body-medium);letter-spacing:var(--md-sys-typescale-body-medium-tracking)}
html[data-theme="m3"] .apple-workspace,
html[data-theme="m3"] .login-page.login-redesign{font-family:var(--md-ref-typeface-plain);letter-spacing:normal}
html[data-theme="m3"] .apple-workspace::before,
html[data-theme="m3"] .login-page.login-redesign::before{display:none}
html[data-theme="m3"] :focus-visible{outline:3px solid var(--md-sys-color-secondary);outline-offset:2px}

/* ---------- Typography ---------- */
html[data-theme="m3"] h1,
html[data-theme="m3"] .apple-workspace .page-heading h1,
html[data-theme="m3"] .apple-workspace .mobile-page-heading h1,
html[data-theme="m3"] .apple-workspace .sales-composition-heading h1{font:var(--md-sys-typescale-headline-medium);letter-spacing:0}
html[data-theme="m3"] h2{font:var(--md-sys-typescale-title-large);letter-spacing:0}
html[data-theme="m3"] h3{font:var(--md-sys-typescale-title-medium);letter-spacing:var(--md-sys-typescale-title-medium-tracking)}
html[data-theme="m3"] .eyebrow{font:var(--md-sys-typescale-label-medium);letter-spacing:var(--md-sys-typescale-label-medium-tracking);text-transform:none;color:var(--md-sys-color-primary)}
html[data-theme="m3"] .muted,
html[data-theme="m3"] .page-heading p,
html[data-theme="m3"] .product-muted,
html[data-theme="m3"] .customer-meta{color:var(--md-sys-color-on-surface-variant)}
html[data-theme="m3"] .price,
html[data-theme="m3"] .num{font-variant-numeric:tabular-nums}

/* ---------- Top app bar ---------- */
html[data-theme="m3"] .workspace-topbar,
html[data-theme="m3"] .login-topbar{background:var(--md-sys-color-surface);border-bottom:0;box-shadow:none;-webkit-backdrop-filter:none;backdrop-filter:none}
html[data-theme="m3"] .workspace-header-inner,
html[data-theme="m3"] .login-header-inner{min-height:64px}
html[data-theme="m3"] .workspace-tools .btn,
html[data-theme="m3"] .workspace-menu>summary{border:0;background:transparent;color:var(--md-sys-color-on-surface-variant);border-radius:var(--md-sys-shape-corner-full);min-height:48px;min-width:48px;box-shadow:none}
html[data-theme="m3"] .workspace-tools .sync-status{background:var(--md-ext-color-success-container);color:var(--md-ext-color-on-success-container);min-height:32px;padding:0 12px;border-radius:var(--md-sys-shape-corner-small);font:var(--md-sys-typescale-label-large)}
html[data-theme="m3"] .workspace-tools .sync-status.is-offline{background:var(--md-ext-color-warning-container);color:var(--md-ext-color-on-warning-container)}
html[data-theme="m3"] .workspace-tools .sync-status small{color:inherit;opacity:.8}
html[data-theme="m3"] .workspace-menu-panel{background:var(--md-sys-color-surface-container);border:0;border-radius:var(--md-sys-shape-corner-extra-small);box-shadow:var(--md-sys-elevation-level2);color:var(--md-sys-color-on-surface)}

/* ---------- Navigation bar (phones, < 600px) ---------- */
@media(max-width:599px){
  html[data-theme="m3"] .apple-workspace>.workspace-mobile-nav{grid-template-columns:repeat(5,minmax(0,1fr));height:calc(80px + env(safe-area-inset-bottom,0px));padding:12px 0 calc(16px + env(safe-area-inset-bottom,0px));background:var(--md-sys-color-surface-container);border-top:0;box-shadow:none;-webkit-backdrop-filter:none;backdrop-filter:none}
  html[data-theme="m3"] .apple-workspace .workspace-body{padding-bottom:calc(112px + env(safe-area-inset-bottom,0px))}
  html[data-theme="m3"] .apple-workspace .sales-order-bar,
  html[data-theme="m3"] .apple-workspace .mobile-order-bar,
  html[data-theme="m3"] .apple-workspace .cartbar.mobile-order-bar{bottom:calc(80px + env(safe-area-inset-bottom,0px))}
}
html[data-theme="m3"] .workspace-mobile-nav>a,
html[data-theme="m3"] .nav-more>summary{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:4px;min-height:52px;padding:0;color:var(--md-sys-color-on-surface-variant);font:var(--md-sys-typescale-label-medium);letter-spacing:var(--md-sys-typescale-label-medium-tracking);text-decoration:none;background:transparent;cursor:pointer;list-style:none}
html[data-theme="m3"] .nav-more>summary::-webkit-details-marker{display:none}
html[data-theme="m3"] .workspace-mobile-nav>a>svg,
html[data-theme="m3"] .nav-more>summary>svg{box-sizing:content-box;width:24px;height:24px;padding:4px 20px;border-radius:var(--md-sys-shape-corner-full);transition:background var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard)}
html[data-theme="m3"] .workspace-mobile-nav>a:hover>svg,
html[data-theme="m3"] .nav-more>summary:hover>svg{background:color-mix(in srgb,var(--md-sys-color-on-surface) 8%,transparent)}
html[data-theme="m3"] .workspace-mobile-nav>a.active,
html[data-theme="m3"] .workspace-mobile-nav>a[aria-current="page"],
html[data-theme="m3"] .nav-more.active>summary{color:var(--md-sys-color-on-surface);font-weight:700;background:transparent}
html[data-theme="m3"] .workspace-mobile-nav>a.active>svg,
html[data-theme="m3"] .workspace-mobile-nav>a[aria-current="page"]>svg,
html[data-theme="m3"] .nav-more.active>summary>svg{background:var(--md-sys-color-secondary-container);color:var(--md-sys-color-on-secondary-container)}
html[data-theme="m3"] .apple-workspace>.workspace-mobile-nav>a>span,
html[data-theme="m3"] .nav-more>summary>span{font:var(--md-sys-typescale-label-medium);letter-spacing:var(--md-sys-typescale-label-medium-tracking);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
/* «Ще» = M3 modal navigation drawer: from the left, full height, width = screen − 56dp (max 360dp), scrim over everything. */
html[data-theme="m3"] .nav-more{position:static}
html[data-theme="m3"] .workspace-mobile-nav .nav-drawer{position:fixed;top:0;bottom:0;left:0;z-index:90;width:min(360px,calc(100vw - 56px));display:flex;flex-direction:column;gap:0;overflow-y:auto;padding:calc(12px + env(safe-area-inset-top,0px)) 12px calc(12px + env(safe-area-inset-bottom,0px));background:var(--md-sys-color-surface-container-low);border-radius:0 var(--md-sys-shape-corner-large) var(--md-sys-shape-corner-large) 0;box-shadow:var(--md-sys-elevation-level1);animation:m3-drawer-in var(--md-sys-motion-duration-long) var(--md-sys-motion-easing-emphasized-decelerate)}
html[data-theme="m3"] .workspace-mobile-nav .nav-drawer-headline{margin:0;padding:16px 16px 16px 16px;min-height:56px;box-sizing:border-box;display:flex;align-items:center;font:var(--md-sys-typescale-title-small);letter-spacing:.1px;color:var(--md-sys-color-on-surface-variant)}
html[data-theme="m3"] .workspace-mobile-nav .nav-drawer a{display:flex;flex-direction:row;justify-content:flex-start;align-items:center;gap:12px;min-height:56px;height:56px;width:auto;padding:0 24px 0 16px;margin:0;border-radius:var(--md-sys-shape-corner-full);background:transparent;color:var(--md-sys-color-on-surface-variant);text-decoration:none}
html[data-theme="m3"] .workspace-mobile-nav .nav-drawer a>span{font:var(--md-sys-typescale-label-large);letter-spacing:var(--md-sys-typescale-label-large-tracking);color:inherit;max-width:none;overflow:visible;white-space:nowrap}
html[data-theme="m3"] .workspace-mobile-nav .nav-drawer a>svg{width:24px;height:24px;padding:0;margin:0;background:transparent;color:inherit;flex:none}
html[data-theme="m3"] .workspace-mobile-nav .nav-drawer a:hover{background:color-mix(in srgb,var(--md-sys-color-on-surface) 8%,transparent)}
html[data-theme="m3"] .workspace-mobile-nav .nav-drawer a.active{background:var(--md-sys-color-secondary-container);color:var(--md-sys-color-on-secondary-container)}
html[data-theme="m3"] .workspace-mobile-nav .nav-drawer a.active>span{font-weight:700}
html[data-theme="m3"] .nav-more[open]::before{content:"";position:fixed;inset:0;z-index:85;background:color-mix(in srgb,var(--md-sys-color-scrim) 32%,transparent)}
@keyframes m3-drawer-in{from{transform:translateX(-100%)}to{transform:none}}
@media(prefers-reduced-motion:reduce){html[data-theme="m3"] .workspace-mobile-nav .nav-drawer{animation:none}}

/* ---------- Buttons ---------- */
html[data-theme="m3"] .btn{min-height:40px;border-radius:var(--md-sys-shape-corner-full);padding:10px 24px;font:var(--md-sys-typescale-label-large);letter-spacing:var(--md-sys-typescale-label-large-tracking);border:1px solid var(--md-sys-color-outline);background:transparent;color:var(--md-sys-color-primary);box-shadow:none}
html[data-theme="m3"] .btn:hover{background:color-mix(in srgb,var(--md-sys-color-primary) 8%,transparent)}
html[data-theme="m3"] .btn.primary{background:var(--md-sys-color-primary);border-color:transparent;color:var(--md-sys-color-on-primary)}
html[data-theme="m3"] .btn.primary:hover{background:var(--primary-hover);box-shadow:var(--md-sys-elevation-level1)}
html[data-theme="m3"] .btn.light{background:var(--md-sys-color-secondary-container);border-color:transparent;color:var(--md-sys-color-on-secondary-container)}
html[data-theme="m3"] .btn.light:hover{background:var(--soft-hover)}
html[data-theme="m3"] .btn.danger{background:var(--md-sys-color-error-container);border-color:transparent;color:var(--md-sys-color-on-error-container)}
html[data-theme="m3"] .btn.small{min-height:40px;padding:8px 16px}
html[data-theme="m3"] .btn:disabled{opacity:.38;box-shadow:none}
html[data-theme="m3"] .text-btn{border-radius:var(--md-sys-shape-corner-full);color:var(--md-sys-color-primary);font:var(--md-sys-typescale-label-large);padding:10px 12px}
html[data-theme="m3"] .icon-btn,
html[data-theme="m3"] .add-btn{border:0;border-radius:var(--md-sys-shape-corner-full);background:var(--md-sys-color-secondary-container);color:var(--md-sys-color-on-secondary-container);min-width:48px;min-height:48px}

/* ---------- Cards, panels, lists ---------- */
html[data-theme="m3"] .card,
html[data-theme="m3"] .panel,
html[data-theme="m3"] .stat,
html[data-theme="m3"] .today-card,
html[data-theme="m3"] .apple-workspace .card,
html[data-theme="m3"] .apple-workspace .panel{background:var(--md-sys-color-surface-container-low);border:0;border-radius:var(--md-sys-shape-corner-medium);box-shadow:var(--md-sys-elevation-level1);-webkit-backdrop-filter:none;backdrop-filter:none}
html[data-theme="m3"] .panel-head{border-bottom:1px solid var(--md-sys-color-outline-variant)}
html[data-theme="m3"] .product-row,
html[data-theme="m3"] .apple-workspace .sales-product-row{background:var(--md-sys-color-surface-container-low);border:0;border-radius:var(--md-sys-shape-corner-medium);box-shadow:var(--md-sys-elevation-level1)}
html[data-theme="m3"] .customer-row,
html[data-theme="m3"] .apple-customer-row{min-height:72px;border-bottom:0;border-radius:0;color:var(--md-sys-color-on-surface)}
html[data-theme="m3"] .customer-row:hover,
html[data-theme="m3"] .apple-customer-row:hover{background:color-mix(in srgb,var(--md-sys-color-on-surface) 8%,transparent)}
html[data-theme="m3"] .customer-icon,
html[data-theme="m3"] .avatar{border-radius:50%;background:var(--md-sys-color-primary-container);color:var(--md-sys-color-on-primary-container)}
html[data-theme="m3"] .customer-name{font:var(--md-sys-typescale-body-large)}
html[data-theme="m3"] .stat-value{font:var(--md-sys-typescale-headline-medium);letter-spacing:0}
html[data-theme="m3"] .divider{background:var(--md-sys-color-outline-variant)}

/* ---------- Chips ---------- */
html[data-theme="m3"] .chip{min-height:32px;padding:6px 16px;border:1px solid var(--md-sys-color-outline-variant);border-radius:var(--md-sys-shape-corner-small);background:transparent;color:var(--md-sys-color-on-surface-variant);font:var(--md-sys-typescale-label-large)}
html[data-theme="m3"] .chip.active,
html[data-theme="m3"] .chip[aria-pressed="true"],
html[data-theme="m3"] .chip[aria-selected="true"]{background:var(--md-sys-color-secondary-container);border-color:transparent;color:var(--md-sys-color-on-secondary-container);font-weight:500}

/* Catalog tabs (Купує / Не купував / Радимо / Акції / Усі): a scrolling row of filter chips. */
html[data-theme="m3"] .sales-tabs{display:flex;gap:8px;padding:4px 0 8px;margin-bottom:8px;background:transparent;border-radius:0;overflow-x:auto;scrollbar-width:none}
html[data-theme="m3"] .sales-tabs::-webkit-scrollbar{display:none}
html[data-theme="m3"] .sales-tabs .chip{flex:none;min-height:32px;padding:6px 16px;border:1px solid var(--md-sys-color-outline-variant);border-radius:var(--md-sys-shape-corner-small);background:transparent;color:var(--md-sys-color-on-surface-variant);font:var(--md-sys-typescale-label-large);box-shadow:none}
html[data-theme="m3"] .sales-tabs .chip.active,
html[data-theme="m3"] .sales-tabs .chip[aria-pressed="true"]{background:var(--md-sys-color-secondary-container);border-color:transparent;color:var(--md-sys-color-on-secondary-container)}

/* ---------- Badges (status) ---------- */
html[data-theme="m3"] .badge{border-radius:var(--md-sys-shape-corner-small);min-height:24px;padding:2px 8px;font:var(--md-sys-typescale-label-medium);background:var(--md-sys-color-secondary-container);color:var(--md-sys-color-on-secondary-container)}
html[data-theme="m3"] .badge.warn{background:var(--md-ext-color-warning-container);color:var(--md-ext-color-on-warning-container)}
html[data-theme="m3"] .badge.error{background:var(--md-sys-color-error-container);color:var(--md-sys-color-on-error-container)}
html[data-theme="m3"] .badge.neutral{background:var(--md-sys-color-surface-container-highest);color:var(--md-sys-color-on-surface-variant)}

/* ---------- Notices ---------- */
html[data-theme="m3"] .notice{border:0;border-radius:var(--md-sys-shape-corner-medium);background:var(--md-ext-color-warning-container);color:var(--md-ext-color-on-warning-container)}
html[data-theme="m3"] .notice.error{background:var(--md-sys-color-error-container);color:var(--md-sys-color-on-error-container)}
html[data-theme="m3"] .notice.info{background:var(--md-sys-color-secondary-container);color:var(--md-sys-color-on-secondary-container)}
html[data-theme="m3"] .demo,
html[data-theme="m3"] .pilot-notice{border-radius:var(--md-sys-shape-corner-small);background:var(--md-ext-color-warning-container);color:var(--md-ext-color-on-warning-container)}

/* ---------- Text fields (filled) ---------- */
html[data-theme="m3"] input.field,
html[data-theme="m3"] textarea.field,
html[data-theme="m3"] .select,
html[data-theme="m3"] select,
html[data-theme="m3"] .qty-input,
html[data-theme="m3"] .login-redesign input:not([type="checkbox"]):not([type="radio"]){min-height:56px;border:0;border-bottom:1px solid var(--md-sys-color-on-surface-variant);border-radius:var(--md-sys-shape-corner-extra-small) var(--md-sys-shape-corner-extra-small) 0 0;background:var(--md-sys-color-surface-container-highest);color:var(--md-sys-color-on-surface);font:var(--md-sys-typescale-body-large);box-shadow:none}
html[data-theme="m3"] input.field:focus,
html[data-theme="m3"] textarea.field:focus,
html[data-theme="m3"] .select:focus,
html[data-theme="m3"] select:focus,
html[data-theme="m3"] .qty-input:focus,
html[data-theme="m3"] .login-redesign input:focus{outline:0;border-bottom:2px solid var(--md-sys-color-primary)}
html[data-theme="m3"] label.field-label{font:var(--md-sys-typescale-body-small);color:var(--md-sys-color-on-surface-variant)}
html[data-theme="m3"] .search{min-height:56px;border:0;border-radius:var(--md-sys-shape-corner-full);background:var(--md-sys-color-surface-container-high);color:var(--md-sys-color-on-surface-variant);padding:0 16px}
html[data-theme="m3"] .search input{background:transparent;border:0;min-height:56px;font:var(--md-sys-typescale-body-large)}
html[data-theme="m3"] .search:focus-within{outline:2px solid var(--md-sys-color-primary);outline-offset:0}
html[data-theme="m3"] input[type="checkbox"],
html[data-theme="m3"] input[type="radio"]{accent-color:var(--md-sys-color-primary)}

/* ---------- Order bar (bottom app bar) ---------- */
html[data-theme="m3"] .sales-order-bar,
html[data-theme="m3"] .mobile-order-bar,
html[data-theme="m3"] .cartbar,
html[data-theme="m3"] .apple-workspace .sales-order-bar,
html[data-theme="m3"] .apple-workspace .mobile-order-bar{background:var(--md-sys-color-surface-container);color:var(--md-sys-color-on-surface);border:0;border-top:1px solid var(--md-sys-color-outline-variant);border-radius:0;box-shadow:none;-webkit-backdrop-filter:none;backdrop-filter:none}
html[data-theme="m3"] .cartbar small{color:var(--md-sys-color-on-surface-variant)}
html[data-theme="m3"] .btn.text-btn{border-color:transparent;background:transparent;padding:8px 12px}
html[data-theme="m3"] .btn.text-btn:hover{background:color-mix(in srgb,var(--md-sys-color-primary) 8%,transparent)}
html[data-theme="m3"] .sales-order-bar .sales-compose-link{flex-direction:column;align-items:flex-start;justify-content:center;gap:0;min-height:48px;padding:4px 8px;color:var(--md-sys-color-on-surface);text-align:left;white-space:nowrap}
html[data-theme="m3"] .sales-order-bar .sales-compose-link span{font:var(--md-sys-typescale-body-small);color:var(--md-sys-color-on-surface-variant)}
html[data-theme="m3"] .sales-order-bar .sales-compose-link strong{font:var(--md-sys-typescale-title-medium);font-variant-numeric:tabular-nums}
html[data-theme="m3"] .sales-order-bar small{color:var(--md-sys-color-on-surface-variant);font:var(--md-sys-typescale-body-small)}
@media(max-width:767px){
  html[data-theme="m3"] .apple-workspace .sales-order-bar,
  html[data-theme="m3"] .apple-workspace .mobile-order-bar{position:fixed;left:0;right:0;margin:0;width:auto;max-width:none;padding:12px 16px;z-index:45}
}

/* ---------- Dialog → modal bottom sheet on phones, basic dialog on wide screens ---------- */
html[data-theme="m3"] dialog{border:0;border-radius:var(--md-sys-shape-corner-extra-large);background:var(--md-sys-color-surface-container-high);color:var(--md-sys-color-on-surface);box-shadow:var(--md-sys-elevation-level3);padding:24px}
html[data-theme="m3"] dialog::backdrop{background:color-mix(in srgb,var(--md-sys-color-scrim) 32%,transparent)}
html[data-theme="m3"] dialog h2{font:var(--md-sys-typescale-headline-small)}
@media(max-width:767px){
  html[data-theme="m3"] dialog{margin:auto 0 0;max-width:100%;width:100%;max-height:90dvh;border-radius:var(--md-sys-shape-corner-extra-large) var(--md-sys-shape-corner-extra-large) 0 0;background:var(--md-sys-color-surface-container-low);box-shadow:var(--md-sys-elevation-level1);padding:16px 24px calc(24px + env(safe-area-inset-bottom,0px))}
  html[data-theme="m3"] dialog::before{content:"";display:block;width:32px;height:4px;border-radius:2px;background:var(--md-sys-color-on-surface-variant);opacity:.4;margin:0 auto 16px}
  html[data-theme="m3"] dialog[open]{animation:m3-sheet-in var(--md-sys-motion-duration-long) var(--md-sys-motion-easing-emphasized-decelerate)}
}
@keyframes m3-sheet-in{from{transform:translateY(100%)}to{transform:none}}

/* ---------- Snackbar ---------- */
html[data-theme="m3"] .toast{background:var(--md-sys-color-inverse-surface);color:var(--md-sys-color-inverse-on-surface);border-radius:var(--md-sys-shape-corner-extra-small);box-shadow:var(--md-sys-elevation-level3);font:var(--md-sys-typescale-body-medium);bottom:calc(96px + env(safe-area-inset-bottom,0px))}
html[data-theme="m3"] .toast.error{background:var(--md-sys-color-error-container);color:var(--md-sys-color-on-error-container)}

/* ---------- Login ---------- */
html[data-theme="m3"] .login-redesign .login-card.login-form-panel{background:var(--md-sys-color-surface-container-low);border:0;border-radius:var(--md-sys-shape-corner-extra-large);box-shadow:none;-webkit-backdrop-filter:none;backdrop-filter:none}
html[data-theme="m3"] .login-redesign .login-title{font:var(--md-sys-typescale-display-small);letter-spacing:0}
html[data-theme="m3"] .login-redesign .login-title *{background:none;-webkit-text-fill-color:currentColor;color:var(--md-sys-color-primary)}
html[data-theme="m3"] .login-redesign .login-lead{font:var(--md-sys-typescale-body-large);color:var(--md-sys-color-on-surface-variant)}

/* ---------- Loading line ---------- */
html[data-theme="m3"] .loading-line{height:4px;background:linear-gradient(90deg,var(--md-sys-color-primary) 0 40%,var(--md-sys-color-secondary-container) 40% 100%);background-size:200% 100%}

@media(prefers-reduced-motion:reduce){
  html[data-theme="m3"] dialog[open]{animation:none}
}

/* =====================================================================
   Review fixes + tablet layout (tablet is the main device).
   Window classes per M3: compact < 600, medium 600–839, expanded ≥ 840.
   ===================================================================== */

/* Counters on «Сьогодні» (Купує / Давно не купував / Радимо): cards, not pills. */
html[data-theme="m3"] .sales-counters{gap:8px}
html[data-theme="m3"] .sales-counters .btn{border-radius:var(--md-sys-shape-corner-medium);min-height:56px;padding:8px 12px;flex-direction:column;gap:0;background:var(--md-sys-color-secondary-container);border-color:transparent;color:var(--md-sys-color-on-secondary-container);font:var(--md-sys-typescale-label-large);word-break:normal;overflow-wrap:normal;hyphens:none;text-align:center}

/* Collapsible section headers read as primary text in both themes. */
html[data-theme="m3"] details>summary{color:var(--md-sys-color-primary)}

/* Quantity: one tonal pill  − 1 +  (M3 stepper pattern). */
html[data-theme="m3"] .quantity-control,
html[data-theme="m3"] .sales-v2 .sales-entry>.quantity-control{gap:0;height:48px;border-radius:var(--md-sys-shape-corner-full);background:var(--md-sys-color-secondary-container);color:var(--md-sys-color-on-secondary-container);overflow:hidden}
html[data-theme="m3"] .quantity-control .quantity-step{width:48px;min-width:48px;height:48px;border:0;border-radius:var(--md-sys-shape-corner-full);background:transparent;color:inherit;font:500 22px/1 var(--md-ref-typeface-plain);padding:0}
html[data-theme="m3"] .quantity-control .quantity-step:hover{background:color-mix(in srgb,currentColor 8%,transparent)}
html[data-theme="m3"] .quantity-control .quantity-step:active{background:color-mix(in srgb,currentColor 12%,transparent)}
html[data-theme="m3"] .quantity-control .qty-input{width:64px;min-height:48px;height:48px;border:0;border-radius:0;background:transparent;color:inherit;text-align:center;font:var(--md-sys-typescale-title-medium);font-variant-numeric:tabular-nums;padding:0}
html[data-theme="m3"] .quantity-control .qty-input:focus{outline:2px solid var(--md-sys-color-primary);outline-offset:-2px;border:0}
html[data-theme="m3"] .quantity-control .qty-input.invalid{color:var(--md-sys-color-error);outline:2px solid var(--md-sys-color-error);outline-offset:-2px}

/* Unit choice (шт. / Упаковка ×12 / Ящик ×48): M3 segmented button. */
html[data-theme="m3"] .sales-v2 .sales-unit-options{flex-wrap:nowrap;gap:0}
html[data-theme="m3"] .sales-v2 .sales-unit-options>.sales-unit-choice{flex:1 1 0;min-width:0;min-height:48px;padding:4px 8px;border:1px solid var(--md-sys-color-outline);border-radius:0;background:transparent;color:var(--md-sys-color-on-surface);box-shadow:none;font:var(--md-sys-typescale-label-large)}
html[data-theme="m3"] .sales-v2 .sales-unit-options>.sales-unit-choice+.sales-unit-choice{margin-left:-1px}
html[data-theme="m3"] .sales-v2 .sales-unit-options>.sales-unit-choice:first-child{border-radius:var(--md-sys-shape-corner-full) 0 0 var(--md-sys-shape-corner-full)}
html[data-theme="m3"] .sales-v2 .sales-unit-options>.sales-unit-choice:last-of-type{border-radius:0 var(--md-sys-shape-corner-full) var(--md-sys-shape-corner-full) 0}
html[data-theme="m3"] .sales-v2 .sales-unit-options>.sales-unit-choice[aria-pressed="true"]{background:var(--md-sys-color-secondary-container);color:var(--md-sys-color-on-secondary-container);border-color:var(--md-sys-color-outline);box-shadow:none}
html[data-theme="m3"] .sales-v2 .sales-unit-options>.sales-unit-choice{position:relative}
html[data-theme="m3"] .sales-v2 .sales-unit-options>.sales-unit-choice[aria-pressed="true"]{padding-left:28px}
html[data-theme="m3"] .sales-v2 .sales-unit-options>.sales-unit-choice[aria-pressed="true"]::before{content:"✓";position:absolute;left:12px;top:50%;transform:translateY(-50%);font-size:14px;line-height:1}
html[data-theme="m3"] .sales-v2 .sales-unit-choice small{font:var(--md-sys-typescale-body-small);color:inherit;opacity:.8}

/* Text links inside lists get a 48px touch target without changing their look. */
html[data-theme="m3"] .text-btn,
html[data-theme="m3"] main details>summary{min-height:48px;display:flex;align-items:center}
html[data-theme="m3"] main .task-meta a,
html[data-theme="m3"] main .plan-fact-grid a{display:inline-flex;align-items:center;min-height:48px}

/* Login: on phones and portrait tablets the form comes first; quick roles are plain tonal buttons. */
html[data-theme="m3"] .login-redesign .demo-logins{background:transparent;padding:0;gap:8px;flex-wrap:wrap}
html[data-theme="m3"] .login-redesign .demo-logins .btn{flex:1 1 auto;min-height:48px;background:var(--md-sys-color-secondary-container);color:var(--md-sys-color-on-secondary-container);border-color:transparent}
@media(max-width:1023px){
  html[data-theme="m3"] .login-layout{display:flex;flex-direction:column;gap:24px;padding:24px 16px 48px;max-width:560px}
  html[data-theme="m3"] .login-layout>.login-form-wrap{order:-1;width:100%;max-width:none;padding:0}
  html[data-theme="m3"] .login-layout .login-form-panel{width:100%;max-width:none}
  html[data-theme="m3"] .login-redesign .login-title{font:var(--md-sys-typescale-headline-small)}
  html[data-theme="m3"] .login-redesign .login-benefits{display:none}
}
@media(min-width:1024px){
  html[data-theme="m3"] .login-layout{padding:48px 32px;gap:48px;min-height:calc(100dvh - 64px)}
}

/* ---------- Navigation rail (tablets and wider, ≥ 600px) ---------- */
@media(min-width:600px){
  html[data-theme="m3"] .apple-workspace{padding-left:80px}
  html[data-theme="m3"] .apple-workspace>.workspace-mobile-nav{display:none!important}
  html[data-theme="m3"] .workspace-nav{display:flex!important;position:fixed;z-index:70;top:0;bottom:0;left:0;width:80px;flex-direction:column;align-items:stretch;justify-content:flex-start;gap:12px;padding:calc(72px + env(safe-area-inset-top,0px)) 0 16px;overflow-y:auto;overflow-x:hidden;background:var(--md-sys-color-surface)}
  html[data-theme="m3"] .workspace-nav a,
  html[data-theme="m3"] .workspace-nav a:hover{flex-direction:column;gap:4px;min-height:56px;padding:0;border-radius:0;background:transparent;color:var(--md-sys-color-on-surface-variant);font:var(--md-sys-typescale-label-medium);letter-spacing:var(--md-sys-typescale-label-medium-tracking);white-space:normal;text-align:center}
  html[data-theme="m3"] .workspace-nav a>svg{display:block;box-sizing:content-box;width:24px;height:24px;padding:4px 16px;border-radius:var(--md-sys-shape-corner-full);transition:background var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard)}
  html[data-theme="m3"] .workspace-nav a:hover>svg{background:color-mix(in srgb,var(--md-sys-color-on-surface) 8%,transparent)}
  html[data-theme="m3"] .workspace-nav a.active,
  html[data-theme="m3"] .workspace-nav a[aria-current="page"]{background:transparent;color:var(--md-sys-color-on-surface);font-weight:700}
  html[data-theme="m3"] .workspace-nav a.active>svg,
  html[data-theme="m3"] .workspace-nav a[aria-current="page"]>svg{background:var(--md-sys-color-secondary-container);color:var(--md-sys-color-on-secondary-container)}
  html[data-theme="m3"] .workspace-nav a>span{max-width:80px;padding:0 2px;letter-spacing:0;overflow:hidden;text-overflow:ellipsis}
  html[data-theme="m3"] .workspace-header-inner{max-width:none;padding:0 24px}
  html[data-theme="m3"] .apple-workspace .workspace-body{padding:24px 24px 160px;max-width:1280px}
  html[data-theme="m3"] .apple-workspace .sales-order-bar,
  html[data-theme="m3"] .apple-workspace .mobile-order-bar,
  html[data-theme="m3"] .apple-workspace .cartbar.mobile-order-bar{position:fixed;left:80px;right:0;bottom:0;margin:0;width:auto;max-width:none;padding:12px 24px calc(12px + env(safe-area-inset-bottom,0px));z-index:45;display:flex;align-items:center;gap:16px}
  html[data-theme="m3"] .apple-workspace .sales-order-bar>div{flex:1;min-width:0}
  html[data-theme="m3"] .apple-workspace .sales-order-bar>.btn.primary{width:auto;flex:none;min-height:48px;padding:0 32px}
  html[data-theme="m3"] .apple-workspace .sales-order-bar>small{flex:none;max-width:30%}
  html[data-theme="m3"] .toast{bottom:96px}
}

/* ---------- Expanded (landscape tablet, ≥ 840px): use the width ---------- */
@media(min-width:840px){
  html[data-theme="m3"] .apple-workspace .workspace-body{padding:24px 32px 120px}
  html[data-theme="m3"] .apple-workspace .sales-catalog-workspace>.sales-order-bar{display:flex}
}

/* ---------- One type scale: emphasis is weight 500, never 600/700 (M3 has no bold role) ---------- */
html[data-theme="m3"] :is(strong,b,th,dt){font-weight:500}
html[data-theme="m3"] :is(h1,h2,h3,h4,h5,h6){letter-spacing:0}

/* ---------- One block style ----------
   Every top-level block is an M3 elevated card: surface-container-low, no border, elevation 1,
   radius 12, padding 16. Blocks inside a block are flat. !important is deliberate here: the Apple
   layer styles these blocks with 3-class selectors, and this layer must win only under M3. */
html[data-theme="m3"] :is(.card,.panel,.today-card,.stat,.sales-context,.sales-empty,.sales-customer-list,.sales-order-conditions,.sales-draft-options,.login-form-panel,.invoice-card){background:var(--md-sys-color-surface-container-low)!important;border:0!important;border-radius:var(--md-sys-shape-corner-medium)!important;box-shadow:var(--md-sys-elevation-level1)!important;-webkit-backdrop-filter:none!important;backdrop-filter:none!important}
html[data-theme="m3"] :is(.card,.today-card,.stat,.sales-context,.sales-empty,.sales-order-conditions,.sales-draft-options,.invoice-card){padding:16px!important}
html[data-theme="m3"] .login-form-panel{padding:24px!important}
html[data-theme="m3"] :is(.card,.panel,.sales-customer-list,.login-form-panel) :is(.card,.panel,.today-card,.stat,.sales-context,.sales-empty,.sales-order-conditions,.sales-draft-options,.invoice-card){background:var(--md-sys-color-surface-container)!important;box-shadow:none!important}
html[data-theme="m3"] :is(.panel-head,.panel-body){padding:16px}
/* Notices: one tonal block with the same radius and padding. */
html[data-theme="m3"] .notice{padding:12px 16px!important;border-radius:var(--md-sys-shape-corner-medium)!important;border:0!important}
html[data-theme="m3"] .workspace-tools .sync-status{line-height:20px}

/* Segmented unit choice: equal segments, labels never break inside a word. */
html[data-theme="m3"] .sales-v2 .sales-unit-options>.sales-unit-choice{padding:4px 6px;font:var(--md-sys-typescale-label-medium);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
html[data-theme="m3"] .sales-v2 .sales-unit-options>.sales-unit-choice[aria-pressed="true"]{padding-left:22px}
html[data-theme="m3"] .sales-v2 .sales-unit-options>.sales-unit-choice[aria-pressed="true"]::before{left:8px}
/* The working place sets the unit buttons to padding:4px 8px !important (m3-bridge.css, from styles.css): the ✓ of the
   chosen unit lost its room and crossed out the first letter («ш» of «шт.», owner 26.11.2026). It keeps it here. */
html[data-theme="m3"] .apple-workspace :is(#main,.point-panel) .sales-unit-options>.sales-unit-choice[aria-pressed="true"]{padding-left:22px!important}
html[data-theme="m3"] .sales-v2 .sales-unit-choice small{white-space:nowrap}
/* The drawer and its scrim cover the top app bar as well (M3 modal drawer sits above all app content). */
html[data-theme="m3"] .workspace-mobile-nav:has(.nav-more[open]){z-index:1000}

/* ---------- Unslop polish (copy and details; M3 tokens unchanged) ---------- */
/* Login: logo and the form only, centred; card width as an M3 dialog (≤ 560dp). */
html[data-theme="m3"] .login-redesign.login-m3 .login-layout{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0;min-height:100dvh;max-width:none;margin:0;padding:24px 16px;box-sizing:border-box}
html[data-theme="m3"] .login-redesign.login-m3 .login-form-wrap{display:flex;flex-direction:column;align-items:center;gap:24px;width:100%;max-width:560px;padding:0;order:0}
html[data-theme="m3"] .login-redesign.login-m3 .login-form-panel{width:100%;max-width:none;box-sizing:border-box}
html[data-theme="m3"] .login-redesign.login-m3 .snapshot-label{margin:16px 0 0}
/* Product row: overflow menu is an icon button (⋮), not a «Ще» text link next to «Додати». */
html[data-theme="m3"] .sales-v2 .sales-row-more>summary{display:inline-flex;align-items:center;justify-content:center;width:48px;height:48px;min-height:48px;padding:0;border-radius:var(--md-sys-shape-corner-full);color:var(--md-sys-color-on-surface-variant);list-style:none;cursor:pointer}
html[data-theme="m3"] .sales-v2 .sales-row-more>summary::-webkit-details-marker{display:none}
html[data-theme="m3"] .sales-v2 .sales-row-more>summary>svg{width:24px;height:24px;stroke-width:3}
html[data-theme="m3"] .sales-v2 .sales-row-more>summary:hover{background:color-mix(in srgb,var(--md-sys-color-on-surface) 8%,transparent)}
/* Selected point on «Сьогодні»: one filled button (new order); payment and debts tonal; the rest text buttons. */
html[data-theme="m3"] .apple-current-point .sales-visit-cash.primary,
html[data-theme="m3"] .apple-current-point .apple-point-actions a[href^="#debt"]{background:var(--md-sys-color-secondary-container);color:var(--md-sys-color-on-secondary-container);border-color:transparent;box-shadow:none}
html[data-theme="m3"] .apple-current-point .sales-visit-actions .btn:not(.sales-visit-cash),
html[data-theme="m3"] .apple-current-point [data-action="sales-repeat"]{background:transparent;border-color:transparent;color:var(--md-sys-color-primary);box-shadow:none;padding-left:12px;padding-right:12px}
/* Connection: the normal state is a quiet dot; the chip shows up only when something needs attention. */
html[data-theme="m3"] .workspace-tools .sync-status.is-ok{background:transparent;width:48px;min-width:48px;min-height:48px;padding:0;justify-content:center}
html[data-theme="m3"] .workspace-tools .sync-status.is-ok>span:not(.workspace-status-dot){position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
html[data-theme="m3"] .workspace-tools .sync-status.is-ok .workspace-status-dot{width:10px;height:10px;background:var(--md-ext-color-success)}
/* Login: the logo alone; the uppercase tagline is not part of the M3 look. */
html[data-theme="m3"] .login-m3 .brand-sub{display:none}

/* ==================================================================================================================
   Tablet stage 1 (13.11.2026): the 13.11 web markup in the M3 look — «Контрагенти», point card, picker, catalog,
   «Замовлення», «Борги». Goods are one M3 list (a single surface with dividers), not a card per product.
   ================================================================================================================== */
/* The list: one surface, rows divided by outline-variant; a row with the product in the order is tinted. */
html[data-theme="m3"] .apple-workspace .sales-workspace .sales-results:not(.with-photos){background:var(--md-sys-color-surface-container-low);border:0;border-radius:var(--md-sys-shape-corner-large);box-shadow:none;overflow:visible}
html[data-theme="m3"] .apple-workspace .sales-workspace .sales-results:not(.with-photos) .sales-product-row{border-bottom:1px solid var(--md-sys-color-outline-variant);padding:12px 16px}
html[data-theme="m3"] .apple-workspace .sales-workspace .sales-results:not(.with-photos) .sales-product-row:last-child{border-bottom:0}
html[data-theme="m3"] .apple-workspace .sales-workspace .sales-results:not(.with-photos) .sales-product-row:hover{background:color-mix(in srgb,var(--md-sys-color-on-surface) 4%,transparent)}
html[data-theme="m3"] .apple-workspace .sales-workspace .sales-results:not(.with-photos) .sales-product-row:has(.sales-quantity){background:color-mix(in srgb,var(--md-sys-color-primary) 8%,transparent)}
html[data-theme="m3"] .apple-workspace .sales-workspace .sales-results:not(.with-photos) .sales-product-name>span:first-child{font:var(--md-sys-typescale-title-small);font-size:15px;color:var(--md-sys-color-on-surface)}
html[data-theme="m3"] .apple-workspace .sales-workspace .sales-results:not(.with-photos) .sales-product-name .sales-sku,
html[data-theme="m3"] .apple-workspace .sales-workspace .sales-results:not(.with-photos) .sales-stock-block .sales-stock-1c,
html[data-theme="m3"] .apple-workspace .sales-workspace .sales-results:not(.with-photos) .sales-product-row .sales-pack-line{font:var(--md-sys-typescale-body-small);color:var(--md-sys-color-on-surface-variant)}
html[data-theme="m3"] .apple-workspace .sales-workspace .sales-results:not(.with-photos) .sales-stock-block{font:var(--md-sys-typescale-body-medium)}
html[data-theme="m3"] .apple-workspace .sales-workspace .sales-results:not(.with-photos) .sales-unit-price{font:var(--md-sys-typescale-title-medium)}
/* Product marks: the smallest M3 assist chips (label-small, tonal). */
html[data-theme="m3"] .apple-workspace .sales-workspace .sales-results:not(.with-photos) .sales-signs .sales-sign{font:var(--md-sys-typescale-label-small);padding:2px 8px;border-radius:var(--md-sys-shape-corner-small);background:var(--md-sys-color-surface-container-highest);color:var(--md-sys-color-on-surface-variant)}
/* Stepper: a tonal pill with 40dp buttons; «Додати» a filled button 40dp high. */
html[data-theme="m3"] .apple-workspace .sales-workspace .sales-results:not(.with-photos) .quantity-control{grid-template-columns:40px 56px 40px;gap:0;border-radius:var(--md-sys-shape-corner-full);background:var(--md-sys-color-secondary-container);overflow:hidden}
html[data-theme="m3"] .apple-workspace .sales-workspace .sales-results:not(.with-photos) .quantity-control .quantity-step{width:40px;min-width:40px;height:40px;min-height:40px;border:0;border-radius:0;background:transparent;color:var(--md-sys-color-on-secondary-container);font-size:20px}
html[data-theme="m3"] .apple-workspace .sales-workspace .sales-results:not(.with-photos) .quantity-control .qty-input{width:56px;height:40px;min-height:40px;border:0;border-radius:0;background:transparent;color:var(--md-sys-color-on-secondary-container);font:var(--md-sys-typescale-title-small)}
html[data-theme="m3"] .apple-workspace .sales-workspace .sales-results:not(.with-photos) .sales-entry-add,
html[data-theme="m3"] .apple-workspace .sales-workspace .sales-results:not(.with-photos) .sales-product-row.is-browse .sales-product-actions .btn{min-height:40px;padding:0 20px;border-radius:var(--md-sys-shape-corner-full);font:var(--md-sys-typescale-label-large)}
/* «Ще» is the ⋮ icon button; its menu an M3 menu on surface-container. */
html[data-theme="m3"] .apple-workspace .sales-workspace .sales-results:not(.with-photos) .sales-row-more>summary{width:40px;min-width:40px;height:40px;min-height:40px;padding:0;background:transparent;color:var(--md-sys-color-on-surface-variant)}
html[data-theme="m3"] .apple-workspace .sales-workspace .sales-results:not(.with-photos) .sales-row-more>summary svg{width:24px;height:24px;stroke-width:3}
html[data-theme="m3"] .apple-workspace .sales-workspace .sales-results:not(.with-photos) .sales-row-more[open]>div{border:0;border-radius:var(--md-sys-shape-corner-extra-small);background:var(--md-sys-color-surface-container);box-shadow:var(--md-sys-elevation-level2);padding:8px 0}
html[data-theme="m3"] .apple-workspace .sales-workspace .sales-results:not(.with-photos) .sales-row-more[open]>div>*{min-height:48px;border-radius:0;padding:0 16px;font:var(--md-sys-typescale-body-large)}
/* Tablet portrait: the list is 560–719dp wide (the rail beside it). Three short lines instead of a stacked tile:
   name | price · stock | quantity, «Додати», ⋮ · marks | multiplicity. */
@container (min-width:560px) and (max-width:719px){
  html[data-theme="m3"] .apple-workspace .sales-workspace .sales-results:not(.with-photos) .sales-product-row{grid-template-columns:minmax(0,1fr) auto;gap:4px 16px;align-items:start}
  html[data-theme="m3"] .apple-workspace .sales-workspace .sales-results:not(.with-photos) .sales-product-name{grid-column:1;grid-row:1;padding-right:0}
  html[data-theme="m3"] .apple-workspace .sales-workspace .sales-results:not(.with-photos) .sales-pricing{grid-column:2;grid-row:1;align-self:start}
  html[data-theme="m3"] .apple-workspace .sales-workspace .sales-results:not(.with-photos) .sales-stock-block{grid-column:1;grid-row:2;align-self:center}
  html[data-theme="m3"] .apple-workspace .sales-workspace .sales-results:not(.with-photos) .sales-product-actions{grid-column:2;grid-row:2;flex-wrap:nowrap;align-self:center}
  html[data-theme="m3"] .apple-workspace .sales-workspace .sales-results:not(.with-photos) .sales-entry,
  html[data-theme="m3"] .apple-workspace .sales-workspace .sales-results:not(.with-photos) .sales-quantity{flex-wrap:nowrap}
  html[data-theme="m3"] .apple-workspace .sales-workspace .sales-results:not(.with-photos) .sales-signs{grid-column:1;grid-row:3}
  html[data-theme="m3"] .apple-workspace .sales-workspace .sales-results:not(.with-photos) .sales-product-row .sales-pack-line{grid-column:2;grid-row:3;padding-right:44px}
  html[data-theme="m3"] .apple-workspace .sales-workspace .sales-results:not(.with-photos) .sales-row-more{position:static}
  /* An error or a unit conversion under the controls takes the whole width of the controls. */
  html[data-theme="m3"] .apple-workspace .sales-workspace .sales-results:not(.with-photos) .sales-entry:has(.inline-error:not(:empty)),
  html[data-theme="m3"] .apple-workspace .sales-workspace .sales-results:not(.with-photos) .sales-entry:has(.sales-conversion:not([hidden])){flex-wrap:wrap}
  /* Catalog reference: name | price · stock | «В замовлення» · marks and packing under them. */
  html[data-theme="m3"] .apple-workspace .sales-workspace .sales-results:not(.with-photos) .sales-product-row.is-browse .sales-pack-line{grid-column:1 / -1;grid-row:4;padding-right:0}
}
/* «Усі / Обрана точка», «Замовлення / Чернетки»: an M3 segmented button; the chosen segment is tonal with a check. */
html[data-theme="m3"] .apple-workspace .order-tabs{display:inline-flex;gap:0;padding:0;margin:0 0 16px;border:1px solid var(--md-sys-color-outline);border-radius:var(--md-sys-shape-corner-full);background:transparent;overflow:hidden;box-shadow:none}
html[data-theme="m3"] .apple-workspace .order-tabs .order-tab{min-height:40px;max-width:none;margin:0;padding:0 20px;border:0;border-right:1px solid var(--md-sys-color-outline);border-radius:0;background:transparent;color:var(--md-sys-color-on-surface);font:var(--md-sys-typescale-label-large);box-shadow:none}
html[data-theme="m3"] .apple-workspace .order-tabs .order-tab:last-child{border-right:0}
html[data-theme="m3"] .apple-workspace .order-tabs .order-tab.is-current{background:var(--md-sys-color-secondary-container);color:var(--md-sys-color-on-secondary-container)}
html[data-theme="m3"] .apple-workspace .order-tabs .order-tab.is-current::before{content:"✓";margin-right:8px}
/* Empty states read as body text, not as a headline. */
html[data-theme="m3"] .apple-workspace .sales-empty h2{font:var(--md-sys-typescale-body-large);color:var(--md-sys-color-on-surface-variant);text-align:center;margin:0}
/* The groups tree is a list header: title-medium, not a page headline. */
html[data-theme="m3"] .apple-workspace .sales-catalog-tree>summary h2{font:var(--md-sys-typescale-title-medium);color:var(--md-sys-color-on-surface);margin:0}
html[data-theme="m3"] .apple-workspace .sales-catalog-tree>summary{min-height:56px}
/* Rail: the draft count is an M3 badge on the icon, it does not push the destinations down. */
html[data-theme="m3"] .apple-workspace .workspace-nav a{position:relative}
html[data-theme="m3"] .apple-workspace .workspace-nav a .nav-count{position:absolute;top:2px;left:calc(50% + 6px);min-width:16px;height:16px;margin:0;padding:0 4px;border-radius:var(--md-sys-shape-corner-full);background:var(--md-sys-color-error);color:var(--md-sys-color-on-error);font:var(--md-sys-typescale-label-small);line-height:16px;text-align:center}
/* Exchange state chip: one line. */
html[data-theme="m3"] .workspace-tools .sync-status{white-space:nowrap}
/* Saved order card: the point name is the card title (title-medium), the total beside it. */
html[data-theme="m3"] .apple-workspace .sales-saved-order h2{font:var(--md-sys-typescale-title-medium);margin:0 0 4px}
html[data-theme="m3"] .apple-workspace .sales-saved-order .apple-saved-total{font:var(--md-sys-typescale-title-large)}
/* Order as a document (13.11): an outlined M3 card (1dp outline-variant, medium shape), not a 2px primary frame;
   the document name is title-large, the line count a label-large tonal chip, the total title-large. */
html[data-theme="m3"] .sales-doc{border:1px solid var(--md-sys-color-outline-variant);border-radius:var(--md-sys-shape-corner-medium)}
html[data-theme="m3"] .sales-doc-head,html[data-theme="m3"] .sales-doc-tools{border-bottom-color:var(--md-sys-color-outline-variant)}
html[data-theme="m3"] .sales-doc-head h2{font:var(--md-sys-typescale-title-large);color:var(--md-sys-color-on-surface)}
html[data-theme="m3"] .sales-doc-count{font:var(--md-sys-typescale-label-large);border-radius:var(--md-sys-shape-corner-small);color:var(--md-sys-color-on-secondary-container);background:var(--md-sys-color-secondary-container)}
html[data-theme="m3"] .sales-doc-foot strong{font:var(--md-sys-typescale-title-large);color:var(--md-sys-color-on-surface)}
/* Inside the order document (7e945fe) the conditions are a section of the card, not a nested elevated card: flat,
   divided by outline-variant; the summary is a 48dp row in label-large. The order fields sit on the 16dp grid with
   body-small on-surface-variant labels (M3 filled field supporting text). */
html[data-theme="m3"] .sales-doc .sales-order-conditions{background:none!important;border:0!important;border-bottom:1px solid var(--md-sys-color-outline-variant)!important;border-radius:0!important;box-shadow:none!important;margin:0!important;padding:0 16px!important}
html[data-theme="m3"] .sales-doc .sales-order-conditions>summary{min-height:48px;font:var(--md-sys-typescale-label-large);color:var(--md-sys-color-primary)}
html[data-theme="m3"] .sales-doc .sales-order-conditions[open]{padding-bottom:12px!important}
html[data-theme="m3"] .sales-doc-fields{padding:12px 16px;gap:16px;border-bottom-color:var(--md-sys-color-outline-variant)}
html[data-theme="m3"] .sales-doc-fields label>span{font:var(--md-sys-typescale-body-small);color:var(--md-sys-color-on-surface-variant)}
/* Quantity entry without «Додати» (8155291): the empty field shows the step as a placeholder, so it must read lighter
   than a typed number (M3: placeholder on-surface-variant). In a document line the unit sits beside the stepper. */
html[data-theme="m3"] .sales-product-row .quantity-control input::placeholder{color:var(--md-sys-color-on-surface-variant);opacity:.6}
html[data-theme="m3"] .sales-doc .sales-quantity>.sales-unit-label{grid-column:2;grid-row:1;min-height:0;font:var(--md-sys-typescale-body-large);color:var(--md-sys-color-on-surface-variant)}
/* Last purchase is one line (6fef817): outside the order the whole line is an M3 text button «Як минулого разу · N · дата»
   (label-large, primary, one line with an ellipsis), its label aligned with the text above; in the order it is body-medium
   supporting text «Востаннє …». */
html[data-theme="m3"] .sales-last-buy{font:var(--md-sys-typescale-body-medium);color:var(--md-sys-color-on-surface-variant)}
html[data-theme="m3"] .sales-last-buy .sales-last-add{display:block;width:auto;max-width:calc(100% + 12px);min-height:32px;height:auto;margin-inline-start:-12px;padding:0 12px;border-radius:var(--md-sys-shape-corner-full);font:var(--md-sys-typescale-label-large);line-height:32px;color:var(--md-sys-color-primary);text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* Row warning and promo hint: tonal containers of the warning/success roles, small shape, body-medium. */
html[data-theme="m3"] :is(.sales-row-warning,.sales-row-hint){padding:4px 12px;border:0;border-radius:var(--md-sys-shape-corner-small);font:var(--md-sys-typescale-body-medium)}
html[data-theme="m3"] .sales-row-warning{background:var(--md-ext-color-warning-container);color:var(--md-ext-color-on-warning-container)}
html[data-theme="m3"] .sales-row-hint{background:var(--md-ext-color-success-container);color:var(--md-ext-color-on-success-container)}
/* Debt above the document: a filled M3 card link; overdue uses the error-container role. */
html[data-theme="m3"] .sales-doc-debt{padding:12px 16px;border:0;border-radius:var(--md-sys-shape-corner-medium);background:var(--md-sys-color-surface-container-high);font:var(--md-sys-typescale-body-medium)}
html[data-theme="m3"] .sales-doc-debt>span{color:var(--md-sys-color-on-surface-variant)}
html[data-theme="m3"] .sales-doc-debt>strong{font:var(--md-sys-typescale-title-medium);color:var(--md-sys-color-on-surface)}
html[data-theme="m3"] .sales-doc-debt.is-overdue{background:var(--md-sys-color-error-container)}
html[data-theme="m3"] .sales-doc-debt.is-overdue>span,html[data-theme="m3"] .sales-doc-debt.is-overdue>strong,html[data-theme="m3"] .sales-doc-debt .sales-doc-debt-overdue{color:var(--md-sys-color-on-error-container)}
/* Order path: steps are 32dp chips with the small shape and label-large, like M3 filter chips. */
html[data-theme="m3"] .order-chain{gap:8px}
html[data-theme="m3"] .order-state{font:var(--md-sys-typescale-label-large);border-radius:var(--md-sys-shape-corner-small)}
html[data-theme="m3"] .order-state:is(.is-wait,.is-warn){background:var(--md-ext-color-warning-container);color:var(--md-ext-color-on-warning-container)}
html[data-theme="m3"] .order-state.is-info{background:var(--md-sys-color-secondary-container);color:var(--md-sys-color-on-secondary-container)}
html[data-theme="m3"] .order-state.is-ok{background:var(--md-ext-color-success-container);color:var(--md-ext-color-on-success-container)}
html[data-theme="m3"] .order-state.is-bad{background:var(--md-sys-color-error-container);color:var(--md-sys-color-on-error-container)}
html[data-theme="m3"] .dash-list span.order-state{font:inherit;font-weight:500}
html[data-theme="m3"] .order-state.is-closed{background:var(--md-sys-color-surface-container-high);color:var(--md-sys-color-on-surface-variant)}
html[data-theme="m3"] .order-chain li{min-height:32px;display:flex;align-items:center;padding:0 12px 0 28px;border-radius:var(--md-sys-shape-corner-small);font:var(--md-sys-typescale-label-large);background:var(--md-sys-color-surface-container-high);color:var(--md-sys-color-on-surface-variant)}
html[data-theme="m3"] .order-chain li::before{left:12px}
html[data-theme="m3"] .order-chain li.is-done{background:var(--md-ext-color-success-container);color:var(--md-ext-color-on-success-container)}
html[data-theme="m3"] .order-chain li.is-current{background:var(--md-sys-color-secondary-container);color:var(--md-sys-color-on-secondary-container)}
html[data-theme="m3"] .order-chain li.is-problem{background:var(--md-sys-color-error-container);color:var(--md-sys-color-on-error-container)}

/* ── Web v2 structure in M3 (owner 16.11.2026: the Android app follows web v2, M3 canon over the web look) ── */
/* Selected-customer panel: a surface band; the terms are 32dp assist chips in one row (contract, warehouse, currency, debt). */
html[data-theme="m3"] .point-panel{background:var(--md-sys-color-surface-container);border-bottom:0}
html[data-theme="m3"] .point-panel-label{font:var(--md-sys-typescale-label-medium);color:var(--md-sys-color-primary);text-transform:none;letter-spacing:normal}
html[data-theme="m3"] .point-panel-title h2{font:var(--md-sys-typescale-title-large);color:var(--md-sys-color-on-surface)}
html[data-theme="m3"] .point-panel-address{font:var(--md-sys-typescale-body-medium);color:var(--md-sys-color-on-surface-variant)}
html[data-theme="m3"] .point-panel-terms{display:flex;flex-wrap:wrap;align-items:center;gap:8px;flex:1 1 100%;min-width:0;max-width:100%}
html[data-theme="m3"] .point-panel-terms>span,html[data-theme="m3"] .point-panel-terms .point-panel-term,html[data-theme="m3"] .point-panel-terms select.point-panel-select,html[data-theme="m3"] .point-panel-debt{display:inline-flex;align-items:center;box-sizing:border-box;height:32px;min-height:32px;max-width:100%;margin:0;padding:0 16px;border:1px solid var(--md-sys-color-outline-variant);border-radius:var(--md-sys-shape-corner-small);background:transparent;box-shadow:none;font:var(--md-sys-typescale-label-large);color:var(--md-sys-color-on-surface-variant);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
html[data-theme="m3"] .point-panel-terms select.point-panel-select{width:auto;max-width:min(100%,360px);text-overflow:ellipsis;padding-right:36px;background:transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5z' fill='%2344474e'/%3E%3C/svg%3E") no-repeat right 10px center;-webkit-appearance:none;appearance:none}
/* Panel actions are M3 text buttons: they change the context, they are not the main action of the screen. */
html[data-theme="m3"] .point-panel-actions .btn,html[data-theme="m3"] .apple-workspace .point-panel-actions .btn,html[data-theme="m3"] .apple-workspace .point-panel-actions .btn.point-card-reset{min-height:40px;padding:0 12px;border:0;border-radius:var(--md-sys-shape-corner-full);background:transparent;box-shadow:none;font:var(--md-sys-typescale-label-large);color:var(--md-sys-color-primary)}
/* Customer menu: M3 primary tabs — 48dp, title-small, 3dp indicator with rounded top under the label, divider under the row. */
html[data-theme="m3"] .point-menu{gap:0;border-bottom:1px solid var(--md-sys-color-outline-variant);background:transparent}
html[data-theme="m3"] .point-menu a{position:relative;display:inline-flex;align-items:center;gap:8px;min-height:48px;padding:0 16px;border:0;border-radius:0;background:transparent;box-shadow:none;font:var(--md-sys-typescale-title-small);color:var(--md-sys-color-on-surface-variant);white-space:nowrap}
html[data-theme="m3"] .point-menu a.is-current{color:var(--md-sys-color-primary);background:transparent}
html[data-theme="m3"] .point-menu a.is-current::after{content:"";position:absolute;left:16px;right:16px;bottom:0;height:3px;border-radius:3px 3px 0 0;background:var(--md-sys-color-primary)}
html[data-theme="m3"] .point-menu a b{min-width:16px;height:16px;padding:0 4px;border-radius:var(--md-sys-shape-corner-full);font:var(--md-sys-typescale-label-small);line-height:16px;background:var(--md-sys-color-primary);color:var(--md-sys-color-on-primary)}
html[data-theme="m3"] .point-menu a b.is-alert{background:var(--md-sys-color-error);color:var(--md-sys-color-on-error)}
/* «Що купував / Давно не купував / Радимо»: three equal entries into a window — tonal 56dp list entries with a trailing chevron. */
html[data-theme="m3"] .work-assort-btn,html[data-theme="m3"] .apple-workspace .work-assort-btn{justify-content:space-between;min-height:56px;padding:0 16px;border:0;border-radius:var(--md-sys-shape-corner-medium);background:var(--md-sys-color-secondary-container);box-shadow:none;font:var(--md-sys-typescale-label-large);color:var(--md-sys-color-on-secondary-container);text-align:left}

/* ── Android patterns over the web v2 layout (owner 16.11.2026: «это же андроид, тут можно сворачивать, смахивать»;
      the web version is a sample, not a spec) ── */
/* Navigation rail: labels are label-medium on up to two lines, never cut with an ellipsis. */
html[data-theme="m3"] .workspace-nav a span{white-space:normal;overflow:visible;text-overflow:clip;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;max-width:80px;font:var(--md-sys-typescale-label-small);text-align:center;overflow-wrap:normal;word-break:normal;hyphens:manual}
/* Search row: one line of controls — 56dp search bar, 48dp currency switch and filter button, centred on one axis. */
html[data-theme="m3"] .sales-search-controls{align-items:center}
html[data-theme="m3"] .sales-search-controls .price-currency{height:48px;align-self:center}
html[data-theme="m3"] .sales-search-controls .sales-filters>summary{min-height:48px;height:48px;padding:0 16px;display:inline-flex;align-items:center;gap:8px;border-radius:var(--md-sys-shape-corner-full);font:var(--md-sys-typescale-label-large)}
/* Goods are one M3 list: rows divided by outline-variant inside one surface, not a card with a shadow per product. */
html[data-theme="m3"] .sales-results{background:var(--md-sys-color-surface-container-low);border-radius:var(--md-sys-shape-corner-medium);overflow:hidden}
html[data-theme="m3"] .sales-results>.sales-product-row,html[data-theme="m3"] .apple-workspace .sales-results>.sales-product-row,html[data-theme="m3"] .apple-workspace .sales-v2 .sales-results>.sales-product-row.is-compact{margin:0;border:0;border-bottom:1px solid var(--md-sys-color-outline-variant);border-radius:0;box-shadow:none;background:transparent}
html[data-theme="m3"] .sales-results>.sales-product-row:last-child{border-bottom:0}
/* Collapsing customer panel (like a collapsing top app bar): once the page scrolls, only the name and the tabs stay. */
html[data-theme="m3"] .point-panel :is(.point-panel-label,.point-panel-address,.point-panel-terms,.point-panel-actions){transition:opacity .15s}
html[data-theme="m3"].vitol-scrolled .point-panel :is(.point-panel-label,.point-panel-address,.point-panel-terms,.point-panel-actions,.point-panel-debt){display:none!important}
html[data-theme="m3"].vitol-scrolled .point-panel-title h2{font:var(--md-sys-typescale-title-medium)}
html[data-theme="m3"].vitol-scrolled .point-panel{box-shadow:var(--md-sys-elevation-level2)}
/* The panel sticks under the app bar (its height is measured by the shell into --vitol-top), not under the status line. */
html[data-theme="m3"] .point-panel{top:var(--vitol-top,64px)}
/* Swiping between customer tabs: the new tab slides in from the side it came from. */
@keyframes vitol-in-next{from{transform:translateX(48px);opacity:.4}to{transform:none;opacity:1}}
@keyframes vitol-in-prev{from{transform:translateX(-48px);opacity:.4}to{transform:none;opacity:1}}
html[data-theme="m3"].vitol-swipe-next main{animation:vitol-in-next .2s ease-out}
html[data-theme="m3"].vitol-swipe-prev main{animation:vitol-in-prev .2s ease-out}
/* Pull to refresh: the M3 circular indicator on a surface disc under the top bar. */
.vitol-ptr{position:fixed;left:50%;top:var(--vitol-top,64px);z-index:1000;width:40px;height:40px;margin-left:-20px;border-radius:50%;background:var(--md-sys-color-surface-container-high);box-shadow:var(--md-sys-elevation-level3);display:grid;place-items:center;transform:translateY(-56px);opacity:0;pointer-events:none}
.vitol-ptr svg{width:24px;height:24px;color:var(--md-sys-color-primary)}
.vitol-ptr.is-busy svg{animation:vitol-spin .8s linear infinite}
@keyframes vitol-spin{to{transform:rotate(360deg)}}
/* Exchange state chip in the app bar: one line. */
html[data-theme="m3"] .workspace-topbar .sync-status{white-space:nowrap}
/* Windows (salesModal) are M3 dialogs: scrim, extra-large shape, surface-container-high, headline-small title,
   closing is an icon button. On a phone the same window is a bottom sheet with a drag handle (swipe down closes it,
   vitol-shell.js); Android Back closes it too (MainActivity → window.__vitolBack). */
html[data-theme="m3"] .sales-modal-layer{background:rgb(0 0 0 / .32)}
html[data-theme="m3"] .sales-modal,html[data-theme="m3"] .apple-workspace .sales-modal{border:0;border-radius:var(--md-sys-shape-corner-extra-large);background:var(--md-sys-color-surface-container-high);box-shadow:var(--md-sys-elevation-level3)}
html[data-theme="m3"] .sales-modal :is(h1,h2):first-of-type{font:var(--md-sys-typescale-headline-small);color:var(--md-sys-color-on-surface)}
html[data-theme="m3"] .sales-modal .sales-modal-close,html[data-theme="m3"] .apple-workspace .sales-modal .sales-modal-close{width:48px;min-width:48px;height:48px;min-height:48px;padding:0;border:0;border-radius:var(--md-sys-shape-corner-full);background:transparent;box-shadow:none;color:var(--md-sys-color-on-surface-variant);display:inline-grid;place-items:center}
html[data-theme="m3"] .sales-modal .sales-modal-close>span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
html[data-theme="m3"] .sales-modal .sales-modal-close svg{width:24px;height:24px}
@media(max-width:599px){
  html[data-theme="m3"] .sales-modal,html[data-theme="m3"] .apple-workspace .sales-modal{border-radius:var(--md-sys-shape-corner-extra-large) var(--md-sys-shape-corner-extra-large) 0 0;background:var(--md-sys-color-surface-container-low);padding-top:28px;position:relative;transition:transform .2s}
  html[data-theme="m3"] .sales-modal::before{content:"";position:absolute;top:12px;left:50%;width:32px;height:4px;margin-left:-16px;border-radius:2px;background:var(--md-sys-color-on-surface-variant);opacity:.4}
}

/* ── Feel of a native app (owner 18.11.2026: «плавним, м'яким, зручним, максимально швидкий відгук на кліки») ──
   The web re-renders the whole screen on every action, so entry animations hang on short-lived classes the shell sets
   (vitol-route, vitol-modal-in), never on the elements themselves. */
/* Instant response: no double-tap zoom delay, no grey tap flash; the pressed state layer paints on touch, before the
   screen is rebuilt (M3 pressed = 10 % of the content colour). The ripple is drawn by the shell in its own layer. */
html[data-theme="m3"]{-webkit-tap-highlight-color:transparent;touch-action:manipulation}
html[data-theme="m3"] :is(button,.btn,a.btn,summary,.point-menu a,.workspace-nav a,.bottom-nav a,.work-assort-btn,[data-sales-window],[role=button]):active{background-image:linear-gradient(color-mix(in srgb,currentColor 10%,transparent),color-mix(in srgb,currentColor 10%,transparent))}
html[data-theme="m3"] :is(.apple-customer-row,.sales-product-row,.work-step,tr):active{background-image:linear-gradient(color-mix(in srgb,var(--md-sys-color-on-surface) 6%,transparent),color-mix(in srgb,var(--md-sys-color-on-surface) 6%,transparent))}
.vitol-ripple-host{position:fixed;z-index:2000;overflow:hidden;pointer-events:none;contain:strict}
.vitol-ripple{position:absolute;border-radius:50%;background:currentColor;opacity:.16;transform:scale(0);animation:vitol-ripple .42s cubic-bezier(.2,0,0,1) forwards}
@keyframes vitol-ripple{to{transform:scale(1);opacity:0}}
/* Soft surfaces: tonal cards without shadows and with the large shape; elevation stays for what floats
   (dialogs, the stuck customer panel, snackbars). */
html[data-theme="m3"] :is(.card,.panel,.today-card,.stat,.sales-context,.sales-empty,.sales-customer-list,.sales-order-conditions,.sales-draft-options,.invoice-card){box-shadow:none!important;border-radius:var(--md-sys-shape-corner-large)!important}
html[data-theme="m3"] .sales-doc .sales-order-conditions{border-radius:0!important}
/* Motion: a screen enters with M3 fade-through (fade + 8 dp rise, emphasized decelerate); a dialog grows in, a phone
   sheet slides up, the scrim fades. Users who turned animations off in Android get none. */
@keyframes vitol-route-in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes vitol-dialog-in{from{opacity:0;transform:scale(.92)}to{opacity:1;transform:none}}
@keyframes vitol-sheet-in{from{transform:translateY(100%)}to{transform:none}}
@keyframes vitol-scrim-in{from{opacity:0}to{opacity:1}}
html[data-theme="m3"].vitol-route main{animation:vitol-route-in .22s cubic-bezier(.05,.7,.1,1)}
html[data-theme="m3"].vitol-modal-in .sales-modal-layer{animation:vitol-scrim-in .2s linear}
html[data-theme="m3"].vitol-modal-in .sales-modal{animation:vitol-dialog-in .25s cubic-bezier(.05,.7,.1,1)}
@media(max-width:599px){html[data-theme="m3"].vitol-modal-in .sales-modal{animation:vitol-sheet-in .3s cubic-bezier(.05,.7,.1,1)}}
html[data-theme="m3"] :is(.point-panel,.point-panel *){transition-property:opacity,background-color;transition-duration:.15s}
@media(prefers-reduced-motion:reduce){html[data-theme="m3"] *,html[data-theme="m3"] *::before,html[data-theme="m3"] *::after{animation:none!important;transition:none!important}.vitol-ripple{display:none}}
/* «Робота з контрагентом» in the 80 dp rail: label-small with a slightly tighter tracking, so the long word fits. */
html[data-theme="m3"] .workspace-nav a span{letter-spacing:-.25px;padding:0 2px}

/* ── Панель выбранного контрагента: компактно, без переносов (владелец 19.11.2026: «не влезает», «окно уезжает») ──
   Строка 1: имя и адрес (в одну строку с многоточием) · «Інший» и «Закрити» справа.
   Строка 2: договор, склад, валюта и долг — одной строкой чипов, лишнее листается вбок. Затем вкладки. */
html[data-theme="m3"] .point-panel.is-set .point-panel-row{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"title actions" "terms debt";align-items:center;column-gap:8px;row-gap:8px;padding-top:8px;padding-bottom:8px}
html[data-theme="m3"] .point-panel.is-set .point-panel-label{display:none}
html[data-theme="m3"] .point-panel.is-set .point-panel-title{grid-area:title;min-width:0}
html[data-theme="m3"] .point-panel.is-set .point-panel-title h2{margin:0;font:var(--md-sys-typescale-title-medium);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
html[data-theme="m3"] .point-panel.is-set .point-panel-address{margin:0;font:var(--md-sys-typescale-body-small);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
html[data-theme="m3"] .point-panel.is-set .point-panel-actions{grid-area:actions;display:flex;flex-wrap:nowrap;align-items:center;gap:0;margin:0}
html[data-theme="m3"] .point-panel.is-set .point-panel-actions .btn{min-height:40px;padding:0 12px;white-space:nowrap}
/* Договор, склад, валюта — целиком; не помещаются в строку — переносятся (владелец 24.11.2026: «подписи договора и складов
   обрезаны»). Долг — справа, всегда виден. */
html[data-theme="m3"] .point-panel.is-set .point-panel-terms{grid-area:terms;display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:0;min-width:0}
html[data-theme="m3"] .point-panel.is-set .point-panel-terms>*{flex:0 1 auto;min-width:0;max-width:100%;min-height:32px;white-space:nowrap}
html[data-theme="m3"] .point-panel.is-set .point-panel-terms>span{height:auto;padding-top:5px;padding-bottom:5px;white-space:normal;line-height:20px;overflow-wrap:anywhere}
html[data-theme="m3"] .point-panel.is-set .point-panel-terms select.point-panel-select{max-width:100%}
html[data-theme="m3"] .point-panel.is-set .point-panel-debt{grid-area:debt;justify-self:end;flex:none;min-height:32px;margin:0;white-space:nowrap}
/* Вкладки: одной строкой, листаются вбок, край растворяется — видно, что дальше есть ещё. */
html[data-theme="m3"] .point-panel.is-set .point-menu{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;-webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 32px),transparent);mask-image:linear-gradient(90deg,#000 calc(100% - 32px),transparent)}
html[data-theme="m3"] .point-panel.is-set .point-menu::-webkit-scrollbar{display:none}
html[data-theme="m3"] .point-panel.is-set .point-menu a{flex:none;white-space:nowrap}
/* Все шесть вкладок в ширину планшета без прокрутки (владелец 24.11.2026): поля вкладки 8 dp вместо 16. */
html[data-theme="m3"] .point-panel.is-set .point-menu{padding-left:4px;padding-right:4px;-webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 16px),transparent);mask-image:linear-gradient(90deg,#000 calc(100% - 16px),transparent)}
html[data-theme="m3"] .point-panel.is-set .point-menu a{padding:0 8px}
html[data-theme="m3"] .point-panel.is-set .point-menu a.is-current::after{left:8px;right:8px}
/* Телефон: кнопки — под именем, чтобы имя не сжималось до пары букв. */
@media (max-width:599px){
  html[data-theme="m3"] .point-panel.is-set .point-panel-row{grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"title title" "terms debt" "actions actions"}
  html[data-theme="m3"] .point-panel.is-set .point-panel-actions{justify-content:flex-start;margin-left:-12px}
}
/* «Інший контрагент»: окно выбора — по центру экрана поверх содержимого, а не от кнопки (уезжало за левый край). */
html[data-theme="m3"] .point-panel.is-set .point-chooser[open] .point-chooser-panel{position:fixed;left:50%;top:calc(var(--vitol-top,64px) + 72px);right:auto;transform:translateX(-50%);width:min(560px,calc(100vw - 32px));max-height:calc(100vh - var(--vitol-top,64px) - 104px);overflow:auto;z-index:60;border-radius:var(--md-sys-shape-corner-extra-large);background:var(--md-sys-color-surface-container-high);box-shadow:var(--md-sys-elevation-level3)}
html[data-theme="m3"] .point-panel .point-chooser[open]>summary::before{content:"";position:fixed;inset:0;z-index:59;background:rgb(0 0 0/.32);cursor:default}
/* Фокус, поставленный программой после перехода (#main), рамкой не рисуется — только с клавиатуры. */
html[data-theme="m3"] main:focus,html[data-theme="m3"] #main:focus{outline:none}
/* Пока открыт выбор контрагента, панель (и её затемнение) — поверх верхней полосы и бокового меню. */
html[data-theme="m3"] .point-panel:has(.point-chooser[open]){z-index:1000}
/* Без выбранного контрагента (поиск на «Сьогодні»): окно шириной 560 от поля поиска вылезало за правый край —
   страница становилась шире экрана, и Android сдвигал и уменьшал весь экран («окно уезжает»). Теперь — по центру. */
html[data-theme="m3"] .point-panel.is-empty .point-chooser[open]>.point-chooser-panel{position:fixed;left:50%;right:auto;top:calc(var(--vitol-top,64px) + 8px);transform:translateX(-50%);width:min(560px,calc(100vw - 32px));min-width:0;max-height:calc(100vh - var(--vitol-top,64px) - 40px);overflow:auto;z-index:60;border-radius:var(--md-sys-shape-corner-extra-large);box-shadow:var(--md-sys-elevation-level3)}
/* Tablet sign-in (owner, 19.11.2026): «Показати пароль» and the package version under the card. */
html[data-theme="m3"] .login-redesign .login-show-password{display:flex;gap:12px;align-items:center;margin:8px 0 0;font:var(--md-sys-typescale-body-medium);color:var(--md-sys-color-on-surface-variant);min-height:40px}
html[data-theme="m3"] .login-redesign .login-show-password input{min-height:0;width:18px;height:18px;accent-color:var(--md-sys-color-primary)}
html[data-theme="m3"] .login-m3 .login-version{font:var(--md-sys-typescale-body-small);color:var(--md-sys-color-on-surface-variant);margin:0}
html[data-theme="m3"] .login-m3 .login-description{color:var(--md-sys-color-on-surface-variant)}

/* The order check on the order page (owner, 23.11.2026): status line, «Умови й підсумок», «було → стало» */
html[data-theme="m3"] .sales-check-status{font:var(--md-sys-typescale-body-medium);color:var(--md-sys-color-on-surface-variant)}
html[data-theme="m3"] .sales-check-status.is-verified,html[data-theme="m3"] .sales-order-bar-status.is-verified{color:var(--md-sys-color-primary)}
html[data-theme="m3"] .sales-check-status.is-verified .sales-check-dot,html[data-theme="m3"] .sales-check-status.is-checking .sales-check-dot,html[data-theme="m3"] .sales-check-status.is-pending .sales-check-dot{background:var(--md-sys-color-primary)}
html[data-theme="m3"] .sales-check-status.is-blocked,html[data-theme="m3"] .sales-check-status.is-error,html[data-theme="m3"] .sales-order-bar-status.is-blocked,html[data-theme="m3"] .sales-order-bar-status.is-error{color:var(--md-sys-color-error)}
html[data-theme="m3"] .sales-check-status.is-blocked .sales-check-dot,html[data-theme="m3"] .sales-check-status.is-error .sales-check-dot{background:var(--md-sys-color-error)}
/* The order check shows a still dot on the tablet (owner, 26.11.2026): its endless pulse redrew the screen 60 times a
   second for as long as the check took over the network (2 s and more on the owner's tablet). The text says it is checking. */
html[data-theme="m3"] .sales-check-status .sales-check-dot{animation:none}
/* The same for the line of a running operation at the top: it stays shown, still, while the operation goes. */
html[data-theme="m3"] .loading-line{animation:none}
html[data-theme="m3"] .sales-order-check{margin:16px;padding:16px;border-radius:12px;background:var(--md-sys-color-surface-container-low);border:1px solid var(--md-sys-color-outline-variant)}
html[data-theme="m3"] .sales-order-check h2{font:var(--md-sys-typescale-title-medium)}
html[data-theme="m3"] .sales-order-check h3{font:var(--md-sys-typescale-label-large);color:var(--md-sys-color-on-surface-variant)}
html[data-theme="m3"] .sales-order-check-total{border-top-color:var(--md-sys-color-outline-variant)}
html[data-theme="m3"] .sales-order-check-total>.spread>strong{font:var(--md-sys-typescale-title-large)}
html[data-theme="m3"] .sales-order-check-total p{font:var(--md-sys-typescale-body-medium);color:var(--md-sys-color-on-surface-variant)}
html[data-theme="m3"] .sales-price-change{font:var(--md-sys-typescale-body-medium);border-radius:8px}
/* «Так, видалити»: the filled error button of M3 (the bridge mapped it to error-container + on-primary: unreadable) */
html[data-theme="m3"] .apple-workspace :is(#main,.point-panel) .draft-confirm .draft-confirm-yes{background:var(--md-sys-color-error)!important;color:var(--md-sys-color-on-error)!important}
html[data-theme="m3"] .apple-workspace :is(#main,.point-panel) .draft-confirm .draft-confirm-yes:hover{background:var(--md-sys-color-error)!important;filter:brightness(.92)}
/* «Функціонал у розробці» in a window (Прийняти оплату, Зафіксувати домовленість): the window is the surface, the stub
   brings no second panel of its own colour and frame inside it (25.11.2026, tablet). */
html[data-theme="m3"] .sales-modal.is-soon .sales-soon{background:none;padding:8px 0 0;gap:8px}
html[data-theme="m3"] .sales-modal.is-soon .sales-soon h1{font:var(--md-sys-typescale-headline-small);color:var(--md-sys-color-on-surface)}
html[data-theme="m3"] .sales-modal.is-soon .sales-soon-text{font:var(--md-sys-typescale-body-medium);color:var(--md-sys-color-on-surface-variant)}
html[data-theme="m3"] .sales-modal.is-soon .sales-soon .btn{margin-top:16px}
/* «Прострочений борг 23,92 $»: the chip is a flex box, the space between the label and the sum collapsed (owner 25.11.2026). */
html[data-theme="m3"] .point-panel-debt{gap:4px}
/* Lines of the 1C document in M3 (owner, 25.11.2026): the bar and a light tint of the warning / success roles; the marks are
   small chips of the line; a line 1C took out stays on the surface, grey. */
html[data-theme="m3"] .order-line.is-changed{background:color-mix(in srgb,var(--md-ext-color-warning-container) 30%,transparent);border-left-color:var(--md-ext-color-warning)}
html[data-theme="m3"] .order-line.is-added{background:color-mix(in srgb,var(--md-ext-color-success-container) 30%,transparent);border-left-color:var(--md-ext-color-success)}
html[data-theme="m3"] .order-line.is-removed{background:transparent;border-left-color:var(--md-sys-color-outline-variant)}
html[data-theme="m3"] .order-line.is-removed strong,html[data-theme="m3"] .order-line.is-removed .order-line-math{color:var(--md-sys-color-on-surface-variant)}
html[data-theme="m3"] .order-line .order-mark{background:var(--md-sys-color-surface-container-high);color:var(--md-sys-color-on-surface-variant)}
html[data-theme="m3"] .order-line .order-mark.is-added{background:var(--md-ext-color-success-container);color:var(--md-ext-color-on-success-container)}
html[data-theme="m3"] .order-was{color:var(--md-sys-color-on-surface-variant)}
html[data-theme="m3"] .order-changed-1c{color:var(--md-ext-color-warning)}

/* «Показувати фото» on the tablet (owner, 26.11.2026): below 1100 px the compact 60 px thumbnails of the catalogue and the
   picker do not apply, and a thumbnail took the width of its picture — a wide banner squeezed the name and the stock of
   the product. A thumbnail is at most 160 px wide; the picture fits in it whole. */
html[data-theme="m3"] .apple-workspace .sales-results:not(.with-photos) .sales-product-row.has-photo>.product-thumb{max-width:160px;justify-self:start}
html[data-theme="m3"] .apple-workspace .sales-results:not(.with-photos) .sales-product-row.has-photo>.product-thumb img{width:100%;height:100%;object-fit:contain}
/* The gallery of a product card (owner, 26.11.2026): dots and arrows in the M3 roles. */
html[data-theme="m3"] .product-gallery-dot::before{background:var(--md-sys-color-outline-variant)}
html[data-theme="m3"] .product-gallery-dot[aria-current="true"]::before{background:var(--md-sys-color-primary)}
html[data-theme="m3"] .product-gallery-arrow{background:var(--md-sys-color-surface-container-lowest);color:var(--md-sys-color-on-surface)}
html[data-theme="m3"] .product-gallery-count{background:rgba(26,28,30,.6);color:#fff}
html[data-theme="m3"] .product-gallery-track>.product-thumb{background:var(--md-sys-color-surface-container-low)}
