/* Shared workspace colours, navigation and inbox. */
.pilot-shell {
  --ink: #1b263a;
  --quiet: #536176;
  --muted: #58677c;
  --line: #e2e7ef;
  --stroke: var(--line);
  --action: #304fe5;
  --violet: var(--action);
  --violet-light: #edf1ff;
  --bg: #f5f7fa;
  --surface: #fff;
  --top-height: 38px;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.pilot-shell .assistive-title {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.pilot-shell .topbar {
  height: var(--top-height);
  min-height: var(--top-height);
  flex: none;
  padding: 0 clamp(12px, 1.5vw, 26px);
  border: 0;
  box-shadow: inset 0 -1px var(--line);
  background: var(--surface);
}

.pilot-shell .topbar-start {gap: 12px}
.pilot-shell .topbar-right {gap: 10px; margin-left: auto}
.pilot-shell .mobile-brand {
  font-size: 17px;
  line-height: 1;
  font-weight: 730;
  letter-spacing: -.055em;
  color: var(--ink);
}
.pilot-shell .app-name {
  align-self: center;
  font-size: 12px;
  line-height: 18px;
  color: var(--muted);
}
.pilot-shell .store-logo {display:block;width:auto;max-width:80px;height:31px;flex:none;object-fit:contain;border-radius:4px}
.purchase-trigger {display:inline-flex;align-items:center;max-width:100%;gap:6px;overflow:hidden;border:0;padding:0;background:none;color:inherit;font:inherit;cursor:pointer;text-align:start}
.purchase-trigger svg {width:13px;height:13px;flex:none;color:#67788f}
.purchase-trigger:hover {color:var(--action)}
#purchases-body {padding:0 20px 20px;overflow:auto}
.purchase-customer {margin:0 0 8px;color:var(--quiet);font-size:13px}
.purchase-order {padding:12px 0;display:grid;gap:6px;border-bottom:1px solid var(--line);font-size:13px}
.purchase-line {display:flex;justify-content:space-between;align-items:baseline;gap:12px;overflow-wrap:anywhere}
.purchase-line :is(time,small) {color:var(--quiet);white-space:nowrap}
.purchase-stage {color:#4b627e;font-size:12px}
.purchase-stage:is([data-stage=closed],[data-stage=completed]) {color:#216e51}
.purchase-stage:is([data-stage=returned],[data-stage=on_return]) {color:#945d2b}
.purchase-status {margin:12px 0;color:var(--quiet);font-size:13px}
.purchase-status:empty {display:none}
.pilot-shell #access {
  padding: 5px 9px;
  border: 0;
  background: #eff2f6;
  color: var(--quiet);
  border-radius: 5px;
  font-size: 12px;
  min-height: 30px;
}
.pilot-shell #access:hover {color: var(--ink); background: #e5eaf1}
.pilot-shell #workspace-nav {position: relative; z-index: 25; flex: none}
.pilot-shell #menu-toggle,
.pilot-shell #section-nav :where(a:not([hidden])) {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  color: var(--quiet);
  background: var(--surface);
}
.pilot-shell #section-nav:not([hidden]) {
  display: flex;
  align-items: center;
  gap: 6px;
  position: absolute;
  top: 100%;
  left: 0;
  padding: 6px 0;
}
.pilot-shell #section-nav a {box-shadow: 0 1px 5px #26354b26}
.pilot-shell #workspace-nav svg {width: 19px; height: 19px}
.pilot-shell #workspace-nav :is(a, button):hover,
.pilot-shell #menu-toggle[aria-expanded=true] {color: var(--ink); background: #eff2f7}
.pilot-shell #section-nav [aria-current=page] {color: var(--action); background: #eaf0ff}
.pilot-shell #workspace-nav :focus-visible {outline: 2px solid var(--action); outline-offset: 1px}

@media (min-width: 701px) and (hover: hover) and (pointer: fine) {
  .pilot-shell #workspace-nav {
    position: fixed;
    inset: 0 auto 0 0;
    width: 8px;
  }
  .pilot-shell #section-nav:not([hidden]) {
    top: var(--nav-position, 50%);
    transform: translateY(calc(0% - var(--nav-position, 50%)));
    flex-direction: column;
    padding: 4px 4px 4px 6px;
  }
  .pilot-shell #menu-toggle {
    position: absolute;
    top: 5px;
    left: 6px;
  }
  .pilot-shell #menu-toggle:not(:focus-visible) {
    clip-path: inset(50%);
    pointer-events: none;
  }
}
.pilot-shell .chats-page {padding: 0}
.pilot-shell .chats-page .inbox {background: var(--surface)}
.pilot-shell .panel-divider {background: var(--surface)}
.pilot-shell .panel-divider::after {background: var(--line)}
.pilot-shell .panel-divider:is(:hover, :focus-visible, .dragging)::after {background: var(--action)}
.pilot-shell .conversation-list {background: var(--surface)}
.pilot-shell .list-heading {padding: 6px 15px; min-height: 43px}
.pilot-shell .list-heading h2 {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--ink);
  font-size: 21px;
  font-weight: 660;
  line-height: 1.15;
  letter-spacing: -.05em;
}
.pilot-shell .count-label {
  margin: 0;
  padding: 0;
  background: transparent;
  color: var(--quiet);
  font-size: 11px;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}
.pilot-shell .list-refresh {width: 30px; height: 30px; color: var(--muted)}
.pilot-shell .list-refresh:hover {background: #edf1f6; color: var(--ink)}
.pilot-shell .conversation-list {container-type:inline-size}
.pilot-shell .inbox-search-tools {display:flex;align-items:center;gap:6px;margin:0 14px 7px}
.pilot-shell .inbox-search-tools .list-search {flex:1;min-width:0;margin:0}
.pilot-shell .list-search > span {
  top: 50%;
  left: 9px;
  transform: translateY(-50%);
  color: #58677c;
  pointer-events: none;
}
.pilot-shell .list-search input {
  height: 31px;
  padding: 4px 9px 4px 30px;
  border: 0;
  border-radius: 6px;
  background: #f0f3f7;
  color: var(--ink);
  font-size: 12px;
}
.pilot-shell .list-search input::placeholder {color: #617084}
.pilot-shell .list-search input:focus-visible {outline: 2px solid var(--action); outline-offset: 1px}
.pilot-shell .filter-tabs {
  align-items: center;
  gap: 14px;
  padding: 0 15px;
  border: none;
  box-shadow: inset 0 -1px var(--line);
}
.pilot-shell .filter-tab {
  position: relative;
  padding: 6px 0 9px;
  min-height: 29px;
  color: var(--quiet);
  border-radius: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 550;
}
.pilot-shell .filter-tab.active {color: var(--action); background: transparent}
.pilot-shell .filter-tab.active::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}
.pilot-shell .conversation-items {padding: 5px 6px 12px}
.pilot-shell .conversation-item[data-last] {
  --origin: var(--quiet);
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 7px 8px;
  min-height: 58px;
  border: 0;
  border-radius: 6px;
  box-shadow: none;
  background: transparent;
}
.pilot-shell .conversation-item[data-last=buyer] {--origin: #315676}
.pilot-shell .conversation-item[data-last=shop] {--origin: #357063}
.pilot-shell .conversation-item[data-last=system] {--origin: #7553a0; background: #f8f6fb}
.pilot-shell .conversation-item[data-last]:hover {background: #f0f3f8}
.pilot-shell .conversation-item[data-last].active {background: #e7edff}
.pilot-shell .conversation-item .customer-avatar {
  flex: 0 0 33px;
  width: 33px;
  height: 33px;
  font-size: 11px;
  font-weight: 650;
}
.pilot-shell .conversation-item.active .customer-avatar {background: #d3dcfd; color: #344a9c}
.pilot-shell .conversation-meta {gap: 1px}
.pilot-shell .conversation-topline {align-items: baseline; line-height: 16px}
.pilot-shell .customer-name {font-size: 13px; font-weight: 650; color: var(--ink)}
.pilot-shell .conversation-time {
  color: #637084;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.pilot-shell .conversation-product {color: var(--quiet); font-size: 11px; line-height: 13px}
.pilot-shell .conversation-item .conversation-snippet {font-size: 11.5px; line-height: 15px; color: var(--origin)}
.pilot-shell .conversation-item[data-last].active .customer-name {color: #192b56}
.pilot-shell .conversation-item[data-last].active :is(.conversation-product, .conversation-time) {color: #4c5f89}
.pilot-shell .conversation-item[data-last].active .conversation-snippet {color: var(--origin)}
.pilot-shell .conversation-item:focus-visible .customer-name {color: var(--action)}

.pilot-shell .list-heading h2 {margin-right:auto}
.pilot-shell #select-chats[aria-pressed=true] {background:#e7edff;color:#314eac}
.pilot-shell #filters {gap:10px}
.pilot-shell #inbox-mode, .pilot-shell #bulk-action {
  min-width:0;min-height:29px;height:29px;padding:2px 3px;
  border:0;border-radius:4px;background-color:transparent;color:#435672;
  font:inherit;font-size:11px;text-overflow:ellipsis;cursor:pointer;
}
.pilot-shell #inbox-mode {max-width:49%;background-color:#f0f3f7;border-radius:6px;padding-inline-start:7px}
.pilot-shell #inbox-mode:has(option:checked:not([value=""])) {color:#374fb0;font-weight:650}
@container (max-width:260px) {
  .pilot-shell #filters {gap:6px;padding-inline:8px}
  .pilot-shell #inbox-mode {
    width:31px;flex:none;padding:0 !important;font-size:0;
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23435672' stroke-width='1.7' stroke-linecap='round'%3E%3Cpath d='M3 5h18M6 12h12M10 19h4'/%3E%3C/svg%3E") !important;
    background-position:center !important;background-size:16px !important;
  }
  .pilot-shell #inbox-mode:has(option:checked:not([value=""])) {background-color:#dfe8ff}
  .pilot-shell #inbox-mode option {font-size:13px}
}
.pilot-shell .inbox-mode-badge {
  width:18px;height:18px;flex:0 0 18px;display:inline-grid;place-items:center;
  align-self:center;margin-left:auto;border-radius:5px;
}
.pilot-shell .inbox-mode-badge svg {width:13px;height:13px;stroke-width:1.9}
.pilot-shell .inbox-mode-badge[data-mode=auto] {color:#09624f;background:#d9f2e8}
.pilot-shell .inbox-mode-badge[data-mode=manual] {color:#96501b;background:#ffead6}
.pilot-shell .inbox-mode-badge[data-mode=drafts] {color:#59459b;background:#ede8fa}
.pilot-shell .conversation-topline:has(.inbox-mode-badge) {justify-content:flex-start}
.pilot-shell #bulk-bar {
  flex:none;padding:7px 12px 9px;background:#f3f6fc;box-shadow:inset 0 -1px #dce4f1;
}
.pilot-shell .bulk-selection, .pilot-shell .bulk-actions,
.pilot-shell .bulk-selection label, .pilot-shell .bulk-check {display:flex;align-items:center}
.pilot-shell .bulk-selection {justify-content:space-between;min-height:24px;font-size:11px;color:#43536c}
.pilot-shell .bulk-selection label {gap:7px;cursor:pointer}
.pilot-shell :is(.bulk-selection,.bulk-check) input {margin:0;width:16px;height:16px;accent-color:#445fc9;cursor:pointer}
.pilot-shell #bulk-count {font-variant-numeric:tabular-nums}
.pilot-shell .bulk-actions {gap:5px;margin-top:4px}
.pilot-shell #bulk-action {flex:1;background:white}
.pilot-shell #bulk-apply {
  flex:none;min-height:29px;padding:4px 8px;border:0;border-radius:5px;
  font-size:11px;font-weight:600;background:#4059b5;color:white;
}
.pilot-shell #bulk-apply:disabled {background:#e0e5ee;color:#566781}
.pilot-shell #bulk-hint, .pilot-shell #bulk-result {font-size:11px;line-height:1.4;color:#41516a}
.pilot-shell #bulk-hint {margin:5px 0 0}
.pilot-shell #bulk-result {flex:none;margin:0;padding:7px 14px;background:#eff5f4}
.pilot-shell .bulk-row {display:flex;align-items:stretch;border-radius:6px}
.pilot-shell .bulk-row .conversation-item {flex:1;min-width:0}
.pilot-shell .bulk-row .customer-avatar {display:none}
.pilot-shell .bulk-check {flex:0 0 30px;justify-content:center;cursor:pointer}
.pilot-shell .bulk-row.checked, .pilot-shell .bulk-row.checked .conversation-item[data-last] {background:#e8edff}
.pilot-shell .bulk-row .conversation-item.active:not(:hover) {box-shadow:none}
.pilot-shell #conversation-list :is(select, input[type=checkbox], #bulk-apply, #select-chats):focus-visible {
  outline:2px solid #4b67c4;outline-offset:1px;
}

@media (max-width: 700px) {
  .pilot-shell {--top-height: 44px}
  .pilot-shell .topbar {padding: 0 12px}
  .pilot-shell .topbar-start {gap: 7px}
  .pilot-shell .topbar-right {gap: 8px}
  .pilot-shell .mobile-brand {font-size: 18px}
  .pilot-shell .app-name {display: none}
  .pilot-shell :is(.list-heading, .filter-tabs) {padding-left: 18px; padding-right: 18px}
  .pilot-shell .inbox-search-tools {margin-inline:16px}
  .pilot-shell .list-search input {font-size: 16px; height: 36px}
  .pilot-shell .list-heading h2 {font-size: 24px}
  .pilot-shell .filter-tab {min-height: 36px}
  .pilot-shell .conversation-items {padding: 4px 6px 12px}
  .pilot-shell .conversation-item[data-last] {padding: 8px 11px; gap: 12px}
  .pilot-shell .customer-name {font-size: 14px}
  .pilot-shell .conversation-product, .pilot-shell .conversation-item .conversation-snippet {font-size: 12px}
  .pilot-shell .conversation-item .customer-avatar {width: 37px; height: 37px; flex-basis: 37px}
  .pilot-shell main, .pilot-shell.chats-view:not(.auth-mode) main {padding-bottom: env(safe-area-inset-bottom)}
  .pilot-shell.chats-view:has(.inbox.mobile-thread) .topbar {display: none}
  .pilot-shell .inbox.mobile-thread {position: static; inset: auto}
}
