/* Workspace navigation and fixed content header. */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  z-index: 30;
  height: 5px;
  background: var(--brand);
  pointer-events: none;
}

.mobile-menu-toggle,
.mobile-menu-close,
.mobile-sidebar-scrim {
  display: none;
}

.mobile-sidebar-scrim[hidden] {
  display: none !important;
}

.app-shell {
  width: 100%;
  max-width: none;
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-items: start;
  column-gap: 24px;
  margin: 0;
  padding: 0 24px 28px 0;
}

.workspace-sidebar {
  grid-column: 1;
  grid-row: 1 / 4;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  width: 238px;
  min-height: 0;
  height: 100vh;
  height: 100dvh;
  padding: 28px 13px 16px;
  border: 1px solid #d5e4ea;
  border-top: 0;
  border-bottom: 0;
  border-radius: 0;
  background: #f8fcfd;
  box-shadow: 0 12px 32px rgba(23, 77, 98, .06);
  overflow-y: auto;
}

.workspace-sidebar-brand {
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 4px 11px 17px;
  border-bottom: 1px solid #dce9ee;
}

.workspace-sidebar-brand img {
  display: block;
  width: min(100%, 190px);
  height: auto;
}

.workspace-sidebar-context {
  display: grid;
  gap: 3px;
  min-width: 0;
  margin: auto 11px 12px;
}

.workspace-sidebar-context[hidden] {
  display: none;
}

.workspace-sidebar-context:not([hidden]) + .workspace-sidebar-bottom {
  margin-top: 0;
}

.workspace-sidebar-context span {
  color: #667085;
  font-size: .64rem;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.workspace-sidebar-context strong {
  color: #344054;
  font-size: .79rem;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.workspace-nav {
  display: grid;
  align-content: start;
  gap: 5px;
  padding-top: 18px;
}

.workspace-nav button,
.workspace-sidebar-bottom button,
.workspace-sidebar-link {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 45px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #344054;
  font-size: .91rem;
  font-weight: 750;
  text-align: left;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.workspace-nav button svg,
.workspace-sidebar-bottom button svg,
.workspace-sidebar-link svg {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.workspace-nav button:hover,
.workspace-nav button:focus-visible,
.workspace-sidebar-bottom button:hover,
.workspace-sidebar-bottom button:focus-visible,
.workspace-sidebar-link:hover,
.workspace-sidebar-link:focus-visible {
  border-color: #c7dfe8;
  background: #edf7fa;
  color: var(--brand-dark);
}

.workspace-nav button[aria-current="page"],
.workspace-nav button.active,
.workspace-sidebar-bottom button[aria-current="page"] {
  border-color: #bfdbe6;
  background: #e3f2f7;
  color: #174d62;
  box-shadow: inset 3px 0 0 var(--brand);
}

.workspace-nav button[hidden] {
  display: none !important;
}

.workspace-nav button:disabled,
.workspace-nav button:disabled:hover {
  border-color: transparent;
  background: transparent;
  color: #98a2b3;
  box-shadow: none;
  cursor: not-allowed;
}

.workspace-sidebar-bottom {
  display: grid;
  gap: 5px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid #dce9ee;
}

.workspace-sidebar-bottom #supportMenuToggle {
  gap: 8px;
  font-size: .84rem;
  white-space: nowrap;
}

#accountMenuToggle[aria-expanded="true"],
#supportMenuToggle[aria-expanded="true"] {
  border-color: #bfdbe6;
  background: #e3f2f7;
  color: var(--brand-dark);
}

.account-quick-menu {
  position: fixed;
  z-index: 40;
  width: min(340px, calc(100vw - 20px));
}

.account-quick-menu,
.history-tools-popover {
  padding: 7px;
  border: 1px solid #cbdde5;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 18px 46px rgba(22, 42, 53, .2);
}

.history-tools-popover {
  width: max-content;
  min-width: min(150px, calc(100vw - 24px));
  max-width: min(340px, calc(100vw - 24px));
}

.account-quick-menu[hidden] {
  display: none;
}

.account-quick-menu-head {
  display: grid;
  gap: 2px;
  padding: 10px 11px 11px;
}

.account-quick-menu-head strong {
  color: var(--ink);
  font-size: .94rem;
}

.account-quick-menu-head span {
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.3;
}

.account-quick-menu-account-head {
  display: flex;
  align-items: center;
  gap: 11px;
}

.account-quick-menu-head .account-quick-menu-avatar {
  display: grid;
  flex: 0 0 43px;
  width: 43px;
  height: 43px;
  place-items: center;
  border-radius: 50%;
  background: #e3f2f7;
  color: var(--brand-dark);
  font-size: .84rem;
  font-weight: 850;
  letter-spacing: .02em;
}

.account-quick-menu-identity {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.account-quick-menu-identity strong {
  overflow-wrap: anywhere;
  line-height: 1.2;
}

.account-quick-menu-identity #accountQuickMenuStatus {
  overflow-wrap: anywhere;
}

.account-quick-menu > button,
.account-quick-menu > a,
.history-tools-item {
  display: flex;
  width: 100%;
  min-height: 38px;
  align-items: center;
  gap: 11px;
  padding: 8px 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #344054;
  font: inherit;
  font-size: .85rem;
  font-weight: 750;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.account-quick-menu > button svg,
.account-quick-menu > a svg,
.history-tools-item > svg {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.account-quick-menu > button:hover,
.account-quick-menu > button:focus-visible,
.account-quick-menu > a:hover,
.account-quick-menu > a:focus-visible,
.history-tools-item:hover,
.history-tools-item:focus-visible {
  outline: none;
  background: #edf7fa;
  color: var(--brand-dark);
}

.history-tools-item > span {
  flex: 1;
  min-width: 0;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.history-tools-item > .history-tools-chevron {
  flex: 0 0 17px;
  margin-left: auto;
}

.history-tools-item.history-tools-danger {
  color: var(--danger);
}

.history-tools-item.history-tools-danger:hover,
.history-tools-item.history-tools-danger:focus-visible {
  background: #fff1f0;
  color: var(--danger);
}

#accountQuickMenu [data-account-quick="logout"]:hover,
#accountQuickMenu [data-account-quick="logout"]:focus-visible {
  background: #fff1f0;
  color: var(--danger);
}

.account-quick-menu > button:disabled,
.history-tools-item:disabled {
  color: #98a2b3;
  cursor: not-allowed;
}

.account-quick-menu > button:disabled:hover,
.history-tools-item:disabled:hover {
  background: transparent;
}

.account-quick-menu-divider,
.history-tools-divider {
  height: 1px;
  border: 0;
  margin: 6px 8px;
  background: #e4ebef;
}

.modal:has(.setup-guide) {
  display: flex;
  flex-direction: column;
  width: min(1160px, 100%);
  max-width: min(1160px, calc(100vw - 36px));
  height: min(90dvh, 1000px);
  overflow: hidden;
}

.modal:has(.setup-guide) > .panel-header {
  flex: 0 0 auto;
}

.modal:has(.setup-guide) > .panel-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.modal:has(.setup-guide) .setup-guide {
  height: 100%;
  min-height: 0;
}

.setup-guide-content {
  display: grid;
  grid-template-columns: minmax(190px, 220px) minmax(0, 1fr);
  align-items: stretch;
  gap: 14px;
  height: 100%;
  min-height: 0;
}

.setup-guide-content .setup-guide-nav {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 5px;
  min-height: 0;
}

.setup-guide-content .setup-guide-step {
  padding: 8px 10px;
}

.setup-guide-content .setup-guide-step em {
  white-space: normal;
}

.setup-guide-content .setup-guide-main {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  min-width: 0;
  min-height: 0;
}

.setup-guide-content .setup-guide-stage {
  min-width: 0;
  min-height: 0;
  align-content: start;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

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

.setup-guide-intro-grid article {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f8fafb;
}

.setup-guide-intro-grid strong,
.setup-guide-intro-grid span {
  display: block;
}

.setup-guide-intro-grid strong {
  margin-bottom: 4px;
  color: var(--ink);
}

.setup-guide-intro-grid span {
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.45;
}

@media (max-width: 780px) {
  .modal:has(.setup-guide) {
    height: auto;
    max-height: 90dvh;
    overflow-y: auto;
  }
  .modal:has(.setup-guide) > .panel-body { overflow: visible; }
  .modal:has(.setup-guide) .setup-guide,
  .setup-guide-content { height: auto; }
  .setup-guide-content { grid-template-columns: minmax(0, 1fr); }
  .setup-guide-content .setup-guide-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .setup-guide-content .setup-guide-main { grid-template-rows: auto auto; }
  .setup-guide-content .setup-guide-stage { overflow: visible; }
  .setup-guide-intro-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (min-width: 781px) and (max-height: 700px) {
  .setup-guide-content .setup-guide-nav {
    overflow-y: auto;
    scrollbar-gutter: stable;
  }
}

.workspace-nav-parent .workspace-nav-chevron {
  flex: 0 0 18px;
  align-self: center;
  width: 18px;
  height: 18px;
  margin-left: auto;
  stroke-width: 2.2;
  transition: transform .16s ease;
}

.workspace-nav-group > .workspace-nav-parent {
  width: 100%;
}

.workspace-nav-parent[aria-expanded="true"] .workspace-nav-chevron {
  transform: rotate(180deg);
}

.workspace-nav-submenu {
  display: grid;
  gap: 3px;
  margin: 4px 0 10px 22px;
  padding-left: 11px;
  border-left: 1px solid #cbdfe7;
}

.workspace-nav-submenu[hidden],
.workspace-nav-submenu button[hidden] {
  display: none !important;
}

.workspace-nav-submenu button {
  min-height: 35px;
  padding: 7px 9px;
  font-size: .78rem;
  line-height: 1.25;
}

.workspace-nav-submenu button[aria-current="page"] {
  border-color: #c7e4ed;
  background: #f1f9fb;
  color: #174d62;
  box-shadow: inset 2px 0 0 var(--brand);
}

.topbar,
.layout,
.app-footer {
  grid-column: 2;
  min-width: 0;
}

.topbar {
  margin-bottom: 0;
  padding: 17px 2px 12px;
  border-bottom: 1px solid #dce9ee;
}

.topbar .brand-mark {
  display: none;
}

.topbar .brand {
  gap: 0;
}

.topbar h1 {
  font-size: clamp(1.75rem, 2.2vw, 2.25rem);
}

.topbar #clearFormBtn svg {
  width: 18px;
  height: 18px;
}

body:not([data-workspace-view="comparison"]) .topbar #clearFormBtn {
  display: none;
}

.layout {
  padding-top: 12px;
  grid-template-columns: minmax(390px, 420px) minmax(0, 1fr) minmax(275px, 285px);
  align-items: start;
}

body[data-workspace-view="comparison"] .comparison-form .panel-header {
  padding: 16px 18px 13px;
}

body[data-workspace-view="comparison"] .comparison-form .panel-body {
  padding: 16px;
}

body[data-workspace-view="comparison"] .guided-form {
  gap: 14px;
}

body[data-workspace-view="comparison"] .form-step {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfd;
}

body[data-workspace-view="comparison"] .form-step-action {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
}

body[data-workspace-view="comparison"] .form-step-action .step-marker,
body[data-workspace-view="comparison"] .form-step-action h3 {
  display: none;
}

body[data-workspace-view="comparison"] .step-marker {
  width: 28px;
  height: 28px;
  font-size: .82rem;
}

body[data-workspace-view="comparison"] .step-content {
  gap: 7px;
}

body[data-workspace-view="comparison"] .step-content h3 {
  color: var(--ink);
  font-size: .9rem;
  letter-spacing: normal;
  text-transform: none;
}

body[data-workspace-view="comparison"] .form-step .form-grid {
  gap: 9px;
}

body[data-workspace-view="comparison"] .form-step .field {
  gap: 4px;
}

body[data-workspace-view="comparison"] .extra-step-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

body[data-workspace-view="comparison"] .extra-step-heading h3 {
  min-width: 0;
}

body[data-workspace-view="comparison"] .extras-filter {
  flex: 0 1 145px;
  min-width: 122px;
  max-width: 160px;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: visible;
}

body[data-workspace-view="comparison"] .extras-filter select {
  width: 100%;
  min-height: 32px;
  padding: 5px 28px 5px 8px;
  background-position: right 7px center;
  background-size: 14px 14px;
  font-size: .76rem;
}

body[data-workspace-view="comparison"] #calculateBtn {
  width: 100%;
  min-height: 44px;
}

body[data-workspace-view="comparison"] .extras-grid {
  max-height: min(45vh, 390px);
  gap: 6px;
}

body[data-workspace-view="comparison"] .extra-card {
  padding: 9px 10px;
}

body[data-workspace-view="comparison"] .extra-card-body {
  gap: 5px;
}

.history-invoice-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 2px 4px;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 850;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
}

.history-invoice-toggle.open {
  color: #b42318;
}

.history-invoice-toggle.received {
  color: var(--brand);
}

.history-invoice-toggle:hover:not(:disabled),
.history-invoice-toggle:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.history-invoice-toggle:disabled {
  opacity: 1;
  cursor: default;
}

.history-invoice-toggle[aria-busy="true"] {
  opacity: .65;
  cursor: progress;
}

body[data-workspace-view="comparison"] .extra-price-pill {
  min-height: 23px;
  padding: 2px 7px;
}

body[data-workspace-view="comparison"] .comparison-results,
body[data-workspace-view="history"] .history-section,
body[data-workspace-view="stats"] #statsPanel,
body[data-workspace-view="settings"] #adminPanel {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body[data-workspace-view="comparison"] .comparison-results > .panel-header,
body[data-workspace-view="history"] .history-section > .panel-header {
  padding: 0 0 14px;
  border-bottom: 0;
  background: transparent;
}

body[data-workspace-view="comparison"] .comparison-results > .panel-body,
body[data-workspace-view="history"] .history-section > .panel-body {
  padding: 0;
}

body[data-workspace-view="comparison"] .comparison-results > .subscription-banner {
  margin-inline: 0;
}

body[data-workspace-view="comparison"] .comparison-results > .demo-preview-notice {
  margin-bottom: 14px;
}

body[data-workspace-view="comparison"] #quoteCount[hidden] {
  display: none;
}

body[data-workspace-view="history"] .history-section .history-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: nowrap;
  cursor: default;
}

.history-toolbar-search,
.history-toolbar-actions {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
}

.history-toolbar-search {
  flex: 1 1 260px;
}

.history-toolbar-search .history-search {
  flex: 0 1 290px;
  width: 290px;
  min-width: 150px;
}

.history-toolbar-search .badge {
  flex: 0 0 auto;
  white-space: nowrap;
}

.history-section .history-panel-header #historyToolbar {
  flex: 0 0 auto;
  width: auto;
  display: flex;
  justify-content: flex-end;
}

.history-toolbar-actions > .btn,
.history-columns-control > .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 7px 10px;
  white-space: nowrap;
  font-size: .82rem;
}

.history-toolbar-actions > .btn svg,
.history-columns-control > .btn svg {
  width: 17px;
  height: 17px;
}

.history-toolbar-actions > .btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.history-toolbar-actions [data-history-edit-action][hidden] {
  display: none !important;
}

.history-columns-control {
  position: relative;
}

.history-columns-control .history-column-popover {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  z-index: 130;
  width: 220px;
  max-height: min(60vh, 450px);
  overflow-y: auto;
  margin: 0;
  background: #fff;
  box-shadow: var(--shadow);
}

.history-tools-trigger {
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
}

.history-filters-control { position: relative; flex: 0 0 auto; }
.history-filters-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  min-width: 38px;
  height: 38px;
  padding: 0;
}
.history-filters-trigger svg { width: 18px; height: 18px; }
.history-filters-trigger.has-active-filters { color: var(--brand); border-color: var(--brand); background: #edf7fa; }
.history-filter-count {
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  place-items: center;
  min-width: 17px;
  height: 17px;
  padding: 0 3px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: .65rem;
  font-weight: 800;
}
.history-filter-count[hidden] { display: none; }
#historyToolsMenu, #historySelectionMenu {
  position: fixed;
  right: auto;
  z-index: 130;
  max-width: calc(100vw - 24px);
  box-sizing: border-box;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.modal:has(#historyFiltersMenu) { width: min(680px, calc(100vw - 24px)); }
#historyFiltersMenu .history-worklist { padding: 0; }
#historyFiltersMenu .workflow-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
#historyFiltersMenu .workflow-filters input, #historyFiltersMenu .workflow-filters select { width: 100%; min-width: 0; }
.history-filter-results { margin: 18px 0; color: var(--muted); font-size: .85rem; }
#historyToolsMenu .history-column-popover { max-height: 240px; overflow-y: auto; }
#historyToolsMenu .history-tools-item:disabled, #historySelectionMenu .history-tools-item:disabled { opacity: .45; cursor: not-allowed; }
.history-selection-control { position:relative; flex:0 0 auto; }
.history-selection-trigger { border:1px solid transparent; font-family:inherit; cursor:pointer; }
.history-selection-trigger:not(:disabled):hover { border-color:#b5d5df; }
.history-selection-trigger.has-selection { background:#e2f1f5; color:var(--brand-dark); border-color:#b5d5df; cursor:pointer; }
.history-selection-trigger.has-selection:hover { background:#d4eaf0; }
.history-selection-trigger:focus-visible { outline:2px solid var(--brand); outline-offset:3px; }
.history-selection-trigger:disabled { opacity:1; cursor:default; }
.history-selection-menu { padding:8px; }
.history-selection-menu[hidden] { display: none; }
.history-select-all input { width: 18px; min-width:18px; height:18px; min-height:18px; margin:0; padding:0; flex:0 0 18px; }
@media (max-width: 480px) {
  #historyFiltersMenu .workflow-filters { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 1200px) {
  body[data-workspace-view="history"] .history-section .history-panel-header {
    flex-wrap: wrap;
  }

  .history-section .history-panel-header #historyToolbar {
    flex: 1 1 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

@media (max-width: 600px) {
  .history-toolbar-search,
  .history-section .history-panel-header #historyToolbar {
    flex: 1 1 100%;
  }

  .history-toolbar-search .history-search {
    flex: 1 1 auto;
    width: auto;
  }
}

body[data-workspace-view="settings"] #adminPanel > .tabs,
body[data-workspace-view="stats"] #statsPanel .stats-panel-tab-list,
body[data-workspace-view="settings"] .settings-view-label,
body[data-workspace-view="stats"] .stats-view-header > div > span {
  display: none !important;
}

body[data-workspace-view="settings"] #adminPanel .admin-section,
body[data-workspace-view="stats"] #statsPanel .stats-panel-content {
  padding: 0;
}

body[data-workspace-view="settings"] .workspace-preview-note {
  margin: 0 0 19px;
}

body[data-workspace-view="settings"] #adminPanel .admin-helper {
  margin: 20px 0 0;
}

body[data-workspace-view="stats"] #statsPanel .stats-panel-tabs {
  position: absolute;
  top: 0;
  right: 0;
  justify-content: flex-end;
  padding: 0;
  border: 0;
  background: transparent;
}

body[data-workspace-view="stats"] #statsPanel {
  position: relative;
}

body[data-workspace-view="stats"] #statsPanel .stats-view-header {
  padding-right: 145px;
}

body[data-workspace-view="stats"] #statsPanel .stats-content {
  gap: 11px;
}

body[data-workspace-view="stats"] #statsPanel .stats-view-header h2 {
  font-size: 1.18rem;
}

body[data-workspace-view="stats"] #statsPanel .stats-view-header p {
  margin-top: 3px;
  font-size: .82rem;
}

body[data-workspace-view="stats"] #statsPanel .stats-filter-bar {
  gap: 8px;
  padding: 9px;
}

body[data-workspace-view="stats"] #statsPanel .stats-filter-bar select {
  min-height: 34px;
  padding: 5px 9px;
}

body[data-workspace-view="stats"] #statsPanel .stats-card-grid,
body[data-workspace-view="stats"] #statsPanel .stats-insight-grid {
  gap: 8px;
}

body[data-workspace-view="stats"] #statsPanel .stats-card-grid-wide {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body[data-workspace-view="stats"] #statsPanel .stats-overview-kpis {
  gap: 6px;
}

body[data-workspace-view="stats"] #statsPanel .stats-overview-kpis .stats-card {
  gap: 2px;
  padding: 8px 9px;
  background: #f8fafc;
}

body[data-workspace-view="stats"] #statsPanel .stats-overview-kpis .stats-card strong {
  font-size: 1.05rem;
}

body[data-workspace-view="stats"] #statsPanel .stats-overview-kpis .stats-card small {
  font-size: .68rem;
}

body[data-workspace-view="stats"] #statsPanel .stats-overview-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

body[data-workspace-view="stats"] #statsPanel .stats-overview-chart-grid .stats-visual-card {
  min-width: 0;
  gap: 6px;
  padding: 10px;
  background: #fbfcfd;
}

body[data-workspace-view="stats"] #statsPanel .stats-overview-chart-grid .stats-visual-head h3 {
  font-size: .86rem;
}

body[data-workspace-view="stats"] #statsPanel .stats-overview-chart-grid .stats-visual-head p {
  font-size: .69rem;
}

body[data-workspace-view="stats"] #statsPanel .stats-overview-chart-grid .stats-chart svg {
  max-height: 155px;
}

body[data-workspace-view="stats"] #statsPanel .stats-overview-chart-grid .stats-bars {
  gap: 6px;
}

body[data-workspace-view="stats"] #statsPanel .stats-overview-chart-grid .stats-bar-row {
  grid-template-columns: minmax(92px, .8fr) minmax(24px, 1fr) auto;
  gap: 6px;
  font-size: .7rem;
}

body[data-workspace-view="stats"] #statsPanel .stats-overview-chart-grid .stats-bar-row strong {
  font-size: .7rem;
}

body[data-workspace-view="stats"] #statsPanel .stats-overview-chart-grid .stats-bar-row div {
  height: 6px;
}

body[data-workspace-view="stats"] #statsPanel .stats-shipment-mix {
  display: grid;
  gap: 10px;
}

body[data-workspace-view="stats"] #statsPanel .stats-shipment-segments {
  display: flex;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9eef2;
}

body[data-workspace-view="stats"] #statsPanel .stats-shipment-segments i {
  display: block;
  flex: 0 0 auto;
  height: 100%;
}

body[data-workspace-view="stats"] #statsPanel .stats-shipment-mix-legend {
  display: grid;
  gap: 5px;
}

body[data-workspace-view="stats"] #statsPanel .stats-shipment-mix-legend > div {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: .73rem;
}

body[data-workspace-view="stats"] #statsPanel .stats-shipment-mix-legend i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

body[data-workspace-view="stats"] #statsPanel .stats-shipment-mix-legend strong {
  color: var(--ink);
}

body[data-workspace-view="stats"] #statsPanel .stats-card {
  padding: 8px 11px;
}

body[data-workspace-view="stats"] #statsPanel .stats-card strong {
  font-size: 1.18rem;
}

body[data-workspace-view="stats"] #statsPanel .stats-section {
  gap: 6px;
}

body[data-workspace-view="stats"] #statsPanel .stats-primary-grid,
body[data-workspace-view="stats"] #statsPanel .stats-chart-grid {
  gap: 10px;
}

body[data-workspace-view="stats"] #statsPanel .stats-visual-card {
  gap: 8px;
  padding: 11px;
}

body[data-workspace-view="stats"] #statsPanel .stats-visual-head h3 {
  font-size: .9rem;
}

body[data-workspace-view="stats"] #statsPanel .stats-visual-head p {
  font-size: .73rem;
}

body[data-workspace-view="stats"] #statsPanel .stats-chart svg {
  max-height: 180px;
}

body[data-workspace-view="stats"] #statsPanel .stats-bars {
  gap: 7px;
}

body[data-workspace-view="stats"] #statsPanel .stats-donut {
  width: min(100%, 125px);
}

body[data-workspace-view="stats"] #statsPanel .stats-donut-layout {
  gap: 10px;
}

body[data-workspace-view="stats"] #statsPanel .stats-donut strong {
  font-size: 1.15rem;
}

body[data-workspace-view="stats"] #statsPanel .stats-donut span {
  max-width: 74px;
  margin-inline: auto;
  font-size: .61rem;
  line-height: 1.1;
}

body[data-workspace-view="stats"] #statsPanel .stats-donut-track,
body[data-workspace-view="stats"] #statsPanel .stats-donut-segment {
  stroke-width: 20;
}

body[data-workspace-view="stats"] #statsPanel .stats-donut-legend {
  gap: 6px;
}

body[data-workspace-view="stats"] #statsPanel .stats-primary-grid:not(.equal) > .stats-visual-card:last-child .stats-donut-layout {
  grid-template-columns: 105px minmax(0, 1fr);
  gap: 8px;
}

body[data-workspace-view="stats"] #statsPanel .stats-primary-grid:not(.equal) > .stats-visual-card:last-child .stats-donut {
  width: 105px;
}

body[data-workspace-view="stats"] #statsPanel .stats-primary-grid:not(.equal) > .stats-visual-card:last-child .stats-donut-legend {
  justify-self: stretch;
  max-width: none;
  padding-inline: 0;
}

body[data-workspace-view="stats"] #statsPanel .stats-invoice-open-total {
  margin-top: 6px;
  padding-top: 7px;
}

body[data-workspace-view="stats"] #statsPanel .stats-insight {
  padding: 9px;
}

body[data-workspace-view="stats"] #statsPanel .stats-table-wrap {
  max-height: min(40vh, 340px);
}

@media (max-width: 700px) {
  body[data-workspace-view="stats"] #statsPanel .stats-panel-tabs {
    position: static;
    margin-bottom: 9px;
  }

  body[data-workspace-view="stats"] #statsPanel .stats-view-header {
    padding-right: 0;
  }
}

.comparison-form,
.comparison-results,
.comparison-fuel {
  min-width: 0;
}

.comparison-fuel {
  overflow: hidden;
}

.comparison-fuel-heading {
  padding: 13px 17px 17px;
  border-bottom: 1px solid var(--line);
}

.comparison-fuel-heading h2 {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 1.06rem;
  line-height: 1.2;
}

.comparison-fuel-heading p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 750;
}

.comparison-fuel-eyebrow {
  color: var(--brand);
  font-size: .7rem;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.comparison-fuel-body {
  display: grid;
  gap: 16px;
  padding: 12px 17px 17px;
}

.comparison-diesel {
  display: grid;
  gap: 4px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.comparison-diesel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.comparison-diesel-refresh {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 25px;
  height: 25px;
  padding: 2px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.comparison-diesel-refresh svg {
  width: 21px;
  height: 21px;
}

.comparison-diesel-refresh:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.comparison-diesel-refresh:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.comparison-diesel-refresh.is-updating svg {
  animation: comparison-diesel-spin .9s linear infinite;
}

@keyframes comparison-diesel-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .comparison-diesel-refresh.is-updating svg { animation: none; }
}

.comparison-diesel span,
.comparison-diesel small,
.comparison-diesel-source {
  color: var(--muted);
  font-size: .79rem;
  line-height: 1.35;
}

.comparison-diesel-source {
  width: fit-content;
  text-decoration: none;
}

.comparison-diesel-source:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.comparison-diesel-source:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.comparison-diesel span {
  font-weight: 750;
}

.comparison-diesel strong {
  color: var(--ink);
  font-size: 1.1rem;
}

.comparison-fuel-rates {
  display: grid;
  gap: 10px;
}

.comparison-fuel-rate {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  font-size: .82rem;
  line-height: 1.3;
}

.comparison-fuel-rate span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.comparison-fuel-rate strong {
  flex: 0 0 auto;
  color: var(--brand-dark);
}

.comparison-fuel-empty {
  margin: 0;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.45;
}

.comparison-fuel-settings {
  width: 100%;
  white-space: normal;
  font-size: .8rem;
}

.comparison-fuel-settings[hidden] {
  display: none;
}

body[data-workspace-view="comparison"] .summary-grid {
  display: none;
}

body[data-workspace-view="comparison"] .quote-card {
  display: block;
  padding: 18px;
}

.comparison-offer-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.comparison-offer-head > div:first-child {
  min-width: 0;
}

.comparison-offer-head .muted {
  margin-top: 5px;
  font-size: .85rem;
}

.comparison-offer-total {
  display: grid;
  justify-items: end;
  gap: 6px;
  flex: 0 0 auto;
  text-align: right;
}

.comparison-offer-total .price {
  font-size: 1.45rem;
  white-space: nowrap;
}

.comparison-best-label {
  padding: 4px 8px;
  border-radius: 999px;
  background: #e5f5eb;
  color: #28734a;
  font-size: .7rem;
  font-weight: 850;
}

.comparison-offer-lines {
  display: grid;
  margin-top: 17px;
  border-top: 1px solid var(--line);
}

.comparison-offer-lines > div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: .84rem;
  line-height: 1.3;
}

.comparison-offer-lines > div strong {
  flex: 0 0 auto;
  color: var(--ink);
  white-space: nowrap;
}

body[data-workspace-view="comparison"] .quote-card-actions {
  align-items: flex-end;
  margin-top: 14px;
}

body[data-workspace-view="comparison"] .quote-card-actions .btn {
  width: auto;
}

body[data-workspace-view="settings"] .carrier-card {
  cursor: pointer;
}

body[data-workspace-view="settings"] .carrier-overview-list {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 14px;
}

body[data-workspace-view="settings"] .carrier-overview-list .carrier-card {
  align-content: start;
  min-height: 162px;
  padding: 20px;
}

body[data-workspace-view="settings"] .carrier-card.selected {
  border-color: #8fc2d1;
  background: #eaf7fa;
  box-shadow: inset 3px 0 0 var(--brand);
}

body[data-workspace-view="settings"] .carrier-card.pending {
  border-style: dashed;
}

body[data-workspace-view="settings"] .carrier-overview-list .carrier-card-title {
  font-size: 1.12rem;
}

body[data-workspace-view="settings"] .carrier-overview-list .carrier-note {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

body[data-workspace-view="settings"] .carrier-overview-list .carrier-card-meta {
  gap: 6px;
}

.carrier-card-open {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  margin-top: 3px;
  color: var(--brand-dark);
  font-size: .8rem;
  font-weight: 850;
}

.carrier-card-open span {
  font-size: 1rem;
}

.carrier-back-link {
  padding: 0;
  margin: 0 0 16px;
  border: 0;
  background: none;
  color: var(--brand-dark);
  font: inherit;
  font-size: .86rem;
  font-weight: 800;
  cursor: pointer;
}

.carrier-back-link:hover,
.carrier-back-link:focus-visible {
  text-decoration: underline;
}

.carrier-inline-panel {
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.fuel-admin-diesel {
  container: fuel-admin-diesel / inline-size;
  display: block;
  width: 620px;
  max-width: 100%;
  margin: 0;
  padding: 0;
  color: var(--ink);
}

.fuel-admin-diesel-content {
  display: grid;
  grid-template-columns: minmax(100px, .6fr) minmax(0, 1.7fr) auto;
  grid-template-areas: "price meta actions";
  align-items: center;
  gap: 16px;
}

.fuel-admin-diesel-price {
  grid-area: price;
  min-width: 0;
}

.fuel-admin-diesel-label {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 3px;
  font-size: .75rem;
  color: var(--muted);
  font-weight: 700;
}

.fuel-admin-diesel-price > strong {
  font-size: 1.2rem;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}

.fuel-admin-diesel-meta {
  grid-area: meta;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding-left: 16px;
  border-left: 1px solid var(--line);
}

.fuel-admin-diesel-meta dt {
  margin-bottom: 4px;
  font-size: .73rem;
  color: var(--muted);
}

.fuel-admin-diesel-meta dd {
  margin: 0;
  font-size: .8rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.fuel-admin-diesel-meta > dl,
.fuel-admin-diesel-source > dl {
  margin: 0;
}

.fuel-admin-diesel-source {
  display: block;
  margin: -6px -8px;
  padding: 6px 8px;
  border-radius: 6px;
  color: inherit;
  text-decoration: none;
}

.fuel-admin-diesel-source:hover,
.fuel-admin-diesel-source:focus-visible {
  color: var(--brand);
  text-decoration: none;
}

.fuel-admin-diesel-source:hover dt,
.fuel-admin-diesel-source:focus-visible dt {
  color: var(--brand);
}

.fuel-admin-diesel-source:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.fuel-admin-diesel-actions {
  grid-area: actions;
}

.fuel-admin-diesel-actions .btn,
.workspace-header-controls .fuel-admin-diesel-actions .btn {
  flex: 0 0 auto;
  width: max-content;
  min-height: 38px;
  padding: 8px 12px;
  font-size: .8rem;
  white-space: nowrap;
  overflow-wrap: normal;
}

.fuel-admin-diesel-actions svg {
  width: 17px;
  height: 17px;
  flex: none;
}

.fuel-admin-diesel-actions .btn:disabled {
  cursor: not-allowed;
  opacity: .55;
}

@container fuel-admin-diesel (max-width: 520px) {
  .fuel-admin-diesel-content {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "price actions";
    gap: 12px;
  }

  .fuel-admin-diesel-meta {
    display: none;
  }
}

.fuel-admin-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 470px), 1fr));
  gap: 14px;
}

.fuel-admin-card {
  display: grid;
  align-content: start;
  gap: 15px;
  min-width: 0;
  container: fuel-card / inline-size;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}

.fuel-admin-card-head,
.fuel-admin-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.fuel-admin-card-head h4 {
  margin: 0 0 3px;
  font-size: 1.08rem;
}

.fuel-admin-card-head p {
  margin: 0;
  color: var(--muted);
  font-size: .83rem;
}

.fuel-admin-form,
.fuel-admin-form .fuel-country-controls {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.fuel-admin-form .fuel-country-control-row {
  grid-template-columns: minmax(0, 1fr) 62px auto;
  gap: 6px;
  padding: 7px 8px;
}

.fuel-admin-form .fuel-country-control-row > div:first-child {
  grid-column: auto;
}

.fuel-admin-form .fuel-country-control-row > .fuel-rate-field {
  width: 62px;
  grid-column: auto;
}

.fuel-country-control-row input {
  text-align: center;
}

.fuel-admin-form .fuel-country-control-row strong,
.fuel-admin-form .fuel-country-control-row [data-fuel-country-main] {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}

.fuel-admin-form .fuel-country-control-row [data-fuel-country-status],
.carrier-inline-section .fuel-country-control-row [data-fuel-country-status] {
  font-size: .72rem;
  line-height: 1.2;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}

.fuel-admin-form .fuel-country-control-row .switch-control {
  gap: 6px;
  font-size: .76rem;
  grid-column: auto;
}

.fuel-admin-form .fuel-country-control-row [data-fuel-country-status] {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.fuel-admin-save-status {
  margin: 0;
  color: var(--muted);
  font-size: .74rem;
  font-weight: 750;
}

.fuel-admin-save-status:empty {
  display: none;
}

.fuel-admin-form .fuel-country-control-row > div:first-child {
  min-width: 0;
}

.fuel-admin-form .fuel-country-control-row small:empty {
  display: none;
}

.fuel-admin-form .fuel-country-control-row .switch-control {
  white-space: nowrap;
}

.switch-label-compact {
  display: none;
}

.fuel-country-control-row .switch-control em > .switch-label-full,
.fuel-country-control-row .switch-control em > .switch-label-compact {
  color: inherit;
  font: inherit;
}

@container fuel-card (max-width: 360px) {
  .fuel-admin-form .fuel-country-control-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "info rate" "info automatic";
    gap: 6px 12px;
  }

  .fuel-admin-form .fuel-country-control-row > div:first-child {
    grid-area: info;
  }

  .fuel-admin-form .fuel-country-control-row > .fuel-rate-field {
    grid-area: rate;
    justify-self: end;
  }

  .fuel-admin-form .fuel-country-control-row .switch-control {
    grid-area: automatic;
    justify-self: end;
  }

  .fuel-admin-form .switch-label-full {
    display: none;
  }

  .fuel-admin-form .switch-label-compact {
    display: inline;
  }
}

.fuel-admin-tiers {
  display: grid;
  gap: 9px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.fuel-admin-tiers-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.fuel-admin-tiers-head > strong {
  font-size: .94rem;
}

.fuel-admin-tiers-head .btn {
  min-height: 36px;
  padding: 6px 10px;
  font-size: .82rem;
}

.fuel-admin-tier-list {
  display: grid;
  gap: 7px;
}

.fuel-admin-tier-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--ink);
  text-align: left;
}

.fuel-admin-tier-item:hover,
.fuel-admin-tier-item:focus-visible {
  border-color: #a3cbd5;
  background: #f1f9fb;
}

.fuel-admin-tier-item span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.fuel-admin-tier-item strong,
.fuel-admin-tier-item small {
  overflow-wrap: anywhere;
}

.fuel-admin-tier-item small {
  color: var(--muted);
}

.fuel-admin-tier-item em {
  flex: none;
  color: var(--primary);
  font-size: .82rem;
  font-style: normal;
  font-weight: 800;
}

.fuel-admin-actions {
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-top: 5px;
}

.fuel-admin-actions [data-fuel-admin-save] {
  margin-left: auto;
}

.fuel-admin-actions [data-fuel-admin-save]:disabled {
  background: #e9edf4;
  border-color: #e9edf4;
  color: #657184;
  cursor: not-allowed;
}

.carrier-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.carrier-summary-grid > div {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.carrier-summary-grid span {
  color: var(--muted);
  font-size: .75rem;
}

.carrier-summary-grid strong {
  overflow-wrap: anywhere;
  font-size: .89rem;
}

.carrier-summary-grid .carrier-summary-wide {
  grid-column: 1 / -1;
}

.carrier-country-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.modal:has(#carrierBasicsPopupForm) {
  width: min(670px, 100%);
  max-width: min(670px, calc(100vw - 36px));
}

.modal:has(#carrierCountriesForm) {
  width: min(760px, 100%);
  max-width: min(760px, calc(100vw - 36px));
}

.modal:has(#carrierFuelTablesForm) {
  width: min(980px, 100%);
  max-width: min(980px, calc(100vw - 36px));
}

.modal:has(#carrierFuelOverview) {
  width: min(760px, 100%);
  max-width: min(760px, calc(100vw - 36px));
}

#carrierFuelOverview {
  padding-top: 0;
  border-top: 0;
}

#carrierFuelOverview > .form-actions {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 0;
}

.modal:has(#fuelTableEditorPopup) {
  height: min(560px, calc(100dvh - 36px));
  max-height: calc(100dvh - 36px);
  overflow: hidden;
}

.modal:has(#fuelTableEditorPopup) .fuel-table-editor-popup {
  height: 100%;
}

.modal:has(#fuelAdminTableForm) {
  display: flex;
  flex-direction: column;
  width: min(760px, 100%);
  max-width: min(760px, calc(100vw - 36px));
  max-height: min(800px, calc(100dvh - 36px));
  overflow: hidden;
}

.modal:has(#fuelAdminTableForm) > .panel-header {
  flex: none;
}

.modal:has(#fuelAdminTableForm) > .panel-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

#fuelAdminTableForm {
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
}

#fuelAdminTableForm .fuel-admin-table-scroll {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 14px 16px 0;
}

#fuelAdminTableForm .fuel-table-card,
#fuelAdminTableForm .fuel-table-body {
  border: 0;
  padding: 0;
}

#fuelAdminTableForm .fuel-tier-add,
.fuel-table-editor-popup-body .fuel-tier-add {
  width: 100%;
  justify-self: stretch;
}

#fuelAdminTableForm .fuel-admin-table-actions {
  flex: none;
  margin-top: 0;
  padding: 12px 0 0;
  border-top: 0;
}

.modal:has(#zoneMatrixForm) {
  width: min(1140px, 100%);
  max-width: min(1140px, calc(100vw - 36px));
}

.modal:has(#serviceEditorForm) {
  width: min(850px, 100%);
  max-width: min(850px, calc(100vw - 36px));
}

body[data-workspace-view="settings"] .carrier-card:hover,
body[data-workspace-view="settings"] .carrier-card:focus-visible {
  border-color: #95c4d1;
  box-shadow: 0 5px 18px rgba(23, 77, 98, .08);
}

.modal:has(.carrier-inline-sections),
.modal:has(#carrierInlineFormHost) {
  width: min(1120px, 100%);
  max-width: min(1120px, calc(100vw - 36px));
}

.carrier-inline-header {
  display: flex;
  position: sticky;
  top: 8px;
  z-index: 5;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 18px;
  padding: 9px 0 15px;
  border-bottom: 1px solid #dce9ee;
  background: var(--bg);
}

.carrier-inline-header > div:first-child {
  flex: 1 1 275px;
  min-width: 0;
}

.carrier-inline-header-actions {
  display: flex;
  flex: 0 1 auto;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.carrier-inline-header-actions .btn {
  min-height: 39px;
  padding: 8px 12px;
  white-space: nowrap;
}

.carrier-inline-header-actions .switch-control {
  margin-right: 5px;
}

.carrier-leave-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(29, 43, 55, .48);
}

.carrier-leave-dialog {
  width: min(480px, 100%);
  padding: 24px;
  border: 1px solid #bfdbe6;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 22px 65px rgba(16, 24, 40, .22);
}

.carrier-leave-dialog h3 {
  margin: 0 0 9px;
  color: var(--ink);
  font-size: 1.2rem;
}

.carrier-leave-dialog p {
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.5;
}

.carrier-leave-actions {
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 9px;
}

.carrier-inline-header h3 {
  margin: 3px 0 5px;
  color: var(--ink);
  font-size: 1.28rem;
}

.carrier-inline-header p {
  margin: 0;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.4;
}

.carrier-inline-sections {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.carrier-inline-section {
  min-width: 0;
  padding: 17px;
  border: 1px solid #d6e4ea;
  border-radius: 10px;
  background: #fbfdfe;
}

.carrier-inline-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.carrier-inline-section-head h4 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
}

.carrier-inline-section-head > span,
.carrier-inline-hint {
  color: var(--muted);
  font-size: .8rem;
}

.carrier-inline-section .form-grid {
  gap: 10px;
}

.carrier-inline-section .field label {
  font-size: .8rem;
}

.carrier-inline-section input,
.carrier-inline-section textarea {
  background: #fff;
}

.carrier-inline-section #carrierInlineFuelForm .form-actions,
.carrier-inline-section #carrierInlineCountriesForm .form-actions {
  justify-content: flex-end;
  margin-top: 12px;
}

.carrier-inline-section #carrierInlineFuelForm .fuel-country-control-row {
  padding: 9px 11px;
}

.carrier-inline-section #carrierInlineFuelForm .fuel-country-control-row input {
  min-height: 38px;
}

.carrier-inline-section > .fuel-admin-tiers {
  margin-top: 16px;
}

.carrier-inline-section textarea {
  min-height: 68px;
}

.carrier-inline-section .form-actions {
  margin-top: 4px;
}

.carrier-inline-section .carrier-country-switches {
  gap: 6px;
}

.carrier-inline-section .carrier-country-switch-row {
  padding: 8px 10px;
}

.carrier-inline-fuel-rates {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 7px;
}

.carrier-inline-fuel-rates > div {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: .8rem;
}

.carrier-inline-fuel-rates strong {
  color: var(--brand-dark);
}

.carrier-inline-hint {
  margin: 11px 0 0;
}

.carrier-inline-country-note {
  margin: -3px 0 12px;
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.45;
}

.carrier-inline-relations {
  padding: 0;
  border: 0;
  background: transparent;
}

.carrier-inline-relations .carrier-detail-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.carrier-inline-relations .carrier-detail-grid > section {
  min-width: 0;
  padding: 17px;
  border: 1px solid #d6e4ea;
  border-radius: 10px;
  background: #fbfdfe;
}

.carrier-detail-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.carrier-detail-section-head h4 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
}

.carrier-detail-section-head .btn {
  width: auto;
  min-height: 36px;
  margin: 0;
  padding: 6px 11px;
  font-size: .82rem;
}

.carrier-detail-card-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 10px;
}

.carrier-inline-relations .carrier-detail-section:first-child .carrier-detail-card-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.carrier-inline-relations .carrier-detail-section:last-child .carrier-detail-card-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.carrier-detail-card {
  min-width: 0;
  align-content: start;
}

.carrier-detail-card .card-actions {
  flex: none;
  align-items: center;
}

.carrier-detail-card .switch-control {
  flex: none;
  margin: 0;
}

.switch-control {
  position: relative;
}

.carrier-inline-form-host {
  min-width: 0;
}

.carrier-inline-form-host > .form-grid {
  gap: 14px;
}

body[data-workspace-view]:not([data-workspace-view="comparison"]) .comparison-form,
body[data-workspace-view]:not([data-workspace-view="comparison"]) .comparison-results,
body[data-workspace-view]:not([data-workspace-view="comparison"]) .comparison-fuel,
body[data-workspace-view]:not([data-workspace-view="history"]) .history-section,
body[data-workspace-view]:not([data-workspace-view="stats"]) #statsPanel,
body[data-workspace-view]:not([data-workspace-view="stats"]) #statsUnavailablePanel,
body[data-workspace-view]:not([data-workspace-view="settings"]) #adminPanel,
body[data-workspace-view]:not([data-workspace-view="team"]) #teamPage {
  display: none !important;
}

body[data-workspace-view]:not([data-workspace-view="comparison"]) .layout {
  grid-template-columns: minmax(0, 1fr);
}

body[data-workspace-view="history"] .history-section .history-panel {
  max-height: none;
}

body[data-workspace-view="history"] .history-table-body {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

.app-footer,
#settingsToStatsBtn,
#statsToSettingsBtn,
#statsPanelCloseBtn,
#settingsLogoutBtn {
  display: none !important;
}

.workspace-landing {
  display: grid;
  gap: 18px;
  align-content: start;
}

.workspace-landing[hidden],
#teamPage[hidden],
#statsUnavailablePanel[hidden] {
  display: none !important;
}

.workspace-team-page {
  min-width: 0;
}

.team-demo-note {
  margin-bottom: 14px;
}

.workspace-team-page .account-team-panel {
  padding: 22px;
  border-color: #d5e4ea;
  border-radius: 12px;
  background: #fff;
}

.workspace-team-page .account-team-head {
  display: none;
}

.workspace-team-page .team-block-title {
  flex-wrap: wrap;
}

.workspace-team-page .team-block-title span {
  text-align: right;
}

.workspace-team-page .account-activity-section {
  margin-top: 22px;
}

.workspace-team-page .account-activity-panel {
  max-height: none;
  overflow: visible;
}

.workspace-team-page .team-member-card-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  align-items: stretch;
  gap: 12px;
}

.workspace-team-page .team-member-card-grid > .team-member-row,
.workspace-team-page .team-invite-card {
  min-width: 0;
  min-height: 200px;
  padding: 10px 13px 14px;
  border-radius: 11px;
  box-sizing: border-box;
}

.workspace-team-page .team-member-card-grid > .team-member-row {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0;
  overflow: hidden;
}

.workspace-team-page .team-member-card-grid .team-card-labels {
  display: flex !important;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  min-height: 25px;
  width: 100%;
  gap: 6px;
  padding-bottom: 8px;
}

.workspace-team-page .team-member-card-grid .team-member-person {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  flex: 1 1 auto;
  gap: 9px;
  text-align: center;
}

.workspace-team-page .team-member-card-grid .team-member-avatar {
  width: 66px;
  height: 66px;
  flex: 0 0 66px;
  font-size: 1.35rem;
  font-weight: 700;
}

.workspace-team-page .team-member-card-grid .team-member-person > div {
  width: 100%;
  margin-left: 0 !important;
  gap: 2px;
}

.workspace-team-page .team-member-card-grid .team-member-person strong {
  font-size: 1rem;
  line-height: 1.2;
}

.workspace-team-page .team-member-card-grid .team-member-person > div > span {
  color: #667085;
  font-size: .8rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.workspace-team-page .team-member-card-grid .team-card-role {
  margin-left: auto;
  max-width: 100%;
  min-height: 25px;
  padding: 3px 9px;
  font-size: .72rem;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}

.workspace-team-page .team-member-card-grid .is-self .team-card-role {
  max-width: calc(100% - 55px);
}

.workspace-team-page .team-member-card-grid .team-self-badge {
  min-height: 25px;
  padding: 3px 9px;
  font-size: .72rem;
}

.workspace-team-page .team-member-card-grid .team-member-row.pending .team-member-actions {
  display: grid;
  grid-auto-flow: row;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  min-width: 0;
  gap: 6px;
  margin-top: 12px;
}

.workspace-team-page .team-member-card-grid .team-member-row.pending .team-member-actions .btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-width: 0;
  min-height: 32px;
  padding: 5px 4px;
  box-sizing: border-box;
  font-size: .69rem;
  white-space: normal;
  line-height: 1.1;
}

.team-self-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 5px 11px;
  border-radius: 999px;
  background: #dceef4;
  color: var(--brand-dark) !important;
  font-size: .82rem;
  font-weight: 850;
}

.team-self-name-form {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid #d5e4ea;
  border-radius: 10px;
  background: #f5fafc;
}

.team-self-name-form label {
  font-weight: 800;
}

.team-self-name-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.team-self-name-controls input {
  flex: 1 1 220px;
  min-width: 0;
}

.team-self-name-controls .btn {
  flex: 0 0 auto;
}

.workspace-team-page .team-invite-card {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 7px;
  width: 100%;
  border: 1px dashed #88b6c4;
  background: #f4fafc;
  color: var(--brand-dark);
  font: inherit;
  text-align: center;
  cursor: pointer;
}

.workspace-team-page .team-invite-card:hover,
.workspace-team-page .team-invite-card:focus-visible {
  outline: none;
  border-color: var(--brand);
  background: #e9f5f9;
}

.workspace-team-page .team-invite-card:disabled {
  border-color: #d8dee6;
  background: #f8fafc;
  color: #667085;
  cursor: not-allowed;
}

.team-invite-card-symbol {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: #dceef4;
  font-size: 1.4rem;
  line-height: 1;
}

.team-invite-card strong {
  font-size: .95rem;
}

.team-invite-card small {
  font-size: .76rem;
  line-height: 1.3;
}

.workspace-landing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.workspace-landing-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 225px;
  padding: 24px;
  border-color: #d5e4ea;
  background: #fbfdfe;
}

.workspace-landing-card h3 {
  margin: 16px 0 7px;
  font-size: 1.18rem;
}

.workspace-landing-card p {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.5;
}

.workspace-landing-card .btn {
  margin-top: auto;
}

.workspace-landing-card a.btn {
  text-decoration: none;
}

.workspace-landing-card #subscribeBtn {
  margin-top: 9px;
}

.workspace-account-actions {
  display: grid;
  gap: 12px;
  padding: 18px 22px;
  border: 1px solid #d5e4ea;
  border-radius: 12px;
  background: #fbfdfe;
}

.workspace-account-actions h3 {
  margin: 0;
  font-size: 1rem;
}

.workspace-account-actions > div {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.workspace-account-actions .btn {
  width: auto;
}

.workspace-account-actions .btn svg {
  width: 18px;
  height: 18px;
}

.workspace-card-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid #c3e0e8;
  border-radius: 11px;
  background: #e7f6fa;
  color: var(--brand-dark);
  font-size: 1.35rem;
  font-weight: 800;
}

.workspace-contact-card {
  grid-column: 1 / -1;
  min-height: 190px;
}

.workspace-message-panel {
  padding: 26px;
}

.workspace-message-panel strong {
  font-size: 1.1rem;
}

.workspace-message-panel p {
  color: var(--muted);
}

.workspace-preview-note {
  margin: 18px 18px 0;
}

.demo-preview-notice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px 20px;
  padding: 14px 16px;
  border: 1px solid #e8c45b;
  border-radius: 8px;
  background: #fff8db;
  color: #694d0b;
  font-size: .9rem;
  font-weight: 400;
  line-height: 1.4;
  min-width: 0;
}

.demo-preview-notice .demo-preview-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.demo-preview-notice strong {
  font-size: 1rem;
  font-weight: 850;
}

.demo-preview-notice span {
  color: inherit;
}

.demo-preview-notice .demo-preview-actions {
  display: flex;
  justify-content: flex-end;
  min-width: 0;
}

.demo-preview-actions .btn {
  min-width: 0;
  max-width: 100%;
  white-space: normal;
}

@media (max-width: 700px) {
  .demo-preview-notice {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
}

.workspace-preview-note[hidden] {
  display: none !important;
}

.section-demo-notice {
  margin: 0 0 14px;
}

.section-demo-notice[hidden] {
  display: none !important;
}

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

@media (min-width: 1100px) and (max-width: 1500px) {
  body[data-workspace-view="comparison"] .layout {
    grid-template-columns: minmax(400px, 455px) minmax(0, 1fr);
  }

  body[data-workspace-view="comparison"] .comparison-fuel {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1501px) {
  body[data-workspace-view="comparison"] .layout {
    grid-template-columns: minmax(390px, 420px) minmax(0, 1fr) minmax(275px, 285px);
  }

  .comparison-diesel-heading span,
  .comparison-diesel small,
  .comparison-diesel-source,
  .comparison-fuel-settings {
    white-space: nowrap;
  }
}

@media (min-width: 1281px) and (max-width: 1500px) {
  body[data-workspace-view="comparison"] .layout {
    grid-template-columns: minmax(400px, 455px) minmax(0, 1fr);
  }

  .comparison-fuel {
    grid-column: 1 / -1;
  }

  .comparison-fuel-body {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) auto;
    align-items: center;
  }

  .comparison-diesel {
    padding: 0 16px 0 0;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .comparison-fuel-rates {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .carrier-summary-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .carrier-inline-sections,
  .carrier-inline-fuel-rates,
  .carrier-inline-relations .carrier-detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .carrier-inline-header {
    position: static;
    align-items: stretch;
  }

  .carrier-inline-header-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 900px) {
  .app-shell {
    display: block;
    width: 100%;
    padding: 12px 12px 28px;
  }

  .workspace-sidebar {
    position: sticky;
    top: 0;
    bottom: auto;
    left: auto;
    z-index: 30;
    width: auto;
    min-height: 0;
    height: auto;
    max-height: min(50dvh, 360px);
    padding: 12px;
    border: 1px solid #d5e4ea;
    border-radius: 12px;
  }

  .workspace-sidebar-brand {
    display: none;
  }

  .workspace-sidebar-context {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin: 10px 2px 8px;
    padding: 0 6px;
  }

  .workspace-sidebar-context span {
    flex: 0 0 auto;
  }

  .workspace-sidebar-context strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .workspace-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 0;
  }

  .workspace-nav > button,
  .workspace-nav-group {
    flex: 1 1 145px;
    min-width: 0;
  }

  .workspace-nav-group:has(.workspace-nav-submenu:not([hidden])) {
    flex-basis: 100%;
  }

  .workspace-nav button,
  .workspace-sidebar-bottom button,
  .workspace-sidebar-link {
    min-width: 0;
    padding: 8px;
    font-size: .8rem;
  }

  .workspace-sidebar-link {
    white-space: normal;
  }

  .workspace-nav button svg,
  .workspace-sidebar-bottom button svg,
  .workspace-sidebar-link svg {
    flex-basis: 18px;
    width: 18px;
    height: 18px;
  }

  .workspace-nav-submenu {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 145px), 1fr));
    margin: 6px 0 0;
  }

  .workspace-sidebar-bottom {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    margin-top: 9px;
    padding-top: 9px;
  }

  .topbar {
    margin-top: 10px;
  }
}

@media (max-width: 600px) {
  body[data-workspace-view="comparison"] .extra-step-heading {
    flex-wrap: wrap;
  }

  body[data-workspace-view="comparison"] .extras-filter {
    flex: 1 1 100%;
    max-width: none;
  }

  body[data-workspace-view="stats"] #statsPanel .stats-card-grid-wide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-workspace-view="stats"] #statsPanel .stats-overview-chart-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .workspace-nav > button,
  .workspace-nav-group {
    flex-basis: 120px;
  }

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

  .workspace-contact-card {
    grid-column: auto;
  }

  .workspace-landing-card {
    min-height: 0;
  }
}

/* Keep the workspace heading and its actions visible while the page body scrolls. */
.app-shell {
  height: 100dvh;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  padding-bottom: 0;
}

.topbar {
  position: relative;
  z-index: 10;
  gap: 14px;
  padding: 15px 2px 14px;
  background: var(--bg);
}

.layout {
  align-self: stretch;
  height: 100%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding-bottom: 28px;
}

/* Size rows to their contents before adding the final scrollable gap. Otherwise
   a tall grid child can overflow its row and cover the gap in Safari. */
body[data-workspace-view]:not([data-workspace-view="history"]) .layout {
  grid-auto-rows: max-content;
  padding-bottom: 0;
}

body[data-workspace-view]:not([data-workspace-view="history"]) .layout::after {
  content: "";
  display: block;
  grid-column: 1 / -1;
  height: 10px; /* Together with the 18px row gap: 28px below the last card. */
  pointer-events: none;
}

.workspace-page-label {
  display: block;
  margin-bottom: 3px;
  color: var(--brand);
  font-size: .72rem;
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
}

.workspace-page-label[hidden] {
  display: none;
}

.topbar .brand > div:last-child,
.topbar .top-actions {
  min-width: 0;
}

.topbar h1 {
  font-size: clamp(1.45rem, 2vw, 2rem);
  overflow-wrap: break-word;
}

.topbar .subtitle {
  margin-top: 4px;
  font-size: .87rem;
}

.workspace-header-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.workspace-header-controls:empty {
  display: none;
}

.workspace-header-controls > .btn {
  min-height: 38px;
  font-size: .84rem;
}

.workspace-header-controls > strong {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid #abd9c2;
  border-radius: 999px;
  background: #eefaf3;
  color: #067647;
  font-size: .78rem;
}

.workspace-header-controls > .history-panel-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  width: auto;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.workspace-header-controls .history-toolbar-search {
  flex: 0 1 350px;
}

.workspace-header-controls .history-toolbar-actions {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
}

body[data-workspace-view="comparison"] .comparison-form > .panel-header,
body[data-workspace-view="settings"] #adminPanel .admin-section.active > .toolbar,
body[data-workspace-view="settings"] #adminPanel .carrier-inline-header,
body[data-workspace-view="stats"] #statsPanel .stats-view-header,
body[data-workspace-view="stats"] #statsPanel .stats-panel-tabs,
body[data-workspace-view="stats"] #statsPanel .stats-filter-summary,
body[data-workspace-view="team"] #teamPage .team-name-heading {
  display: none !important;
}

@media (max-width: 900px) {
  .topbar .top-actions,
  .workspace-header-controls,
  .workspace-header-controls > .history-panel-header {
    justify-content: flex-start;
  }
}

/* All desktop headers wrap according to their contents and keep the same
   vertical alignment while the window narrows. */
@media (min-width: 901px) {
  .topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
  }

  .topbar .brand {
    flex: 1 1 300px;
  }

  .topbar .top-actions {
    flex: 0 1 auto;
    align-items: center;
    justify-content: flex-end;
    max-width: 100%;
  }

  .workspace-header-controls,
  .workspace-header-controls .carrier-inline-header-actions {
    justify-content: flex-end;
  }

  body[data-workspace-view="history"] .topbar .top-actions {
    flex: 1 1 340px;
    max-width: 520px;
    justify-content: flex-end;
  }

  body[data-workspace-view="history"] .workspace-header-controls {
    flex: 1 1 auto;
    justify-content: flex-end;
  }

  body[data-workspace-view="history"] .workspace-header-controls > .history-panel-header {
    width: 100%;
    flex-wrap: nowrap;
    justify-content: flex-end;
  }

  body[data-workspace-view="history"] .workspace-header-controls .history-toolbar-search {
    flex: 1 1 auto;
  }

  body[data-workspace-view="history"] .workspace-header-controls .history-search {
    flex: 1 1 290px;
    width: 100%;
    min-width: 140px;
  }
}

@media (max-width: 900px) {
  .app-shell {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 8px 12px 0;
    overflow-y: hidden !important;
  }

  .workspace-sidebar {
    position: relative;
    flex: 0 0 auto;
    max-height: min(32dvh, 260px);
  }

  .topbar {
    flex: 0 0 auto;
    margin-top: 0;
  }

  .layout {
    flex: 1 1 auto;
    width: 100%;
    height: auto;
    overflow-y: auto !important;
  }

  .workspace-header-controls > .history-panel-header {
    flex-wrap: wrap;
  }
}

@media (max-width: 1200px) {
  .carrier-inline-relations .carrier-detail-section:first-child .carrier-detail-card-list,
  .carrier-inline-relations .carrier-detail-section:last-child .carrier-detail-card-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .carrier-inline-relations .carrier-detail-section .carrier-detail-card-list {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Statistics overview: a trend and invoice row followed by three visible cost breakdowns. */
body[data-workspace-view="stats"] #statsPanel .stats-panel-content {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 0 12px;
  gap: 14px;
}

/* Grid spacing replaces the chip margin used by non-grid sections. */
body[data-workspace-view="stats"] #statsPanel .stats-panel-content > .active-filter-chips {
  margin-bottom: 0;
}

body[data-workspace-view="stats"] #statsPanel .stats-filter-bar {
  gap: 10px;
  padding: 10px;
}

body[data-workspace-view="stats"] #statsPanel .stats-filter-bar select {
  min-height: 36px;
  font-size: .82rem;
}

body[data-workspace-view="stats"] #statsPanel .stats-card-grid,
body[data-workspace-view="stats"] #statsPanel .stats-insight-grid {
  gap: 10px;
}

body[data-workspace-view="stats"] #statsPanel .stats-overview-kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

body[data-workspace-view="stats"] #statsPanel .stats-card,
body[data-workspace-view="stats"] #statsPanel .stats-overview-kpis .stats-card {
  gap: 3px;
  padding: 10px 12px;
  background: #fff;
}

body[data-workspace-view="stats"] #statsPanel .stats-card strong,
body[data-workspace-view="stats"] #statsPanel .stats-overview-kpis .stats-card strong {
  font-size: clamp(1.08rem, 1.2vw, 1.38rem);
}

body[data-workspace-view="stats"] #statsPanel .stats-card small,
body[data-workspace-view="stats"] #statsPanel .stats-overview-kpis .stats-card small {
  font-size: .7rem;
}

body[data-workspace-view="stats"] #statsPanel .stats-overview-chart-grid {
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  align-items: start;
  gap: 10px;
}

body[data-workspace-view="stats"] #statsPanel .stats-overview-breakdowns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 10px;
}

body[data-workspace-view="stats"] #statsPanel .stats-overview-breakdowns .stats-visual-card {
  height: 100%;
}

body[data-workspace-view="stats"] #statsPanel .stats-overview-chart-grid.stats-overview-primary .stats-chart-compact svg {
  max-height: 170px;
}

body[data-workspace-view="stats"] #statsPanel .stats-cost-breakdown {
  display: grid;
  align-content: start;
  gap: 10px;
}

body[data-workspace-view="stats"] #statsPanel .stats-cost-row {
  display: grid;
  gap: 4px;
  min-width: 0;
}

body[data-workspace-view="stats"] #statsPanel .stats-cost-row-heading,
body[data-workspace-view="stats"] #statsPanel .stats-cost-row-track {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

body[data-workspace-view="stats"] #statsPanel .stats-cost-row-heading span {
  min-width: 0;
  color: #475467;
  font-size: .74rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

body[data-workspace-view="stats"] #statsPanel .stats-cost-row-heading strong {
  flex: 0 0 auto;
  color: var(--ink);
  font-size: .74rem;
  font-variant-numeric: tabular-nums;
}

body[data-workspace-view="stats"] #statsPanel .stats-cost-row-track div {
  flex: 1 1 auto;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef2f6;
}

body[data-workspace-view="stats"] #statsPanel .stats-cost-row-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
}

body[data-workspace-view="stats"] #statsPanel .stats-cost-row-track small {
  flex: 0 0 44px;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

body[data-workspace-view="stats"] #statsPanel .stats-primary-grid,
body[data-workspace-view="stats"] #statsPanel .stats-chart-grid,
body[data-workspace-view="stats"] #statsPanel .stats-quality-column {
  gap: 10px;
}

body[data-workspace-view="stats"] #statsPanel .stats-primary-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: stretch;
}

body[data-workspace-view="stats"] #statsPanel .stats-primary-grid > .stats-visual-card {
  height: 100%;
  grid-template-rows: auto minmax(0, 1fr);
}

body[data-workspace-view="stats"] #statsPanel .stats-primary-grid > .stats-visual-card > .stats-donut-layout {
  align-self: center;
}

body[data-workspace-view="stats"] #statsPanel .stats-visual-card,
body[data-workspace-view="stats"] #statsPanel .stats-overview-chart-grid .stats-visual-card {
  gap: 9px;
  min-width: 0;
  height: auto;
  padding: 13px;
  background: #fff;
}

body[data-workspace-view="stats"] #statsPanel .stats-overview-chart-grid .stats-visual-card {
  min-height: 0;
}

body[data-workspace-view="stats"] #statsPanel .stats-visual-head h3,
body[data-workspace-view="stats"] #statsPanel .stats-overview-chart-grid .stats-visual-head h3 {
  font-size: .94rem;
}

body[data-workspace-view="stats"] #statsPanel .stats-visual-head p,
body[data-workspace-view="stats"] #statsPanel .stats-overview-chart-grid .stats-visual-head p {
  font-size: .74rem;
}

body[data-workspace-view="stats"] #statsPanel .stats-chart svg,
body[data-workspace-view="stats"] #statsPanel .stats-primary-grid > .stats-visual-card > .stats-chart svg,
body[data-workspace-view="stats"] #statsPanel .stats-overview-chart-grid .stats-chart svg {
  max-height: 210px;
}

body[data-workspace-view="stats"] #statsPanel .stats-bars {
  gap: 7px;
}

body[data-workspace-view="stats"] #statsPanel .stats-bar-row,
body[data-workspace-view="stats"] #statsPanel .stats-overview-chart-grid .stats-bar-row {
  grid-template-columns: minmax(100px, .9fr) minmax(32px, 1fr) auto;
  gap: 7px;
  font-size: .74rem;
}

body[data-workspace-view="stats"] #statsPanel .stats-overview-chart-grid .stats-bar-row strong {
  font-size: .74rem;
}

body[data-workspace-view="stats"] #statsPanel .stats-overview-chart-grid .stats-bar-row div {
  height: 7px;
}

body[data-workspace-view="stats"] #statsPanel .stats-donut {
  width: min(135px, 100%);
}

body[data-workspace-view="stats"] #statsPanel .stats-donut-layout {
  gap: 10px;
}

body[data-workspace-view="stats"] #statsPanel .stats-insight-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body[data-workspace-view="stats"] #statsPanel .stats-insight {
  padding: 10px 12px;
}

body[data-workspace-view="stats"] #statsPanel .stats-insight strong {
  font-size: .94rem;
}

body[data-workspace-view="stats"] #statsPanel .stats-insight p {
  font-size: .75rem;
}

body[data-workspace-view="stats"] #statsPanel .stats-no-data-note {
  padding: 24px;
  border: 1px dashed #bfd4dc;
  border-radius: 10px;
  background: #f8fbfc;
  color: var(--muted);
  font-size: .95rem;
  text-align: center;
}

@media (max-width: 1100px) {
  body[data-workspace-view="stats"] #statsPanel .stats-overview-breakdowns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-workspace-view="stats"] #statsPanel .stats-overview-breakdowns .stats-visual-card:first-child {
    grid-column: 1 / -1;
  }

  body[data-workspace-view="stats"] #statsPanel .stats-overview-breakdowns .stats-visual-card:first-child .stats-cost-breakdown {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-workspace-view="stats"] #statsPanel .stats-overview-chart-grid,
  body[data-workspace-view="stats"] #statsPanel .stats-primary-grid,
  body[data-workspace-view="stats"] #statsPanel .stats-chart-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-workspace-view="stats"] #statsPanel .stats-overview-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  body[data-workspace-view="stats"] #statsPanel .stats-overview-breakdowns,
  body[data-workspace-view="stats"] #statsPanel .stats-overview-breakdowns .stats-visual-card:first-child .stats-cost-breakdown {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-workspace-view="stats"] #statsPanel .stats-overview-breakdowns .stats-visual-card:first-child {
    grid-column: auto;
  }

  body[data-workspace-view="stats"] #statsPanel .stats-panel-content {
    padding-inline: 0;
  }

  body[data-workspace-view="stats"] #statsPanel .stats-insight-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-workspace-view="stats"] #statsPanel .stats-visual-card,
  body[data-workspace-view="stats"] #statsPanel .stats-overview-chart-grid .stats-visual-card {
    padding: 12px;
  }

  body[data-workspace-view="stats"] #statsPanel .stats-bar-row,
  body[data-workspace-view="stats"] #statsPanel .stats-overview-chart-grid .stats-bar-row {
    grid-template-columns: minmax(90px, .8fr) minmax(30px, 1fr) auto;
    gap: 7px;
  }
}

/* Small screens use the same vertical navigation as desktop in an off-canvas drawer. */
@media (max-width: 900px) {
  .app-shell {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100dvh;
    padding: 0 12px;
    overflow: hidden;
  }

  .workspace-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 61;
    display: flex;
    flex-direction: column;
    width: min(300px, calc(100vw - 52px));
    max-width: none;
    max-height: none;
    min-height: 0;
    height: 100dvh;
    padding: max(18px, env(safe-area-inset-top)) 13px max(16px, env(safe-area-inset-bottom));
    border: 0;
    border-right: 1px solid #d5e4ea;
    border-radius: 0;
    overflow-y: auto;
    transform: translateX(-105%);
    visibility: hidden;
    transition: transform .22s ease, visibility .22s;
  }

  body.mobile-menu-open .workspace-sidebar {
    transform: translateX(0);
    visibility: visible;
  }

  .mobile-sidebar-scrim:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgba(17, 36, 47, .48);
    cursor: pointer;
  }

  .workspace-sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    height: auto !important;
    min-height: 72px;
    padding: 2px 6px 16px;
  }

  .workspace-sidebar-brand img { width: min(175px, calc(100% - 42px)); }

  .mobile-menu-close {
    display: grid;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    place-items: center;
    padding: 0;
    border: 1px solid #d5e4ea;
    border-radius: 9px;
    background: #fff;
    color: #344054;
    font-size: 27px;
    line-height: 1;
    cursor: pointer;
  }

  .workspace-nav {
    display: grid;
    align-content: start;
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
    padding-top: 18px;
  }

  .workspace-nav > button,
  .workspace-nav-group { width: 100%; min-width: 0; }

  .workspace-nav button,
  .workspace-sidebar-bottom button,
  .workspace-sidebar-link {
    width: 100%;
    min-height: 44px;
    padding: 9px 12px;
    font-size: .91rem;
  }

  .workspace-nav button svg,
  .workspace-sidebar-bottom button svg,
  .workspace-sidebar-link svg {
    flex-basis: 24px;
    width: 24px;
    height: 24px;
  }

  .workspace-nav-submenu {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    margin: 5px 0 0;
  }

  .workspace-nav-submenu[hidden] { display: none; }

  .workspace-sidebar-context:not([hidden]) {
    display: grid;
    align-items: stretch;
    gap: 3px;
    margin: auto 11px 12px;
    padding: 0;
  }

  .workspace-sidebar-context strong {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .workspace-sidebar-bottom {
    display: grid;
    justify-content: stretch;
    gap: 5px;
    margin-top: auto;
    padding-top: 14px;
  }

  .account-quick-menu { z-index: 62; }

  .topbar {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    flex: 0 0 auto;
    gap: 8px 12px;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 12px 0;
  }

  body[data-workspace-view="history"] .topbar {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .mobile-menu-toggle {
    display: flex;
    grid-column: 1;
    grid-row: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid #cbdde5;
    border-radius: 9px;
    background: #fff;
    color: var(--brand-dark);
    cursor: pointer;
  }

  .mobile-menu-toggle span {
    display: block;
    width: 19px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
  }

  .topbar .brand {
    grid-column: 2;
    grid-row: 1;
    align-items: center;
    gap: 0;
  }

  .topbar .brand-mark { display: none; }
  .topbar .top-actions { grid-column: 1 / -1; min-width: 0; }
  .layout { flex: 1 1 auto; width: 100%; min-width: 0; }
}

@media (max-width: 700px) {
  .topbar .brand > div:last-child { min-width: 0; }
  .topbar .workspace-title-row { width: 100%; min-width: 0; }
  .topbar .workspace-title-row h1 {
    flex: 1 1 auto;
    max-width: 100%;
    font-size: clamp(1.25rem, 5.3vw, 1.65rem);
    overflow-wrap: anywhere;
  }
  .topbar .subtitle { font-size: .8rem; line-height: 1.35; overflow-wrap: anywhere; }
  .topbar .top-actions,
  .workspace-header-controls,
  .workspace-header-controls > .history-panel-header,
  .workspace-header-controls .history-toolbar-actions {
    width: 100%;
    min-width: 0;
    justify-content: flex-start;
  }

  .workspace-header-controls > .toolbar-actions:not(.fuel-admin-diesel) {
    flex: 1 1 100%;
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
    gap: 8px;
  }

  .workspace-header-controls > .history-panel-header,
  .workspace-header-controls .history-toolbar-actions { flex-wrap: wrap; }

  .workspace-header-controls .history-toolbar-search { flex: 1 1 100%; max-width: none; }

  .workspace-header-controls .history-toolbar-actions {
    display: flex;
    width: auto;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
  }

  .workspace-header-controls > .history-panel-header { flex-wrap: nowrap; }
  .workspace-header-controls .history-toolbar-search { flex: 1 1 auto; gap: 6px; }
  .workspace-header-controls .history-toolbar-search .history-search { width: 100%; min-width: 0; flex: 1 1 auto; }
  .workspace-header-controls .history-toolbar-search .badge { font-size: .7rem; }
  .workspace-header-controls .history-tools-trigger,
  .workspace-header-controls .history-filters-trigger { width: 38px; min-width: 38px; height: 38px; min-height: 38px; }

  .topbar .btn,
  .workspace-header-controls .btn,
  .panel .btn,
  .modal .btn {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: center;
    line-height: 1.2;
  }

  .topbar .btn svg,
  .panel .btn svg,
  .modal .btn svg { flex: 0 0 18px; }

  .panel,
  .admin-panel,
  .stats-panel,
  .history-section { min-width: 0; }

  .panel-header,
  .toolbar,
  .filter-bar,
  .carrier-inline-header-actions,
  .history-panel-header { min-width: 0; }

  .toolbar-actions,
  .carrier-inline-header-actions,
  .history-toolbar-actions { flex-wrap: wrap; }

  .toolbar-actions > *,
  .carrier-inline-header-actions > * { max-width: 100%; }

  .workspace-header-controls .carrier-inline-header-actions {
    display: grid;
    grid-template-columns: auto repeat(2, minmax(0, 1fr));
    align-items: center;
    gap: 8px;
    width: 100%;
  }

  .workspace-header-controls .carrier-inline-header-actions .btn {
    width: 100%;
    min-width: 0;
    padding-inline: 6px;
    font-size: .76rem;
  }

  .excluded-carriers-head,
  .excluded-carriers-actions { flex-wrap: wrap; }

  .stats-table-wrap,
  .history-table-wrap { overflow-x: auto !important; touch-action: pan-x pan-y; }
}

@media (prefers-reduced-motion: reduce) {
  .workspace-sidebar { transition: none; }
}
