: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; }
.admin-label { display: inline-flex; align-items: center; padding: 3px 7px; border: 1px solid #d9d9d9; border-radius: 5px; background: #e9e9e9; color: #616161; font-size: 10px; font-weight: 600; letter-spacing: .6px; line-height: 1.5; text-transform: uppercase; }
.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; }
.auth-form { display: grid; gap: 18px; }
.field { display: grid; gap: 7px; min-width: 0; }
.field label { font-size: 13px; font-weight: 550; }
.auth-form .field label { color: #515151; }
.auth-form input { height: 46px; padding: 11px 14px; border-color: #d4d7df; border-radius: 7px; }
.auth-form input::placeholder { color: #9399a7; }
.auth-form input:focus { border-color: #616161; }
.auth-form .button { min-height: 46px; border-radius: 7px; font-size: 14px; font-weight: 550; }
.auth-form .button.primary { background: #1e1e1e; border-color: #1e1e1e; box-shadow: none; }
.auth-form .button.primary:hover:not(:disabled) { background: #343434; border-color: #343434; }
.auth-card .alert { margin-bottom: 18px; }
.auth-forgot { justify-self: start; margin-top: 2px; font-weight: 550; }
.auth-link { display: block; margin-top: 16px; font-weight: 550; }
.password-wrap { position: relative; }
.auth-form .password-wrap input { padding-right: 48px; }
.password-toggle { position: absolute; top: 1px; right: 1px; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; background: transparent; color: #616161; }
.password-toggle .icon { width: 18px; height: 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: 112px; height: auto; }
.sidebar-brand .admin-label { background: #e2e2e2; border-color: #d3d3d3; }
.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, .mobile-signout, .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; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.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; }
.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. */
#overview-content, #development-content { max-width: 960px; }
#home-inbox { max-width: 960px; margin-bottom: 16px; }
.home-inbox-link { display: flex; align-items: center; gap: 12px; padding: 14px 18px; text-decoration: none; }
.home-inbox-link:hover { background: #fafafa; }
.home-inbox-icon, .settings-symbol { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 9px; color: #616161; background: #f3f3f3; }
.home-inbox-link > span:nth-child(2) { display: flex; align-items: baseline; flex: 1; flex-wrap: wrap; gap: 4px 12px; min-width: 0; }
.home-inbox-link strong { font-size: 14px; font-weight: 600; }
.home-inbox-link [role="status"] { font-size: 12px; color: var(--muted); }
.home-inbox-link > .icon { color: #777; width: 16px; height: 16px; }
.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; }
#overview-content > .alert, #development-content > .alert { margin-bottom: 16px; }
.overview-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.metric { padding: 18px 20px; }
.metric > p { color: var(--muted); font-size: 13px; }
.metric > strong { display: block; margin-top: 6px; font-size: 30px; font-weight: 650; letter-spacing: -.8px; line-height: 1.25; font-variant-numeric: tabular-nums; }
.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, .inventory-search, .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; }
.result-summary { margin-top: 3px; color: var(--muted); font-size: 12px; }
.directory-table, .inventory-table { width: 100%; border-collapse: collapse; table-layout: fixed; text-align: left; }
.directory-table th, .inventory-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, .inventory-table td { padding: 15px 20px; border-bottom: 1px solid #ebebeb; color: #424242; font-size: 13px; overflow-wrap: anywhere; }
.directory-table tr:last-child td, .inventory-table tr:last-child td { border-bottom: 0; }
.directory-table tbody tr:hover, .inventory-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; }
.mobile-license, .inventory-mobile-category, .inventory-mobile-label { display: none; }
.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, .inventory-panel > .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. */
.inventory-search > .search-field { flex: 1 1 260px; }
.inventory-category { flex: 0 1 210px; min-width: 0; }
.inventory-category select { width: 100%; max-width: 100%; }
.inventory-table th:first-child { width: 48%; }
.inventory-table th:nth-child(2) { width: 24%; }
.inventory-table th:nth-child(3), .inventory-table th:last-child { width: 14%; text-align: right; }
.inventory-table td > strong { display: block; font-weight: 550; }
.product-name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.product-name > div { min-width: 0; }
.product-name strong { display: block; color: #303030; font-weight: 550; }
.inventory-product-button { display: block; max-width: 100%; padding: 0; border: 0; border-radius: 3px; background: transparent; color: #303030; font: inherit; font-weight: 550; line-height: 1.5; text-align: left; overflow-wrap: anywhere; text-decoration: underline; text-decoration-color: #c7c7c7; text-underline-offset: 3px; }
.inventory-product-button:hover:not(:disabled) { text-decoration-color: currentColor; }
.inventory-hidden { display: inline-flex; margin-top: 6px; padding: 2px 6px; border-radius: 4px; background: #ededed; color: #616161; font-size: 10px; line-height: 1.4; }
.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-visibility-help { color: var(--muted); font-size: 13px; line-height: 1.5; }
.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; }
.inventory-product-meta { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.inventory-product-category { color: var(--muted); }
.inventory-price, .inventory-stock { text-align: right; font-variant-numeric: tabular-nums; }
.inventory-stock .inventory-value > strong { display: block; font-weight: 550; }
.inventory-stock .inventory-value > span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }

/* 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-top { display: flex; align-items: flex-start; grid-column: 1; gap: 12px; min-width: 0; }
.user-top .avatar { width: 36px; height: 36px; }
.user-info { flex: 1; min-width: 0; }
.user-email { color: #303030; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.user-name { margin-top: 3px; color: var(--muted); font-size: 12px; }
.user-meta { display: flex; flex-wrap: wrap; grid-column: 1; gap: 4px 14px; color: var(--muted); font-size: 11px; }
.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; }
.user-actions { display: flex; align-items: center; flex-wrap: wrap; grid-column: 3; grid-row: 1 / 3; align-content: center; gap: 8px 16px; }
.user-actions .text-button { 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; }
.footnote-box { display: flex; gap: 9px; margin-top: 20px; padding-top: 18px; border-top: 1px solid #ebebeb; color: var(--muted); }
.footnote-box .icon { width: 16px; height: 16px; margin-top: 1px; }
.footnote-box p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }

/* Product pricing is scoped to the open company, never a second directory. */
.pricing-detail { min-width: 0; }
.pricing-detail-heading h2 { font-size: 16px; overflow-wrap: anywhere; }
.pricing-detail-intro { padding: 16px 20px 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.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; }

/* Preserve the shared StemLot loading mark. */
.boot-screen { display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; background: #fafafa; }
.brand-loader-art { position: relative; display: block; width: 180px; }
.brand-loader-logo { display: block; width: 100%; height: auto; filter: brightness(0); opacity: .35; }
.brand-loader-shine { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, transparent 33.333%, #000 50%, transparent 66.667%) 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; animation: shine 1.4s cubic-bezier(.2, 0, .13, 1) infinite; }
@keyframes shine { from { background-position: 100% 0; } to { background-position: 0% 0; } }

@media (min-width: 1700px) {
  .main { padding: 34px 40px 52px; }
}
@media (max-width: 1200px) {
  .main { padding: 26px 24px 40px; }
  .directory-table th, .directory-table td, .inventory-table th, .inventory-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-top, .user-meta { grid-column: 1 / -1; }
  .user-role-form { grid-column: 1; grid-row: auto; margin-top: 4px; }
  .user-role-form > label { width: auto; }
  .user-actions { grid-column: 2; grid-row: auto; }
}
@media (max-width: 1000px) {
  .company-overview-grid { grid-template-columns: 1fr; }
  .directory-table th:nth-child(3), .directory-table td.company-address { 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; }
  .inventory-table th:first-child { width: 42%; }
  .inventory-table th:nth-child(2) { width: 22%; }
  .inventory-table th:nth-child(3), .inventory-table th:last-child { width: 18%; }
  .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: 124px; 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: 112px; 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; }
  .home-inbox-link { padding: 12px 14px; }
  .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; }
  .overview-metrics { gap: 12px; margin-top: 16px; }
  .metric { padding: 18px 16px; }
  .metric > strong { margin: 8px 0 5px; font-size: 30px; }
  .metric > span { font-size: 11px; }
  .sync-row { gap: 12px; padding: 18px 16px; }
  .company-search, .directory-toolbar, .inventory-search, .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.company-license, .directory-table td.directory-arrow { display: none; }
  .directory-table td.company-address { display: block; margin-top: 7px; padding-left: 44px; color: var(--muted); font-size: 12px; }
  .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; }
  .mobile-license { display: inline; }
  .directory-footer, .inventory-footer { padding: 14px 16px; gap: 10px; }
  .directory-footer p, .inventory-footer p { font-size: 12px; }
  #company-results > .alert, .inventory-panel > .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; }
  .inventory-search > .search-field { flex-basis: 100%; }
  .inventory-category { flex: 1 1 170px; }
  .inventory-table, .inventory-table tbody { display: block; }
  .inventory-table thead { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .inventory-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; padding: 14px; }
  .inventory-table tr + tr { border-top: 1px solid #ebebeb; }
  .inventory-table td { display: block; min-width: 0; padding: 0; border: 0; }
  .inventory-table td:first-child { grid-column: 1 / -1; }
  .inventory-table td.inventory-product-category { display: none; }
  .product-name { align-items: flex-start; gap: 9px; }
  .product-name > div { width: 100%; }
  .product-name strong { font-size: 14px; }
  .inventory-product-button { width: 100%; min-height: 44px; padding: 10px 0; margin-top: -10px; font-size: 14px; text-decoration: none; }
  .inventory-product-meta { font-size: 11px; }
  .inventory-mobile-category { display: inline; margin: 0; color: var(--muted); font-size: 11px; }
  .inventory-mobile-category::before { content: " · "; }
  .inventory-product-meta { display: inline; }
  .inventory-hidden { display: table; margin: 0 0 5px; }
  .inventory-table td.inventory-price, .inventory-table td.inventory-stock { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; text-align: left; }
  .inventory-stock { justify-content: flex-end; }
  .inventory-mobile-label { display: inline; color: var(--muted); font-size: 11px; }
  .inventory-value { display: inline-flex; align-items: baseline; gap: 4px; font-size: 13px; font-variant-numeric: tabular-nums; }
  .inventory-stock .inventory-value > strong { font-weight: 550; }
  .inventory-stock .inventory-value > span { display: inline; margin: 0; }
  .user-list { padding: 0 16px; }
  .user-row { display: block; padding: 20px 0; }
  .user-top { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 4px 10px; }
  .user-top .avatar { grid-column: 1; grid-row: 1 / 3; width: 32px; height: 32px; }
  .user-top .user-info { display: contents; }
  .user-top .user-email { grid-column: 2 / -1; grid-row: 1; }
  .user-top .user-name { grid-column: 2; grid-row: 2; margin-top: 0; }
  .user-top > .status { grid-column: 3; grid-row: 2; justify-self: end; align-self: start; }
  .user-meta { margin-top: 12px; }
  .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; }
  .user-actions { margin-top: 8px; gap: 4px 18px; }
  .user-actions .text-button { font-size: 13px; }
  .pricing-detail-intro { padding: 14px 16px 0; }
  .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; }
  .auth-form input { height: 48px; font-size: 16px; }
  .auth-form .button { min-height: 48px; }
  .auth-forgot, .auth-link { min-height: 44px; }
  .password-toggle { top: 2px; right: 2px; }
}
@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; }
  .metric { padding: 16px 14px; }
  .metric > strong { font-size: 28px; }
  .metric > p { font-size: 12px; }
  .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%; }
  .inventory-table tr { gap: 10px; padding: 14px 12px; }
  .sync-row { flex-wrap: wrap; }
  .sync-row > div { flex: 1; min-width: 155px; }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar { transition: none; }
  .brand-loader-shine { animation: none; background: none; }
  .brand-loader-logo { opacity: 1; }
  .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; }
.list-toolbar .inventory-category select { width: 100%; }
.list-summary { min-height: 42px; padding: 10px 20px; }
.list-summary > div { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; }
.list-summary h2 { font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.list-summary p { margin: 0; }
#inventory-results > .alert { margin: 12px 16px; }
@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%; }
  .list-toolbar .inventory-category { flex: 1; }
  .list-summary { padding: 10px 16px; }
  .sync-grid { grid-template-columns: 1fr; }
  .sync-row + .sync-row { border-left: 0; border-top: 1px solid #ebebeb; }
  .overview-metrics { margin-top: 0; }
  .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-details-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.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-details-grid { grid-template-columns: 1fr; gap: 12px; }
  .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. */
.order-attention-panel { margin-bottom: 16px; }
.order-attention-list { list-style: none; margin: 0; padding: 0; }
.order-attention-list > li { padding: 14px 20px; }
.order-attention-list > li + li { border-top: 1px solid #ebebeb; }
.order-attention-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.order-attention-heading a { min-width: 0; color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.order-attention-heading strong { flex-shrink: 0; font-size: 13px; font-variant-numeric: tabular-nums; }
.order-attention-meta, .order-attention-footer { color: var(--muted); font-size: 12px; line-height: 1.5; }
.order-attention-meta { margin-top: 4px; }
.order-attention-reason { margin-top: 7px; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.order-attention-footer { padding: 0 20px 14px; }
@media (max-width: 600px) { .order-attention-list > li { padding: 14px 16px; } }

/* Orders use the selected company's prices without modifying its customer cart. */
.orders-screen { max-width: 1320px; margin: 0 auto; }
.order-company-picker { max-width: 720px; }
.order-panel-body { padding: 16px 20px; }
.order-company-list, .order-product-results, .order-line-list, .order-history-list, .order-result-lines { padding: 0; margin: 0; list-style: none; }
.order-company-list a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-top: 1px solid #ebebeb; text-decoration: none; }
.order-company-list a:hover, .order-history-list a:hover { background: #fafafa; }
.order-company-list a > span { min-width: 0; overflow-wrap: anywhere; }
.order-company-list small, .order-product-info small, .order-line-product small, .order-history-list small, .order-result-lines small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.order-company-link { text-underline-offset: 3px; }
.order-composer { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.order-composer-main, .order-composer-aside { display: grid; gap: 20px; min-width: 0; }
.order-products-panel .order-panel-body { padding-bottom: 12px; }
.order-product-results { max-height: 320px; overflow-y: auto; overscroll-behavior: contain; }
.order-product-results li { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid #f0f0f0; }
.order-product-image { display: grid; flex: none; place-items: center; width: 44px; height: 44px; border: 1px solid #ebebeb; border-radius: 8px; background: #fafafa; color: #999; overflow: hidden; }
.order-product-image img { width: 100%; height: 100%; object-fit: contain; }
.order-product-info { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.order-product-info strong, .order-line-product strong { font-size: 13px; font-weight: 550; }
.order-list-hint { padding: 10px 20px; border-top: 1px solid #ebebeb; color: var(--muted); font-size: 12px; }
.order-empty { padding: 24px 20px; color: var(--muted); font-size: 13px; }
.order-line-list li { display: grid; grid-template-columns: minmax(0, 1fr) 72px 80px 32px; align-items: center; gap: 12px; padding: 16px 20px; border-top: 1px solid #ebebeb; }
.order-line-list li:first-child { border-top: 0; }
.order-line-product { overflow-wrap: anywhere; min-width: 0; }
.order-line-list input { padding: 6px 8px; text-align: center; }
.order-line-list .icon-button { width: 32px; height: 32px; border: 0; }
.order-line-total { text-align: right; font-size: 13px; font-weight: 550; }
.order-company-details p { margin-top: 5px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.order-summary-values { display: grid; gap: 12px; margin: 0; }
.order-summary-values > div { display: flex; justify-content: space-between; gap: 12px; }
.order-summary-values dd { margin: 0; }
.order-summary-values dt, .order-result-meta dt { color: var(--muted); }
.order-summary-note { margin-top: 12px; color: var(--muted); font-size: 12px; }
.order-recovery-note { margin-top: 14px; font-size: 13px; }
.order-submit { width: 100%; margin-top: 16px; min-height: 40px; white-space: normal; text-align: center; }
.order-history-entry { display: grid; grid-template-columns: minmax(0, 1fr) auto 100px 20px; align-items: center; gap: 16px; padding: 16px 20px; border-top: 1px solid #ebebeb; text-decoration: none; }
.order-history-entry > strong { text-align: right; }
.order-history-entry > div { min-width: 0; overflow-wrap: anywhere; }
.order-result { max-width: 900px; }
.order-result-heading { display: flex; align-items: flex-start; gap: 14px; padding: 24px; border-bottom: 1px solid #ebebeb; }
.order-result-icon { display: grid; flex: none; place-items: center; width: 36px; height: 36px; background: #f3f3f3; border-radius: 50%; }
.order-result-heading p { margin-top: 5px; color: var(--muted); font-size: 13px; max-width: 550px; }
.order-result-meta { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 18px; margin: 0; padding: 20px 24px; font-size: 13px; }
.order-result-meta dd { margin: 4px 0 0; overflow-wrap: anywhere; }
.order-result-lines li { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid #ebebeb; padding: 16px 24px; font-size: 13px; }
.order-result-lines li > span { min-width: 0; overflow-wrap: anywhere; }
.order-result-actions { display: flex; flex-wrap: wrap; gap: 10px; padding: 20px 24px; border-top: 1px solid #ebebeb; }
#order-alert:not(:empty) { margin-bottom: 18px; }
@media (max-width: 1100px) { .order-composer { grid-template-columns: minmax(0, 1fr) 260px; gap: 16px; } .order-line-list li { grid-template-columns: minmax(0, 1fr) 64px 65px 28px; gap: 8px; } }
@media (max-width: 950px) { .order-composer { grid-template-columns: 1fr; } .order-composer-aside { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; } }
@media (max-width: 760px) {
  .order-line-list li { grid-template-columns: minmax(0, 1fr) 64px 72px 44px; }
  .order-line-list .icon-button { width: 44px; height: 44px; }
  .order-result-lines li > strong { flex: none; white-space: nowrap; }
  .order-summary-values { gap: 8px; }
  .order-summary-panel .panel-heading { padding-bottom: 0; border-bottom: 0; }
}
@media (max-width: 520px) {
  .order-composer-aside { grid-template-columns: 1fr; }
  .order-summary-panel { grid-row: 1; }
  .order-composer, .order-composer-main, .order-composer-aside { gap: 12px; }
  .order-panel-body, .order-product-results li, .order-line-list li { padding: 14px; }
  .order-product-results { max-height: 270px; }
  .order-product-results li { gap: 10px; }
  .order-product-image { width: 38px; height: 38px; }
  .order-line-list li { grid-template-columns: minmax(0, 1fr) 60px 44px; gap: 8px 10px; }
  .order-line-product { grid-column: 1 / 3; }
  .order-line-list input { grid-row: 2; grid-column: 1; width: 70px; }
  .order-line-list .icon-button { grid-column: 3; grid-row: 1; }
  .order-line-total { grid-column: 2 / 4; grid-row: 2; }
  .order-history-entry { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 16px; }
  .order-history-entry > .icon { display: none; }
  .order-history-entry > .status { grid-row: 2; justify-self: start; }
  .order-history-entry > strong { grid-column: 2; grid-row: 1; }
  .order-result-heading, .order-result-meta, .order-result-actions { padding: 18px 16px; }
  .order-result-meta { grid-template-columns: 1fr 1fr; }
  .order-result-meta > div:first-child { grid-column: 1 / -1; }
  .order-result-lines li { padding: 16px; }
  .order-result-actions > .button { flex: 1; white-space: normal; text-align: center; }
}

/* 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; }
}

/* Incoming marketplace orders: one list per review status and a review page. */
.incoming-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 24px; border-bottom: 1px solid var(--border); }
.incoming-filters { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.incoming-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; }
.incoming-filters a:hover { background: #e8e8e8; }
.incoming-filters a[aria-current="page"] { background: #1a1a1a; color: #fff; }
.incoming-filters .count-badge { min-height: 20px; padding: 1px 7px; background: #fff; }
.incoming-filters a[aria-current="page"] .count-badge { background: #ffffff2b; color: #fff; }
.incoming-rows { margin: 0; padding: 0; list-style: none; }
.incoming-rows > li + li { border-top: 1px solid var(--border); }
.incoming-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.incoming-row:hover { background: #f8f8f8; }
.incoming-row-buyer { display: grid; gap: 3px; min-width: 0; }
.incoming-row-buyer strong { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.incoming-row-buyer small, .incoming-row-meta { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.incoming-row-meta { display: flex; flex-wrap: wrap; gap: 2px 14px; min-width: 0; }
.incoming-row-end { display: grid; justify-items: end; gap: 6px; }
.incoming-row-total { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.incoming-row > .icon { width: 16px; height: 16px; color: #888; }
#incoming-results > .alert, .incoming-placeholder > .alert { margin: 16px 24px 0; }
.incoming-heading > .status { font-size: 12px; padding: 4px 10px; }
.incoming-heading h1 { overflow-wrap: anywhere; }
/* Wide screens keep the decision beside the items; narrow ones read buyer, items, decision. */
.incoming-detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); grid-template-rows: auto 1fr; grid-template-areas: "items review" "items buyer"; align-items: start; gap: 24px; max-width: 1240px; }
.incoming-buyer { grid-area: buyer; }
.incoming-items { grid-area: items; }
.incoming-review { grid-area: review; }
.incoming-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px 24px; margin: 0; padding: 20px 24px; }
.incoming-facts dt { color: var(--muted); font-size: 13px; }
.incoming-facts dd { margin: 3px 0 0; font-size: 14px; overflow-wrap: anywhere; }
.incoming-facts dd small { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; }
.incoming-notes { padding: 16px 24px 20px; border-top: 1px solid var(--border); }
.incoming-notes h3 { color: var(--muted); font-size: 13px; font-weight: 500; }
.incoming-notes p { margin-top: 4px; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.incoming-lines { width: 100%; border-collapse: collapse; font-size: 14px; }
.incoming-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; }
.incoming-lines th:first-child { width: 55%; text-align: left; }
.incoming-lines td { padding: 16px; border-bottom: 1px solid var(--border); text-align: right; vertical-align: top; font-variant-numeric: tabular-nums; white-space: nowrap; }
.incoming-lines :is(th, td):first-child { padding-left: 24px; }
.incoming-lines :is(th, td):last-child { padding-right: 24px; }
.incoming-lines td.incoming-line-product { text-align: left; white-space: normal; overflow-wrap: anywhere; }
.incoming-line-product strong { display: block; font-weight: 600; }
.incoming-line-product small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.incoming-line-total { font-weight: 600; }
.incoming-cell-label { display: none; }
.incoming-totals { display: grid; gap: 10px; margin: 0; padding: 20px 24px; font-size: 14px; }
.incoming-totals > div { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.incoming-totals dt { color: var(--muted); }
.incoming-totals dd { margin: 0; font-variant-numeric: tabular-nums; }
.incoming-totals > div:last-child { padding-top: 12px; border-top: 1px solid var(--border); }
.incoming-totals > div:last-child dd { font-size: 22px; font-weight: 650; letter-spacing: -.5px; }
.incoming-review-body { display: grid; gap: 16px; padding: 20px 24px 24px; }
.incoming-review-body .alert { margin: 0; }
.incoming-review-form { display: grid; gap: 16px; }
.incoming-review-form textarea { width: 100%; min-height: 96px; resize: vertical; }
.incoming-review-form .form-hint { margin-top: 0; }
.incoming-field-error { color: #a12a24; }
.incoming-review-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.incoming-review-actions > .button { flex: 1 1 auto; }
.incoming-confirm { display: grid; gap: 12px; }
.incoming-confirm h3 { font-size: 16px; }
.incoming-confirm > p:not(.incoming-quote) { color: var(--muted); font-size: 14px; }
.incoming-quote { padding: 12px 14px; border-radius: 10px; background: #f5f5f5; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.incoming-quote > span { display: block; margin-bottom: 3px; color: var(--muted); font-size: 12px; font-weight: 600; }
.incoming-outcome { font-size: 14px; overflow-wrap: anywhere; }
.incoming-review [tabindex="-1"]:focus { outline: none; }
@media (max-width: 1279px) {
  .incoming-detail-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-template-areas: "buyer" "items" "review"; gap: 16px; max-width: 960px; }
}
@media (max-width: 760px) {
  /* Chips wrap under the refresh button: a float reserves its place on the first line only. */
  .incoming-toolbar { position: relative; display: block; padding: 12px 16px 6px; }
  .incoming-toolbar > .list-refresh { position: absolute; top: 12px; right: 12px; }
  .incoming-filters { display: block; }
  .incoming-filters::before { content: ""; float: right; width: 48px; height: 44px; }
  .incoming-filters a { gap: 6px; margin: 0 6px 6px 0; padding: 8px 12px; font-size: 13px; vertical-align: top; }
  .incoming-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "buyer total" "meta meta" "status status"; gap: 4px 12px; padding: 16px; }
  .incoming-row-buyer { grid-area: buyer; }
  .incoming-row-meta { grid-area: meta; gap: 2px 10px; font-size: 12px; }
  .incoming-row-end { display: contents; }
  .incoming-row-total { grid-area: total; align-self: start; }
  .incoming-row-end > .status { grid-area: status; justify-self: start; margin-top: 4px; }
  .incoming-row > .icon { display: none; }
  #incoming-results > .alert, .incoming-placeholder > .alert { margin: 12px 16px 0; }
  .incoming-heading { flex-wrap: wrap; }
  .incoming-facts { padding: 16px; gap: 14px; }
  .incoming-notes { padding: 14px 16px 16px; }
  .incoming-lines, .incoming-lines tbody { display: block; }
  .incoming-lines thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .incoming-lines tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px; padding: 16px; border-bottom: 1px solid var(--border); }
  .incoming-lines td, .incoming-lines td:first-child, .incoming-lines td:last-child { display: block; min-width: 0; padding: 0; border: 0; text-align: left; white-space: normal; }
  .incoming-lines td.incoming-line-product { grid-column: 1 / -1; }
  .incoming-lines td.incoming-line-total { text-align: right; }
  .incoming-cell-label { display: block; margin-bottom: 2px; color: var(--muted); font-size: 12px; font-weight: 400; }
  .incoming-totals { padding: 16px; }
  .incoming-review-body { padding: 16px; }
}

/* 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; }
.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; }
}
