  /* Shared finish for the seller tools. Each page keeps its own layout and data density.
     The redesign puts the page head on the background, not on a card: an
     overline, the h1, one line of description and the data's freshness. */
  :is(#af, #inv, #pp, #rl, #bm) .pagehead,
  #kr .head {
    margin: 8px 0 32px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
  }
  :is(#af, #inv, #pp, #rl, #bm) .pagehead h1, #kr .head h1 { font: 600 28px/36px var(--sans); letter-spacing: 0; }
  :is(#af, #inv, #pp, #rl, #bm) .pagehead .eyebrow, #kr .head .eyebrow { color: var(--ink-faint); }
  :is(#af, #inv, #pp, #rl, #bm) .panel {
    border-color: transparent;
    border-radius: 14px;
    box-shadow: var(--card-shadow);
  }
  :is(#af, #inv, #pp, #rl, #bm) .pcard,
  #rl .ccard.mine {
    border-radius: 14px;
    box-shadow: var(--card-shadow);
    transition-property: box-shadow;
    transition-duration: 150ms;
    transition-timing-function: ease-out;
  }
  :is(#af, #inv, #pp, #rl, #bm) .pcard:hover,
  #rl .ccard.mine:hover { box-shadow: var(--shadow); }
  :is(#af, #inv, #pp, #rl, #bm) .btn {
    border-radius: 8px;
    transition-property: background-color, border-color, box-shadow, scale, filter;
    transition-duration: 150ms;
    transition-timing-function: ease-out;
  }
  :is(#af, #inv, #pp, #rl, #bm) .btn:hover:not(:disabled):not(.ghost) {
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 24%, transparent);
  }
  :is(#af, #inv, #pp, #rl, #bm) .tab {
    transition-property: background-color, color, border-color;
    transition-duration: 150ms;
    transition-timing-function: ease-out;
  }
  :is(#af, #inv, #pp, #rl, #bm) .tab:hover:not([aria-selected="true"]) { background: var(--surface-2); }
  :is(#af, #inv, #pp, #rl, #bm) .x:hover { background: var(--surface-2); }
  #bm .chat, #bm .sk, #bm .ctxsec, #bm .launch button {
    border-radius: 14px;
    box-shadow: var(--card-shadow);
  }
  #bm .chat { border-color: transparent; }
  #bm .launch button {
    border-color: transparent;
    transition-property: background-color, box-shadow;
    transition-duration: 150ms;
    transition-timing-function: ease-out;
  }
  #bm .launch button:hover { background: var(--accent-soft); box-shadow: var(--shadow); }
  #kr .tile {
    border-color: transparent;
    border-radius: 14px;
    box-shadow: var(--card-shadow);
  }
  #kr .tab, #kr .seg a {
    transition-property: background-color, color, border-color, box-shadow, scale;
    transition-duration: 150ms;
    transition-timing-function: ease-out;
  }
  #kr .tab:hover:not(.on), #kr .seg a:hover:not(.on) {
    background: var(--surface-2);
  }
  #kr .tab:active, #kr .seg a:active { scale: .96; }
  @media (prefers-reduced-motion: reduce) {
    :is(#af, #inv, #pp, #rl, #bm) :is(.pcard, .btn, .tab), #rl .ccard.mine,
    #bm .launch button,
    #kr .tab, #kr .seg a { transition: none; }
    #kr .tab:active, #kr .seg a:active { scale: 1; }
  }

  /* Brand-scoped chat, available from every authenticated tool page. */
  .quick-chat { position: fixed; right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom)); z-index: 75; font: 400 14px/1.5 "IBM Plex Sans", sans-serif; }
  .quick-chat button, .quick-chat textarea { font: inherit; }
  .quick-chat :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .quick-chat-launcher { display: inline-flex; align-items: center; gap: 9px; min-height: 48px; padding: 0 17px; border: 1px solid color-mix(in srgb, var(--accent) 65%, transparent); border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 600 !important; cursor: pointer; box-shadow: 0 12px 30px -12px rgba(20,45,106,.65); }
  .quick-chat-launcher:hover { filter: brightness(1.08); }
  .quick-chat-launcher svg { width: 19px; height: 19px; flex: none; }
  .quick-chat-panel { position: absolute; right: 0; bottom: calc(100% + 12px); display: flex; flex-direction: column; width: min(390px, calc(100vw - 32px)); height: min(610px, calc(100dvh - 105px)); min-height: 320px; overflow: hidden; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); color: var(--ink); box-shadow: 0 24px 70px -20px rgba(15,25,55,.38); }
  .quick-chat-head { display: flex; align-items: center; gap: 11px; padding: 15px 16px; border-bottom: 1px solid var(--border); background: linear-gradient(120deg,var(--surface),color-mix(in srgb,var(--accent-soft) 72%,var(--surface))); }
  .quick-chat-mark { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
  .quick-chat-mark svg { width: 18px; height: 18px; }
  .quick-chat-title { min-width: 0; flex: 1; }
  .quick-chat-title strong { display: block; line-height: 1.2; }
  .quick-chat-title small { display: block; margin-top: 2px; overflow: hidden; color: var(--ink-muted); font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
  .quick-chat-close { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--ink); cursor: pointer; }
  .quick-chat-close:hover { background: var(--surface-2); }
  .quick-chat-feed { display: flex; flex: 1; flex-direction: column; gap: 12px; min-height: 0; overflow-y: auto; padding: 16px; overscroll-behavior: contain; }
  .quick-chat-feed .msg { max-width: 90%; padding: 11px 13px; border-radius: 13px; overflow-wrap: anywhere; }
  .quick-chat-feed .msg.u { align-self: flex-end; background: var(--accent); color: var(--accent-ink); }
  /* _thread_messages.html labels teammates' and skill-run questions (<span class="who">); same as chat_workspace.html's #bm .msg.u .who. */
  .quick-chat-feed .msg.u .who { display: block; margin-bottom: 2px; font-size: 11px; font-weight: 600; opacity: .85; }
  .quick-chat-feed .msg.a { align-self: flex-start; background: var(--surface-2); color: var(--ink); }
  .quick-chat-feed .msg.sys { align-self: center; color: var(--ink-muted); text-align: center; font-size: 13px; }
  .quick-chat-feed .msg p { margin: 6px 0 0; }
  .quick-chat-feed .msg p:first-child { margin-top: 0; }
  .quick-chat-feed .msg .meta { font-size: 11px; font-weight: 600; color: var(--accent); }
  .quick-chat-feed .msg .src { margin-top: 9px; font-size: 10.5px; color: var(--ink-faint); }
  .quick-chat-feed .rcard { padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
  .quick-chat-feed .rcard .rh { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; }
  .quick-chat-feed .rcard .rb { margin-top: 8px; font-size: 12px; color: var(--ink-muted); }
  .quick-chat-feed .rcard .ra { margin-top: 8px; }
  .quick-chat-feed .rcard textarea { width: 100%; min-height: 64px; padding: 8px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--ink); }
  .quick-chat-feed .rcard button { padding: 7px 11px; border: 0; border-radius: 8px; background: var(--accent); color: var(--accent-ink); cursor: pointer; }
  .quick-chat-feed .chip { padding: 1px 6px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
  .quick-chat-feed .brandctx { margin-top: 6px; }
  .quick-chat-feed .brandctx .chip { white-space: normal; line-height: 18px; }
  .quick-chat-feed .brandctx .chip.good { background: var(--good-soft); color: var(--good); }
  .quick-chat-feed .brandctx .chip.warn { background: var(--warn-soft); color: var(--warn); }
  .quick-chat-feed .brandctx a.chip { text-decoration: none; }
  .quick-chat-feed .brandctx a.chip:hover { text-decoration: underline; }
  .quick-chat-feed .bar { width: 100%; height: 4px; margin-bottom: 8px; border-radius: 4px; background: var(--border); overflow: hidden; }
  .quick-chat-feed .bar i { display: block; width: 35%; height: 100%; background: var(--accent); animation: chat-wait 1.3s ease-in-out infinite alternate; }
  @keyframes chat-wait { to { transform: translateX(180%); } }
  .quick-chat-state { padding: 15px; color: var(--ink-muted); text-align: center; font-size: 13px; }
  .quick-chat-state button { margin-top: 8px; padding: 7px 11px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--ink); cursor: pointer; }
  .quick-chat-form { border-top: 1px solid var(--border); padding: 12px; }
  .quick-chat-form textarea { width: 100%; min-height: 68px; max-height: 130px; resize: vertical; padding: 10px 11px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); color: var(--ink); }
  .quick-chat-form textarea:disabled { opacity: .7; }
  .quick-chat-geo { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12.5px; color: var(--ink-muted); }
  .quick-chat-geo select { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 999px; padding: 3px 8px; }
  .quick-chat-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
  .quick-chat-actions a { font-size: 12px; font-weight: 600; }
  .quick-chat-actions button { min-height: 34px; padding: 0 14px; border: 0; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-weight: 600; cursor: pointer; }
  .quick-chat-actions button:disabled { opacity: .55; cursor: default; }
  .quick-chat-feedback { min-height: 18px; margin-top: 4px; color: var(--critical); font-size: 11.5px; }
  .quick-chat-feedback button { padding: 0; border: 0; background: none; color: var(--accent); font-size: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
  @media (max-width: 600px) { .quick-chat { right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); } .quick-chat-panel { width: min(390px, calc(100vw - 48px)); height: min(640px, calc(100dvh - 92px)); } }
  /* Phones: the launcher is a 48px round icon, its label kept for screen
     readers, so it covers less of the page scrolling under it (live QA,
     2026-10-20). */
  @media (max-width: 600px) {
    .quick-chat-launcher { width: 48px; padding: 0; justify-content: center; }
    .quick-chat-launcher .quick-chat-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  }
  @media (prefers-reduced-motion: reduce) { .quick-chat-feed .bar i { animation: none; } }

  /* The Product costs assistant (_cost_assistant.html, cost-assistant.js): a
     420px drawer on the right, full screen on a phone; the quick chat's look. */
  .cost-ai { position: fixed; top: 0; right: 0; bottom: 0; z-index: 90; display: flex; flex-direction: column; width: min(420px, 100vw); box-sizing: border-box; margin: 0; border-left: 1px solid var(--border); background: var(--surface); color: var(--ink); box-shadow: -24px 0 70px -30px rgba(15,25,55,.45); font: 400 14px/1.5 "IBM Plex Sans", sans-serif; }
  .cost-ai[hidden] { display: none; }
  .cost-ai button, .cost-ai textarea, .cost-ai input { font: inherit; }
  .cost-ai :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .cost-ai-head { display: flex; align-items: center; gap: 11px; padding: 15px 16px; border-bottom: 1px solid var(--border); background: linear-gradient(120deg,var(--surface),color-mix(in srgb,var(--accent-soft) 72%,var(--surface))); }
  .cost-ai-mark { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
  .cost-ai-mark svg { width: 18px; height: 18px; }
  .cost-ai-title { min-width: 0; flex: 1; }
  .cost-ai-title strong { display: block; line-height: 1.2; }
  .cost-ai-title small { display: block; margin-top: 2px; overflow: hidden; color: var(--ink-muted); font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
  .cost-ai-close { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--ink); cursor: pointer; }
  .cost-ai-close:hover { background: var(--surface-2); }
  .cost-ai-feed { display: flex; flex: 1; flex-direction: column; gap: 12px; min-height: 0; overflow-y: auto; padding: 16px; overscroll-behavior: contain; }
  .cost-ai-msg { max-width: 92%; padding: 11px 13px; border-radius: 13px; overflow-wrap: anywhere; }
  .cost-ai-msg p { margin: 0; }
  .cost-ai-msg p + p, .cost-ai-msg p + div { margin-top: 8px; }
  .cost-ai-msg.u { align-self: flex-end; background: var(--accent); color: var(--accent-ink); }
  .cost-ai-msg.u .cost-ai-text { display: block; white-space: pre-wrap; max-height: 220px; overflow: auto; }
  .cost-ai-msg.u .cost-ai-file { display: block; font-weight: 600; }
  .cost-ai-msg.u .cost-ai-file + .cost-ai-text { margin-top: 4px; }
  .cost-ai-msg.a { align-self: flex-start; background: var(--surface-2); color: var(--ink); }
  .cost-ai-msg.a.err { background: var(--warn-soft); }
  .cost-ai-msg.sys { align-self: stretch; max-width: none; background: var(--warn-soft); color: var(--ink); }
  .cost-ai-msg.sys a { display: inline-block; margin-top: 6px; font-weight: 600; }
  .cost-ai-facts { margin: 0; padding-left: 18px; }
  .cost-ai-facts li + li { margin-top: 3px; }
  .cost-ai-note { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
  .cost-ai-facts:empty + .cost-ai-note, .cost-ai-note:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
  .cost-ai-top { color: var(--ink-muted); font-size: 13px; }
  .cost-ai-msg .cost-ai-quick + .cost-ai-top { margin-top: 10px; }
  .cost-ai-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
  .cost-ai-quick a, .cost-ai-quick button { display: inline-flex; align-items: center; min-height: 30px; padding: 0 11px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); color: var(--ink); font-size: 12.5px; font-weight: 600; text-decoration: none; cursor: pointer; }
  .cost-ai-quick a:hover, .cost-ai-quick button:hover { border-color: var(--accent); color: var(--accent); }
  .cost-ai-card { padding: 12px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); }
  .cost-ai-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
  .cost-ai-chip { padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 11.5px; }
  .cost-ai-counts { margin-top: 6px; font-weight: 600; font-size: 13px; }
  .cost-ai-sub { color: var(--ink-muted); font-size: 12px; }
  .cost-ai-rows { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
  .cost-ai-row { padding: 9px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); font-size: 13px; }
  .cost-ai-row.look { border-color: color-mix(in srgb, var(--warn) 55%, var(--border)); background: var(--warn-soft); }
  .cost-ai-row.out { opacity: .6; }
  .cost-ai-row-head { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; }
  .cost-ai-row-head .cost-ai-sub { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 11.5px; }
  .cost-ai-cost { margin-top: 2px; }
  .cost-ai-why { margin-top: 4px; color: var(--warn); font-size: 12.5px; }
  .cost-ai-card > .cost-ai-why { margin-top: 10px; font-weight: 600; }
  .cost-ai-info { margin-top: 2px; color: var(--ink-faint); font-size: 12px; }
  .cost-ai-row-acts, .cost-ai-card-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
  .cost-ai-card-acts { margin-top: 12px; }
  .cost-ai-card-acts form { margin: 0; }
  .cost-ai-mini { min-height: 28px; padding: 0 10px; border: 1px solid var(--accent); border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-size: 12.5px; font-weight: 600; cursor: pointer; }
  .cost-ai-mini.ghost { border-color: var(--border-strong); background: var(--surface); color: var(--ink); }
  .cost-ai-mini:disabled, .cost-ai-go:disabled { opacity: .55; cursor: default; }
  .cost-ai-go { min-height: 34px; padding: 0 14px; border: 0; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-weight: 600; cursor: pointer; }
  .cost-ai-review { font-size: 13px; font-weight: 600; }
  .cost-ai-wait { color: var(--ink-muted); font-size: 13px; }
  .cost-ai-bar { width: 100%; height: 4px; margin-top: 8px; border-radius: 4px; background: var(--border); overflow: hidden; }
  .cost-ai-bar i { display: block; width: 35%; height: 100%; background: var(--accent); animation: chat-wait 1.3s ease-in-out infinite alternate; }
  .cost-ai-state { padding: 15px; color: var(--ink-muted); text-align: center; font-size: 13px; }
  .cost-ai-state button { margin-left: 4px; padding: 5px 10px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--ink); cursor: pointer; }
  .cost-ai-form { border-top: 1px solid var(--border); padding: 12px; }
  .cost-ai-form textarea { width: 100%; box-sizing: border-box; min-height: 64px; max-height: 160px; resize: vertical; padding: 10px 11px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); color: var(--ink); }
  .cost-ai-form textarea:disabled { opacity: .7; }
  .cost-ai-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
  .cost-ai-attach { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 600; cursor: pointer; }
  .cost-ai-attach svg { width: 16px; height: 16px; }
  .cost-ai-send { min-height: 34px; padding: 0 16px; border: 0; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-weight: 600; cursor: pointer; }
  .cost-ai-attach:disabled, .cost-ai-send:disabled { opacity: .55; cursor: default; }
  .cost-ai-feedback { min-height: 18px; margin-top: 4px; color: var(--ink-muted); font-size: 12px; }
  .cost-ai-drop { position: absolute; inset: 0; display: grid; place-items: center; border: 2px dashed var(--accent); background: color-mix(in srgb, var(--accent-soft) 88%, transparent); color: var(--ink); font-weight: 600; pointer-events: none; }
  .cost-ai-drop[hidden] { display: none; }
  @media (max-width: 600px) { .cost-ai { width: 100vw; border-left: 0; } body.cost-ai-open { overflow: hidden; } }
  @media (prefers-reduced-motion: reduce) { .cost-ai-bar i { animation: none; } }

  /* ---- Native <select> lists, every page, both themes ----
     A select with color:inherit or background:transparent (most of the tool
     pages' compact filters) passed the page's pale dark-mode text down to
     its options, which the browser drew on its own light list: only the
     highlighted option was readable. Each option now takes the theme's
     surface and ink, and color-scheme (base.css :root) makes the list itself
     dark or light. :where() keeps the select rule at zero specificity, so a
     page's own select styling still wins; only the UA defaults are replaced.
     The fallbacks are the system colors for a page that renames the tokens. */
  :where(select) { background-color: var(--surface, Field); color: var(--ink, FieldText); }
  select option, select optgroup { background-color: var(--surface, Canvas); color: var(--ink, CanvasText); }
  select option:disabled { color: var(--ink-faint, GrayText); }

  /* ---- Help tooltips (base-tail.js) ----
     One shared tooltip that shows at once on hover, focus and tap. The "?"
     icon's ::after widens its hit area to at least 28x28 px without moving
     the layout; dotted help text gets a few px above and below. */
  [data-tip] { position: relative; cursor: help; }
  [data-tip]::after { content: ""; position: absolute; left: 0; right: 0; top: -4px; bottom: -4px; }
  [data-tip][data-tip-icon]::after { left: 50%; top: 50%; right: auto; bottom: auto; width: max(100%, 28px); height: max(100%, 28px); transform: translate(-50%, -50%); border-radius: 50%; }
  [data-tip][data-tip-icon][data-tip-open] { color: var(--accent); border-color: var(--accent); }
  .rr-tip {
    position: fixed; z-index: 1000; max-width: min(320px, calc(100vw - 16px)); padding: 8px 11px;
    border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--ink);
    box-shadow: var(--shadow); font: 400 12.5px/1.45 "IBM Plex Sans", -apple-system, "Segoe UI", sans-serif;
    text-align: left; white-space: normal; overflow-wrap: break-word; pointer-events: none;
  }
  .rr-tip[hidden] { display: none; }

  /* Password reveal button (_password_field.html, base-tail.js): inside the field's right edge. */
  .pw-wrap { position: relative; }
  .pw-wrap input.input { padding-right: 64px; }
  .pw-toggle { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); min-height: 28px; padding: 0 10px; border: 0; border-radius: 6px;
    background: transparent; color: var(--ink-muted); font: 500 12.5px/18px var(--sans); cursor: pointer; }
  .pw-toggle:hover { color: var(--ink); background: var(--accent-soft); }
  .pw-toggle[hidden] { display: none; }
