:root {
  color-scheme: light;
  font-family:
    Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --nav-width: 232px;
  --topbar-height: 64px;
  --canvas: #f4f7fa;
  --surface: #ffffff;
  --surface-subtle: #f8fafc;
  --surface-muted: #eef3f7;
  --navy: #11263f;
  --navy-deep: #0b1d31;
  --cobalt: #0b5ed7;
  --cobalt-hover: #0755c9;
  --cobalt-soft: #eaf2ff;
  --graphite: #263442;
  --text-muted: #677789;
  --text-faint: #8a98a8;
  --border: #dce4eb;
  --border-strong: #cbd6df;
  --success: #14877a;
  --success-soft: #e4f5f2;
  --warning: #b57408;
  --warning-soft: #fff4d9;
  --danger: #c33b4a;
  --danger-soft: #fdecef;
  --info: #256aa9;
  --info-soft: #e8f2fb;
  --radius-sm: 8px;
  --radius: 10px;
  --shadow-sm: 0 2px 8px rgb(17 38 63 / 6%);
  --shadow-modal: 0 18px 48px rgb(17 38 63 / 18%);
  color: var(--graphite);
  background: var(--canvas);
}

/* Full-width marketplace toolbar and request workspace. */
.market-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  align-items: stretch;
  min-height: 0;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.market-layout > .market-filter-panel,
.market-layout > .market-results {
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #ffffff;
  box-shadow: none;
}

.market-layout > .panel {
  margin-top: 0;
}

.market-layout > .market-filter-panel {
  height: auto;
  padding: 16px;
  overflow: visible;
  border-bottom: 1px solid var(--border);
}

.market-found-count {
  align-self: center;
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 600;
  white-space: nowrap;
}

.market-filter-search {
  position: relative;
  margin-bottom: 14px;
}

.market-filter-search > svg {
  position: absolute;
  top: 50%;
  left: 14px;
  z-index: 1;
  width: 19px;
  height: 19px;
  color: #8190a0;
  pointer-events: none;
  transform: translateY(-50%);
}

.market-filter-search input {
  min-height: 46px;
  padding-left: 43px;
  font-size: 0.86rem;
}

.market-filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.market-filter-grid > .field + .field {
  margin-top: 0;
}

.market-filter-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  margin-top: 14px;
  padding-top: 14px;
  gap: 14px;
  border-top: 1px solid var(--border);
}

.market-filter-chips,
.market-filter-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.market-filter-actions {
  flex: 0 0 auto;
  justify-content: flex-end;
  margin-left: auto;
}

.market-filter-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 10px 6px 12px;
  gap: 7px;
  border: 1px solid #c9ddfb;
  border-radius: var(--radius-sm);
  background: #eef5ff;
  color: var(--cobalt-hover);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 650;
  cursor: pointer;
}

.market-filter-chip:hover {
  border-color: #9fc0eb;
  background: var(--cobalt-soft);
}

.market-filter-chip svg {
  width: 15px;
  height: 15px;
}

.market-filter-actions .btn {
  width: auto;
  min-width: 104px;
}

.market-layout > .market-results {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.market-results .panel-header,
.market-preview .panel-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.market-request-list,
.market-results-list {
  display: grid;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.market-results-list:has(> .market-request-row),
.market-results-list:has(> .request-feed-row) {
  align-content: start;
}

.market-request-row {
  display: grid;
  grid-template-columns: minmax(240px, 1.6fr) minmax(140px, 0.8fr) 96px 132px 120px;
  align-items: center;
  width: 100%;
  min-height: 82px;
  padding: 12px 14px;
  gap: 14px;
  border: 0;
  border-bottom: 1px solid #e5ebf0;
  background: #ffffff;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: default;
}

.market-request-row:last-child {
  border-bottom: 0;
}

.market-request-row:hover {
  background: #f8fbfd;
}

.market-request-row[aria-selected="true"],
.market-request-row.active,
.market-request-row.is-selected {
  background: #f2f7ff;
  box-shadow: inset 3px 0 0 var(--cobalt);
}

.market-request-main,
.market-request-meta,
.market-request-metrics,
.market-request-status,
.market-request-actions {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.market-request-main > strong,
.market-request-main > span,
.market-request-main > small {
  display: block;
  min-width: 0;
}

.market-request-main > strong {
  color: #1f3245;
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.35;
}

.market-request-main > span {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-request-main > small {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.66rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-request-meta > span {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 5px;
  color: #536679;
  font-size: 0.69rem;
  line-height: 1.3;
}

.market-request-meta svg {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
}

.market-request-metrics {
  color: #647587;
  font-size: 0.67rem;
}

.market-request-metrics strong {
  color: #263b4f;
  font-size: 0.78rem;
}

.market-request-status {
  align-content: center;
  justify-items: stretch;
  min-height: 52px;
  overflow: hidden;
  gap: 6px;
  text-align: center;
}

.market-request-status .badge {
  width: 100%;
  max-width: 100%;
  min-height: 28px;
  padding: 5px 9px;
  justify-content: center;
  white-space: normal;
  line-height: 1.15;
  text-align: center;
}

.market-request-status small,
.market-request-offers {
  color: var(--text-muted);
  font-size: 0.65rem;
}

.market-request-offers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 16px;
  gap: 4px;
  white-space: nowrap;
}

.market-request-offers svg {
  flex: 0 0 12px;
  width: 12px;
  height: 12px;
}

.market-request-actions {
  align-items: center;
  justify-items: end;
}

.market-request-actions .btn {
  width: 116px;
  min-width: 116px;
  min-height: 36px;
  justify-content: center;
}

.market-request-row .primary-cell {
  min-width: 0;
  color: #1f3245;
  font-weight: 700;
}

.market-request-row .subtext {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-request-row .market-meta {
  color: #536679;
  font-size: 0.72rem;
}

.market-preview {
  padding-bottom: 14px;
}

.market-preview > :not(.panel-header) {
  margin-right: 14px;
  margin-left: 14px;
}

.market-preview .detail-grid {
  grid-template-columns: 1fr 1fr;
  margin-top: 14px;
}

.market-preview .positions-table {
  min-width: 0;
  font-size: 0.72rem;
}

.market-preview .positions-table th,
.market-preview .positions-table td {
  padding: 8px;
}

.market-preview .wizard-actions {
  align-items: stretch;
  flex-direction: column;
}

.market-preview .btn {
  width: 100%;
}

/* The comparison keeps its position and demand columns visible while scrolling supplier offers. */
.comparison-table {
  min-width: 1120px;
}

.table-wrap:has(.comparison-table) {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  contain: inline-size paint;
}

.comparison-table th:first-child,
.comparison-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 250px;
  min-width: 250px;
  max-width: 250px;
  box-shadow: 1px 0 0 var(--border);
}

.comparison-table th:nth-child(2),
.comparison-table td:nth-child(2) {
  position: sticky;
  left: 250px;
  z-index: 2;
  width: 88px;
  min-width: 88px;
  background: #ffffff;
  box-shadow: 1px 0 0 var(--border);
}

.comparison-table th:first-child,
.comparison-table th:nth-child(2) {
  z-index: 4;
  background: #f7f9fb;
}

.comparison-table tbody tr:hover td:first-child,
.comparison-table tbody tr:hover td:nth-child(2) {
  background: #fafcfd;
}

@media (max-width: 1280px) {
  .market-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    align-items: stretch;
  }

  .market-layout > .market-filter-panel {
    height: auto;
  }

  .market-layout > .market-results {
    height: 100%;
  }

  .market-results-list {
    overflow: visible;
  }
}

@media (max-width: 640px) {
  .market-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .market-layout > .market-filter-panel,
  .market-preview {
    position: static;
    grid-column: auto;
    max-height: none;
  }

  .market-filter-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .market-filter-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .market-filter-actions {
    width: 100%;
    margin-left: 0;
  }

  .market-filter-actions .btn {
    flex: 1 1 0;
    min-width: 0;
  }

  .market-request-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .market-request-meta,
  .market-request-metrics,
  .market-request-status {
    display: none;
  }

  .market-request-actions .btn {
    min-width: 44px;
  }

  .comparison-table th:first-child,
  .comparison-table td:first-child {
    width: 190px;
    min-width: 190px;
    max-width: 190px;
  }

  .comparison-table th:nth-child(2),
  .comparison-table td:nth-child(2) {
    left: 190px;
  }
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--canvas);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--canvas);
  color: var(--graphite);
  -webkit-font-smoothing: antialiased;
}

body,
button,
input,
select,
textarea {
  font: inherit;
}

button,
input,
select,
textarea {
  color: inherit;
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button,
[role="button"],
a {
  touch-action: manipulation;
}

a {
  color: var(--cobalt);
  text-decoration: none;
}

a:hover {
  color: var(--cobalt-hover);
}

button {
  border: 0;
}

img,
svg {
  display: block;
  max-width: 100%;
}

svg {
  flex: 0 0 auto;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1,
h2,
h3,
h4 {
  color: #1d2b38;
  font-weight: 700;
  letter-spacing: -0.015em;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(1.55rem, 2vw, 1.9rem);
  line-height: 1.2;
}

h2 {
  margin-bottom: 14px;
  font-size: 1.15rem;
  line-height: 1.35;
}

h3 {
  margin-bottom: 10px;
  font-size: 1rem;
  line-height: 1.4;
}

p {
  line-height: 1.55;
}

small {
  color: var(--text-muted);
}

::selection {
  background: #cfe1fb;
  color: #10243c;
}

:focus-visible {
  outline: 3px solid rgb(11 94 215 / 22%);
  outline-offset: 2px;
}

#root {
  min-height: 100vh;
  min-height: 100dvh;
}

.app-shell {
  display: grid;
  grid-template-areas:
    "topbar topbar"
    "nav page";
  grid-template-columns: var(--nav-width) minmax(0, 1fr);
  grid-template-rows: var(--topbar-height) minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  background: var(--canvas);
}

.side-nav svg,
.topbar svg,
.mobile-nav svg,
.btn svg {
  width: 19px;
  height: 19px;
  stroke-width: 1.8;
}

.side-nav {
  position: static;
  z-index: 20;
  grid-area: nav;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 20px 14px;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  background: #f8fafc;
  scrollbar-color: var(--border-strong) transparent;
  scrollbar-width: thin;
}

.side-nav > h2,
.side-nav > h3,
.side-nav .nav-title {
  margin: 0 10px 16px;
  color: #203247;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0;
}

.side-nav .nav-section + .nav-section {
  margin-top: 24px;
}

.side-nav .nav-section--directory {
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.side-nav .nav-label {
  display: block;
  margin: 0 10px 8px;
  color: var(--text-faint);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.075em;
  line-height: 1.4;
  text-transform: uppercase;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
  color: #17293d;
  font-size: 1rem;
  font-weight: 750;
  letter-spacing: -0.01em;
  line-height: 1;
}

.brand:hover {
  color: #17293d;
}

.brand-mark,
.brand > svg,
.brand > img {
  display: grid;
  flex: 0 0 36px;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--cobalt);
  color: #ffffff;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 42px;
  margin: 2px 0;
  padding: 9px 11px;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: #596a7b;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    color 150ms ease;
}

.nav-item:hover {
  border-color: #e2e9ef;
  background: #ffffff;
  color: #263b50;
}

.nav-item.active,
.nav-item[aria-current="page"] {
  border-color: #d6e5fb;
  background: var(--cobalt-soft);
  color: var(--cobalt-hover);
}

.nav-item.active svg,
.nav-item[aria-current="page"] svg {
  color: var(--cobalt);
}

.nav-item.nav-item--primary,
.nav-item.nav-item--primary[aria-current="page"] {
  margin-bottom: 8px;
  border-color: var(--cobalt);
  background: var(--cobalt);
  color: #ffffff;
  box-shadow: 0 4px 12px rgb(15 98 224 / 16%);
}

.nav-item.nav-item--primary:hover,
.nav-item.nav-item--primary[aria-current="page"]:hover {
  border-color: var(--cobalt-hover);
  background: var(--cobalt-hover);
  color: #ffffff;
}

.nav-item.nav-item--primary svg,
.nav-item.nav-item--primary[aria-current="page"] svg {
  color: currentColor;
}

.nav-item .count,
.nav-item .nav-count {
  min-width: 22px;
  margin-left: auto;
  padding: 2px 6px;
  border-radius: 999px;
  background: #e6edf3;
  color: #5b6b7b;
  font-size: 0.68rem;
  font-weight: 750;
  line-height: 1.45;
  text-align: center;
}

.nav-item.active .count,
.nav-item.active .nav-count,
.nav-item[aria-current="page"] .count,
.nav-item[aria-current="page"] .nav-count {
  background: #ffffff;
  color: var(--cobalt-hover);
}

.side-nav-footer {
  margin-top: auto;
  padding-top: 20px;
}

.side-nav-footer .nav-item {
  border-top: 1px solid var(--border);
  border-radius: 0;
  color: var(--text-muted);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  grid-area: topbar;
  display: flex;
  align-items: center;
  min-width: 0;
  height: var(--topbar-height);
  padding: 0 24px;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  background: rgb(255 255 255 / 96%);
}

.topbar .brand {
  display: inline-flex;
}

.topbar-title {
  min-width: 0;
  color: #203247;
  font-size: 0.96rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  margin-left: auto;
  gap: 8px;
}

.topbar-search {
  position: relative;
  width: min(480px, 42vw);
  margin-right: auto;
}

.topbar-search input {
  width: 100%;
  height: 38px;
  padding-left: 36px;
  border-color: #dfe7ee;
  background: #f7f9fb;
}

.topbar-search svg {
  position: absolute;
  top: 50%;
  left: 11px;
  color: #8190a0;
  pointer-events: none;
  transform: translateY(-50%);
}

.topbar .icon-btn,
.topbar > button:not(.btn) {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: #607184;
  cursor: pointer;
}

.topbar .icon-btn:hover,
.topbar > button:not(.btn):hover {
  border-color: #c8d5df;
  background: #f7f9fb;
  color: #203247;
}

.topbar .topbar-notification-settings[aria-expanded="true"] {
  border-color: #9fc0eb;
  background: var(--cobalt-soft);
  color: var(--cobalt);
}

.avatar {
  display: grid;
  flex: 0 0 36px;
  place-items: center;
  width: 36px;
  height: 36px;
  overflow: hidden;
  border: 1px solid #c9d7e3;
  border-radius: 50%;
  background: #e8eef4;
  color: #31475c;
  font-size: 0.73rem;
  font-weight: 750;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.page {
  grid-area: page;
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  padding: 28px 30px 40px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  background: var(--canvas);
}

.page > * {
  width: 100%;
  max-width: 1600px;
  margin-right: auto;
  margin-left: auto;
}

.page--directory {
  padding: 0;
  overflow: hidden;
  scrollbar-gutter: auto;
}

.page.page--platform-info {
  min-height: 0;
  padding: 0;
}

.page > .directory-workspace {
  width: 100%;
  max-width: none;
  height: 100%;
  min-height: 0;
  margin: 0;
  background: var(--canvas);
}

.directory-frame {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  background: var(--canvas);
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  min-width: 0;
  margin-bottom: 22px;
  gap: 20px;
}

.page-header h1,
.page-header h2 {
  margin-bottom: 5px;
}

.page-header p {
  max-width: 720px;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.page-header > div:last-child:not(:first-child),
.page-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.page-actions--standalone {
  justify-content: flex-end;
  margin: 0 0 14px;
}

.panel {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.panel + .panel {
  margin-top: 16px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin: -2px 0 16px;
  gap: 16px;
}

.panel-header h2,
.panel-header h3,
.panel-header p {
  margin-bottom: 0;
}

.panel-header p {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.panel-header > div:last-child:not(:first-child) {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.attention-strip {
  display: flex;
  align-items: flex-start;
  min-height: 52px;
  margin-bottom: 18px;
  padding: 13px 15px;
  gap: 11px;
  border: 1px solid #efd9a9;
  border-left: 3px solid #d4931a;
  border-radius: var(--radius-sm);
  background: var(--warning-soft);
  color: #70501a;
  font-size: 0.84rem;
  line-height: 1.5;
}

.attention-strip svg {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  color: var(--warning);
}

.attention-strip strong {
  color: #634613;
}

.attention-strip .btn,
.attention-strip a {
  flex: 0 0 auto;
  margin-left: auto;
}

.deal-payment-checklist {
  display: grid;
  margin: 0;
  padding-left: 22px;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.deal-safety-confirmation {
  grid-template-columns: auto minmax(0, 1fr);
  padding: 13px;
}

.deal-safety-confirmation > span {
  display: grid;
  gap: 3px;
  white-space: normal;
}

.deal-safety-confirmation small {
  line-height: 1.4;
  white-space: normal;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
  gap: 14px;
}

.stats-grid > * {
  min-width: 0;
  padding: 17px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.stat-label,
.stats-grid > * > span:first-child,
.stats-grid > * > small:first-child {
  display: block;
  margin-bottom: 9px;
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.stat-value,
.stats-grid > * > strong {
  display: block;
  color: #1e3042;
  font-size: 1.5rem;
  font-weight: 750;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.stat-meta {
  display: flex;
  align-items: center;
  margin-top: 7px;
  gap: 5px;
  color: var(--text-muted);
  font-size: 0.72rem;
}

.stat-meta.positive {
  color: var(--success);
}

.stat-meta.negative {
  color: var(--danger);
}

.table-wrap {
  position: relative;
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  scrollbar-color: var(--border-strong) transparent;
  scrollbar-width: thin;
}

.panel > .table-wrap {
  width: calc(100% + 40px);
  margin: 0 -20px -20px;
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  border-radius: 0 0 var(--radius) var(--radius);
}

.data-table,
.positions-table {
  width: 100%;
  min-width: 720px;
  border-collapse: separate;
  border-spacing: 0;
  color: #334456;
  font-size: 0.8rem;
  line-height: 1.35;
}

.data-table th,
.positions-table th {
  height: 42px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: #f7f9fb;
  color: #6c7c8c;
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.018em;
  text-align: left;
  text-transform: none;
  white-space: nowrap;
}

.data-table td,
.positions-table td {
  height: 54px;
  padding: 11px 14px;
  border-bottom: 1px solid #e8edf2;
  background: #ffffff;
  vertical-align: middle;
}

.data-table tbody tr:last-child td,
.positions-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover td,
.positions-table tbody tr:hover td {
  background: #fafcfd;
}

.data-table th:first-child,
.data-table td:first-child,
.positions-table th:first-child,
.positions-table td:first-child {
  padding-left: 18px;
}

.data-table th:last-child,
.data-table td:last-child,
.positions-table th:last-child,
.positions-table td:last-child {
  padding-right: 18px;
}

.data-table .numeric,
.positions-table .numeric,
.data-table th[align="right"],
.data-table td[align="right"],
.positions-table th[align="right"],
.positions-table td[align="right"] {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.data-table .primary-cell,
.positions-table .primary-cell {
  color: #1f3245;
  font-weight: 650;
}

.data-table .subtext,
.positions-table .subtext {
  display: block;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 0.72rem;
}

.data-table .subtext.request-anonymous-label {
  display: flex;
  width: max-content;
  align-items: center;
  gap: 4px;
  line-height: 1.2;
  white-space: nowrap;
}

.request-anonymous-label svg {
  width: 14px;
  height: 14px;
  stroke-width: 1.8;
}

.positions-table input,
.positions-table select {
  min-width: 90px;
  height: 34px;
  padding: 6px 9px;
  font-size: 0.78rem;
}

.wizard-position-actions-heading {
  width: 86px;
}

.wizard-position-actions {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  justify-content: flex-end;
  white-space: nowrap;
}

.wizard-position-actions .btn.icon {
  width: 32px;
  min-width: 32px;
  min-height: 32px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 3px 8px;
  gap: 5px;
  border: 1px solid #d9e2ea;
  border-radius: 999px;
  background: #f2f5f7;
  color: #5c6d7d;
  font-size: 0.67rem;
  font-weight: 750;
  letter-spacing: 0.01em;
  line-height: 1.25;
  white-space: nowrap;
}

.badge svg {
  width: 12px;
  height: 12px;
}

.badge.success,
.badge--success,
.badge[data-variant="success"] {
  border-color: #bfe2dc;
  background: var(--success-soft);
  color: #0f7469;
}

.badge.warning,
.badge--warning,
.badge[data-variant="warning"] {
  border-color: #eed8a4;
  background: var(--warning-soft);
  color: #8c5d09;
}

.badge.danger,
.badge--danger,
.badge[data-variant="danger"] {
  border-color: #f3c7ce;
  background: var(--danger-soft);
  color: #a42e3c;
}

.badge.info,
.badge.primary,
.badge--info,
.badge[data-variant="info"] {
  border-color: #cbdcf2;
  background: var(--cobalt-soft);
  color: #0a55bd;
}

.badge.neutral,
.badge--neutral,
.badge[data-variant="neutral"] {
  border-color: #d9e2ea;
  background: #f2f5f7;
  color: #5c6d7d;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 14px;
  gap: 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: #34485b;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    color 150ms ease,
    box-shadow 150ms ease,
    transform 100ms ease;
}

.btn:hover {
  border-color: #aebdca;
  background: #f7f9fb;
  color: #21364a;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled,
.btn.disabled {
  opacity: 0.52;
  cursor: not-allowed;
  transform: none;
}

.btn.primary,
.btn--primary,
.btn[data-variant="primary"] {
  border-color: var(--cobalt);
  background: var(--cobalt);
  color: #ffffff;
  box-shadow: 0 2px 5px rgb(11 94 215 / 16%);
}

.btn.primary:hover,
.btn--primary:hover,
.btn[data-variant="primary"]:hover {
  border-color: var(--cobalt-hover);
  background: var(--cobalt-hover);
  color: #ffffff;
}

.btn.secondary,
.btn--secondary,
.btn[data-variant="secondary"] {
  border-color: #bcd1ef;
  background: #ffffff;
  color: var(--cobalt-hover);
}

.btn.secondary:hover,
.btn--secondary:hover,
.btn[data-variant="secondary"]:hover {
  border-color: #8eb1e2;
  background: var(--cobalt-soft);
  color: #064aaa;
}

.btn.ghost,
.btn--ghost,
.btn[data-variant="ghost"] {
  border-color: transparent;
  background: transparent;
  color: #526579;
  box-shadow: none;
}

.btn.ghost:hover,
.btn--ghost:hover,
.btn[data-variant="ghost"]:hover {
  border-color: #e2e8ee;
  background: #f2f5f8;
  color: #253b50;
}

.btn.danger,
.btn--danger,
.btn[data-variant="danger"] {
  border-color: #e2aeb5;
  background: #ffffff;
  color: #ad3342;
}

.btn.danger:hover,
.btn--danger:hover,
.btn[data-variant="danger"]:hover {
  border-color: #d88a94;
  background: var(--danger-soft);
  color: #942836;
}

.btn.small,
.btn--small {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 0.74rem;
}

.btn.large,
.btn--large {
  min-height: 44px;
  padding: 10px 17px;
  font-size: 0.86rem;
}

.btn.icon,
.btn--icon {
  width: 38px;
  min-width: 38px;
  padding: 0;
}

.field {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.field + .field {
  margin-top: 14px;
}

.field label,
.field-label {
  color: #405266;
  font-size: 0.73rem;
  font-weight: 700;
  line-height: 1.4;
}

.field label .required,
.field-label .required {
  color: var(--danger);
}

.field-hint,
.field small {
  color: var(--text-muted);
  font-size: 0.7rem;
  line-height: 1.4;
}

.field-error {
  color: var(--danger);
  font-size: 0.7rem;
  line-height: 1.4;
}

input,
select,
textarea,
.input,
.select {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  outline: 0;
  background: #ffffff;
  color: #26394b;
  font-size: 0.82rem;
  line-height: 1.35;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    background-color 150ms ease;
}

textarea,
textarea.input {
  min-height: 94px;
  resize: vertical;
}

select,
.select {
  cursor: pointer;
}

input::placeholder,
textarea::placeholder {
  color: #98a5b2;
}

input:hover,
select:hover,
textarea:hover,
.input:hover,
.select:hover {
  border-color: #aebdca;
}

input:focus,
select:focus,
textarea:focus,
.input:focus,
.select:focus,
.input.focused,
.select.focused {
  border-color: var(--cobalt);
  box-shadow: 0 0 0 3px rgb(11 94 215 / 12%);
}

input:disabled,
select:disabled,
textarea:disabled,
.input.disabled,
.select.disabled {
  border-color: #e0e6eb;
  background: #f3f5f7;
  color: #8a98a6;
  cursor: not-allowed;
}

.field.error input,
.field.error select,
.field.error textarea,
input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: #d46370;
  box-shadow: 0 0 0 3px rgb(195 59 74 / 10%);
}

input[type="checkbox"],
input[type="radio"] {
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
  padding: 0;
  accent-color: var(--cobalt);
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field-row > .field + .field {
  margin-top: 0;
}

.offer-conditions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 14px;
}

.offer-conditions-grid > .field {
  align-self: start;
  margin-top: 0;
}

.offer-conditions-grid .field > label {
  display: flex;
  min-height: 1.4em;
  align-items: flex-end;
}

.offer-condition-comment,
.offer-vat-toggle {
  grid-column: 1 / -1;
}

.offer-vat-toggle {
  min-height: 20px;
  margin: 0;
}

.offer-delivery-pricing {
  display: grid;
  min-width: 0;
  margin: 0;
  padding: 0;
  gap: 8px;
  border: 0;
}

.offer-delivery-pricing > legend {
  margin: 0 0 5px;
  padding: 0;
}

.offer-delivery-included-setting,
.offer-delivery-static-note {
  display: flex;
  min-width: 0;
  min-height: 52px;
  align-items: flex-start;
  padding: 10px 12px;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #f7f9fb;
}

.offer-delivery-included-setting {
  cursor: pointer;
  transition:
    border-color 150ms ease,
    background-color 150ms ease,
    box-shadow 150ms ease;
}

.offer-delivery-included-setting:hover {
  border-color: #aebdca;
}

.offer-delivery-included-setting:has(input:checked) {
  border-color: #79a7e4;
  background: var(--cobalt-soft);
}

.offer-delivery-included-setting:has(input:focus-visible) {
  border-color: var(--cobalt);
  box-shadow: 0 0 0 3px rgb(11 94 215 / 12%);
}

.offer-delivery-included-setting input {
  margin-top: 2px;
  accent-color: var(--cobalt);
}

.offer-delivery-included-setting > span,
.offer-delivery-static-note > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.offer-delivery-included-setting strong,
.offer-delivery-static-note strong {
  color: #30465b;
  font-size: 0.78rem;
  line-height: 1.35;
}

.offer-delivery-included-setting small,
.offer-delivery-static-note small {
  color: var(--text-muted);
  font-size: 0.7rem;
  line-height: 1.4;
}

.offer-delivery-static-note > svg {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  color: var(--info);
}

.offer-delivery-cost-field {
  margin-top: 0;
}

.delivery-setting {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #f7f9fb;
}

.delivery-setting .cluster {
  color: #30465b;
  font-weight: 700;
}

.delivery-setting .field-hint {
  display: block;
  margin-top: 4px;
  padding-left: 24px;
}

.delivery-setting + .field {
  margin-top: 14px;
}

.field[hidden] {
  display: none;
}

.segmented {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #eef2f5;
}

.segmented button,
.segmented a,
.segmented label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 11px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #68798a;
  font-size: 0.73rem;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
  cursor: pointer;
}

.segmented button:hover,
.segmented a:hover,
.segmented label:hover {
  color: #34495d;
}

.segmented .active,
.segmented [aria-selected="true"],
.segmented input:checked + label {
  border-color: #d4dee7;
  background: #ffffff;
  color: #17426e;
  box-shadow: 0 1px 3px rgb(17 38 63 / 7%);
}

.segmented input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.role-label-short {
  display: none;
}

.visibility-field {
  display: grid;
  min-width: 0;
  margin: 0;
  padding: 0;
  gap: 10px;
  border: 0;
}

.visibility-field > legend {
  padding: 0;
}

.visibility-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.visibility-option {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 18px;
  align-items: center;
  min-width: 0;
  min-height: 88px;
  padding: 12px 14px;
  gap: 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #ffffff;
  cursor: pointer;
  transition:
    border-color 150ms ease,
    background-color 150ms ease,
    box-shadow 150ms ease;
}

.visibility-option:hover {
  border-color: #aebdca;
  background: #f8fafc;
}

.visibility-option:has(input:checked) {
  border-color: #79a7e4;
  background: var(--cobalt-soft);
  box-shadow: 0 0 0 1px rgb(11 94 215 / 8%);
}

.visibility-option:focus-within {
  border-color: var(--cobalt);
  box-shadow: 0 0 0 3px rgb(11 94 215 / 12%);
}

.visibility-option input[type="radio"] {
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  padding: 0;
  accent-color: var(--cobalt);
  cursor: pointer;
}

.visibility-option-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 9px;
  background: var(--surface-muted);
  color: #536b82;
}

.visibility-option:has(input:checked) .visibility-option-icon {
  background: #ffffff;
  color: var(--cobalt);
}

.visibility-option-icon svg {
  width: 20px;
  height: 20px;
}

.visibility-option-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.visibility-option-copy strong {
  color: var(--navy);
  font-size: 0.82rem;
  line-height: 1.25;
}

.visibility-option-copy small {
  color: var(--text-muted);
  font-size: 0.7rem;
  line-height: 1.4;
}

.visibility-note {
  display: flex;
  align-items: flex-start;
  margin: 0;
  padding: 9px 11px;
  gap: 8px;
  border: 1px solid #e4eaf0;
  border-radius: var(--radius-sm);
  background: #f7f9fb;
  color: var(--text-muted);
  font-size: 0.7rem;
  line-height: 1.45;
}

.visibility-note svg {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  color: var(--info);
}

@media (max-width: 640px) {
  .visibility-options {
    grid-template-columns: 1fr;
  }

  .visibility-option {
    min-height: 82px;
  }
}

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
  background: rgb(9 24 40 / 54%);
}

.modal {
  position: relative;
  width: min(560px, 100%);
  max-height: calc(100dvh - 48px);
  overflow: auto;
  border: 1px solid #cad5df;
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow-modal);
}

.modal.wide,
.modal--wide {
  width: min(820px, 100%);
}

.modal-header,
.modal-body,
.modal-footer {
  padding: 18px 20px;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2,
.modal-header h3,
.modal-header p {
  margin-bottom: 0;
}

.modal-header p {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--border);
  background: #fafbfd;
}

.modal-close {
  display: grid;
  flex: 0 0 34px;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: #748495;
  cursor: pointer;
}

.modal-close:hover {
  border-color: var(--border);
  background: #f3f6f8;
  color: #2e4357;
}

html.modal-open,
body.modal-open {
  overflow: hidden !important;
}

body.modal-open .page {
  overflow: hidden;
}

.modal--request {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(960px, 100%);
  overflow: hidden;
}

.request-modal-header {
  align-items: flex-start;
}

.modal--request .modal-close {
  flex-basis: 44px;
  width: 44px;
  height: 44px;
}

.request-modal-heading {
  min-width: 0;
}

.request-modal-heading .eyebrow {
  margin: 0 0 5px;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.request-modal-title-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.request-modal-title-row h2 {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.3;
}

.request-modal-title-row .badge {
  flex: 0 0 auto;
  max-width: 190px;
  white-space: normal;
  text-align: center;
}

.request-modal-body {
  display: grid;
  min-height: 0;
  padding: 18px 20px 22px;
  gap: 18px;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.request-modal-attention {
  margin: 0;
}

.request-scope-summary {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  gap: 12px;
  border: 1px solid #b9d3f4;
  border-radius: var(--radius-sm);
  background: var(--cobalt-soft);
  color: #17426e;
}

.request-scope-summary > svg {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
}

.request-scope-summary > div {
  display: grid;
  gap: 2px;
}

.request-scope-summary span,
.request-scope-summary small {
  color: #5b7187;
  font-size: 0.7rem;
}

.request-scope-summary strong {
  color: #153e68;
  font-size: 0.88rem;
}

.request-modal-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  gap: 10px;
}

.request-modal-facts .request-modal-fact-wide {
  grid-column: span 2;
}

.request-modal-section {
  min-width: 0;
}

.request-modal-section > .panel-header {
  margin-bottom: 10px;
}

.request-spec-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.request-spec-table {
  min-width: 720px;
}

.request-spec-table th,
.request-spec-table td {
  padding: 10px 11px;
}

.request-spec-table .deal-quantity {
  color: var(--cobalt-hover);
  font-weight: 750;
}

.request-spec-cell-value {
  display: block;
  min-width: 0;
}

.request-spec-cell-value > strong {
  display: block;
}

.request-modal-note {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
}

.request-modal-note h3 {
  margin-bottom: 5px;
  font-size: 0.78rem;
}

.request-modal-note p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.76rem;
  line-height: 1.5;
}

.table-inline-action {
  display: flex;
  align-items: center;
  width: fit-content;
  margin-top: 5px;
  padding: 2px 0;
  gap: 5px;
  border: 0;
  background: transparent;
  color: var(--cobalt-hover);
  font: inherit;
  font-size: 0.68rem;
  font-weight: 650;
  cursor: pointer;
}

.table-inline-action:hover {
  text-decoration: underline;
}

.table-inline-action:focus-visible {
  outline: 2px solid var(--cobalt);
  outline-offset: 3px;
}

.table-inline-action svg {
  width: 14px;
  height: 14px;
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  place-items: center;
  padding: 36px 20px;
  background: var(--canvas);
}

.auth-card {
  width: min(440px, 100%);
  padding: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 8px 24px rgb(17 38 63 / 8%);
}

.auth-card--register {
  width: min(540px, 100%);
}

.auth-card .brand {
  margin-bottom: 28px;
}

.auth-card h1 {
  margin-bottom: 7px;
  font-size: 1.45rem;
}

.auth-card h1:focus {
  outline: none;
}

.auth-card > p {
  margin-bottom: 22px;
  color: var(--text-muted);
  font-size: 0.84rem;
}

.auth-error-summary {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid rgb(195 59 74 / 28%);
  border-radius: 10px;
  background: rgb(195 59 74 / 7%);
  color: #7c2430;
  outline: none;
}

.auth-error-summary:focus-visible {
  box-shadow: 0 0 0 3px rgb(195 59 74 / 14%);
}

.auth-error-summary svg {
  width: 20px;
  height: 20px;
  margin-top: 1px;
}

.auth-error-summary strong,
.auth-error-summary p {
  display: block;
}

.auth-error-summary strong {
  margin-bottom: 3px;
  color: #6c1723;
  font-size: 0.82rem;
}

.auth-error-summary p,
.auth-error-summary li {
  font-size: 0.74rem;
  line-height: 1.45;
}

.auth-error-summary ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.auth-feedback--success {
  border-color: rgb(22 132 95 / 30%);
  background: rgb(22 132 95 / 8%);
  color: #126447;
}

.auth-feedback--success strong {
  color: #0c5139;
}

.auth-feedback--info {
  border-color: rgb(11 94 215 / 25%);
  background: rgb(11 94 215 / 7%);
  color: #174d8e;
}

.auth-feedback--info strong {
  color: #103d73;
}

.auth-card .field-error {
  display: block;
  margin-top: 5px;
  font-size: 0.72rem;
}

.password-input-wrap {
  position: relative;
}

.password-input-wrap input {
  padding-right: 82px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 7px;
  min-height: 30px;
  padding: 4px 7px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--cobalt);
  font-size: 0.7rem;
  font-weight: 700;
  transform: translateY(-50%);
  cursor: pointer;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  background: rgb(11 94 215 / 8%);
  outline: none;
}

.auth-tabs {
  margin-bottom: 18px;
}

.auth-text-action {
  display: block;
  width: fit-content;
  margin: 14px auto 0;
  padding: 3px 0;
  border: 0;
  background: transparent;
  color: var(--cobalt);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.auth-text-action--right {
  margin-right: 0;
}

.auth-text-action:hover,
.auth-text-action:focus-visible {
  color: #084aa9;
  outline: 2px solid rgb(11 94 215 / 20%);
  outline-offset: 3px;
}

.auth-consents {
  display: grid;
  gap: 11px;
  margin-top: 16px;
}

.auth-consent-field {
  min-width: 0;
}

.auth-checkline {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #f8fafc;
  color: var(--text);
  font-size: 0.73rem;
  font-weight: 500;
  line-height: 1.45;
  cursor: pointer;
}

.auth-checkline:has(input:checked) {
  border-color: rgb(11 94 215 / 34%);
  background: rgb(11 94 215 / 5%);
}

.auth-checkline:has(input[aria-invalid="true"]) {
  border-color: rgb(195 59 74 / 45%);
  background: rgb(195 59 74 / 5%);
}

.auth-checkline input {
  margin-top: 2px;
}

.auth-consent-field > .field-error,
.auth-consent-field > .field-hint {
  display: block;
  margin: 5px 4px 0;
}

.auth-state-panel {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 18px;
  border: 1px solid rgb(11 94 215 / 20%);
  border-radius: 12px;
  background: rgb(11 94 215 / 5%);
  color: var(--text);
  text-align: center;
}

.auth-state-panel > svg,
.auth-state-icon svg {
  width: 30px;
  height: 30px;
  color: var(--cobalt);
}

.auth-state-panel p,
.auth-state-panel strong {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.auth-state-panel p {
  font-size: 0.78rem;
  line-height: 1.5;
}

.auth-state-panel > strong {
  color: var(--navy);
  font-size: 0.9rem;
}

.auth-state-panel--success {
  border-color: rgb(22 132 95 / 26%);
  background: rgb(22 132 95 / 7%);
}

.auth-state-panel--success > svg {
  color: #16845f;
}

.auth-state-panel--danger {
  border-color: rgb(195 59 74 / 28%);
  background: rgb(195 59 74 / 7%);
  color: #7c2430;
}

.auth-state-panel--danger > svg {
  color: #a52f3f;
}

.auth-context-hint {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 0.7rem;
  line-height: 1.45;
}

.auth-context-hint svg {
  width: 15px;
  min-width: 15px;
  height: 15px;
  margin-top: 1px;
}

.auth-card .btn {
  width: 100%;
  margin-top: 18px;
}

.stepper {
  display: flex;
  align-items: flex-start;
  width: 100%;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.stepper .step,
.stepper > li,
.stepper > div {
  position: relative;
  display: grid;
  flex: 1 1 0;
  justify-items: center;
  min-width: 0;
  gap: 7px;
  color: #8795a4;
  font-size: 0.7rem;
  font-weight: 650;
  line-height: 1.25;
  text-align: center;
  counter-increment: step;
}

.stepper .step:not(:last-child)::after,
.stepper > li:not(:last-child)::after,
.stepper > div:not(:last-child)::after {
  position: absolute;
  top: 14px;
  right: -50%;
  left: 50%;
  z-index: 0;
  height: 1px;
  background: #d9e2e9;
  content: "";
}

.stepper .step-number,
.stepper .step > span:first-child,
.stepper > li > span:first-child,
.stepper > div > span:first-child {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border: 1px solid #cbd6df;
  border-radius: 50%;
  background: #ffffff;
  color: #718192;
  font-size: 0.69rem;
  font-weight: 750;
}

.stepper .active,
.stepper [aria-current="step"] {
  color: #24415f;
}

.stepper .active .step-number,
.stepper .active > span:first-child,
.stepper [aria-current="step"] .step-number,
.stepper [aria-current="step"] > span:first-child {
  border-color: var(--cobalt);
  background: var(--cobalt);
  color: #ffffff;
}

.stepper .complete,
.stepper .completed {
  color: var(--success);
}

.stepper .complete .step-number,
.stepper .completed .step-number,
.stepper .complete > span:first-child,
.stepper .completed > span:first-child {
  border-color: var(--success);
  background: var(--success-soft);
  color: var(--success);
}

.stepper .complete:not(:last-child)::after,
.stepper .completed:not(:last-child)::after {
  background: #91cfc5;
}

.wizard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: start;
  gap: 18px;
}

.wizard-grid > * {
  min-width: 0;
}

.wizard-grid .wizard-summary,
.wizard-grid > aside {
  position: sticky;
  top: 18px;
  max-height: calc(100dvh - var(--topbar-height) - 36px);
  overflow-y: auto;
}

.wizard-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  padding-top: 16px;
  gap: 10px;
  border-top: 1px solid var(--border);
}

.request-list {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
}

.request-list-header {
  padding: 15px 16px;
  border-bottom: 1px solid var(--border);
  background: #fafbfd;
}

.request-list-header h2,
.request-list-header h3 {
  margin-bottom: 0;
}

.request-item {
  display: block;
  width: 100%;
  padding: 14px 16px;
  border: 0;
  border-bottom: 1px solid #e7edf2;
  background: #ffffff;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.request-item:last-child {
  border-bottom: 0;
}

.request-item:hover {
  background: #f9fbfc;
  color: inherit;
}

.request-item.active,
.request-item[aria-selected="true"] {
  background: var(--cobalt-soft);
  box-shadow: inset 3px 0 0 var(--cobalt);
}

.request-item-top,
.request-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.request-item-title {
  color: #203449;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.35;
}

.request-item-meta {
  margin-top: 7px;
  color: var(--text-muted);
  font-size: 0.69rem;
}

.detail-panel {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.request-detail-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  align-items: start;
  gap: 16px;
}

.detail-panel .detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.detail-grid > div {
  padding: 12px;
  border: 1px solid #e3e9ee;
  border-radius: var(--radius-sm);
  background: #fafcfd;
}

.detail-grid dt {
  margin-bottom: 4px;
  color: var(--text-muted);
  font-size: 0.67rem;
  font-weight: 650;
}

.detail-grid dd {
  margin: 0;
  color: #2c4054;
  font-size: 0.79rem;
  font-weight: 650;
}

.comparison-grid {
  display: grid;
  grid-template-columns: minmax(180px, 0.9fr) repeat(4, minmax(190px, 1fr));
  width: 100%;
  min-width: 760px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.comparison-cell {
  min-width: 0;
  min-height: 58px;
  padding: 13px 14px;
  border-right: 1px solid #e3e9ee;
  border-bottom: 1px solid #e3e9ee;
  background: #ffffff;
  color: #35485b;
  font-size: 0.76rem;
  line-height: 1.4;
}

.comparison-cell:nth-child(5n) {
  border-right: 0;
}

.comparison-cell.header,
.comparison-cell--header {
  min-height: 74px;
  background: #f7f9fb;
  color: #203449;
  font-weight: 700;
}

.comparison-cell.label,
.comparison-cell--label {
  background: #fafbfd;
  color: #68798a;
  font-weight: 650;
}

.comparison-cell.best,
.comparison-cell--best {
  background: #f1f9f7;
  box-shadow: inset 0 3px 0 var(--success);
}

.comparison-cell:last-child,
.comparison-cell:nth-last-child(-n + 5) {
  border-bottom: 0;
}

.coverage {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
  color: #4f6173;
  font-size: 0.69rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.coverage-track,
.coverage > i,
.coverage > span:first-child:has(> i) {
  display: block;
  flex: 1 1 auto;
  height: 7px;
  min-width: 50px;
  overflow: hidden;
  border-radius: 999px;
  background: #e4eaf0;
  font-style: normal;
}

.coverage-fill,
.coverage-track > span,
.coverage > i > span,
.coverage > span:first-child > i {
  display: block;
  width: var(--coverage, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--cobalt);
}

.coverage.success .coverage-fill,
.coverage.success .coverage-track > span {
  background: var(--success);
}

.chat-layout {
  display: grid;
  grid-template-columns: 270px minmax(420px, 1fr) 280px;
  grid-template-rows: minmax(0, 1fr);
  min-width: 0;
  height: calc(100dvh - var(--topbar-height) - 56px);
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.conversation-list {
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  background: #fafbfd;
}

.conversation-list-header,
.chat-thread-header,
.context-panel-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  min-height: 58px;
  padding: 12px 14px;
  gap: 9px;
  border-bottom: 1px solid var(--border);
  background: rgb(255 255 255 / 97%);
}

.conversation-list-header h2,
.conversation-list-header h3,
.chat-thread-header h2,
.chat-thread-header h3,
.context-panel-header h2,
.context-panel-header h3 {
  margin-bottom: 0;
  font-size: 0.86rem;
}

.conversation {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  min-width: 0;
  min-height: 68px;
  width: 100%;
  padding: 10px 14px;
  gap: 5px;
  border: 0;
  border-bottom: 1px solid #e5ebf0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.conversation:hover {
  background: #f2f6f9;
}

.conversation--unread:not([aria-selected="true"]) {
  background: #f2f7ff;
  box-shadow: inset 3px 0 0 var(--cobalt);
}

.conversation--unread .conversation-name,
.conversation--unread .conversation-counterparty,
.conversation--unread .conversation-time {
  color: #123f73;
  font-weight: 800;
}

.conversation.active,
.conversation[aria-selected="true"] {
  background: var(--cobalt-soft);
  box-shadow: inset 3px 0 0 var(--cobalt);
}

.conversation-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  gap: 8px;
}

.conversation-name {
  min-width: 0;
  overflow: hidden;
  color: #263a4d;
  font-size: 0.77rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-name-wrap {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  min-width: 0;
  overflow: hidden;
  gap: 5px;
}

.conversation-name-wrap .conversation-name {
  flex: 1 1 auto;
}

.conversation-pin-indicator {
  display: inline-flex;
  flex: 0 0 auto;
  color: var(--cobalt);
}

.conversation-pin-indicator svg {
  width: 13px;
  height: 13px;
}

.conversation-time {
  flex: 0 0 auto;
  color: var(--text-faint);
  font-size: 0.68rem;
}

.conversation-meta {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
}

.conversation-secondary {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 4px;
}

.conversation-counterparty {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.69rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-reference {
  flex: 0 0 auto;
  max-width: 46%;
  overflow: hidden;
  color: var(--text-faint);
  font-size: 0.62rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-separator {
  flex: 0 0 auto;
  color: var(--text-faint);
  font-size: 0.64rem;
}

.conversation-unread {
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--cobalt);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 1;
}

.conversation[aria-selected="true"] .conversation-unread {
  background: #ffffff;
  color: var(--cobalt);
  box-shadow: 0 0 0 1px rgb(15 94 215 / 20%);
}

.chat-thread {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  background: #ffffff;
}

.chat-thread-header {
  justify-content: space-between;
}

.chat-thread-header > div:first-child {
  min-width: 0;
  overflow: hidden;
}

.chat-thread-header > div:first-child h2,
.chat-thread-header > div:first-child small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-pin-button {
  flex: 0 0 36px;
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
}

.chat-pin-button[aria-pressed="true"] {
  border-color: #bfd4f1;
  background: var(--cobalt-soft);
  color: var(--cobalt-hover);
}

.chat-messages,
.message-list {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 18px;
  gap: 12px;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  background: #f7f9fb;
}

.message {
  align-self: flex-start;
  width: fit-content;
  max-width: min(76%, 560px);
  padding: 10px 12px;
  border: 1px solid #dae3ea;
  border-radius: var(--radius) var(--radius) var(--radius) 3px;
  background: #ffffff;
  color: #34485a;
  font-size: 0.77rem;
  line-height: 1.5;
  box-shadow: 0 1px 3px rgb(17 38 63 / 4%);
}

.message p:last-child {
  margin-bottom: 0;
}

.message.outgoing,
.message.own,
.message--outgoing {
  align-self: flex-end;
  border-color: #bfd4f1;
  border-radius: var(--radius) var(--radius) 3px var(--radius);
  background: var(--cobalt-soft);
  color: #183f6c;
}

.message.system,
.message--system {
  align-self: center;
  max-width: 92%;
  padding: 6px 10px;
  border-color: #e0e6eb;
  border-radius: 999px;
  background: #eef2f5;
  color: #6f7e8d;
  font-size: 0.65rem;
  text-align: center;
  box-shadow: none;
}

.message-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 5px;
  gap: 5px;
  color: #8391a0;
  font-size: 0.66rem;
}

.chat-composer {
  display: flex;
  align-items: flex-end;
  padding: 12px;
  gap: 8px;
  border-top: 1px solid var(--border);
  background: #ffffff;
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
}

.chat-composer textarea,
.chat-composer input {
  min-height: 40px;
  max-height: 120px;
  resize: none;
}

.context-panel {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  border-left: 1px solid var(--border);
  background: #fbfcfd;
}

.context-section {
  padding: 15px;
  border-bottom: 1px solid var(--border);
}

.context-section h3 {
  margin-bottom: 10px;
  color: #5b6d7f;
  font-size: 0.7rem;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.context-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 5px 0;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.7rem;
}

.context-row strong {
  color: #31465a;
  font-weight: 650;
  text-align: right;
}

.deal-timeline {
  display: flex;
  align-items: flex-start;
  width: 100%;
  padding: 4px 0;
}

.timeline-step {
  position: relative;
  display: grid;
  flex: 1 1 0;
  min-width: 0;
  justify-items: center;
  gap: 8px;
  color: #8492a1;
  font-size: 0.68rem;
  font-weight: 650;
  line-height: 1.3;
  text-align: center;
}

.timeline-step:not(:last-child)::after {
  position: absolute;
  top: 8px;
  right: -50%;
  left: 50%;
  z-index: 0;
  height: 2px;
  background: #dce4eb;
  content: "";
}

.timeline-step-marker,
.timeline-step > span:first-child {
  position: relative;
  z-index: 1;
  width: 17px;
  height: 17px;
  border: 4px solid #ffffff;
  border-radius: 50%;
  background: #c5d0da;
  box-shadow: 0 0 0 1px #c5d0da;
}

.timeline-step.complete,
.timeline-step.completed {
  color: var(--success);
}

.timeline-step.complete:not(:last-child)::after,
.timeline-step.completed:not(:last-child)::after {
  background: #88c9bf;
}

.timeline-step.complete .timeline-step-marker,
.timeline-step.completed .timeline-step-marker,
.timeline-step.complete > span:first-child,
.timeline-step.completed > span:first-child {
  background: var(--success);
  box-shadow: 0 0 0 1px var(--success);
}

.timeline-step.active {
  color: var(--cobalt-hover);
}

.timeline-step.active .timeline-step-marker,
.timeline-step.active > span:first-child {
  background: var(--cobalt);
  box-shadow: 0 0 0 1px var(--cobalt);
}

.toast {
  position: fixed;
  top: auto;
  right: auto;
  bottom: 20px;
  left: calc(var(--nav-width) + 20px);
  z-index: 140;
  display: flex;
  align-items: flex-start;
  width: min(380px, calc(100vw - 32px));
  min-height: 58px;
  padding: 13px 14px;
  gap: 10px;
  border: 1px solid #cdd8e1;
  border-left: 3px solid var(--cobalt);
  border-radius: var(--radius);
  background: #ffffff;
  color: #33485b;
  font-size: 0.78rem;
  line-height: 1.45;
  box-shadow: 0 10px 28px rgb(17 38 63 / 14%);
  pointer-events: none;
}

.toast.success {
  border-left-color: var(--success);
}

.toast.warning {
  border-left-color: var(--warning);
}

.toast.danger,
.toast.error {
  border-left-color: var(--danger);
}

.toast-title {
  display: block;
  margin-bottom: 2px;
  color: #203449;
  font-weight: 750;
}

.toast-close {
  margin-left: auto;
  padding: 2px;
  background: transparent;
  color: #7d8b99;
  cursor: pointer;
  pointer-events: auto;
}

.mobile-nav {
  display: none;
}

.anonymous-card {
  display: grid;
  width: min(640px, 100%);
  margin: 0 auto;
  padding: 28px;
  justify-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.anonymous-card > svg,
.anonymous-card .anonymous-icon {
  width: 44px;
  height: 44px;
  margin-bottom: 16px;
  padding: 10px;
  border: 1px solid #cbdcf2;
  border-radius: var(--radius);
  background: var(--cobalt-soft);
  color: var(--cobalt);
}

.anonymous-card h1,
.anonymous-card h2 {
  margin-bottom: 7px;
}

.anonymous-card p {
  max-width: 500px;
  margin-bottom: 20px;
  color: var(--text-muted);
  font-size: 0.84rem;
}

.anonymous-card .anonymous-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.empty-state {
  display: grid;
  min-height: 260px;
  padding: 34px 20px;
  place-content: center;
  justify-items: center;
  border: 1px dashed #cbd6df;
  border-radius: var(--radius);
  background: #fbfcfd;
  color: var(--text-muted);
  text-align: center;
}

.empty-state > svg,
.empty-state .empty-icon {
  width: 42px;
  height: 42px;
  margin-bottom: 14px;
  padding: 9px;
  border: 1px solid #d9e2e9;
  border-radius: var(--radius);
  background: #ffffff;
  color: #748596;
}

.empty-state h2,
.empty-state h3 {
  margin-bottom: 6px;
  color: #34495c;
}

.empty-state p {
  max-width: 430px;
  margin-bottom: 17px;
  font-size: 0.8rem;
}

.empty-state .btn + .btn {
  margin-left: 6px;
}

.stack {
  display: grid;
  gap: 16px;
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.request-row-actions {
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.request-row-actions .btn {
  white-space: nowrap;
}

/* Shared request feed: buyer requests, supplier overview and marketplace. */
.request-feed {
  display: grid;
  min-width: 0;
  overflow: hidden;
  border-top: 1px solid var(--border);
  background: #ffffff;
}

.panel > .request-feed {
  width: calc(100% + 40px);
  margin: 0 -20px -20px;
  border-radius: 0 0 var(--radius) var(--radius);
}

.market-results > .request-feed,
.market-results-list .request-feed {
  width: 100%;
  margin: 0;
  border-top: 0;
  border-radius: 0;
}

.request-feed-row {
  display: grid;
  grid-template-columns:
    minmax(210px, 1.25fr)
    minmax(155px, 0.9fr)
    minmax(135px, 0.72fr)
    minmax(128px, 0.68fr)
    96px
    156px;
  grid-template-areas: "main party facts state offers actions";
  align-items: center;
  min-width: 0;
  min-height: 78px;
  padding: 11px 18px;
  gap: 16px;
  border-bottom: 1px solid #e5ebf0;
  background: #ffffff;
  transition: background-color 140ms ease;
}

.request-feed-row:last-child {
  border-bottom: 0;
}

.request-feed-row:hover {
  background: #f8fbfd;
}

.request-feed-main,
.request-feed-party,
.request-feed-facts,
.request-feed-state,
.request-feed-offers,
.request-feed-actions {
  min-width: 0;
}

.request-feed-main {
  display: grid;
  grid-area: main;
  gap: 2px;
}

.request-feed-main strong {
  overflow: hidden;
  color: #142b42;
  font-size: 0.92rem;
  font-weight: 750;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.request-feed-main > span {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.request-feed-party {
  display: grid;
  grid-area: party;
  gap: 5px;
  color: #40576d;
  font-size: 0.78rem;
}

.request-feed-party > span,
.request-feed-party .request-anonymous-label,
.request-feed-facts > span {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  gap: 7px;
}

.request-feed-party > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.request-visibility-note {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 5px 10px;
  border: 1px solid #d8e4ee;
  border-radius: 999px;
  background: #f5f8fb;
  color: #40576d;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
}

.request-visibility-note.is-anonymous {
  border-color: #dddfe5;
  background: #f5f5f7;
  color: #596675;
}

.request-visibility-note.is-open {
  border-color: #bfe4da;
  background: #edf9f5;
  color: #17624f;
}

.request-feed-party svg,
.request-feed-facts svg {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  color: #647b91;
  stroke-width: 1.8;
}

.request-feed-facts {
  display: grid;
  grid-area: facts;
  gap: 5px;
  color: #40576d;
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
}

.request-feed-state {
  display: flex;
  grid-area: state;
  align-items: center;
}

.request-feed-state .badge {
  width: max-content;
  max-width: 100%;
  min-height: 29px;
  padding: 5px 10px;
  white-space: normal;
  text-align: center;
}

.request-feed-offers {
  display: grid;
  grid-area: offers;
  justify-items: center;
  gap: 2px;
  text-align: center;
}

.request-feed-offers strong {
  display: grid;
  min-height: 25px;
  place-items: center;
  color: var(--cobalt);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
}

.request-feed-offers strong svg {
  width: 18px;
  height: 18px;
}

.request-feed-offers span {
  color: var(--text-muted);
  font-size: 0.68rem;
  line-height: 1.25;
}

.request-feed-actions {
  display: flex;
  grid-area: actions;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.request-feed-menu {
  position: relative;
  z-index: 3;
}

.request-feed-menu-trigger {
  display: inline-grid;
  width: 40px;
  height: 40px;
  padding: 0;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #40576d;
  cursor: pointer;
}

.request-feed-menu-trigger:hover,
.request-feed-menu-trigger[aria-expanded="true"] {
  border-color: #cbd9e6;
  background: #f2f7fb;
  color: var(--cobalt);
}

.request-feed-menu-trigger svg {
  width: 19px;
  height: 19px;
}

.request-feed-menu-popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  display: grid;
  width: 210px;
  padding: 6px;
  overflow: hidden;
  border: 1px solid #d8e2eb;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 14px 34px rgb(13 43 74 / 16%);
  text-align: left;
}

.request-feed-row:last-child .request-feed-menu-popover {
  top: auto;
  bottom: calc(100% + 6px);
}

.request-feed-menu-item {
  display: flex;
  min-height: 42px;
  align-items: center;
  padding: 9px 10px;
  gap: 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #203b56;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}

.request-feed-menu-item:hover {
  background: #f2f7fb;
}

.request-feed-menu-item.is-danger {
  color: #a62936;
}

.request-feed-menu-item.is-danger:hover {
  background: #fff2f3;
}

.request-feed-menu-item.is-disabled {
  color: #91a0ae;
  cursor: not-allowed;
}

.request-feed-menu-item svg {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
}

.request-feed-open,
.request-feed-edit {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 8px 6px;
  gap: 7px;
  border: 0;
  background: transparent;
  color: #183d68;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.request-feed-open:hover,
.request-feed-edit:hover {
  color: var(--cobalt);
}

.request-feed-open svg,
.request-feed-edit svg {
  width: 17px;
  height: 17px;
}

@media (max-width: 1400px) {
  .request-feed-row {
    grid-template-columns: minmax(0, 1.25fr) minmax(150px, 0.9fr) 156px;
    grid-template-areas:
      "main party state"
      "facts offers actions";
    min-height: 96px;
    padding: 10px 16px;
    row-gap: 6px;
    column-gap: 14px;
  }
}

@media (max-width: 640px) {
  .panel > .request-feed {
    width: calc(100% + 32px);
    margin-right: -16px;
    margin-bottom: -16px;
    margin-left: -16px;
  }

  .request-feed-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "main state"
      "party party"
      "facts offers"
      "actions actions";
    min-height: 0;
    padding: 12px 14px;
    gap: 8px 10px;
  }

  .request-feed-main strong {
    font-size: 0.88rem;
  }

  .request-feed-state {
    justify-content: flex-end;
  }

  .request-feed-state .badge {
    max-width: 130px;
  }

  .request-feed-offers {
    align-self: end;
    justify-items: end;
    text-align: right;
  }

  .request-feed-actions {
    justify-content: stretch;
    padding-top: 0;
    border-top: 1px solid #edf1f4;
  }

  .request-feed-open {
    flex: 1;
    min-width: 0;
    min-height: 44px;
  }

  .request-feed-menu-trigger {
    width: 44px;
    height: 44px;
  }

  .request-feed-menu-popover {
    width: min(240px, calc(100vw - 48px));
  }
}

.muted {
  color: var(--text-muted);
}

.numeric {
  font-variant-numeric: tabular-nums;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (max-width: 1280px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wizard-grid {
    grid-template-columns: minmax(0, 1fr) 260px;
  }

  .chat-layout {
    grid-template-columns: 240px minmax(380px, 1fr);
  }

  .chat-layout .context-panel {
    display: none;
  }

  .detail-panel .detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  :root {
    --nav-width: 0px;
  }

  .app-shell {
    grid-template-areas:
      "topbar"
      "page";
    grid-template-columns: minmax(0, 1fr);
  }

  .side-nav {
    display: none;
  }

  .topbar {
    padding: 0 18px;
  }

  .topbar .brand {
    display: inline-flex;
  }

  .topbar-title {
    display: none;
  }

  .topbar-search {
    width: min(300px, 38vw);
  }

  .page {
    padding: 24px 22px 34px;
  }

  .wizard-grid,
  .request-detail-layout {
    grid-template-columns: 1fr;
  }

  .wizard-grid .wizard-summary,
  .wizard-grid > aside {
    position: static;
  }

  .request-list {
    max-height: 340px;
    overflow-y: auto;
  }

  .chat-layout {
    grid-template-columns: 220px minmax(0, 1fr);
    height: calc(100dvh - var(--topbar-height) - 48px);
    min-height: 0;
  }

  .toast {
    top: auto;
    right: auto;
    bottom: 74px;
    left: 18px;
  }
}

@media (max-width: 640px) {
  :root {
    --topbar-height: 58px;
  }

  body {
    padding-bottom: 62px;
  }

  .app-shell {
    display: block;
    height: auto;
    min-height: calc(100dvh - 62px);
    overflow: visible;
  }

  .side-nav {
    display: none;
  }

  .topbar {
    position: sticky;
    width: 100%;
    height: var(--topbar-height);
    padding: 0 14px;
    gap: 10px;
  }

  .topbar .brand {
    min-width: 0;
  }

  .topbar .brand > span:last-child {
    display: none;
  }

  .topbar .brand-mark,
  .topbar .brand > svg,
  .topbar .brand > img {
    flex-basis: 34px;
    width: 34px;
    height: 34px;
  }

  .topbar-search {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    margin-right: 0;
  }

  .topbar-search input {
    height: 36px;
  }

  .topbar-actions {
    gap: 5px;
  }

  .topbar-actions .btn:not(.icon):not(.btn--icon),
  .topbar-actions .avatar {
    display: none;
  }

  .page {
    height: auto;
    min-height: calc(100dvh - var(--topbar-height) - 62px);
    padding: 18px 14px 26px;
    overflow: visible;
  }

  .page--directory {
    height: calc(100dvh - var(--topbar-height) - 62px);
    min-height: 520px;
    padding: 0;
    overflow: hidden;
  }

  .page-header {
    display: grid;
    margin-bottom: 17px;
    gap: 12px;
  }

  .page-header > div:last-child:not(:first-child),
  .page-actions {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  h1 {
    font-size: 1.4rem;
  }

  .panel {
    padding: 16px;
  }

  .panel-header {
    display: grid;
    gap: 10px;
  }

  .panel-header > div:last-child:not(:first-child) {
    flex-wrap: wrap;
  }

  .panel > .table-wrap {
    width: calc(100% + 32px);
    margin: 0 -16px -16px;
  }

  .attention-strip {
    display: grid;
  }

  .attention-strip .btn,
  .attention-strip a {
    width: fit-content;
    margin-left: 0;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .stats-grid > * {
    padding: 14px;
  }

  .stat-value,
  .stats-grid > * > strong {
    font-size: 1.25rem;
  }

  .data-table,
  .positions-table {
    min-width: 650px;
  }

  .field-row,
  .offer-conditions-grid {
    grid-template-columns: 1fr;
  }

  .segmented {
    width: 100%;
    overflow-x: auto;
  }

  .segmented button,
  .segmented a,
  .segmented label {
    flex: 1 0 auto;
  }

  .backdrop {
    align-items: end;
    padding: 0;
  }

  .modal,
  .modal.wide,
  .modal--wide {
    width: 100%;
    max-height: calc(100dvh - 24px);
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: var(--radius) var(--radius) 0 0;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 16px;
  }

  .modal-footer {
    flex-wrap: wrap;
  }

  .modal-footer .btn {
    flex: 1 1 auto;
  }

  .auth-shell {
    align-items: start;
    padding: 22px 14px;
  }

  .auth-card {
    padding: 22px 18px;
  }

  .stepper {
    justify-content: flex-start;
    overflow-x: auto;
    padding: 2px 1px 8px;
  }

  .stepper .step,
  .stepper > li,
  .stepper > div {
    flex: 0 0 92px;
  }

  .wizard-actions {
    flex-wrap: wrap;
  }

  .wizard-actions .btn {
    flex: 1 1 auto;
  }

  .detail-panel {
    padding: 16px;
  }

  .detail-panel .detail-grid {
    grid-template-columns: 1fr;
  }

  .comparison-grid {
    grid-template-columns: minmax(150px, 0.8fr) repeat(4, minmax(170px, 1fr));
    min-width: 850px;
  }

  .chat-layout {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-columns: minmax(0, 1fr);
    height: calc(100dvh - var(--topbar-height) - 198px);
    min-height: 0;
  }

  .conversation-list {
    display: flex;
    min-height: 92px;
    overflow-x: auto;
    overflow-y: hidden;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    scroll-snap-type: x proximity;
  }

  .conversation-list-header {
    display: none;
  }

  .conversation {
    flex: 0 0 220px;
    min-width: 220px;
    border-right: 1px solid var(--border);
    border-bottom: 0;
    scroll-snap-align: start;
  }

  .chat-thread {
    height: auto;
    min-height: 0;
  }

  .message {
    max-width: 86%;
  }

  .context-panel {
    display: none;
  }

  .deal-timeline {
    display: grid;
    gap: 0;
  }

  .timeline-step {
    grid-template-columns: 20px minmax(0, 1fr);
    justify-items: start;
    min-height: 48px;
    gap: 10px;
    text-align: left;
  }

  .timeline-step:not(:last-child)::after {
    top: 16px;
    right: auto;
    bottom: -2px;
    left: 8px;
    width: 2px;
    height: auto;
  }

  .toast {
    top: calc(var(--topbar-height) + 10px);
    right: 12px;
    bottom: auto;
    left: 12px;
    width: auto;
  }

  .mobile-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 80;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    height: 62px;
    padding: 5px max(6px, env(safe-area-inset-right)) max(5px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
    border-top: 1px solid var(--border);
    background: #ffffff;
    box-shadow: 0 -4px 14px rgb(17 38 63 / 7%);
  }

  .mobile-nav a,
  .mobile-nav button,
  .mobile-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 4px 2px;
    gap: 3px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.58rem;
    font-weight: 650;
    line-height: 1;
    text-align: center;
  }

  .mobile-nav a:hover,
  .mobile-nav button:hover,
  .mobile-nav .nav-item:hover,
  .mobile-nav .active,
  .mobile-nav [aria-current="page"] {
    background: var(--cobalt-soft);
    color: var(--cobalt-hover);
  }

  .mobile-nav svg {
    width: 18px;
    height: 18px;
  }

  .mobile-nav .nav-item > span {
    max-width: 100%;
    overflow-wrap: anywhere;
    line-height: 1.05;
  }

  .anonymous-card {
    padding: 24px 18px;
  }

  .anonymous-card .anonymous-actions {
    display: grid;
    width: 100%;
  }

  .empty-state {
    min-height: 230px;
    padding: 28px 16px;
  }
}

@media (max-width: 420px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .topbar-search {
    display: none;
  }

  .topbar-actions {
    margin-left: auto;
  }
}

/* Tablet navigation override lives last so it wins over the desktop rail layout. */
@media (min-width: 641px) and (max-width: 900px) {
  body {
    padding-bottom: 0;
  }

  .app-shell {
    grid-template-areas:
      "topbar"
      "page";
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: var(--topbar-height) minmax(0, 1fr);
    height: calc(100dvh - 62px);
  }

  .page {
    padding-bottom: 24px;
  }

  .mobile-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 80;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    height: 62px;
    padding: 5px 10px;
    border-top: 1px solid var(--border);
    background: #ffffff;
    box-shadow: 0 -4px 14px rgb(17 38 63 / 7%);
  }

  .mobile-nav .nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 0;
    margin: 0;
    padding: 6px;
    gap: 7px;
    border: 0;
    background: transparent;
  }

  .mobile-nav [aria-current="page"] {
    background: var(--cobalt-soft);
    color: var(--cobalt-hover);
  }
}

/* Full-height workspaces use the available screen instead of growing the document. */
@media (min-width: 901px) {
  body {
    overflow: hidden;
  }

  .page:has(> [data-testid="marketplace"]),
  .page:has(> [data-testid="chats"]),
  .page:has(> [data-testid="comparison"]) {
    overflow: hidden;
  }

  .page:has(> [data-testid="chats"]) {
    padding: 12px 18px;
  }

  [data-testid="marketplace"],
  [data-testid="chats"],
  [data-testid="comparison"] {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    height: 100%;
    min-height: 0;
  }

  [data-testid="marketplace"] .market-layout {
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  [data-testid="marketplace"] .market-layout > .panel {
    margin-top: 0;
  }

  [data-testid="chats"] .chat-layout {
    height: min(720px, calc(100dvh - var(--topbar-height) - 140px));
    max-height: 100%;
    min-height: 0;
  }

  [data-testid="chats"] {
    grid-template-rows: minmax(0, 1fr) auto;
  }

  [data-testid="comparison"] {
    display: flex;
    flex-direction: column;
  }

  [data-testid="comparison"] > .page-header,
  [data-testid="comparison"] > .attention-strip,
  [data-testid="comparison"] > .wizard-actions {
    flex: 0 0 auto;
  }

  [data-testid="comparison"] > .panel {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
  }

  [data-testid="comparison"] > .panel > .table-wrap {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
  }

  .comparison-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
  }

  .comparison-table thead th:first-child,
  .comparison-table thead th:nth-child(2) {
    z-index: 5;
  }
}

@media (min-width: 641px) and (max-width: 900px) {
  .page:has(> [data-testid="chats"]) {
    height: 100%;
    min-height: 0;
    padding: 12px 14px;
    overflow: hidden;
  }

  [data-testid="chats"] {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    height: 100%;
    min-height: 0;
  }

  [data-testid="chats"] .chat-layout {
    height: 100%;
    min-height: 0;
  }
}

@media (max-width: 640px) {
  .page:has(> [data-testid="chats"]) {
    height: calc(
      100dvh - var(--topbar-height) - 62px - env(safe-area-inset-bottom)
    );
    min-height: 0;
    padding: 8px;
    overflow: hidden;
  }

  [data-testid="chats"] {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    height: 100%;
    min-height: 0;
  }

  [data-testid="chats"] .chat-layout {
    height: 100%;
    min-height: 0;
  }

  .chat-pin-button {
    flex-basis: 44px;
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
  }
}

@media (min-width: 901px) and (max-width: 1280px) {
  [data-testid="marketplace"] .market-layout {
    align-items: stretch;
    overflow: hidden;
  }

  [data-testid="marketplace"] .market-filter-panel {
    height: auto;
  }

  [data-testid="marketplace"] .market-results {
    height: 100%;
  }

  [data-testid="marketplace"] .market-request-row {
    grid-template-columns: minmax(180px, 1fr) 96px 124px 116px;
  }

  [data-testid="marketplace"] .market-request-meta {
    display: none;
  }
}

/* Expanded company profile. */
[data-testid="profile"] {
  min-width: 0;
}

.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 18px;
}

.profile-main,
.profile-sidebar {
  display: grid;
  min-width: 0;
  gap: 16px;
}

.profile-form-fieldset {
  display: grid;
  min-width: 0;
  margin: 0;
  padding: 0;
  gap: 16px;
  border: 0;
}

.profile-form-fieldset:disabled .profile-section,
.profile-form-fieldset:disabled .profile-form-actions {
  opacity: 0.72;
}

.profile-main > .panel + .panel,
.profile-form-fieldset > .panel + .panel,
.profile-sidebar > .panel + .panel {
  margin-top: 0;
}

.profile-sidebar {
  position: sticky;
  top: 18px;
  max-height: none;
  overflow: visible;
}

.profile-section .panel-header {
  margin-bottom: 18px;
}

.profile-fields {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px 16px;
}

.profile-fields > .field {
  grid-column: span 6;
  align-content: start;
  min-width: 0;
}

.profile-fields > .field + .field {
  margin-top: 0;
}

.profile-fields > .field--span-4 {
  grid-column: span 4;
}

.profile-fields > .field--span-6 {
  grid-column: span 6;
}

.profile-fields > .field--span-8 {
  grid-column: span 8;
}

.profile-fields > .field--span-12,
.profile-fields > .profile-privacy-note.field--span-12 {
  grid-column: 1 / -1;
}

.profile-category-field {
  margin: 0;
  padding: 0;
  border: 0;
}

.profile-category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 6px;
  gap: 8px;
}

.profile-category-option {
  display: flex;
  align-items: flex-start;
  min-width: 0;
  min-height: 44px;
  padding: 10px 11px;
  gap: 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: #405266;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.35;
  cursor: pointer;
}

.profile-category-option:hover {
  border-color: #aebdca;
  background: #f7f9fb;
}

.profile-category-option:has(input:checked) {
  border-color: #8eb1e2;
  background: var(--cobalt-soft);
  color: var(--cobalt-hover);
}

.profile-category-option input {
  flex: 0 0 16px;
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 1px 0 0;
  padding: 0;
}

.profile-privacy-note {
  display: flex;
  align-items: flex-start;
  padding: 12px 14px;
  gap: 9px;
  border: 1px solid #bfddd8;
  border-radius: var(--radius-sm);
  background: var(--success-soft);
  color: #26645c;
  font-size: 0.75rem;
  line-height: 1.45;
}

.profile-privacy-note svg {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
}

.profile-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 14px 18px;
  gap: 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: rgb(255 255 255 / 97%);
  box-shadow: 0 10px 26px rgb(17 38 63 / 12%);
}

.profile-form-actions .muted {
  margin-right: auto;
  font-size: 0.74rem;
}

.profile-completion-value {
  color: var(--cobalt-hover);
  font-size: 1.3rem;
  font-variant-numeric: tabular-nums;
}

.profile-progress {
  width: 100%;
  height: 9px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #e5ecf2;
  accent-color: var(--cobalt);
}

.profile-progress::-webkit-progress-bar {
  border-radius: 999px;
  background: #e5ecf2;
}

.profile-progress::-webkit-progress-value {
  border-radius: 999px;
  background: var(--cobalt);
}

.profile-checklist {
  display: grid;
  margin: 14px 0 0;
  padding: 0;
  gap: 9px;
  list-style: none;
}

.profile-checklist li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 600;
}

.profile-checklist li.complete {
  color: var(--success);
}

.profile-checklist svg {
  width: 17px;
  height: 17px;
}

.profile-verification .panel-header {
  align-items: flex-start;
}

@media (max-width: 1180px) {
  .profile-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .profile-sidebar {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: none;
    overflow: visible;
  }

  .profile-sidebar > .profile-summary {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  .profile-fields {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .profile-fields > .field,
  .profile-fields > .field--span-4,
  .profile-fields > .field--span-6,
  .profile-fields > .field--span-8,
  .profile-fields > .field--span-12,
  .profile-fields > .profile-privacy-note.field--span-12 {
    grid-column: auto;
  }

  .profile-category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-form-actions {
    position: static;
    align-items: stretch;
    flex-direction: column;
  }

  .profile-form-actions .muted {
    margin-right: 0;
  }

  .profile-form-actions .btn {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .topbar-actions .icon-btn {
    display: none;
  }

  .topbar-actions .avatar {
    display: grid;
  }

  .profile-layout,
  .profile-main,
  .profile-sidebar {
    gap: 14px;
  }

  .profile-sidebar {
    grid-template-columns: minmax(0, 1fr);
  }

  .profile-sidebar > .profile-summary {
    grid-column: auto;
  }
}

/* Platform information pages own their responsive gutter inside the iframe. */
@media (max-width: 900px) {
  .page.page--platform-info {
    min-height: 0;
    padding: 0;
  }

  .mobile-nav--platform-info {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .mobile-nav--platform-info + .support-fab {
    right: max(6px, env(safe-area-inset-right));
    bottom: max(5px, env(safe-area-inset-bottom));
    left: auto;
    z-index: 81;
    width: calc((100vw - 12px) / 6);
    height: 52px;
    min-height: 0;
    flex-direction: column;
    padding: 4px 2px;
    gap: 3px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.58rem;
    line-height: 1;
    box-shadow: none;
  }

  .mobile-nav--platform-info + .support-fab:hover {
    border-color: transparent;
    background: var(--cobalt-soft);
    color: var(--cobalt-hover);
  }

  .mobile-nav--platform-info + .support-fab svg {
    width: 18px;
    height: 18px;
  }

  .mobile-nav--platform-info + .support-fab .support-fab__label {
    display: none;
  }

  .mobile-nav--platform-info + .support-fab .support-fab__mobile-label {
    display: block;
    max-width: 100%;
    overflow-wrap: anywhere;
    line-height: 1.05;
  }
}

@media (max-width: 640px) {
  body:has(.page--platform-info) {
    padding-bottom: 0;
    overflow: hidden;
  }

  .app-shell {
    min-height: calc(100dvh - 62px - env(safe-area-inset-bottom));
  }

  .page.page--platform-info {
    height: calc(
      100dvh - var(--topbar-height) - 62px - env(safe-area-inset-bottom)
    );
  }

  .mobile-nav {
    height: calc(62px + env(safe-area-inset-bottom));
  }
}

@media (min-width: 641px) and (max-width: 900px) {
  .app-shell {
    height: calc(100dvh - 62px - env(safe-area-inset-bottom));
  }

  .mobile-nav {
    height: calc(62px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 420px) {
  .profile-category-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .request-modal-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .request-modal-facts .request-modal-fact-wide {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .modal--request {
    max-height: calc(100dvh - 16px);
  }

  .request-modal-title-row {
    display: grid;
    gap: 8px;
  }

  .request-modal-title-row .badge {
    width: fit-content;
    max-width: 100%;
  }

  .request-modal-body {
    padding: 14px 16px 18px;
    gap: 14px;
  }

  .request-modal-facts {
    grid-template-columns: minmax(0, 1fr);
  }

  .request-modal-facts .request-modal-fact-wide {
    grid-column: auto;
  }

  .request-spec-wrap {
    overflow: visible;
    border: 0;
  }

  .request-spec-table,
  .request-spec-table tbody,
  .request-spec-table tr,
  .request-spec-table td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .request-spec-table thead {
    display: none;
  }

  .request-spec-table tbody {
    display: grid;
    gap: 10px;
  }

  .request-spec-table tr {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #ffffff;
  }

  .request-spec-table td,
  .request-spec-table td.numeric {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    padding: 5px 0;
    gap: 10px;
    border: 0;
    text-align: left;
    white-space: normal;
  }

  .request-spec-table td::before {
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 650;
    content: attr(data-label);
  }

  .market-request-actions .btn {
    min-width: 44px;
    min-height: 44px;
  }

  .table-inline-action {
    min-height: 32px;
  }
}

/* Global support and trust & safety flows. */
.support-fab {
  position: fixed;
  bottom: 16px;
  left: calc(var(--nav-width) + 16px);
  z-index: 72;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  max-width: calc(100vw - var(--nav-width) - 32px);
  min-height: 42px;
  padding: 9px 14px;
  gap: 8px;
  border: 1px solid #c9dcf7;
  border-radius: var(--radius-sm);
  background: var(--cobalt-soft);
  color: var(--cobalt-hover);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 750;
  box-shadow: 0 5px 16px rgb(17 38 63 / 10%);
  cursor: pointer;
}

.support-fab:hover {
  border-color: #9ebfea;
  background: #dceaff;
}

.support-fab:focus-visible {
  outline: 3px solid rgb(11 94 215 / 20%);
  outline-offset: 2px;
}

.support-fab svg {
  flex: 0 0 17px;
  width: 17px;
  height: 17px;
}

.support-fab__mobile-label {
  display: none;
}

.modal--support,
.modal--report {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.modal--support {
  width: min(760px, 100%);
}

.modal--support > .modal-body,
.modal--report > .modal-body {
  min-height: 0;
  overflow-y: auto;
}

.support-tabs {
  width: fit-content;
  max-width: 100%;
  margin-bottom: 18px;
}

.support-tabs button {
  min-height: 38px;
}

.support-context {
  margin: 0;
}

.support-ticket-list {
  display: grid;
  gap: 12px;
}

.support-ticket-list .support-ticket {
  margin: 0;
}

.support-ticket > p {
  margin: 12px 0;
  color: #405469;
  font-size: 0.8rem;
  line-height: 1.55;
}

.support-ticket .attention-strip {
  margin: 12px 0 0;
}

.modal--report {
  width: min(620px, 100%);
}

@media (max-width: 900px) {
  .support-fab {
    bottom: 76px;
    left: 18px;
    width: 48px;
    min-height: 48px;
    padding: 0;
    border-radius: 50%;
    background: var(--cobalt);
    color: #ffffff;
    box-shadow: 0 8px 22px rgb(11 94 215 / 28%);
  }

  .support-fab:hover {
    border-color: var(--cobalt-hover);
    background: var(--cobalt-hover);
  }

  .support-fab span {
    display: none;
  }

  .support-fab svg {
    width: 20px;
    height: 20px;
  }
}

@media (max-width: 640px) {
  .modal--support,
  .modal--report {
    max-height: calc(100dvh - 18px);
  }

  .support-tabs {
    display: grid;
    width: 100%;
    grid-template-columns: 1fr 1fr;
  }

  .support-tabs button {
    min-width: 0;
    padding-inline: 9px;
    font-size: 0.7rem;
  }
}

/* Deal workspace, confirmations and persistent notifications. */
.notifications-wrap {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
}

.notification-counter {
  position: absolute;
  top: -4px;
  right: -5px;
  display: grid;
  place-items: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: var(--danger);
  color: #ffffff;
  font-size: 0.58rem;
  font-weight: 800;
  line-height: 1;
}

.notifications-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 130;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(390px, calc(100vw - 28px));
  max-height: min(560px, calc(100dvh - var(--topbar-height) - 24px));
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 16px 42px rgb(17 38 63 / 18%);
}

.notifications-popover[hidden] {
  display: none;
}

.notifications-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  min-height: 54px;
  padding: 11px 13px;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  background: #ffffff;
}

.notifications-header h2,
.notifications-header h3,
.notifications-header p {
  min-width: 0;
  margin: 0;
}

.notifications-heading {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.notifications-heading > strong {
  color: #203449;
  font-size: 0.86rem;
}

.notifications-heading > span {
  color: var(--text-muted);
  font-size: 0.68rem;
}

.notifications-header-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
}

.notifications-read-all {
  min-height: 34px;
  padding: 6px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--cobalt);
  font: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
}

.notifications-read-all:hover,
.notifications-read-all:focus-visible {
  background: var(--cobalt-soft);
}

.notifications-header h2,
.notifications-header h3 {
  color: #203449;
  font-size: 0.86rem;
}

.notifications-header .btn,
.notifications-header button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.notifications-list {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--border-strong) transparent;
  scrollbar-width: thin;
}

.notification-item {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  width: 100%;
  min-width: 0;
  padding: 12px 14px;
  gap: 10px;
  border: 0;
  border-bottom: 1px solid #e8edf2;
  background: #ffffff;
  color: #33485b;
  font: inherit;
  font-size: 0.75rem;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
}

.notification-item:last-child {
  border-bottom: 0;
}

.notification-item:hover,
.notification-item:focus-visible {
  background: #f7faff;
}

.notification-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--surface-subtle);
  color: #728499;
}

.notification-icon > svg {
  width: 18px;
  height: 18px;
}

.notification-item > span:last-child {
  display: block;
  min-width: 0;
  overflow: hidden;
}

.notification-item strong {
  display: block;
  overflow: hidden;
  margin-bottom: 2px;
  color: #203449;
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-item p {
  margin: 0;
  color: var(--text-muted);
}

.notification-item time,
.notification-item small {
  display: block;
  margin-top: 5px;
  color: var(--text-faint);
  font-size: 0.65rem;
}

.notification-item--unread {
  background: #f2f7ff;
  box-shadow: inset 3px 0 0 var(--cobalt);
}

.notification-item--unread .notification-icon {
  background: var(--cobalt-soft);
  color: var(--cobalt);
}

.notification-empty {
  display: grid;
  place-items: center;
  min-height: 180px;
  padding: 24px;
  gap: 8px;
  color: var(--text-muted);
  text-align: center;
}

.notification-empty > svg {
  width: 24px;
  height: 24px;
}

.notification-empty p {
  margin: 0;
  font-size: 0.75rem;
}

.notifications-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  gap: 10px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.75rem;
}

.notifications-footer button {
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--cobalt);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.modal--notification-settings {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(780px, 100%);
  max-height: min(860px, calc(100dvh - 40px));
  overflow: hidden;
}

.notification-settings-form {
  display: contents;
}

.notification-settings-header h2:focus {
  outline: 0;
}

.notification-settings-body {
  display: grid;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 18px 20px;
  gap: 12px;
  background: #f5f8fb;
  overscroll-behavior: contain;
  scrollbar-color: var(--border-strong) transparent;
  scrollbar-width: thin;
}

.notification-transport-note {
  display: flex;
  align-items: flex-start;
  padding: 11px 13px;
  gap: 10px;
  border: 1px solid #efd9a7;
  border-radius: var(--radius-sm);
  background: #fffaf0;
  color: #72571e;
}

.notification-transport-note > svg {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  color: #aa7920;
}

.notification-transport-note strong {
  display: block;
  margin-bottom: 2px;
  color: #5f4719;
  font-size: 0.76rem;
}

.notification-transport-note p {
  margin: 0;
  font-size: 0.69rem;
  line-height: 1.45;
}

.notification-email-controls {
  display: grid;
  min-width: 0;
  margin: 0;
  padding: 0;
  gap: 12px;
  border: 0;
}

.notification-email-controls:disabled {
  opacity: 0.6;
}

.notification-settings-section {
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
}

.notification-master-row,
.notification-section-heading,
.notification-address-row,
.notification-quiet-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  gap: 14px;
}

.notification-master-row {
  cursor: pointer;
}

.notification-master-row > span:first-child,
.notification-quiet-toggle > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.notification-master-row strong,
.notification-quiet-toggle strong {
  color: #263b50;
  font-size: 0.8rem;
}

.notification-master-row small,
.notification-quiet-toggle small {
  color: var(--text-muted);
  font-size: 0.68rem;
  line-height: 1.4;
}

.notification-checkbox-control,
.notification-inline-check {
  display: inline-flex;
  flex: 0 0 auto;
  min-height: 34px;
  align-items: center;
  padding: 7px 9px;
  gap: 7px;
  border: 1px solid #cbd8e4;
  border-radius: 9px;
  background: #f8fafc;
  color: #405469;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
}

.notification-checkbox-control:has(input:checked),
.notification-inline-check:has(input:checked) {
  border-color: #8ab1e6;
  background: var(--cobalt-soft);
  color: var(--cobalt);
}

.notification-address-row {
  margin-top: 13px;
  padding-top: 13px;
  border-top: 1px solid var(--border);
}

.notification-address-row > svg {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  color: #6b7e90;
}

.notification-address-row > div {
  display: grid;
  flex: 1 1 auto;
  min-width: 0;
  gap: 1px;
}

.notification-address-row span {
  color: var(--text-muted);
  font-size: 0.65rem;
}

.notification-address-row strong {
  overflow: hidden;
  color: #2c4054;
  font-size: 0.74rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-email-warning {
  display: flex;
  align-items: flex-start;
  margin-top: 10px;
  padding: 8px 10px;
  gap: 7px;
  border-radius: 8px;
  background: var(--danger-soft);
  color: #963746;
  font-size: 0.68rem;
  line-height: 1.4;
}

.notification-email-warning > svg {
  flex: 0 0 15px;
  width: 15px;
  height: 15px;
  margin-top: 1px;
}

.notification-section-heading {
  align-items: flex-start;
  margin-bottom: 13px;
}

.notification-section-heading > div {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 10px;
}

.notification-section-heading h3,
.notification-section-heading p {
  margin: 0;
}

.notification-section-heading h3 {
  color: #263b50;
  font-size: 0.82rem;
}

.notification-section-heading p {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 0.68rem;
  line-height: 1.4;
}

.notification-section-icon,
.notification-rule-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  background: var(--cobalt-soft);
  color: var(--cobalt);
}

.notification-section-icon {
  width: 34px;
  height: 34px;
}

.notification-section-icon > svg,
.notification-rule-icon > svg {
  width: 17px;
  height: 17px;
}

.notification-schedule-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(150px, 0.6fr);
  gap: 12px;
}

.notification-schedule-grid > .field + .field {
  margin-top: 0;
}

.notification-rules {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.notification-rule {
  display: grid;
  grid-template-columns: auto 34px minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 62px;
  align-items: center;
  padding: 9px 11px;
  gap: 9px;
  border-bottom: 1px solid var(--border);
  background: #ffffff;
  cursor: pointer;
}

.notification-rule:last-child {
  border-bottom: 0;
}

.notification-rule:hover {
  background: #f8fbff;
}

.notification-rule:has(input:focus-visible) {
  position: relative;
  z-index: 1;
  box-shadow: inset 0 0 0 2px rgb(11 94 215 / 32%);
}

.notification-rule:has(input:checked) .notification-rule-icon {
  background: var(--cobalt);
  color: #ffffff;
}

.notification-rule-icon {
  width: 34px;
  height: 34px;
  background: #eef2f6;
  color: #74879a;
}

.notification-rule-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
  color: var(--text-muted);
  font-size: 0.67rem;
  line-height: 1.4;
}

.notification-rule-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  color: #2c4054;
  font-size: 0.75rem;
  font-weight: 750;
}

.notification-rule-title small {
  padding: 2px 5px;
  border-radius: 999px;
  background: #edf2f7;
  color: #64778a;
  font-size: 0.57rem;
  font-weight: 750;
  letter-spacing: 0.02em;
}

.notification-rule-channel {
  padding: 4px 7px;
  border-radius: 999px;
  background: #eef7f3;
  color: #267359;
  font-size: 0.61rem;
  font-weight: 750;
  white-space: nowrap;
}

.notification-timezone-field {
  max-width: 340px;
}

.notification-quiet-toggle {
  justify-content: flex-start;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--border);
  cursor: pointer;
}

.notification-quiet-toggle > input {
  flex: 0 0 17px;
  width: 17px;
  height: 17px;
}

.notification-quiet-grid {
  margin-top: 11px;
  grid-template-columns: repeat(2, minmax(0, 170px));
}

.modal--notification-settings .modal-footer {
  background: #ffffff;
}

.notification-settings-footnote {
  margin-right: auto;
  color: var(--text-muted);
  font-size: 0.66rem;
}

.comparison-action-bar {
  position: sticky;
  z-index: 8;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  padding: 12px 14px;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgb(255 255 255 / 97%);
  box-shadow: 0 -6px 22px rgb(17 38 63 / 8%);
  backdrop-filter: blur(10px);
}

.comparison-action-bar > .btn,
.comparison-action-bar > button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.comparison-action-actions {
  display: flex;
  flex: 0 1 auto;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  gap: 12px;
}

.comparison-action-actions > .muted {
  max-width: 360px;
  text-align: right;
}

.comparison-action-actions > .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.comparison-allocation-summary {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: center;
  min-width: 0;
  gap: 6px 18px;
  color: var(--text-muted);
  font-size: 0.72rem;
}

.comparison-allocation-summary strong {
  color: #263b50;
  font-size: 0.79rem;
  font-variant-numeric: tabular-nums;
}

.comparison-supplier-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  min-height: 21px;
  margin-top: 5px;
  padding: 2px 7px;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #f3f6f8;
  color: #66788a;
  font-size: 0.62rem;
  font-weight: 750;
  line-height: 1.25;
  white-space: nowrap;
}

.deal-status-banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  min-width: 0;
  margin-bottom: 18px;
  padding: 14px 16px;
  gap: 14px;
  border: 1px solid #c9dced;
  border-radius: var(--radius);
  background: var(--info-soft);
  color: #274d6f;
}

.deal-status-banner > div {
  min-width: 0;
}

.deal-status-banner strong {
  display: block;
  margin-bottom: 2px;
  color: #183f63;
  font-size: 0.83rem;
}

.deal-status-banner p,
.deal-status-banner span {
  margin: 0;
  color: inherit;
  font-size: 0.75rem;
  line-height: 1.45;
}

.offer-selected-summary {
  display: grid;
  margin-top: 10px;
  padding: 10px 12px;
  gap: 5px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
}

.deal-status-banner > .btn,
.deal-status-banner > button,
.deal-status-banner > .cluster {
  flex: 0 0 auto;
}

.deal-status-banner--pending {
  border-color: #efd292;
  background: var(--warning-soft);
  color: #77521a;
}

.deal-status-banner--pending strong {
  color: #67430c;
}

.deal-status-banner--confirmed {
  border-color: #b7ded8;
  background: var(--success-soft);
  color: #27675f;
}

.deal-status-banner--confirmed strong {
  color: #145b52;
}

.deal-status-banner--cancelled {
  border-color: #efc4ca;
  background: var(--danger-soft);
  color: #8e3440;
}

.deal-status-banner--cancelled strong {
  color: #7c2531;
}

.deal-header-actions,
.offer-confirmation-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  gap: 8px;
}

.deal-header-actions .btn,
.deal-header-actions button,
.offer-confirmation-actions .btn,
.offer-confirmation-actions button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.deal-position-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  color: #334456;
  font-size: 0.78rem;
  line-height: 1.4;
}

.deal-position-table th {
  height: 42px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: #f7f9fb;
  color: #6c7c8c;
  font-size: 0.68rem;
  font-weight: 750;
  text-align: left;
  white-space: nowrap;
}

.deal-position-table td {
  min-width: 0;
  height: 58px;
  padding: 11px 12px;
  border-bottom: 1px solid #e8edf2;
  background: #ffffff;
  vertical-align: middle;
}

.deal-position-table tbody tr:last-child td {
  border-bottom: 0;
}

.deal-position-table tbody tr:hover td {
  background: #fafcfd;
}

.deal-position-table th:first-child,
.deal-position-table td:first-child {
  width: 30%;
  padding-left: 16px;
}

.deal-position-table th:last-child,
.deal-position-table td:last-child {
  width: 20%;
  padding-right: 16px;
}

.deal-position-name {
  display: grid;
  min-width: 0;
  gap: 3px;
  color: #1f3245;
  font-weight: 700;
}

.deal-position-name > strong,
.deal-position-name > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deal-position-name small,
.deal-position-name .subtext {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.69rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deal-position-state {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  min-width: 0;
  gap: 5px;
}

.deal-position-state > span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #f3f6f8;
  color: #647586;
  font-size: 0.64rem;
  font-weight: 700;
  white-space: nowrap;
}

.deal-position-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  gap: 6px;
}

.deal-position-actions .btn,
.deal-position-actions button {
  flex: 0 0 auto;
  min-width: max-content;
  white-space: nowrap;
}

.deal-event-list {
  position: relative;
  display: grid;
  gap: 0;
}

.deal-event {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  min-width: 0;
  padding: 10px 0;
  gap: 11px;
}

.deal-event:not(:last-child)::after {
  position: absolute;
  top: 43px;
  bottom: -9px;
  left: 16px;
  width: 1px;
  background: var(--border);
  content: "";
}

.deal-event-icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid #ccdae7;
  border-radius: 50%;
  background: #f3f7fb;
  color: var(--info);
}

.deal-event-icon svg {
  width: 16px;
  height: 16px;
}

.deal-event-content {
  min-width: 0;
  padding-top: 1px;
}

.deal-event-content strong {
  display: block;
  margin-bottom: 2px;
  color: #263a4d;
  font-size: 0.77rem;
}

.deal-event-content p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.deal-event-content time,
.deal-event-content small {
  display: block;
  margin-top: 4px;
  color: var(--text-faint);
  font-size: 0.65rem;
}

.document-request-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.document-request-card {
  display: grid;
  min-width: 0;
  padding: 13px 14px;
  gap: 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fbfcfd;
}

.document-request-card > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  min-width: 0;
  gap: 10px;
}

.document-request-card > div:first-child {
  min-width: 0;
}

.document-request-card > div:first-child > strong {
  display: block;
  margin-bottom: 4px;
  color: #203449;
  font-size: 0.8rem;
}

.document-request-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 8px;
  gap: 6px 14px;
  color: var(--text-muted);
  font-size: 0.68rem;
}

.document-request-meta > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.document-request-meta svg {
  width: 14px;
  height: 14px;
}

.document-request-card h3,
.document-request-card h4 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: #263a4d;
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-request-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.document-request-card .btn,
.document-request-card button {
  width: fit-content;
  max-width: 100%;
  white-space: nowrap;
}

.document-request-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 12px;
  color: var(--text-faint);
  font-size: 0.66rem;
}

.document-request-meta > span {
  min-width: 0;
}

.document-position-selector {
  display: grid;
  max-height: 300px;
  overflow-y: auto;
  padding: 6px;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  scrollbar-color: var(--border-strong) transparent;
  scrollbar-width: thin;
}

.document-position-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  min-width: 0;
  padding: 9px 10px;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: #ffffff;
  color: #34485a;
  font-size: 0.73rem;
  cursor: pointer;
}

.document-position-option:hover {
  border-color: #d5e2ee;
  background: #f8fbff;
}

.document-position-option:has(input:checked) {
  border-color: #b8d1f2;
  background: var(--cobalt-soft);
}

.document-position-option input {
  width: 17px;
  height: 17px;
  margin: 0;
}

.document-position-option > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-position-option small {
  color: var(--text-muted);
  font-size: 0.67rem;
  white-space: nowrap;
}

.chat-access-banner {
  display: flex;
  align-items: flex-start;
  padding: 9px 12px;
  gap: 8px;
  border-bottom: 1px solid #cfe0ef;
  background: var(--info-soft);
  color: #345a78;
  font-size: 0.7rem;
  line-height: 1.4;
}

.chat-access-banner > svg {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  margin-top: 1px;
}

.chat-access-banner strong {
  color: #234966;
}

.chat-composer--readonly {
  background: #f4f6f8;
}

.chat-composer--readonly textarea,
.chat-composer--readonly input {
  border-color: #dce3e9;
  background: #eef2f5;
  color: #7b8997;
  cursor: not-allowed;
  pointer-events: none;
}

.chat-composer--readonly .btn,
.chat-composer--readonly button {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.offer-status-stack {
  display: grid;
  justify-items: start;
  min-width: 0;
  gap: 5px;
}

.offer-confirmation-actions {
  justify-content: flex-start;
}

.confirmation-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.confirmation-item {
  display: grid;
  min-width: 0;
  padding: 12px 13px;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
}

.confirmation-item > span,
.confirmation-item > small {
  color: var(--text-muted);
  font-size: 0.68rem;
}

.confirmation-item > strong {
  min-width: 0;
  overflow: hidden;
  color: #263a4d;
  font-size: 0.79rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal--document-request {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(820px, 100%);
  max-height: min(820px, calc(100dvh - 40px));
  overflow: hidden;
}

.modal--document-request .modal-body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal--document-request > .document-request-form {
  display: contents;
}

.modal--document-request .modal-footer {
  background: #ffffff;
}

@media (max-width: 1280px) {
  .deal-header-actions,
  .offer-confirmation-actions {
    gap: 6px;
  }

  .deal-header-actions .btn,
  .deal-header-actions button,
  .offer-confirmation-actions .btn,
  .offer-confirmation-actions button {
    padding-inline: 10px;
    font-size: 0.72rem;
  }

  .deal-position-table th,
  .deal-position-table td {
    padding-inline: 9px;
  }

  .deal-position-table th:first-child,
  .deal-position-table td:first-child {
    width: 28%;
    padding-left: 12px;
  }

  .deal-position-table th:last-child,
  .deal-position-table td:last-child {
    width: 22%;
    padding-right: 12px;
  }

  .document-request-list {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 1100px) {
  .deal-position-table {
    min-width: 760px;
    table-layout: auto;
  }

  .deal-position-table th:first-child,
  .deal-position-table td:first-child {
    width: 220px;
    min-width: 220px;
  }

  .deal-position-table th:last-child,
  .deal-position-table td:last-child {
    width: 170px;
    min-width: 170px;
  }
}

@media (max-width: 768px) {
  .notifications-popover {
    position: fixed;
    top: calc(var(--topbar-height) + 8px);
    right: 12px;
    left: 12px;
    width: auto;
    max-height: calc(100dvh - var(--topbar-height) - 82px);
  }

  .comparison-action-bar,
  .deal-status-banner {
    align-items: stretch;
    flex-direction: column;
  }

  .comparison-action-actions {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
    gap: 8px;
  }

  .comparison-action-actions > .muted {
    max-width: none;
    text-align: left;
  }

  .comparison-action-actions > .btn {
    width: 100%;
    justify-content: center;
  }

  .comparison-action-bar > .btn,
  .comparison-action-bar > button,
  .deal-status-banner > .btn,
  .deal-status-banner > button,
  .deal-status-banner > .cluster {
    width: 100%;
  }

  .comparison-action-bar > .btn,
  .comparison-action-bar > button {
    justify-content: center;
  }

  .deal-status-banner > .cluster {
    display: flex;
    flex-wrap: wrap;
  }

  .deal-header-actions,
  .offer-confirmation-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .deal-position-table {
    min-width: 760px;
    table-layout: auto;
  }

  .deal-position-table th:first-child,
  .deal-position-table td:first-child {
    width: 220px;
    min-width: 220px;
  }

  .deal-position-table th:last-child,
  .deal-position-table td:last-child {
    width: 170px;
    min-width: 170px;
  }

  .deal-position-actions {
    justify-content: flex-start;
  }

  .confirmation-pair {
    grid-template-columns: minmax(0, 1fr);
  }

  .modal--document-request {
    width: 100%;
    max-height: calc(100dvh - 18px);
  }
}

@media (max-width: 390px) {
  .notifications-popover {
    top: calc(var(--topbar-height) + 6px);
    right: 8px;
    left: 8px;
    max-height: calc(100dvh - var(--topbar-height) - 74px);
    border-radius: 9px;
  }

  .notifications-header {
    padding-inline: 11px;
  }

  .notifications-header .btn,
  .notifications-header button {
    padding-inline: 7px;
    font-size: 0.65rem;
  }

  .notification-item {
    padding: 11px;
  }

  .comparison-action-bar,
  .deal-status-banner {
    padding: 11px;
  }

  .comparison-allocation-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .deal-header-actions,
  .offer-confirmation-actions,
  .deal-status-banner > .cluster {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .deal-header-actions .btn,
  .deal-header-actions button,
  .offer-confirmation-actions .btn,
  .offer-confirmation-actions button,
  .deal-status-banner > .cluster .btn,
  .deal-status-banner > .cluster button {
    width: 100%;
    min-width: 0;
    justify-content: center;
    white-space: nowrap;
  }

  .deal-position-table {
    min-width: 680px;
  }

  .deal-event {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 9px;
  }

  .deal-event-icon {
    width: 30px;
    height: 30px;
  }

  .deal-event:not(:last-child)::after {
    top: 39px;
    left: 14px;
  }

  .document-request-card {
    padding: 11px;
  }

  .document-position-option {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .document-position-option small {
    grid-column: 2;
  }

  .modal--document-request {
    max-height: calc(100dvh - 10px);
    border-radius: 9px;
  }
}

@media (max-width: 640px) {
  .topbar-actions .notifications-wrap .icon-btn {
    display: grid;
  }

  .topbar-actions > .topbar-notification-settings {
    display: grid;
  }

  .comparison-action-bar {
    bottom: calc(62px + env(safe-area-inset-bottom, 0px));
  }

  .comparison-table th:first-child,
  .comparison-table td:first-child {
    width: 180px;
    min-width: 180px;
    max-width: 180px;
  }

  .comparison-table th:nth-child(2),
  .comparison-table td:nth-child(2) {
    position: static;
    width: 82px;
    min-width: 82px;
    box-shadow: none;
  }

  .chat-thread-header > .cluster {
    justify-content: flex-end;
  }

  .modal--notification-settings {
    width: 100%;
    max-height: calc(100dvh - 10px);
  }

  .notification-settings-body {
    padding: 13px;
    gap: 10px;
  }

  .notification-settings-section {
    padding: 13px;
  }

  .notification-master-row,
  .notification-address-row {
    align-items: stretch;
    flex-direction: column;
    gap: 9px;
  }

  .notification-checkbox-control {
    width: fit-content;
  }

  .notification-address-row {
    position: relative;
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
  }

  .notification-address-row .btn {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: center;
  }

  .notification-schedule-grid,
  .notification-quiet-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .notification-rule {
    grid-template-columns: auto 32px minmax(0, 1fr);
    min-height: 70px;
    padding: 9px;
  }

  .notification-rule-channel {
    grid-column: 2 / -1;
    width: fit-content;
  }

  .notification-rule-icon {
    width: 32px;
    height: 32px;
  }

  .notification-timezone-field {
    max-width: none;
  }

  .notification-settings-footnote {
    flex: 1 0 100%;
    margin: 0 0 2px;
    text-align: center;
  }
}

@media (max-width: 390px) {
  .notifications-read-all {
    max-width: 84px;
    padding-inline: 5px;
    line-height: 1.15;
    white-space: normal;
  }

  .notification-settings-header p {
    display: none;
  }

  .notification-transport-note {
    padding: 10px;
  }

  .notification-section-heading {
    gap: 9px;
  }

  .notification-section-heading > div {
    gap: 8px;
  }

  .notification-inline-check {
    padding-inline: 7px;
  }
}

@media (max-width: 360px) {
  .topbar {
    padding-inline: 10px;
    gap: 6px;
  }

  .topbar-actions {
    min-width: 0;
    gap: 4px;
  }

  .topbar-actions > .segmented button {
    padding-inline: 7px;
    font-size: 0.72rem;
  }

  .topbar-actions > .segmented .role-label-full {
    display: none;
  }

  .topbar-actions > .segmented .role-label-short {
    display: inline;
  }

  .topbar-actions .icon-btn,
  .topbar-actions .notifications-wrap {
    flex: 0 0 auto;
  }
}

/* Buyer deal search and status filters. */
.deal-filter-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  align-items: end;
  margin-bottom: 16px;
  padding: 12px;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
}

.deal-filter-toolbar .field {
  margin: 0;
}

.deal-filter-search-control {
  position: relative;
}

.deal-filter-search-control input {
  padding-left: 36px;
  background: var(--surface);
}

.deal-filter-search-control > svg {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 11px;
  width: 17px;
  height: 17px;
  color: var(--text-faint);
  pointer-events: none;
  transform: translateY(-50%);
}

.deal-filter-status {
  display: grid;
  min-width: 0;
  margin: 0;
  padding: 0;
  gap: 6px;
  border: 0;
}

.deal-filter-status legend {
  padding: 0;
}

.deal-filters button {
  gap: 6px;
}

.deal-filters [aria-pressed="true"] {
  border-color: #d4dee7;
  background: #ffffff;
  color: #17426e;
  box-shadow: 0 1px 3px rgb(17 38 63 / 7%);
}

.deal-filter-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 1100px) {
  .deal-filter-toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .deal-filter-search {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .deal-filter-toolbar {
    grid-template-columns: minmax(0, 1fr);
    padding: 10px;
    gap: 10px;
  }

  .deal-filter-search,
  .deal-filter-status,
  .deal-filter-actions {
    grid-column: 1;
    width: 100%;
  }

  .deal-filter-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .deal-filter-status .segmented {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  .deal-filter-status .segmented button {
    min-width: 0;
    white-space: normal;
  }

  .deal-filter-actions .btn {
    width: 100%;
  }
}

@media (min-width: 901px) and (max-width: 1280px) {
  [data-testid="marketplace"] .market-results-list {
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
  }
}

/* Chat workspace fills the screen; only the message history scrolls. */
@media (min-width: 901px) {
  .page:has(> [data-testid="chats"]) {
    padding: 8px 12px;
  }

  [data-testid="chats"] .chat-layout {
    height: 100%;
    max-height: none;
  }
}

@media (min-width: 1281px) {
  [data-testid="chats"] .chat-layout {
    grid-template-columns: minmax(300px, 320px) minmax(420px, 1fr) minmax(260px, 300px);
  }
}

@media (min-width: 901px) and (max-width: 1280px) {
  [data-testid="chats"] .chat-layout {
    grid-template-columns: minmax(270px, 300px) minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  [data-testid="chats"] .chat-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 104px minmax(0, 1fr);
    width: 100%;
    max-width: 100%;
  }

  [data-testid="chats"] .conversation-list {
    display: flex;
    width: 100%;
    max-width: 100%;
    height: 104px;
    min-height: 0;
    overflow-x: auto;
    overflow-y: hidden;
  }

  [data-testid="chats"] .conversation {
    flex: 0 0 min(250px, 78vw);
    min-width: 0;
  }

  [data-testid="chats"] .chat-thread {
    width: 100%;
    min-width: 0;
    height: 100%;
  }

  [data-testid="chats"] .chat-thread-header {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  [data-testid="chats"] .chat-thread-header > div:first-child {
    flex: 1 1 170px;
    min-width: 0;
  }

  [data-testid="chats"] .chat-thread-header > .cluster {
    flex-wrap: nowrap;
    max-width: 100%;
    overflow-x: auto;
  }
}

@media (max-width: 640px) {
  [data-testid="chats"] .chat-composer {
    width: 100%;
    min-width: 0;
    padding: 8px;
  }
}
