:root {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #303030; background: #f1f1f1; font-size: 14px; line-height: 1.5; font-synthesis: none;
  --muted: #616161; --border: #dedede; --surface: #fff; --accent: #303030;
  --sidebar-width: 220px; --radius: 12px; --shadow: 0 1px 0 #00000006, 0 1px 3px #00000004;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
button, input, select, textarea { border-radius: 8px; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 27px; font-weight: 650; letter-spacing: -.8px; line-height: 1.25; }
h2 { font-size: 16px; font-weight: 650; letter-spacing: -.25px; line-height: 1.4; }
h3 { font-size: 14px; font-weight: 600; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid #005bd3; outline-offset: 3px; }
[hidden] { display: none !important; }
input, select, textarea { min-width: 0; color: inherit; background: #fff; border: 1px solid #b5b5b5; }
input { width: 100%; height: 38px; padding: 8px 12px; }
input::placeholder { color: #777; }
input:focus, select:focus, textarea:focus { border-color: #616161; }
select { min-height: 38px; padding: 8px 32px 8px 12px; }
select:disabled, input:disabled { background: #f7f7f7; }
input[type="checkbox"] { width: 16px; height: 16px; margin: 0; accent-color: #303030; flex: none; }
svg { flex: none; vertical-align: middle; }
.icon { width: 20px; height: 20px; }
.logo { display: block; width: 132px; max-width: 100%; height: auto; object-fit: contain; filter: brightness(0); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 12px; top: -80px; z-index: 100; padding: 10px 16px; background: #fff; border: 1px solid var(--border); border-radius: 8px; }
.skip-link:focus { top: 12px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 7px 13px; border: 1px solid #c9c9c9; border-radius: 8px; background: #fff; color: #303030; font-size: 13px; font-weight: 550; line-height: 1.4; text-decoration: none; white-space: nowrap; box-shadow: 0 1px 0 #0000000d; }
.button:hover:not(:disabled) { background: #f7f7f7; border-color: #aaa; }
.button.primary { background: #303030; color: #fff; border-color: #242424; box-shadow: inset 0 1px 0 #ffffff20, 0 1px 0 #0000001a; }
.button.primary:hover:not(:disabled) { background: #1a1a1a; border-color: #1a1a1a; }
.button.danger { color: #b42318; border-color: #e4c5c2; }
.button.small-button { min-height: 32px; padding: 5px 10px; font-size: 12px; }
.button .icon { width: 17px; height: 17px; }
.text-button { min-height: 32px; padding: 6px 0; border: 0; background: none; color: #4a4a4a; font-size: 13px; line-height: 1.5; text-align: left; }
.text-button:hover:not(:disabled) { text-decoration: underline; }
.text-button.danger { color: #b42318; }
.icon-button { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid var(--border); background: #fff; color: #4a4a4a; }
.icon-button:hover:not(:disabled) { background: #f1f1f1; }
.alert { display: flex; align-items: flex-start; gap: 9px; padding: 12px 14px; border: 1px solid #edc9c4; border-radius: 8px; background: #fff4f2; color: #9c2b20; font-size: 13px; overflow-wrap: anywhere; }
.alert.success { border-color: #bee4cf; background: #effaf3; color: #176b43; }
.alert .icon { width: 17px; height: 17px; margin-top: 1px; }
.alert + .alert { margin-top: 8px; }
.empty-state { display: grid; justify-items: center; align-content: center; gap: 9px; min-height: 240px; padding: 36px 24px; text-align: center; color: var(--muted); }
.empty-state .empty-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 5px; border: 1px solid #e7e7e7; border-radius: 12px; background: #f7f7f7; color: #707070; }
.empty-state h2, .empty-state h3 { color: #303030; }
.empty-state p { max-width: 350px; font-size: 13px; }
.inline-loading { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 130px; padding: 32px 16px; color: var(--muted); font-size: 13px; }
.spinner { display: inline-block; flex: none; width: 16px; height: 16px; border: 2px solid #dedede; border-top-color: #616161; border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* A simple, unboxed sign-in form with a centered brand. */
.auth-page { display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; padding: 48px 24px; background: #f7f8fb; }
.auth-wrap { width: min(100%, 420px); }
.auth-brand { display: flex; justify-content: center; margin-bottom: 24px; }
.auth-brand .logo { width: 132px; height: auto; }
.auth-card { width: 100%; }
.auth-heading { margin-bottom: 28px; }
.auth-card h1 { color: #1e1e1e; font-size: 32px; font-weight: 650; letter-spacing: -1.1px; }
.auth-intro { margin-top: 12px; color: var(--muted); font-size: 14px; }
.field { display: grid; gap: 7px; min-width: 0; }
.field label { font-size: 13px; font-weight: 550; }
.auth-card .alert { margin-bottom: 18px; }

/* Fixed desktop navigation; the mobile drawer leaves the page full width. */
.app-shell { min-height: 100vh; min-height: 100dvh; padding-left: var(--sidebar-width); }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; display: flex; flex-direction: column; width: var(--sidebar-width); height: 100vh; height: 100dvh; padding: 18px 12px 14px; overflow-y: auto; overscroll-behavior: contain; border-right: 1px solid #dedede; background: #ebebeb; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 0 12px 22px; }
.sidebar-brand .logo { width: 96px; height: auto; }
/* StemLot Vendor: the wordmark and the product name beside it. */
.brand-home { display: inline-flex; align-items: center; gap: 8px; min-width: 0; color: #303030; text-decoration: none; }
.brand-product { padding-left: 8px; border-left: 1px solid #d4d4d4; font-size: 15px; font-weight: 600; letter-spacing: -.2px; line-height: 22px; white-space: nowrap; }
/* The choice of vendor in the account panel, for staff of several vendors. */
.vendor-switch { display: grid; gap: 6px; min-width: 0; padding: 4px 10px 12px; margin-bottom: 6px; border-bottom: 1px solid #eee; }
.vendor-switch-label { color: #6b6b6b; font-size: 11px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; }
.vendor-switch select { width: 100%; min-height: 40px; padding: 6px 8px; border: 1px solid #cfcfcf; border-radius: 8px; background: #fff; color: #202020; font: inherit; font-size: 14px; font-weight: 600; }
.sidebar-nav { display: grid; flex: none; gap: 4px; }
.nav-link { display: flex; align-items: center; gap: 10px; min-height: 39px; padding: 9px 12px; border-radius: 8px; color: #4a4a4a; font-size: 13px; font-weight: 550; text-decoration: none; }
.nav-link:hover { color: #202020; background: #e0e0e0; }
.nav-link[aria-current="page"] { color: #202020; background: #fff; box-shadow: 0 1px 3px #0000000d; }
.nav-link .icon { width: 19px; height: 19px; color: #616161; }
.nav-link[aria-current="page"] .icon { color: #303030; }
.sidebar-footer { flex: none; margin-top: auto; padding: 16px 10px 0; border-top: 1px solid #d4d4d4; }
.signed-in { display: flex; align-items: center; gap: 10px; min-width: 0; margin-bottom: 10px; }
.avatar { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 9px; background: #d8e4da; color: #345a3d; font-size: 12px; font-weight: 600; }
.signed-in-text { min-width: 0; }
.signed-in-name, .signed-in-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.signed-in-name { font-size: 12px; font-weight: 600; }
.signed-in-email { margin-top: 2px; color: var(--muted); font-size: 11px; }
.logout-button { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 34px; padding: 6px 0; border: 0; background: none; color: #4a4a4a; font-size: 12px; }
.logout-button:hover { color: #202020; }
.logout-button .icon { width: 17px; height: 17px; }
.mobile-bar, .sidebar-close, .navigation-backdrop { display: none; }
.main { width: 100%; min-width: 0; padding: 30px 32px 48px; }
#main:focus, .company-detail:focus, .pricing-detail:focus { outline: none; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-heading > div, .page-heading > h1 { min-width: 0; }
.page-heading p { max-width: 720px; margin-top: 6px; color: var(--muted); font-size: 13px; }
.page-heading .button { flex: none; margin-top: 1px; }
.heading-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.page-alert:empty { display: none; }
.page-alert { margin-bottom: 18px; }
.panel { min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 17px 20px; border-bottom: 1px solid #ebebeb; }
.panel-heading > div { min-width: 0; }
.panel-heading p { margin-top: 4px; color: var(--muted); font-size: 12px; }
.count-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; min-height: 22px; padding: 2px 7px; border-radius: 6px; background: #f0f0f0; color: #616161; font-size: 11px; font-weight: 550; }
.status { display: inline-flex; align-items: center; gap: 5px; flex: none; padding: 3px 8px; border-radius: 6px; color: #575757; background: #f0f0f0; font-size: 11px; font-weight: 500; line-height: 1.4; white-space: nowrap; }
.status.active { color: #146c43; background: #dff2e7; }
.status.invited { color: #805d09; background: #fff1ce; }
.status.disabled { color: #a12a24; background: #fce7e4; }
.status.progress { color: #1d4f91; background: #e2ecfb; }
.refresh-indicator { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; }
.refresh-indicator .spinner { width: 12px; height: 12px; border-width: 1.5px; }

/* A compact summary, without a second copy of navigation. */
#development-content { max-width: 960px; }
.settings-symbol { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 9px; color: #616161; background: #f3f3f3; }
.settings-list { max-width: 760px; }
.settings-link { display: flex; align-items: center; gap: 14px; padding: 18px 20px; text-decoration: none; }
.settings-link + .settings-link { border-top: 1px solid #ebebeb; }
.settings-link:hover { background: #fafafa; }
.settings-link > span:nth-child(2) { min-width: 0; flex: 1; }
.settings-link strong { display: block; font-weight: 600; }
.settings-link > span > span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.settings-link > .icon { width: 18px; height: 18px; color: #777; }
#development-content > .alert { margin-bottom: 16px; }
.sync-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sync-row { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px; }
.sync-row + .sync-row { border-left: 1px solid #ebebeb; }
.sync-row p { margin-top: 5px; color: var(--muted); font-size: 12px; }

/* Compact toolbars and useful full-width directories. */
.search-field { position: relative; flex: 1 1 260px; min-width: 0; }
.search-field .icon { position: absolute; top: 50%; left: 12px; width: 18px; height: 18px; color: #707070; transform: translateY(-50%); pointer-events: none; }
.search-field input { height: 38px; padding-left: 38px; }
.company-search, .directory-toolbar, .team-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.company-directory-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; }
.directory-toolbar { padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.panel > .directory-toolbar, .panel > .team-toolbar { margin-bottom: 0; padding: 14px 16px; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; box-shadow: none; }
.check-option { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; color: var(--muted); font-size: 12px; cursor: pointer; }
.directory-table { width: 100%; border-collapse: collapse; table-layout: fixed; text-align: left; }
.directory-table th { padding: 12px 20px; border-bottom: 1px solid var(--border); background: #f7f7f7; color: var(--muted); font-size: 12px; font-weight: 550; }
.directory-table td { padding: 15px 20px; border-bottom: 1px solid #ebebeb; color: #424242; font-size: 13px; overflow-wrap: anywhere; }
.directory-table tr:last-child td { border-bottom: 0; }
.directory-table tbody tr:hover { background: #fafafa; }
.directory-table th:first-child { width: 40%; }
.directory-table th:nth-child(2) { width: 20%; }
.directory-table th:nth-child(3) { width: 34%; }
.directory-table th:last-child { width: 6%; }
.directory-table td.directory-arrow { padding-left: 0; padding-right: 16px; text-align: right; }
.directory-arrow .icon-button { width: 32px; height: 32px; margin-left: auto; border-color: transparent; background: transparent; }
.directory-arrow .icon { width: 17px; height: 17px; color: #777; }
.company-cell { display: flex; align-items: center; gap: 12px; min-width: 0; color: inherit; text-decoration: none; }
.company-cell > span:last-child { min-width: 0; }
.company-avatar{ display: grid; place-items: center; flex: none; width: 36px; height: 36px; overflow: hidden; border: 1px solid #e4e4e4; border-radius: 8px; background: #f4f4f4; color: #777; font-size: 13px; font-weight: 550; }
.company-cell-name { display: block; color: #303030; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
a.company-cell:hover .company-cell-name { text-decoration: underline; }
.company-cell-meta { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.directory-footer, .inventory-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-top: 1px solid #ebebeb; }
.directory-footer p, .inventory-footer p { color: var(--muted); font-size: 12px; }
.directory-footer > div { display: flex; align-items: center; gap: 8px; }
#company-results > .alert { margin: 16px 20px; }

/* A company owns its overview, individual prices, and customer access. */
.breadcrumb { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; color: var(--muted); font-size: 12px; }
.breadcrumb a { display: inline-flex; align-items: center; gap: 7px; width: fit-content; text-decoration: none; }
.breadcrumb a:hover { color: #303030; text-decoration: underline; }
.breadcrumb .icon { width: 16px; height: 16px; }
.company-page-heading { margin-bottom: 22px; }
.company-page-heading h1 { overflow-wrap: anywhere; }
.company-page-heading p { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; overflow-wrap: anywhere; }
.company-tabs { display: flex; gap: 20px; overflow-x: auto; margin-bottom: 24px; border-bottom: 1px solid #d5d5d5; scrollbar-width: none; }
.company-tabs::-webkit-scrollbar { display: none; }
.company-tabs a { display: inline-flex; align-items: center; justify-content: center; flex: none; min-height: 44px; padding: 9px 2px 12px; border-bottom: 3px solid transparent; color: var(--muted); font-size: 13px; font-weight: 550; text-decoration: none; white-space: nowrap; }
.company-tabs a:hover { color: #303030; }
.company-tabs a[aria-current="page"] { border-bottom-color: #303030; color: #202020; }
.company-tabs a:focus-visible { outline-offset: -3px; }
.company-overview-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); gap: 20px; align-items: start; }
.company-detail { min-width: 0; }
.detail-body { padding: 20px; }
.detail-body > .alert { margin-bottom: 16px; }
.member-list { margin: 0; padding: 0; list-style: none; }
.member-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 20px; padding: 18px 0; border-top: 1px solid #ebebeb; }
.member-row:first-child { padding-top: 0; border-top: 0; }
.member-title { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; min-width: 0; }
.member-email { min-width: 0; font-size: 13px; font-weight: 550; overflow-wrap: anywhere; }
.member-audit { grid-column: 1; color: var(--muted); font-size: 11px; line-height: 1.7; overflow-wrap: anywhere; }
.add-member { margin-top: 4px; padding-top: 20px; border-top: 1px solid #ebebeb; }
.add-member label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 550; }
.inline-form-fields { display: flex; align-items: flex-start; gap: 10px; }
.inline-form-fields input { max-width: 520px; }
.form-hint { margin-top: 8px; color: var(--muted); font-size: 12px; }
.empty-members { padding: 4px 0 20px; color: var(--muted); font-size: 13px; }

/* Products retain a useful name column with aligned price and stock values. */
.product-marketplace-status { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 20px; padding-bottom: 16px; border-bottom: 1px solid #ebebeb; font-size: 13px; }
.product-marketplace-status dt { color: var(--muted); }
.product-marketplace-status dd { margin: 0; font-weight: 550; text-align: right; }
.product-visibility-setting { display: flex; align-items: center; justify-content: space-between; gap: 20px; cursor: pointer; }
.product-visibility-setting > span:first-child { display: grid; gap: 5px; }
.product-visibility-setting strong { font-size: 14px; font-weight: 550; }
.product-switch { position: relative; display: grid; place-items: center; flex: none; width: 44px; height: 44px; }
.product-switch input[type="checkbox"] { position: absolute; inset: 0; width: 44px; height: 44px; min-height: 0; margin: 0; opacity: 0; cursor: pointer; }
.product-switch-track { width: 36px; height: 22px; padding: 3px; border-radius: 20px; background: #b5b5b5; pointer-events: none; transition: background .15s; }
.product-switch-track::after { content: ''; display: block; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px #0003; transition: transform .15s; }
.product-switch input:checked + .product-switch-track { background: #303030; }
.product-switch input:checked + .product-switch-track::after { transform: translateX(14px); }
.product-switch input:focus-visible + .product-switch-track { outline: 2px solid #005bd3; outline-offset: 3px; }
.product-switch input:disabled + .product-switch-track { opacity: .5; }
.product-switch input:disabled { cursor: default; }

/* Team is one searchable roster; invitations use a focused dialog. */
.team-toolbar { justify-content: space-between; }
.users-panel > .alert, #users-roster > .alert { margin: 16px 20px; }
.user-list { margin: 0; padding: 0 20px; list-style: none; }
.user-row { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(190px, .7fr) auto; gap: 8px 24px; padding: 20px 0; border-bottom: 1px solid #ebebeb; }
.user-row:last-child { border-bottom: 0; }
.user-role-form { display: flex; align-items: center; flex-wrap: wrap; grid-column: 2; grid-row: 1 / 3; align-content: center; gap: 8px; }
.user-role-form > label { width: 100%; color: var(--muted); font-size: 12px; }
.user-role-form > select { min-height: 34px; padding-top: 6px; padding-bottom: 6px; font-size: 12px; }
.you-label { margin-left: 6px; color: var(--muted); font-size: 11px; font-weight: 400; }
.invite-form { display: grid; gap: 16px; }
.invite-form label { font-size: 13px; font-weight: 550; }
.invite-form input, .invite-form select { display: block; width: 100%; margin-top: 7px; }

/* Product pricing is scoped to the open company, never a second directory. */
.pricing-detail { min-width: 0; }
.pricing-scope-tabs { display: flex; gap: 6px; flex-wrap: wrap; padding: 14px 20px 0; }
.pricing-scope-tabs button, .pricing-scope-tabs a { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 32px; padding: 6px 11px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 550; text-decoration: none; }
.pricing-scope-tabs button:hover, .pricing-scope-tabs a:hover { background: #f7f7f7; }
.pricing-scope-tabs [aria-pressed="true"], .pricing-scope-tabs [aria-selected="true"], .pricing-scope-tabs [aria-current="page"], .pricing-scope-tabs .active { color: #303030; background: #eaeaea; }
.pricing-product-search { display: flex; gap: 10px; padding: 16px 20px 12px; }
.pricing-product-search > .search-field { flex: 1; min-width: 0; }
.pricing-product-search > select { width: 200px; max-width: 35%; font-size: 13px; }
.pricing-list-summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 2px 20px 14px; color: var(--muted); font-size: 12px; }
#pricing-products > .alert { margin: 0 20px 16px; }
.pricing-column-labels, .pricing-product-row { display: grid; grid-template-columns: minmax(0, 1fr) 125px 145px 72px; align-items: center; gap: 24px; padding: 16px 20px; }
.pricing-column-labels { padding-top: 11px; padding-bottom: 11px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: #f7f7f7; color: var(--muted); font-size: 12px; }
.pricing-column-labels > span:nth-child(2), .pricing-column-labels > span:nth-child(3) { text-align: right; }
.pricing-product-list { margin: 0; padding: 0; list-style: none; }
.pricing-product-row + .pricing-product-row { border-top: 1px solid #ebebeb; }
.pricing-product-row:hover { background: #fafafa; }
.pricing-product-name { min-width: 0; }
.pricing-product-name h3 { font-size: 13px; font-weight: 550; line-height: 1.45; overflow-wrap: anywhere; }
.pricing-product-name p { margin-top: 4px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.pricing-price { min-width: 0; text-align: right; font-variant-numeric: tabular-nums; }
.pricing-price > strong { font-size: 13px; font-weight: 550; overflow-wrap: anywhere; }
.pricing-base > strong { color: var(--muted); font-weight: 400; }
.pricing-rule { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.pricing-rule.custom { color: #146c43; }
.pricing-edit { justify-self: end; min-width: 56px; }
.pricing-mobile-label { display: none; }
.pricing-row-message { grid-column: 1 / -1; color: #146c43; font-size: 12px; }
.pricing-row-message.error { color: #a12a24; }

/* Native dialogs keep browser focus containment and fit small viewports. */
.pricing-dialog, .team-dialog { width: min(500px, calc(100% - 40px)); max-width: none; max-height: calc(100dvh - 48px); padding: 0; overflow: auto; overscroll-behavior: contain; border: 1px solid #d4d4d4; border-radius: 14px; background: #fff; color: inherit; box-shadow: 0 20px 70px #0003; }
.team-dialog { width: min(520px, calc(100% - 40px)); }
.pricing-dialog::backdrop, .team-dialog::backdrop { background: #1a1a1a66; }
.pricing-dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 24px 18px; border-bottom: 1px solid #e6e6e6; }
.pricing-dialog-heading h2 { font-size: 19px; }
.pricing-dialog-heading p { margin-top: 5px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.pricing-dialog-heading > .icon-button { flex: none; width: 32px; height: 32px; margin: -3px -5px 0 0; border: 0; }
.pricing-dialog-content { display: grid; gap: 18px; padding: 22px 24px; }
.pricing-edit-product h3 { font-size: 15px; overflow-wrap: anywhere; }
.pricing-edit-product p { margin-top: 5px; color: var(--muted); font-size: 12px; }
#pricing-edit-error:empty, #team-invite-error:empty { display: none; }
#pricing-edit-error > .text-button { margin-top: 7px; text-decoration: underline; }
.pricing-value-field[hidden] { display: none; }
.pricing-rule-help { color: var(--muted); font-size: 12px; line-height: 1.6; }
.pricing-preview { padding: 16px; border: 1px solid #e5e5e5; border-radius: 9px; background: #f7f7f7; }
.pricing-preview > div { display: flex; justify-content: space-between; gap: 16px; font-size: 13px; }
.pricing-preview > div + div { margin-top: 10px; }
.pricing-preview > div > span { color: var(--muted); }
.pricing-preview strong { font-weight: 600; font-variant-numeric: tabular-nums; }
.pricing-preview > p { margin-top: 12px; color: #a12a24; font-size: 12px; }
.pricing-dialog-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid #e6e6e6; background: #fafafa; }
.pricing-dialog-open, .team-dialog-open, .product-dialog-open { overflow: hidden; }

/* brand-loader: one StemLot loading mark for every StemLot site; the copies in
   apps/portal/public/styles.css, apps/portal/login/login.css and
   apps/admin/public/styles.css are equal (tests/brand-loader.test.mjs).
   While a site or a page opens, the mark sits in the middle of the screen at one
   size, so going from the boot screen to a page, or to another StemLot site,
   never moves it; its sweep carries on across those swaps (loadingState). A
   compact mark loads part of a page in place. */
.boot-screen { min-height: 100vh; min-height: 100dvh; background: #fafafa; }
.brand-loader { --loader-width: 180px; display: block; width: 100%; min-height: clamp(240px, 55dvh, 480px); }
.brand-loader-art { position: fixed; top: 50%; left: 50%; z-index: 1; display: block; width: var(--loader-width); transform: translate(-50%, -50%); }
.brand-loader-logo { display: block; width: 100%; height: auto; object-fit: contain; filter: brightness(0); opacity: .35; }
.brand-loader-shine {
  position: absolute; inset: 0; pointer-events: none;
  /* One logo-wide band travels from fully outside the left edge to the right. */
  background: linear-gradient(90deg, transparent 33.333333%, #000 50%, transparent 66.666667%) 100% 0 / 300% 100% no-repeat;
  -webkit-mask: url('assets/stemlot-logo.png') center / 100% 100% no-repeat;
  mask: url('assets/stemlot-logo.png') center / 100% 100% no-repeat;
  mask-mode: alpha;
  animation: brand-shine 1.4s cubic-bezier(.2, 0, .13, 1) infinite;
}
.brand-loader-label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.brand-loader--compact { --loader-width: 112px; display: grid; place-items: center; min-height: 128px; padding: 24px; }
.brand-loader--compact .brand-loader-art { position: relative; top: auto; left: auto; z-index: auto; transform: none; animation: brand-loader-reveal 120ms ease-out 160ms both; }
@keyframes brand-loader-reveal { from { opacity: 0; } to { opacity: 1; } }
@keyframes brand-shine {
  from { background-position: 100% 0; }
  to { background-position: 0% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .brand-loader-logo { opacity: 1; }
  .brand-loader-shine { animation: none; background: none; }
}
/* brand-loader:end */

@media (min-width: 1700px) {
  .main { padding: 34px 40px 52px; }
}
@media (max-width: 1200px) {
  .main { padding: 26px 24px 40px; }
  .directory-table th, .directory-table td { padding-left: 16px; padding-right: 16px; }
  .company-overview-grid { grid-template-columns: minmax(0, 1.25fr) minmax(230px, 1fr); gap: 16px; }
  .pricing-column-labels, .pricing-product-row { grid-template-columns: minmax(0, 1fr) 100px 120px 60px; gap: 16px; }
  .user-row { grid-template-columns: minmax(0, 1fr) auto; gap: 10px 20px; }
  .user-role-form { grid-column: 1; grid-row: auto; margin-top: 4px; }
  .user-role-form > label { width: auto; }
}
@media (max-width: 1000px) {
  .company-overview-grid { grid-template-columns: 1fr; }
  .directory-table th:nth-child(3) { display: none; }
  .directory-table th:first-child { width: 58%; }
  .directory-table th:nth-child(2) { width: 34%; }
  .directory-table th:last-child { width: 8%; }
  .pricing-column-labels, .pricing-product-row { grid-template-columns: minmax(0, 1fr) 86px 100px 55px; gap: 12px; padding-left: 16px; padding-right: 16px; }
  .member-row { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .app-shell { padding-left: 0; }
  .mobile-bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; height: 60px; padding: 8px 16px; border-bottom: 1px solid var(--border); background: #fff; }
  .mobile-bar > .icon-button { flex: none; width: 44px; height: 44px; margin-left: -7px; border: 0; background: transparent; }
  .mobile-bar .logo { width: 104px; height: auto; }
  .sidebar { z-index: 50; width: min(292px, calc(100% - 44px)); padding: 14px 12px 16px; padding-bottom: max(16px, env(safe-area-inset-bottom)); border-right: 1px solid #d5d5d5; background: #f5f5f5; visibility: hidden; transform: translateX(-100%); transition: transform .18s ease, visibility 0s linear .18s; }
  .sidebar-brand { gap: 12px; min-height: 62px; padding: 0 8px 18px; }
  .sidebar-brand .logo { width: 96px; height: auto; }
  .sidebar-close { display: grid; flex: none; width: 44px; height: 44px; margin-left: auto; border: 0; background: transparent; }
  .sidebar-nav { display: grid; gap: 5px; }
  .nav-link { min-height: 46px; padding: 11px 13px; font-size: 14px; }
  .nav-link .icon { width: 20px; height: 20px; }
  .sidebar-footer { padding: 18px 12px 0; }
  .signed-in { margin-bottom: 8px; }
  .signed-in-name { font-size: 13px; }
  .signed-in-email { font-size: 12px; }
  .logout-button { min-height: 44px; font-size: 13px; }
  .navigation-backdrop { position: fixed; inset: 0; z-index: 40; width: 100%; height: 100%; padding: 0; border: 0; border-radius: 0; background: #15151566; }
  .navigation-open .sidebar { visibility: visible; transform: translateX(0); transition-delay: 0s; }
  .navigation-open .navigation-backdrop { display: block; }
  body:has(.app-shell.navigation-open) { overflow: hidden; }
  .main { padding: 22px 16px 32px; }
  .settings-link { padding: 16px 14px; }
  .page-heading { gap: 12px; margin-bottom: 20px; }
  .page-heading h1{ font-size: 25px; }
  .page-heading p { max-width: 360px; font-size: 13px; }
  .page-heading .button { padding-left: 11px; padding-right: 11px; }
  .page-heading:has(.heading-actions) { flex-wrap: wrap; }
  .heading-actions { width: 100%; justify-content: flex-start; }
  .button, .button.small-button, .icon-button, .text-button { min-height: 44px; }
  .icon-button { width: 44px; height: 44px; }
  input, select, textarea { min-height: 44px; font-size: 16px; }
  input[type="checkbox"] { min-height: 16px; }
  .search-field input { height: 44px; }
  .panel-heading { gap: 12px; padding: 16px; }
  .panel-heading p { font-size: 12px; }
  .sync-row { gap: 12px; padding: 18px 16px; }
  .company-search, .directory-toolbar, .team-toolbar { gap: 8px; }
  .panel > .directory-toolbar, .panel > .team-toolbar { padding: 12px; }
  .company-search > .search-field, .directory-toolbar > .search-field { flex-basis: calc(100% - 85px); }
  .check-option { order: 3; min-height: 44px; font-size: 12px; }
  .company-search > .check-option, .directory-toolbar > .check-option { flex-basis: 100%; }
  .company-directory-filters { flex-basis: 100%; gap: 6px; }
  .company-directory-filters .check-option { flex: 1 1 auto; gap: 6px; min-height: 44px; padding: 7px 8px; border: 1px solid #e5e5e5; border-radius: 8px; font-size: 11px; white-space: nowrap; }
  .company-directory-filters .check-option:has(:checked) { border-color: #b5b5b5; color: #303030; background: #f3f3f3; }
  .directory-table, .directory-table tbody { display: block; }
  .directory-table thead { display: none; }
  .directory-table tr { display: block; padding: 16px; }
  .directory-table tr + tr { border-top: 1px solid #e8e8e8; }
  .directory-table td { display: block; padding: 0; border: 0; font-size: 12px; }
  .directory-table td.directory-arrow { display: none; }
  .company-cell { align-items: flex-start; gap: 10px; min-height: 44px; }
  .company-avatar { width: 34px; height: 34px; }
  .company-cell-name { font-size: 14px; }
  .company-cell-meta { font-size: 12px; }
  .directory-footer, .inventory-footer { padding: 14px 16px; gap: 10px; }
  .directory-footer p, .inventory-footer p { font-size: 12px; }
  #company-results > .alert { margin: 14px 16px; }
  .breadcrumb { min-height: 44px; margin-top: -8px; margin-bottom: 8px; font-size: 13px; }
  .breadcrumb a { min-height: 44px; }
  .company-page-heading { margin-bottom: 14px; }
  .company-page-heading p { font-size: 12px; }
  .company-tabs { gap: 20px; margin-bottom: 18px; }
  .company-tabs a { min-height: 46px; padding-bottom: 11px; font-size: 13px; }
  .company-overview-grid { gap: 16px; }
 .detail-body { padding: 18px 16px; }
  .member-row { gap: 7px; padding: 18px 0; }
  .inline-form-fields { gap: 8px; }
  .form-hint { font-size: 12px; }
  .user-list { padding: 0 16px; }
  .user-row { display: block; padding: 20px 0; }
  .user-role-form { margin-top: 14px; gap: 8px; }
  .user-role-form > label { width: 100%; }
  .user-role-form > select { flex: 1; max-width: 320px; min-height: 44px; font-size: 16px; }
  .pricing-scope-tabs { padding: 10px 12px 0; gap: 4px; }
  .pricing-scope-tabs button, .pricing-scope-tabs a { min-height: 44px; padding: 10px 12px; font-size: 13px; }
  .pricing-product-search { flex-wrap: wrap; gap: 8px; padding: 12px 16px; }
  .pricing-product-search > .search-field { flex-basis: 100%; }
  .pricing-product-search > select { width: 100%; max-width: none; font-size: 16px; }
  .pricing-list-summary { padding: 2px 16px 14px; }
  #pricing-products > .alert { margin: 0 16px 14px; }
  .pricing-column-labels { display: none; }
  .pricing-product-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 52px; gap: 10px 12px; padding: 14px; align-items: start; }
  .pricing-product-name { grid-column: 1 / 3; }
  .pricing-product-name h3 { font-size: 14px; }
  .pricing-product-name p { font-size: 12px; }
  .pricing-price { text-align: left; }
  .pricing-price > strong { font-size: 14px; }
  .pricing-mobile-label { display: block; margin-bottom: 3px; color: var(--muted); font-size: 11px; }
  .pricing-edit { grid-column: 3; grid-row: 1 / 3; align-self: center; min-width: 52px; min-height: 44px; }
  .pricing-base { grid-column: 1; grid-row: 2; }
  .pricing-company-price { grid-column: 2; grid-row: 2; }
  .pricing-rule { font-size: 11px; }
  .pricing-dialog, .team-dialog { width: calc(100% - 24px); max-height: calc(100dvh - 24px); border-radius: 12px; overflow: hidden; }
  .pricing-dialog[open], .team-dialog[open] { display: flex; flex-direction: column; }
  .pricing-dialog > form { display: flex; flex-direction: column; min-height: 0; }
  .pricing-dialog-heading { flex: none; gap: 12px; padding: 16px; }
  .pricing-dialog-heading > div { min-width: 0; }
  .pricing-dialog-heading h2 { overflow-wrap: anywhere; }
  .pricing-dialog-heading h2 { font-size: 19px; }
  .pricing-dialog-heading > .icon-button { width: 44px; height: 44px; margin: -5px -5px 0 0; }
  .pricing-dialog-content { min-height: 0; gap: 16px; padding: 16px; overflow-y: auto; overscroll-behavior: contain; }
  .pricing-dialog-actions { flex: none; padding: 12px 16px max(12px, env(safe-area-inset-bottom)); }
  .pricing-dialog-actions > .button { flex: 1; min-width: 0; white-space: normal; text-align: center; }
  .pricing-dialog input, .pricing-dialog select, .team-dialog input, .team-dialog select { min-height: 44px; font-size: 16px; }
  .auth-page { padding: 32px 24px; }
}
@media (max-width: 380px) {
  .main { padding-left: 12px; padding-right: 12px; }
  .mobile-bar { padding-left: 12px; padding-right: 12px; }
  .page-heading h1 { font-size: 23px; }
  .directory-table tr { padding: 16px 14px; }
  .directory-footer { flex-wrap: wrap; }
  .company-tabs { gap: 16px; }
  .inline-form-fields { flex-wrap: wrap; }
  .inline-form-fields input { flex-basis: 100%; }
  .inline-form-fields .button { width: 100%; }
  .sync-row { flex-wrap: wrap; }
  .sync-row > div { flex: 1; min-width: 155px; }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar { transition: none; }
  .spinner { animation: none; }
  html { scroll-behavior: auto; }
}

/* Shared list layout: one heading, one toolbar, one result count. */
.page-heading { align-items: center; margin-bottom: 18px; }
.list-refresh { flex: none; background: transparent; border-color: transparent; }
.list-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 0; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.list-toolbar .search-field { flex: 1 1 220px; }
@media (max-width: 760px) {
  .main { padding-top: 16px; }
  .page-heading { margin-bottom: 14px; }
  .page-heading:has(.heading-actions) { flex-wrap: nowrap; }
  .heading-actions { width: auto; flex-wrap: nowrap; }
  .heading-actions { flex: none; }
  .heading-actions .button { padding-left: 10px; padding-right: 10px; }
  .company-page-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; }
  .company-page-heading > div:first-child { display: contents; }
  .company-page-heading .heading-actions { display: contents; }
  .company-page-heading .list-refresh { grid-column: 2; grid-row: 1; align-self: start; justify-self: end; margin-top: -7px; }
  .company-page-heading .heading-actions > .button { grid-column: 2; grid-row: 2; justify-self: end; }
  .company-page-heading h1 { grid-column: 1 / -1; grid-row: 1; padding-right: 54px; font-size: 23px; line-height: 1.25; }
  .company-page-heading p { grid-column: 1; grid-row: 2; margin: 0; align-self: center; }
  .team-invite-label { display: none; }
  .mobile-bar { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; }
  .mobile-bar > a { justify-self: center; }
  .list-toolbar { padding: 12px; gap: 8px; }
  .list-toolbar .search-field { flex-basis: 100%; }
  .sync-grid { grid-template-columns: 1fr; }
  .sync-row + .sync-row { border-left: 0; border-top: 1px solid #ebebeb; }
  .company-tabs { margin-bottom: 14px; }
}

/* Team directory keeps account controls in the employee dialog. */
.team-roster .team-roster-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(215px, auto) 44px; align-items: center; gap: 12px 24px; padding: 14px 0; }
.team-person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.team-person > .avatar { width: 36px; height: 36px; flex: none; }
.team-person-info { min-width: 0; }
.team-person-name { color: #303030; font-size: 13px; font-weight: 550; overflow-wrap: anywhere; }
.team-person-email { margin-top: 3px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.team-permissions { display: flex; align-items: center; justify-content: space-between; gap: 18px; font-size: 12px; }
.team-role { color: var(--muted); }
.team-row-trigger { width: 44px; height: 44px; border-color: transparent; background: transparent; }
.team-row-trigger:hover { background: #f3f3f3; }
.team-member-content > .alert { margin: 0; }
.team-role-editor { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-column: auto; grid-row: auto; gap: 8px 12px; margin: 0; }
.team-role-editor > label { grid-column: 1 / -1; width: auto; color: #303030; font-size: 13px; font-weight: 550; }
.team-role-editor > select { min-width: 0; min-height: 44px; font-size: 14px; }
.team-role-editor > button { min-height: 44px; }
.team-account-actions { display: grid; gap: 4px; padding-top: 18px; border-top: 1px solid #e6e6e6; }
.team-account-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; font-size: 13px; font-weight: 550; }
.team-account-actions > button { width: fit-content; min-height: 44px; text-align: left; font-size: 13px; }
#team-count { display: inline-flex; align-items: center; gap: 8px; flex: none; }
@media (max-width: 760px) {
  .team-roster .team-roster-row { grid-template-columns: minmax(0, 1fr) 44px; gap: 6px 10px; padding: 14px 0; }
  .team-person { grid-column: 1; gap: 10px; }
  .team-person > .avatar { width: 32px; height: 32px; }
  .team-permissions { grid-column: 1; justify-content: flex-start; gap: 12px; margin-left: 42px; font-size: 11px; }
  .team-row-trigger { grid-column: 2; grid-row: 1 / 3; }
  .team-role-editor { margin: 0; }
  .team-role-editor > select { font-size: 16px; }
}

/* Compact company details and customer access. */
.company-address-panel .panel-heading { padding: 18px 20px 4px; border-bottom: 0; }
.company-address-panel h2 { color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: normal; }
.company-address-body { padding: 0 20px 18px; font-size: 13px; overflow-wrap: anywhere; }
.company-detail { overflow: visible; }
.customer-heading { flex-wrap: wrap; gap: 12px; padding: 14px 20px; }
.customer-heading h2 { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.customer-heading-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.customer-list-body { padding: 0 20px; }
.customer-list-body > .alert { margin: 16px 0; }
.customer-member-row, .customer-member-row:first-child { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 0; }
.customer-member-row .member-title { gap: 8px; }
.customer-row-options { position: relative; justify-self: end; }
.customer-row-options > summary { border-color: transparent; border-radius: 8px; list-style: none; cursor: pointer; }
.customer-row-options > summary::-webkit-details-marker { display: none; }
.customer-row-options > summary:focus-visible { outline: 2px solid #005bd3; outline-offset: 3px; }
.customer-row-options[open] > summary { background: #f1f1f1; }
.customer-row-menu { position: absolute; z-index: 5; top: calc(100% + 4px); right: 0; display: grid; gap: 2px; width: 220px; max-width: calc(100vw - 64px); padding: 6px; border: 1px solid var(--border); border-radius: 10px; background: #fff; box-shadow: 0 6px 22px #00000014; }
.customer-row-menu .text-button { width: 100%; min-height: 40px; padding: 8px 10px; border-radius: 6px; }
.customer-row-menu .text-button:hover:not(:disabled) { background: #f4f4f4; text-decoration: none; }
.customer-row-menu .member-audit { grid-column: auto; padding: 10px; border-top: 1px solid #ebebeb; line-height: 1.5; }
.customer-add-form { margin: 0; padding: 16px 0; border-top: 0; border-bottom: 1px solid #ebebeb; }
.customer-add-form .inline-form-fields { align-items: center; }
.customer-add-form input { flex: 1; max-width: none; }
.customer-access-hint { margin: 16px 0; }
.customer-list-body .empty-members { padding: 20px 0; }
@media (max-width: 760px) {
  .company-address-panel .panel-heading { padding: 16px 16px 4px; }
  .company-address-body { padding: 0 16px 16px; }
  .customer-heading { padding: 12px 16px; }
  .customer-heading .button { min-height: 44px; }
  .customer-list-body { padding: 0 16px; }
  .customer-member-row, .customer-member-row:first-child { grid-template-columns: minmax(0, 1fr) auto; padding: 10px 0; }
  .customer-member-row .member-title { display: grid; justify-items: start; gap: 5px; }
  .customer-row-options > summary { width: 44px; height: 44px; }
  .customer-row-menu .text-button { min-height: 44px; }
  .customer-add-form .inline-form-fields { flex-wrap: wrap; }
  .customer-add-form input { flex: 1 1 100%; min-height: 44px; }
  .customer-add-form .button { flex: 1; min-height: 44px; }
}
.list-count { color: var(--muted); font-size: 12px; }
.team-account-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0; padding-top: 12px; border-top: 1px solid #eee; font-size: 12px; }
.team-account-dates dt { color: var(--muted); }
.team-account-dates dd { margin: 3px 0 0; }

/* Exceptions appear on Home only while an order needs an employee's review. */

/* Orders use the selected company's prices without modifying its customer cart. */
.order-empty { padding: 24px 20px; color: var(--muted); font-size: 13px; }

/* The sales workspace shares the existing panels and date-only Pacific calendar. */
#sales-home { max-width: 960px; margin-bottom: 22px; }
.sales-filters { display: flex; flex-wrap: wrap; gap: 5px; padding: 10px 16px; border-bottom: 1px solid #ebebeb; }
.sales-filters .text-button { padding: 6px 11px; border-radius: 7px; white-space: nowrap; }
.sales-filters .text-button[aria-pressed="true"] { color: #222; background: #ebebeb; font-weight: 600; }
.sales-filters .text-button:hover { background: #f1f1f1; text-decoration: none; }
.sales-company-table th:first-child { width: 43%; }
.sales-company-table th:nth-child(2) { width: 22%; }
.sales-company-table th:nth-child(3) { display: table-cell; width: 29%; }
.sales-company-table .company-cell-meta { margin-top: 2px; }
.sales-company-next-task a { text-decoration: none; font-weight: 550; }
.sales-company-next-task a:hover { text-decoration: underline; }
.sales-mobile-label { display: none; }
.sales-workspace { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; gap: 20px; }
#sales-company-error:not(:empty) { margin-bottom: 16px; }
.sales-tasks-panel .panel-heading { align-items: center; }
.sales-tasks-panel .panel-heading > .button { flex: none; }
.sales-task-list, .sales-activity-list { list-style: none; padding: 0; margin: 0; }
.sales-task-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 18px 20px; }
.sales-task-row + .sales-task-row { border-top: 1px solid #ebebeb; }
.sales-task-content { min-width: 0; }
.sales-task-content h3 { overflow-wrap: anywhere; }
.sales-task-company { display: inline-block; margin-top: 4px; color: #616161; font-size: 12px; text-decoration: none; }
.sales-task-company:hover { text-decoration: underline; }
.sales-task-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 12px; margin-top: 7px; color: var(--muted); font-size: 12px; }
.sales-due.overdue, .sales-overdue { color: #a12a24; }
.sales-due.today { color: #75550a; }
.sales-task-note { margin-top: 8px; color: var(--muted); font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.sales-task-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 5px 12px; flex: none; max-width: 175px; }
.sales-task-actions .button { min-width: 100px; }
.sales-task-actions .text-button { font-size: 12px; }
.sales-tasks-panel .directory-footer { border-top: 1px solid #ebebeb; padding: 12px 20px; }
.sales-tasks-panel .alert, #sales-company-history > .alert { margin: 16px; }
.sales-empty { min-height: 200px; padding: 28px 20px; }
.sales-contact-form { display: grid; gap: 14px; padding: 18px 20px; border-bottom: 1px solid #ebebeb; }
.sales-contact-form #sales-contact-error:empty { display: none; }
.sales-contact-form select { width: 150px; max-width: 100%; }
.sales-contact-form textarea, .sales-task-dialog textarea { width: 100%; padding: 10px 12px; resize: vertical; min-height: 90px; }
.sales-contact-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.sales-contact-footer .form-hint { margin: 0; }
.sales-activity-list { padding: 8px 20px; }
.sales-activity-item { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 12px; padding: 16px 0; }
.sales-activity-item + .sales-activity-item { border-top: 1px solid #f0f0f0; }
.sales-activity-marker { display: grid; place-items: center; width: 26px; height: 26px; background: #f1f1f1; border: 1px solid #e8e8e8; border-radius: 50%; color: #707070; }
.sales-activity-marker .icon { width: 14px; height: 14px; }
.sales-activity-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; }
.sales-activity-heading span { color: var(--muted); overflow-wrap: anywhere; }
.sales-activity-text { margin-top: 6px; font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.sales-activity-time { margin-top: 7px; color: var(--muted); font-size: 11px; }
.sales-task-dialog .pricing-dialog-content > #sales-task-error:empty { display: none; }
.sales-task-dialog #sales-task-error > .button { margin-top: 10px; }
.sales-task-review p { color: var(--muted); margin-top: 6px; font-size: 12px; }
.sales-task-review h3 { overflow-wrap: anywhere; }
.sales-current-version { display: grid; gap: 5px; padding: 12px; border: 1px solid #d5e4f6; border-radius: 8px; background: #f4f8fe; font-size: 12px; overflow-wrap: anywhere; }
.sales-dialog-open { overflow: hidden; }
@media (max-width: 1200px) {
  .sales-workspace { grid-template-columns: 1fr; max-width: 960px; }
}
@media (max-width: 760px) {
  .sales-company-table th:first-child { width: 42%; }
  .sales-company-table th:nth-child(2) { width: 24%; }
  .sales-company-table th:nth-child(3) { width: 28%; }
  .sales-filters .text-button { min-height: 40px; }
  .sales-workspace { gap: 16px; }
  .sales-task-actions .button, .sales-task-actions .text-button { min-height: 40px; }
  .sales-company-table td.sales-company-last-order,
  .sales-company-table td.sales-company-next-task { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 6px; margin-top: 10px; padding-left: 44px; }
  .sales-mobile-label { display: block; color: var(--muted); font-size: 11px; }
  .sales-company-value { min-width: 0; }
  .sales-company-value > .company-cell-meta { margin: 3px 0 0; font-size: 11px; }
  .sales-company-next-task .company-cell-meta { white-space: nowrap; }
  .sales-company-table .company-cell::after { content: ""; flex: none; width: 6px; height: 6px; margin: 12px 3px 0 auto; border-top: 1.5px solid #888; border-right: 1.5px solid #888; transform: rotate(45deg); }
  .sales-company-table .company-cell > span:last-child { flex: 1; }
}
@media (max-width: 520px) {
  #sales-home { margin-bottom: 16px; }
  .sales-filters { padding: 8px 12px; gap: 3px; }
  .sales-filters .text-button { padding: 6px 9px; font-size: 12px; }
  .sales-tasks-panel .panel-heading, .sales-history-panel .panel-heading { padding: 16px; gap: 10px; }
  .sales-task-row { flex-wrap: wrap; gap: 12px; padding: 16px; }
  .sales-task-actions { max-width: none; justify-content: flex-start; gap: 5px 16px; }
  .sales-task-content { flex: 1 1 100%; }
  .sales-task-meta { gap: 5px 10px; }
  .sales-contact-form { padding: 16px; }
  .sales-contact-footer { align-items: flex-start; }
  .sales-contact-footer .form-hint { max-width: 160px; }
  .sales-activity-list { padding: 4px 16px; }
  .sales-contact-form textarea, .sales-task-dialog textarea, .sales-contact-form select { font-size: 16px; }
}

/* Vendor API keys */
#api-keys-content { display: grid; gap: 16px; }
#api-keys-content > .alert { margin: 0; }
.api-key-form { display: grid; gap: 16px; padding: 18px 20px; }
.api-key-scopes { display: grid; gap: 10px; border: 0; padding: 0; margin: 0; }
.api-key-scopes legend { margin-bottom: 8px; font-size: 13px; font-weight: 550; }
.api-key-scope { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; }
.api-key-scope > span { display: grid; gap: 2px; }
.api-key-scope > span > span { color: var(--muted); font-size: 12px; }
.api-key-list { list-style: none; margin: 0; padding: 0; }
.api-key-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 20px; border-top: 1px solid #ebebeb; }
.api-key-row:first-child { border-top: 0; }
.api-key-main { display: grid; gap: 4px; min-width: 0; }
.api-key-main p { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.api-key-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.api-key-created { border-color: #c7e6d4; }
.api-key-token { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 16px 20px; }
.api-key-token code { flex: 1 1 320px; min-width: 0; padding: 9px 11px; border-radius: 8px; background: #f4f4f4; font-size: 12px; overflow-wrap: anywhere; user-select: all; }
.button.danger { color: #a12a24; border-color: #e9b7b2; }
@media (max-width: 760px) {
  .api-key-row { flex-direction: column; align-items: stretch; }
  .api-key-actions { justify-content: space-between; }
}

/* Webhooks (Settings → Webhooks): order events sent to the vendor's own systems. */
#webhooks-content { display: grid; gap: 16px; }
#webhooks-content > .alert { margin: 0; }
.webhook-form { display: grid; gap: 16px; padding: 18px 20px; }
.webhook-events { display: grid; gap: 10px; min-width: 0; margin: 0; padding: 0; border: 0; }
.webhook-events legend { margin-bottom: 8px; font-size: 13px; font-weight: 550; }
.webhook-event { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; }
.webhook-event > span { display: grid; gap: 2px; min-width: 0; }
.webhook-event > span > span { color: var(--muted); font-size: 12px; }
.field-optional { color: var(--muted); font-weight: 400; }
.webhook-form-error { display: flex; align-items: flex-start; gap: 8px; color: #a12a24; font-size: 13px; line-height: 1.45; }
.webhook-form-error .icon, .webhook-row-notice .icon, .webhook-row-error .icon { flex: none; width: 17px; height: 17px; margin-top: 1px; }
.webhook-unavailable { padding: 10px 12px; border-radius: 8px; background: #fff4d6; color: #6b4e07; font-size: 13px; line-height: 1.45; }
.webhook-list { margin: 0; padding: 0; list-style: none; }
.webhook-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 18px; padding: 16px 20px; border-top: 1px solid #ebebeb; }
.webhook-row:first-child { border-top: 0; }
.webhook-main { display: grid; align-content: start; gap: 6px; min-width: 0; }
.webhook-url { font-size: 14px; overflow-wrap: anywhere; }
.webhook-description { color: #444; font-size: 13px; overflow-wrap: anywhere; }
.webhook-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.webhook-meta code, .webhook-deliveries code { font-size: 12px; }
.webhook-last { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.webhook-row-notice, .webhook-row-error { display: flex; align-items: flex-start; gap: 6px; font-size: 13px; line-height: 1.45; }
.webhook-row-notice { color: #146c43; }
.webhook-row-error { color: #a12a24; }
.webhook-actions { display: flex; flex-wrap: wrap; align-content: flex-start; justify-content: flex-end; gap: 8px; max-width: 380px; }
.webhook-deliveries-section { display: grid; grid-column: 1 / -1; gap: 10px; min-width: 0; }
.webhook-deliveries-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.webhook-deliveries-heading h4 { font-size: 13px; font-weight: 650; }
.webhook-deliveries-wrap { overflow-x: auto; border: 1px solid #ebebeb; border-radius: 10px; }
.webhook-deliveries { width: 100%; border-collapse: collapse; font-size: 13px; }
.webhook-deliveries th { padding: 8px 12px; border-bottom: 1px solid #ebebeb; background: #fafafa; color: var(--muted); font-size: 12px; font-weight: 550; text-align: left; white-space: nowrap; }
.webhook-deliveries td { padding: 10px 12px; border-top: 1px solid #f0f0f0; vertical-align: top; }
.webhook-deliveries tbody tr:first-child td { border-top: 0; }
.webhook-deliveries td small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.webhook-deliveries td small.webhook-delivery-error { color: #a12a24; }
.webhook-empty { color: var(--muted); font-size: 13px; }
.webhook-secret { border-color: #c7e6d4; }
.webhook-secret-url { color: #303030; overflow-wrap: anywhere; }
.webhook-help-text { padding: 16px 20px 18px; color: #444; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.webhook-confirm-url { overflow-wrap: anywhere; }
.webhook-confirm-text { color: #444; font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .webhook-form { padding: 16px 14px; }
  .webhook-row { grid-template-columns: minmax(0, 1fr); padding: 16px 14px; }
  .webhook-actions { justify-content: flex-start; max-width: none; }
  .webhook-actions .button { flex: 1 1 auto; }
  .webhook-help-text { padding: 14px; }
  /* Deliveries read as cards on a phone: each cell names its column. */
  .webhook-deliveries-wrap { overflow: visible; border: 0; }
  .webhook-deliveries thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .webhook-deliveries, .webhook-deliveries tbody, .webhook-deliveries tr, .webhook-deliveries td { display: block; width: 100%; }
  .webhook-deliveries tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; margin-bottom: 10px; padding: 12px; border: 1px solid #ebebeb; border-radius: 10px; }
  .webhook-deliveries td { padding: 0; border: 0; }
  .webhook-deliveries td::before { content: attr(data-label); display: block; margin-bottom: 2px; color: var(--muted); font-size: 11px; font-weight: 550; }
  .webhook-deliveries td[data-label="Event"], .webhook-deliveries td.webhook-delivery-status { grid-column: 1 / -1; }
}

/* Vendor directory (platform admins): register, open and suspend vendors. */
#vendors-content { display: grid; gap: 16px; max-width: 900px; }
#vendors-content > .alert { margin: 0; }
.vendor-list { list-style: none; margin: 0; padding: 0; }
.vendor-row { display: grid; gap: 12px; padding: 14px 20px; border-top: 1px solid #ebebeb; }
.vendor-row:first-child { border-top: 0; }
.vendor-row-main { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.vendor-row-name { display: grid; gap: 4px; min-width: 0; }
.vendor-row-name p { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.vendor-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; }
.vendor-row-name .vendor-admins { color: #4a4a4a; }
.vendor-warning { color: #9a3412; font-weight: 600; }
.vendor-admin-form { display: grid; gap: 12px; padding: 12px 14px; border: 1px solid #ebebeb; border-radius: 10px; background: #fafafa; }
.vendor-admin-form .vendor-actions { justify-content: flex-start; }
.vendor-confirm { display: grid; gap: 10px; padding: 12px 14px; border: 1px solid #ebebeb; border-radius: 10px; background: #fafafa; }
.vendor-confirm p { font-size: 13px; }
.vendor-confirm .vendor-actions { justify-content: flex-start; }
.vendor-registered { border-color: #c7e6d4; }
.vendor-registered-actions { display: flex; flex-wrap: wrap; gap: 10px; padding: 0 20px 18px; }
.vendor-form { display: grid; gap: 16px; padding: 18px 20px; }
.vendor-form-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
@media (max-width: 760px) {
  .vendor-row-main { flex-direction: column; align-items: stretch; }
  .vendor-actions { justify-content: flex-start; }
  .vendor-form-fields { grid-template-columns: 1fr; }
}

/* Incoming marketplace orders: one list per review status and a review page. */
.orders-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 24px; border-bottom: 1px solid var(--border); }
.orders-filters { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.orders-filters a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 16px; border-radius: 999px; background: #f0f0f0; color: #4d4d4d; font-size: 14px; font-weight: 550; line-height: 1.3; text-decoration: none; }
.orders-filters a:hover { background: #e8e8e8; }
.orders-filters a[aria-current="page"] { background: #1a1a1a; color: #fff; }
.orders-filters .count-badge { min-height: 20px; padding: 1px 7px; background: #fff; }
.orders-filters a[aria-current="page"] .count-badge { background: #ffffff2b; color: #fff; }
.orders-rows { margin: 0; padding: 0; list-style: none; }
.orders-rows > li + li { border-top: 1px solid var(--border); }
.orders-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto 16px; align-items: center; gap: 8px 24px; padding: 20px 24px; color: inherit; text-decoration: none; }
a.orders-row:hover { background: #f8f8f8; }
.orders-row-buyer { display: grid; gap: 3px; min-width: 0; }
.orders-row-buyer strong { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.orders-row-buyer small, .orders-row-meta { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.orders-row-meta { display: flex; flex-wrap: wrap; gap: 2px 14px; min-width: 0; }
.orders-row-end { display: grid; justify-items: end; gap: 6px; }
.orders-row-total { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.orders-row > .icon { width: 16px; height: 16px; color: #888; }
#orders-results > .alert, .orders-placeholder > .alert { margin: 16px 24px 0; }
.orders-heading-end { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px; flex: none; }
.orders-heading-end > .status { font-size: 12px; padding: 4px 10px; }
.orders-heading h1 { overflow-wrap: anywhere; }
.orders-toolbar-actions { display: flex; align-items: center; gap: 8px; flex: none; }
#orders-export-status > .alert { margin: 12px 24px 0; }
.orders-row-pills { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.orders-row-delivery { color: #1d4f91; }
/* Wide screens keep the next step and the payment beside the items; narrow ones
   read buyer, items, next step, payment and history. */
.orders-detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); align-items: start; gap: 24px; max-width: 1240px; }
.orders-main, .orders-side { display: grid; gap: 24px; min-width: 0; }
.orders-stock { color: var(--muted); }
.orders-stock.short { color: #a12a24; font-weight: 600; }
.orders-qty-field { display: inline-flex; align-items: center; justify-content: flex-end; gap: 9px; }
.orders-qty-field small { color: var(--muted); font-size: 12px; white-space: nowrap; }
/* A line bought in cases (decided 2026-11-01): "2 cases of 12" under its units. */
.orders-case { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; font-weight: 400; white-space: nowrap; }
input.orders-qty { width: 76px; height: 34px; padding: 4px 8px; text-align: right; font-variant-numeric: tabular-nums; }
.orders-line-removed td { color: #8a8a8a; }
.orders-line-removed .orders-line-product strong { text-decoration: line-through; }
.orders-changes { margin: 0 24px 20px; padding: 14px 16px; border-radius: 10px; background: #fff7e6; color: #4f3a08; }
.orders-changes h3 { font-size: 13px; }
.orders-changes ul { display: grid; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; font-size: 14px; }
.orders-changes li { display: flex; justify-content: space-between; gap: 12px; overflow-wrap: anywhere; }
.orders-changes li > span:last-child { flex: none; font-variant-numeric: tabular-nums; }
.orders-changes p { margin-top: 8px; font-size: 13px; }
.orders-quantity-toggle { display: grid; justify-items: start; gap: 2px; }
.orders-quantity-toggle .form-hint, .orders-accept-terms { margin: 0; }
.orders-steps { display: grid; margin: 0; padding: 0; list-style: none; }
.orders-steps li { position: relative; display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 12px; padding-bottom: 14px; color: #8a8a8a; }
.orders-steps li:last-child { padding-bottom: 0; }
.orders-steps li:not(:last-child)::before { content: ""; position: absolute; top: 17px; bottom: 1px; left: 6px; width: 2px; border-radius: 1px; background: #e3e3e3; }
.orders-steps li.done::before { background: #146c43; }
.orders-step-dot { width: 14px; height: 14px; margin-top: 2px; border: 2px solid #c9c9c9; border-radius: 50%; background: #fff; }
.orders-steps li.done, .orders-steps li.current { color: inherit; }
.orders-steps li.done .orders-step-dot { border-color: #146c43; background: #146c43; }
.orders-steps li.current .orders-step-dot { border-color: #1d4f91; background: #1d4f91; box-shadow: 0 0 0 3px #e2ecfb; }
.orders-steps strong { font-size: 14px; font-weight: 550; }
.orders-steps small { display: block; margin-top: 1px; color: var(--muted); font-size: 12px; }
.orders-delivery-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px 16px; margin: 0; padding-top: 14px; border-top: 1px solid var(--border); }
.orders-delivery-facts dt { color: var(--muted); font-size: 13px; }
.orders-delivery-facts dd { margin: 3px 0 0; font-size: 14px; overflow-wrap: anywhere; }
.orders-secondary-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 16px; margin-top: -6px; }
.orders-secondary-actions .form-hint { margin: 0; }
.orders-accepted { display: grid; gap: 8px; padding-top: 14px; border-top: 1px solid var(--border); }
.orders-accepted > .orders-outcome { color: var(--muted); font-size: 13px; }
.orders-payment-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 14px; }
.orders-payment-line > .status { font-size: 12px; padding: 4px 10px; }
.orders-payment-detail { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.orders-payment .form-hint { margin: 0; }
.orders-payment [tabindex="-1"]:focus { outline: none; }
.orders-review-form select { width: 100%; }
.orders-history-list { display: grid; margin: 0; padding: 6px 24px 14px; list-style: none; }
.orders-history-list li { display: grid; gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.orders-history-list li:last-child { border-bottom: 0; }
.orders-history-list strong { font-size: 14px; font-weight: 550; overflow-wrap: anywhere; }
.orders-history-list small { color: var(--muted); font-size: 12px; }
/* The invoice: one page to print or save as PDF. */
.orders-invoice-page { max-width: 920px; }
.orders-invoice-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.orders-invoice-toolbar > .button { margin-left: auto; }
.orders-invoice-missing { flex: 1 1 320px; padding: 10px 14px; border-radius: 8px; background: #fff7e6; color: #4f3a08; font-size: 14px; }
.orders-invoice { display: grid; gap: 32px; padding: 40px; }
.orders-invoice-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 24px; }
.orders-invoice-kicker { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; }
.orders-invoice-head h1 { margin-top: 4px; font-size: 28px; letter-spacing: -.5px; }
.orders-invoice-void { display: inline-block; margin-top: 10px; padding: 3px 10px; border: 2px solid #a12a24; border-radius: 6px; color: #a12a24; font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.orders-invoice-meta { display: grid; grid-template-columns: auto auto; gap: 6px 24px; margin: 0; font-size: 14px; }
.orders-invoice-meta > div { display: contents; }
.orders-invoice-meta dt { color: var(--muted); }
.orders-invoice-meta dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.orders-invoice-parties { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.orders-invoice-parties h2, .orders-invoice-terms h2 { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.orders-invoice-parties p { margin-top: 6px; font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.orders-invoice-lines { width: 100%; border-collapse: collapse; font-size: 14px; }
.orders-invoice-lines th { padding: 10px 12px; border-bottom: 2px solid #1a1a1a; font-size: 12px; font-weight: 700; text-align: right; white-space: nowrap; }
.orders-invoice-lines :is(th, td):first-child { padding-left: 0; text-align: left; }
.orders-invoice-lines :is(th, td):nth-child(2) { text-align: left; }
.orders-invoice-lines :is(th, td):last-child { padding-right: 0; }
.orders-invoice-lines td { padding: 12px; border-bottom: 1px solid var(--border); text-align: right; vertical-align: top; font-variant-numeric: tabular-nums; white-space: nowrap; }
.orders-invoice-lines td:is(:first-child, :nth-child(2)) { white-space: normal; overflow-wrap: anywhere; }
.orders-invoice-lines td small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.orders-invoice-totals { display: grid; gap: 8px; width: min(320px, 100%); margin: -12px 0 0 auto; font-size: 14px; }
.orders-invoice-totals > div { display: flex; justify-content: space-between; gap: 16px; }
.orders-invoice-totals dt { color: var(--muted); }
.orders-invoice-totals dd { margin: 0; font-variant-numeric: tabular-nums; }
.orders-invoice-totals > div:last-child { padding-top: 10px; border-top: 2px solid #1a1a1a; font-size: 20px; font-weight: 650; }
.orders-invoice-totals > div:last-child dt { color: inherit; }
.orders-invoice-terms p { margin-top: 6px; font-size: 14px; }
@media print {
  @page { margin: 14mm; }
  body, .main { background: #fff !important; }
  .mobile-bar, .sidebar, .navigation-backdrop, .skip-link, .orders-no-print { display: none !important; }
  .app-shell { padding: 0 !important; }
  .main { padding: 0 !important; }
  .orders-invoice-page { max-width: none; }
  .orders-invoice { padding: 0; border: 0; border-radius: 0; box-shadow: none; overflow: visible; }
  .orders-invoice-lines tr { break-inside: avoid; }
}
.orders-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px 24px; margin: 0; padding: 20px 24px; }
.orders-facts dt { color: var(--muted); font-size: 13px; }
.orders-facts dd { margin: 3px 0 0; font-size: 14px; overflow-wrap: anywhere; }
.orders-facts dd small { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; }
.orders-notes { padding: 16px 24px 20px; border-top: 1px solid var(--border); }
.orders-notes h3 { color: var(--muted); font-size: 13px; font-weight: 500; }
.orders-notes p { margin-top: 4px; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.orders-lines { width: 100%; border-collapse: collapse; font-size: 14px; }
.orders-lines th { padding: 12px 16px; border-bottom: 1px solid var(--border); color: #646464; font-size: 13px; font-weight: 600; text-align: right; white-space: nowrap; }
.orders-lines th:first-child { width: 55%; text-align: left; }
.orders-lines td { padding: 16px; border-bottom: 1px solid var(--border); text-align: right; vertical-align: top; font-variant-numeric: tabular-nums; white-space: nowrap; }
.orders-lines :is(th, td):first-child { padding-left: 24px; }
.orders-lines :is(th, td):last-child { padding-right: 24px; }
.orders-lines td.orders-line-product { text-align: left; white-space: normal; overflow-wrap: anywhere; }
.orders-line-product strong { display: block; font-weight: 600; }
.orders-line-product small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.orders-line-total { font-weight: 600; }
.orders-cell-label { display: none; }
.orders-totals { display: grid; gap: 10px; margin: 0; padding: 20px 24px; font-size: 14px; }
.orders-totals > div { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.orders-totals dt { color: var(--muted); }
.orders-totals dd { margin: 0; font-variant-numeric: tabular-nums; }
.orders-totals > div:last-child { padding-top: 12px; border-top: 1px solid var(--border); }
.orders-totals > div:last-child dd { font-size: 22px; font-weight: 650; letter-spacing: -.5px; }
.orders-review-body { display: grid; gap: 16px; padding: 20px 24px 24px; }
.orders-review-body .alert { margin: 0; }
.orders-review-form { display: grid; gap: 16px; }
.orders-review-form textarea { width: 100%; min-height: 96px; resize: vertical; }
.orders-review-form .form-hint { margin-top: 0; }
.orders-field-error { color: #a12a24; }
.orders-review-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.orders-review-actions > .button { flex: 1 1 auto; }
.orders-confirm { display: grid; gap: 12px; }
.orders-confirm h3 { font-size: 16px; }
.orders-confirm > p:not(.orders-quote) { color: var(--muted); font-size: 14px; }
.orders-quote { padding: 12px 14px; border-radius: 10px; background: #f5f5f5; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.orders-quote > span { display: block; margin-bottom: 3px; color: var(--muted); font-size: 12px; font-weight: 600; }
.orders-outcome { font-size: 14px; overflow-wrap: anywhere; }
.orders-review [tabindex="-1"]:focus { outline: none; }
@media (max-width: 1279px) {
  .orders-detail-layout { display: flex; flex-direction: column; align-items: stretch; gap: 16px; max-width: 960px; }
  .orders-main, .orders-side { display: contents; }
  /* What was ordered first, then who ordered it (and their notes), then what to do
     next: a delivered order's payment before its delivery steps (2026-11-02). */
  .orders-items { order: 1; }
  .orders-buyer { order: 2; }
  .orders-review { order: 3; }
  .orders-payment { order: 4; }
  .orders-detail-layout[data-next="payment"] .orders-payment { order: 3; }
  .orders-detail-layout[data-next="payment"] .orders-review { order: 4; }
  .orders-history { order: 5; }
}
@media (max-width: 760px) {
  /* Export and refresh beside the title, as icons; the status row scrolls (mobile.css). */
  .orders-toolbar-actions > #orders-export { width: 44px; min-height: 44px; padding: 0; }
  .orders-toolbar-actions > #orders-export > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .orders-toolbar-actions > .list-refresh { width: 44px; height: 44px; }
  #orders-export-status > .alert { margin: 8px 16px 0; }
  .orders-filters a { gap: 6px; padding: 8px 12px; font-size: 13px; }
  .orders-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "buyer total" "meta meta" "status status"; gap: 4px 12px; padding: 16px; }
  .orders-row-buyer { grid-area: buyer; }
  .orders-row-meta { grid-area: meta; gap: 2px 10px; font-size: 12px; }
  .orders-row-end { display: contents; }
  .orders-row-total { grid-area: total; align-self: start; }
  .orders-row-pills { grid-area: status; justify-content: flex-start; margin-top: 4px; }
  .orders-row > .icon { display: none; }
  #orders-results > .alert, .orders-placeholder > .alert { margin: 12px 16px 0; }
  .orders-heading { flex-wrap: wrap; }
  .orders-facts { padding: 16px; gap: 14px; }
  .orders-notes { padding: 14px 16px 16px; }
  .orders-lines, .orders-lines tbody { display: block; }
  .orders-lines thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .orders-lines tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px; padding: 16px; border-bottom: 1px solid var(--border); }
  .orders-lines td, .orders-lines td:first-child, .orders-lines td:last-child { display: block; min-width: 0; padding: 0; border: 0; text-align: left; white-space: normal; }
  .orders-lines td.orders-line-product { grid-column: 1 / -1; }
  .orders-lines td.orders-line-total { text-align: right; }
  .orders-cell-label { display: block; margin-bottom: 2px; color: var(--muted); font-size: 12px; font-weight: 400; }
  .orders-totals { padding: 16px; }
  .orders-review-body { padding: 16px; }
  .orders-heading-end { justify-content: flex-start; }
  .orders-changes { margin: 0 16px 16px; }
  .orders-qty-field { justify-content: flex-start; }
  .orders-history-list { padding: 4px 16px 10px; }
  .orders-invoice { gap: 24px; padding: 20px 16px; }
  .orders-invoice-parties { grid-template-columns: minmax(0, 1fr); }
  .orders-invoice-meta dd { text-align: left; }
  .orders-invoice-lines th:nth-child(2), .orders-invoice-lines td:nth-child(2) { display: none; }
  .orders-invoice-lines { font-size: 13px; }
  .orders-invoice-lines th, .orders-invoice-lines td { padding: 10px 6px; }
}

/* Vendor ordering settings */
.ordering-content { display: grid; gap: 16px; max-width: 760px; }
.ordering-content > .alert { margin: 0; }
.ordering-current { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 0; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.ordering-current dt { color: var(--muted); font-size: 14px; }
.ordering-current dd { margin: 0; font-size: 22px; font-weight: 650; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.ordering-form { display: grid; gap: 8px; padding: 20px 24px 24px; }
.ordering-form > label { font-size: 13px; font-weight: 600; }
.ordering-form .form-hint { margin-top: 0; }
.ordering-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.ordering-business-form { gap: 14px; }
.ordering-business-form textarea { width: 100%; resize: vertical; }
/* Settings → Chat hours. */
.chat-hours-form select, .chat-hours-form textarea, .chat-hours-times input { width: 100%; max-width: 420px; min-height: 40px; padding: 8px 10px; border: 1px solid #cfcfcf; border-radius: 8px; background: #fff; font: inherit; }
.chat-hours-days { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; padding: 0; border: 0; }
.chat-hours-days legend { margin-bottom: 6px; font-size: 13px; font-weight: 600; }
.chat-hours-day { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 10px; border: 1px solid #d6d6d6; border-radius: 8px; background: #fff; font-size: 14px; }
.chat-hours-times { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0; }
.chat-hours-times label { display: grid; gap: 6px; min-width: 140px; font-size: 13px; font-weight: 600; }
/* Settings → Store profile (decided 2026-11-01): the form beside a preview of the vendor page. */
.store-profile-content { display: grid; gap: 16px; max-width: 1120px; }
.store-profile-content > div > .alert { margin: 0 0 4px; }
.store-profile-content > [tabindex="-1"]:focus { outline: none; }
.store-profile-content > #store-profile-status:empty { display: none; }
.store-profile-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, 1fr); align-items: start; gap: 16px; }
.store-profile-layout.is-readonly { grid-template-columns: minmax(0, 640px); }
.store-profile-readonly { margin: 0; }
.store-profile-form { gap: 18px; }
.store-profile-form textarea, .store-profile-form input:not([type=checkbox]) { width: 100%; padding: 10px 12px; border: 1px solid #cfcfcf; border-radius: 8px; background: #fff; font: inherit; }
.store-profile-form textarea { min-height: 140px; resize: vertical; line-height: 1.5; }
.store-profile-days { margin: 0; }
.store-profile-days .form-hint { flex-basis: 100%; }
#store-profile-about-count { margin-left: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.store-profile-business { padding: 12px 14px; border-radius: 8px; background: #f7f7f7; font-size: 13px; }
.store-profile-business h3 { font-size: 13px; font-weight: 600; }
.store-profile-business p { margin-top: 3px; color: var(--muted); }
.store-profile-layout.is-readonly > .store-profile-business { background: transparent; padding: 0 2px; }
.store-profile-preview { position: sticky; top: 24px; }
.store-profile-card { padding: 20px; }
.store-card { display: grid; gap: 16px; padding: 18px; border: 1px solid #e3e3e3; border-radius: 12px; background: #fcfcfc; }
.store-card-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.store-card-avatar { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 10px; background: #1a1a1a; color: #fff; font-size: 14px; font-weight: 650; }
.store-card-head > div { min-width: 0; }
.store-card-head h3 { font-size: 17px; font-weight: 650; overflow-wrap: anywhere; }
.store-card-head p { margin-top: 2px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.store-card-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px 16px; margin: 0; }
.store-card-facts dt { color: var(--muted); font-size: 12px; }
.store-card-facts dd { margin: 2px 0 0; font-size: 14px; font-weight: 550; overflow-wrap: anywhere; }
.store-card-note { padding: 10px 12px; border-radius: 8px; background: #f3f7fd; color: #1c3253; font-size: 13px; overflow-wrap: anywhere; }
.store-card-about h4 { margin: 0; color: var(--muted); font-size: 12px; font-weight: 600; }
.store-card-about p { margin-top: 4px; font-size: 14px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 1079px) {
  .store-profile-layout { grid-template-columns: minmax(0, 1fr); }
  .store-profile-preview { position: static; }
}
@media (max-width: 760px) {
  .store-profile-card { padding: 16px; }
  .store-card { padding: 14px; }
  .store-profile-form textarea, .store-profile-form input:not([type=checkbox]) { min-height: 44px; font-size: 16px; }
  .store-profile-days .chat-hours-day { min-height: 44px; }
}
.money-input { position: relative; flex: 1 1 160px; max-width: 280px; min-width: 0; }
.money-input > span { position: absolute; top: 50%; left: 14px; color: var(--muted); transform: translateY(-50%); pointer-events: none; }
.money-input input { width: 100%; padding-left: 28px; font-variant-numeric: tabular-nums; }
#ordering-emails { width: 100%; max-width: 480px; padding: 10px 12px; resize: vertical; min-height: 90px; }
.ordering-note { margin-top: 8px; padding: 10px 12px; border-radius: 8px; background: #fff8ec; color: #81541d; font-size: 13px; }
#ordering-emails-current { font-size: 15px; font-weight: 600; letter-spacing: 0; text-align: right; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .ordering-current, .ordering-form { padding: 16px; }
  .ordering-current dd { font-size: 20px; }
}
