@import url("https://fonts.googleapis.com/css2?family=Fraunces:wght@500;600;700&family=Manrope:wght@400;500;600;700&family=Inter:wght@400;500;600;700&family=Inter+Tight:wght@500;600;700&display=swap");

:root {
  --bg: #f0f1f3;
  --bg-accent: #d9dcdf;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-border: rgba(46, 49, 53, 0.09);
  --text: #202327;
  --muted: #666d75;
  --accent: #005f9e;
  --accent-strong: #004b7d;
  --accent-soft: rgba(0, 95, 158, 0.08);
  --steel: #5d6670;
  --success: #228b55;
  --ui-scale: 1;
  --ui-font-scale: 1;
  --ui-space-scale: 1;
  --sidebar-width: 332px;
  --sidebar-rail-width: 80px;
}

html[data-ui-size="xlarge"] {
  --ui-scale: 1.08;
  --ui-font-scale: 1.08;
  --ui-space-scale: 1.08;
  --sidebar-width: 352px;
  --sidebar-rail-width: 84px;
}

html[data-ui-size="medium"] {
  --ui-scale: 0.93;
  --ui-font-scale: 0.94;
  --ui-space-scale: 0.94;
  --sidebar-width: 312px;
  --sidebar-rail-width: 76px;
}

html[data-ui-size="small"] {
  --ui-scale: 0.86;
  --ui-font-scale: 0.88;
  --ui-space-scale: 0.88;
  --sidebar-width: 292px;
  --sidebar-rail-width: 72px;
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  min-height: 100%;
  overflow: hidden;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

html,
body {
  margin: 0 !important;
  padding: 0 !important;
  min-height: 100%;
  height: 100%;
  width: 100%;
  background:
    radial-gradient(circle at top left, rgba(0, 95, 158, 0.24), transparent 34%),
    radial-gradient(circle at 78% 20%, rgba(99, 179, 237, 0.16), transparent 26%),
    radial-gradient(circle at bottom right, rgba(0, 95, 158, 0.18), transparent 28%),
    linear-gradient(180deg, #e4eaf0 0%, #c7d4df 100%);
  color: var(--text);
  font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
  font-size: calc(16px * var(--ui-font-scale));
  overflow: hidden;
  overscroll-behavior-y: none;
}

body {
  position: relative;
  max-width: 100vw;
}

body > * {
  margin-top: 0 !important;
}

img,
svg,
canvas,
video,
iframe {
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  max-width: 100%;
}

select {
  font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
}

.shell {
  min-height: 100%;
  height: 100%;
  position: relative;
  overflow-x: clip;
  overflow-y: hidden;
  margin-top: 0;
}

.sidebar {
  border-right: 1px solid var(--panel-border);
  background:
    linear-gradient(180deg, rgba(24, 25, 28, 0.98), rgba(52, 56, 60, 0.96)),
    linear-gradient(135deg, rgba(0, 95, 158, 0.18), transparent);
  color: #f4f5f6;
  padding: calc(24px * var(--ui-space-scale)) calc(18px * var(--ui-space-scale)) 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: calc(12px * var(--ui-space-scale));
  width: var(--sidebar-width);
  z-index: 20;
  overflow-x: hidden;
  min-height: 0;
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    padding 180ms ease;
}

.sidebarDesktop {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  height: 100dvh;
  min-height: 100vh;
  overflow-y: hidden;
  padding-bottom: calc(6px * var(--ui-space-scale));
}

html[data-sidebar-collapsed="true"] .sidebarDesktop {
  opacity: 0;
  transform: translateX(-100%);
  pointer-events: none;
}

.sidebar.sidebarHidden {
  opacity: 0;
  transform: translateX(-100%);
  pointer-events: none;
  padding-inline: 0;
  border-right-color: transparent;
}

.sidebarTop {
  display: grid;
  gap: calc(10px * var(--ui-space-scale));
  padding-top: calc(10px * var(--ui-space-scale));
}

.brandPanel {
  display: grid;
  gap: calc(8px * var(--ui-space-scale));
  padding: 2px 0 0;
  background: transparent;
  border: 0;
  overflow: visible;
  justify-items: start;
}

.brandImageWrap {
  width: 100%;
  max-width: calc(248px * var(--ui-scale));
  margin-bottom: 0;
  padding-bottom: calc(10px * var(--ui-space-scale));
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brandImage {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.16));
}

.brandCopy {
  display: grid;
  gap: calc(6px * var(--ui-space-scale));
  position: relative;
  z-index: 1;
  width: 100%;
}

.brandEyebrow {
  color: rgba(214, 220, 228, 0.68);
  margin: 0;
  padding-top: 0;
  font-size: calc(11px * var(--ui-font-scale));
}

.brandTitle {
  margin: 0;
  font-size: calc(22px * var(--ui-scale));
  line-height: 1;
  letter-spacing: -0.03em;
  color: #f5f7fa;
  max-width: 100%;
}

.sidebarLead {
  color: rgba(244, 245, 246, 0.72);
  line-height: 1.55;
  font-size: calc(14px * var(--ui-font-scale));
  margin: 0;
  max-width: 34ch;
}

.content {
  margin-left: var(--sidebar-width);
  padding: calc(32px * var(--ui-space-scale));
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  overflow-x: clip;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
  transition: margin-left 180ms ease;
}

.contentInner {
  width: min(100%, 1540px);
  max-width: 100%;
  min-width: 0;
  margin: 0 auto;
  display: grid;
  gap: calc(14px * var(--ui-space-scale));
  align-content: start;
}

.contentInner > *,
.pageHeader,
.pageHeader > div,
.grid > *,
.summaryGrid > *,
.sourcingSummaryGrid > *,
.sourcingWorkspaceTabs > *,
.sourceCard,
.assistantCard,
.tableCard,
.formCard,
.metricCard,
.chartCard,
.hero,
.summaryCard {
  min-width: 0;
  max-width: 100%;
}

.shell.shellCollapsed .content {
  margin-left: var(--sidebar-rail-width);
}

html[data-sidebar-collapsed="true"] .content {
  margin-left: var(--sidebar-rail-width);
}

html[data-sidebar-collapsed="true"] .sidebarRail {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.sidebarBackdrop {
  position: fixed;
  inset: 0;
  z-index: 24;
  border: 0;
  padding: 0;
  background: rgba(17, 24, 39, 0.38);
}

.sidebarToggle {
  border-radius: 999px;
  border: 1px solid rgba(46, 49, 53, 0.12);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  box-shadow: 0 16px 32px rgba(25, 27, 30, 0.1);
  padding: calc(8px * var(--ui-space-scale)) calc(12px * var(--ui-space-scale));
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 700;
}

.sidebarToggleInside {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 5;
}

.sidebarToggleCollapsed {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 40;
}

.sidebarRail {
  width: var(--sidebar-rail-width);
  padding: calc(16px * var(--ui-space-scale)) calc(12px * var(--ui-space-scale)) calc(24px * var(--ui-space-scale));
  gap: calc(16px * var(--ui-space-scale));
  justify-items: center;
}

.sidebarRailHidden {
  opacity: 0;
  transform: translateX(-40px);
  pointer-events: none;
}

html[data-sidebar-collapsed="true"] .sidebarRail.sidebarRailHidden {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.sidebarRailToggle {
  width: 100%;
  justify-content: center;
  padding: calc(10px * var(--ui-space-scale));
  border-radius: calc(18px * var(--ui-scale));
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.08);
  color: #f4f5f6;
  box-shadow: none;
}

.iconRailSection {
  width: 100%;
  display: grid;
  gap: calc(10px * var(--ui-space-scale));
  align-content: start;
}

.iconRailSectionBottom {
  margin-top: auto;
  padding-top: calc(14px * var(--ui-space-scale));
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.iconRailLink,
.iconRailButton {
  width: 100%;
  min-height: calc(48px * var(--ui-scale));
  border-radius: calc(16px * var(--ui-scale));
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #f4f5f6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
}

.iconRailLinkActive {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.iconRailButton {
  padding: 0;
}

.iconRailLink:hover,
.iconRailLink:focus-visible,
.iconRailButton:hover,
.iconRailButton:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.16);
}

.iconRailLink::after,
.iconRailButton::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(24, 25, 28, 0.94);
  color: #f4f5f6;
  font-size: 13px;
  line-height: 1;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  transition: opacity 140ms ease;
  z-index: 60;
}

.iconRailLink:hover::after,
.iconRailLink:focus-visible::after,
.iconRailButton:hover::after,
.iconRailButton:focus-visible::after {
  opacity: 1;
}

.nav {
  display: grid;
  gap: calc(8px * var(--ui-space-scale));
  min-height: 0;
  align-content: start;
  overflow-y: auto;
  padding-top: calc(20px * var(--ui-space-scale));
  padding-bottom: calc(10px * var(--ui-space-scale));
  padding-right: 4px;
  overscroll-behavior: contain;
}

.sidebarBottom {
  padding-top: calc(10px * var(--ui-space-scale));
  padding-bottom: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  gap: 8px;
  align-content: end;
  align-self: end;
}

.sidebar .navLink,
.sidebar .sidebarSignout {
  min-height: calc(42px * var(--ui-scale));
  padding: calc(9px * var(--ui-space-scale)) calc(12px * var(--ui-space-scale));
}

.navLink,
.secondaryButton,
.primaryButton {
  border-radius: calc(16px * var(--ui-scale));
  padding: calc(12px * var(--ui-space-scale)) calc(14px * var(--ui-space-scale));
  border: 1px solid var(--panel-border);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
}

.expandCollapseButton {
  background: rgba(236, 240, 246, 0.92);
  border-color: rgba(77, 91, 111, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.expandCollapseButton:hover {
  background: rgba(244, 247, 251, 0.98);
  border-color: rgba(47, 61, 99, 0.22);
}

.sidebarSignout {
  width: 100%;
  justify-content: center;
}

.navLink {
  color: #f4f5f6;
  border-color: rgba(255, 255, 255, 0.08);
}

.navLinkActive {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.primaryButton {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 16px 32px rgba(0, 95, 158, 0.18);
}

.pageHeader {
  display: flex;
  justify-content: space-between;
  gap: calc(10px * var(--ui-space-scale)) calc(18px * var(--ui-space-scale));
  align-items: flex-start;
  margin-bottom: calc(12px * var(--ui-space-scale));
}

.pageHeaderCompact {
  margin-bottom: calc(8px * var(--ui-space-scale));
}

.pageHeader > div {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.pageHeader h1,
.pageHeader h2,
.pageHeader p {
  margin: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
  font-size: calc(12px * var(--ui-font-scale));
  margin: 0;
  font-weight: 700;
}

.hero {
  padding: calc(24px * var(--ui-space-scale));
  border: 1px solid var(--panel-border);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.03), rgba(249, 115, 22, 0.08));
  border-radius: calc(28px * var(--ui-scale));
}

.loginShell {
  position: relative;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 32px;
  overflow: hidden;
}

.loginBackdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top left, rgba(0, 95, 158, 0.18), transparent 28%),
    radial-gradient(circle at 85% 18%, rgba(255, 255, 255, 0.58), transparent 24%),
    radial-gradient(circle at bottom right, rgba(93, 102, 112, 0.18), transparent 26%),
    linear-gradient(135deg, #f2f3f5 0%, #d8dce0 52%, #cbd2d8 100%);
}

.loginFrame {
  position: relative;
  z-index: 1;
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 440px);
  gap: 22px;
  align-items: stretch;
}

.loginBrandPanel,
.loginFormCard {
  border: 1px solid rgba(46, 49, 53, 0.09);
  box-shadow: 0 28px 80px rgba(25, 27, 30, 0.12);
  backdrop-filter: blur(18px);
}

.loginBrandPanel {
  display: grid;
  align-content: space-between;
  gap: 28px;
  padding: 32px;
  border-radius: 34px;
  background:
    linear-gradient(180deg, rgba(26, 27, 31, 0.96), rgba(44, 47, 53, 0.94)),
    linear-gradient(135deg, rgba(0, 95, 158, 0.2), transparent);
  color: #f5f7fa;
  overflow: hidden;
}

.loginBrandTop {
  display: grid;
  gap: 14px;
}

.loginLogoWrap {
  width: min(100%, 320px);
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.loginLogo {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.2));
}

.loginEyebrow {
  margin: 0;
  color: rgba(214, 220, 228, 0.72);
}

.loginFormCard .loginEyebrow {
  color: #2b2f33;
}

.loginHeading {
  margin: 0;
  font-size: clamp(30px, 3.4vw, 48px);
  line-height: 0.98;
  letter-spacing: -0.045em;
  color: #f5f7fa;
}

.loginLead {
  margin: 0;
  max-width: 40ch;
  color: rgba(244, 245, 246, 0.78);
  font-size: 18px;
  line-height: 1.58;
}

.loginHighlights {
  display: grid;
  gap: 12px;
}

.loginHighlight {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.loginHighlight svg {
  margin-top: 2px;
  color: #f2b5b5;
}

.loginHighlight strong,
.loginHighlight span {
  display: block;
}

.loginHighlight strong {
  font-size: 15px;
  color: #f5f7fa;
}

.loginHighlight span {
  margin-top: 4px;
  color: rgba(214, 220, 228, 0.72);
  line-height: 1.45;
  font-size: 14px;
}

.loginFormPanel {
  display: grid;
  align-items: center;
  gap: 18px;
}

.loginAiCard {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
  padding: 22px 24px;
  border-radius: 28px;
  border: 1px solid rgba(46, 49, 53, 0.1);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 24px 60px rgba(25, 27, 30, 0.12);
}

.loginAiLogo {
  width: 108px;
  height: 108px;
  border-radius: 24px;
  background: rgba(6, 28, 57, 0.04);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.loginAiLogoImage {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.loginAiCopy {
  display: grid;
  gap: 8px;
}

.loginAiEyebrow {
  color: #2b2f33;
  margin: 0;
}

.loginAiTitle {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.loginAiText {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.loginFormCard {
  padding: 30px;
  border-radius: 34px;
  background: rgba(255, 255, 255, 0.9);
}

.loginFormTitle {
  margin: 0;
  font-size: 34px;
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.loginFormLead {
  margin: 10px 0 0;
  line-height: 1.6;
}

.loginForm {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.loginField {
  display: grid;
  gap: 8px;
}

.loginField span {
  color: var(--steel);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.loginField input {
  width: 100%;
  min-height: 56px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(46, 49, 53, 0.1);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.loginField input::placeholder {
  color: rgba(102, 109, 117, 0.66);
}

.loginSubmit {
  justify-content: center;
  min-height: 56px;
  margin-top: 4px;
  font-weight: 700;
}

.loginFootnote {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.grid {
  display: grid;
  gap: calc(18px * var(--ui-space-scale));
}

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

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metricCard,
.chartCard,
.tableCard,
.formCard {
  padding: calc(20px * var(--ui-space-scale));
  border-radius: calc(24px * var(--ui-scale));
  border: 1px solid var(--panel-border);
  background: var(--panel);
  box-shadow: 0 22px 60px rgba(25, 27, 30, 0.08);
  min-width: 0;
  overflow: hidden;
}

.metricValue {
  font-size: calc(40px * var(--ui-scale));
  margin: calc(6px * var(--ui-space-scale)) 0;
  font-weight: 800;
}

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

.table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.table th,
.table td {
  padding: calc(12px * var(--ui-space-scale)) calc(10px * var(--ui-space-scale));
  text-align: left;
  border-bottom: 1px solid rgba(143, 165, 191, 0.12);
}

.clickableTableRow {
  cursor: pointer;
  transition:
    background-color 140ms ease,
    transform 140ms ease,
    box-shadow 140ms ease;
}

.clickableTableRow:hover,
.clickableTableRow:focus-visible {
  background: linear-gradient(90deg, rgba(0, 95, 158, 0.08), rgba(0, 95, 158, 0.03));
  box-shadow: inset 3px 0 0 rgba(0, 95, 158, 0.38);
}

.clickableTableRow:focus-visible {
  outline: 2px solid rgba(0, 95, 158, 0.28);
  outline-offset: -2px;
}

.rowPrimaryLink {
  color: var(--accent-strong);
  font-weight: 700;
}

.tableSortButton {
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
}

.tableSortIcon {
  font-size: 0.75rem;
  opacity: 0.55;
}

.tableSortButton.isActive .tableSortIcon {
  opacity: 1;
  color: var(--accent-strong);
}

.tableHeaderTools {
  display: flex;
  align-items: center;
  gap: calc(8px * var(--ui-space-scale));
}

.tableHeaderIconButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: calc(28px * var(--ui-scale));
  height: calc(28px * var(--ui-scale));
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(143, 165, 191, 0.18);
  background: rgba(255, 255, 255, 0.8);
  color: var(--muted);
  cursor: pointer;
}

.tableHeaderIconButton.active {
  border-color: rgba(0, 95, 158, 0.3);
  background: rgba(0, 95, 158, 0.08);
  color: var(--accent);
}

.tableHeaderSearch {
  display: flex;
  align-items: center;
  gap: calc(8px * var(--ui-space-scale));
  margin-top: calc(8px * var(--ui-space-scale));
}

.rowActions {
  display: flex;
  flex-wrap: wrap;
  gap: calc(8px * var(--ui-space-scale));
}

.rowActionMeta {
  display: inline-flex;
  align-items: center;
}

.rowActionButton {
  padding: calc(8px * var(--ui-space-scale)) calc(10px * var(--ui-space-scale));
  border-radius: calc(12px * var(--ui-scale));
}

.rowActionButton.compact {
  padding: calc(8px * var(--ui-space-scale)) calc(10px * var(--ui-space-scale));
  font-size: calc(13px * var(--ui-font-scale));
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: calc(6px * var(--ui-space-scale)) calc(10px * var(--ui-space-scale));
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  gap: calc(8px * var(--ui-space-scale));
}

.chartHeader {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: calc(12px * var(--ui-space-scale));
  margin-bottom: calc(14px * var(--ui-space-scale));
}

.chartFilterRow {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  gap: calc(14px * var(--ui-space-scale));
  align-items: end;
  margin: 0 0 calc(16px * var(--ui-space-scale));
}

.chartFilterLabel {
  display: grid;
  gap: 8px;
}

.chartFilterActions {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.comparisonChartGrid {
  margin-top: calc(18px * var(--ui-space-scale));
}

.stockRefreshControls {
  display: grid;
  justify-items: end;
  gap: calc(8px * var(--ui-space-scale));
  min-width: min(100%, 320px);
}

.stockRefreshMeta {
  display: grid;
  justify-items: end;
  gap: 4px;
  text-align: right;
}

.chartFilterHint {
  margin: 0;
}

.chartSelect {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.chartSelect[multiple] {
  min-height: 120px;
}

.chartSelect option {
  padding: 6px 8px;
  font-family: inherit;
  font-weight: 600;
}

.formGrid {
  display: grid;
  gap: 14px;
}

.formGrid input,
.formGrid select,
.textareaField {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.textareaField {
  min-height: 110px;
  resize: vertical;
}

.emptyState {
  padding: 24px;
  border-radius: 20px;
  border: 1px dashed var(--panel-border);
  color: var(--muted);
}

.uploadZone {
  padding: 28px;
  border-radius: 24px;
  border: 1.5px dashed rgba(0, 95, 158, 0.3);
  background: linear-gradient(180deg, rgba(0, 95, 158, 0.05), rgba(255, 255, 255, 0.78));
  display: grid;
  gap: 14px;
  align-content: start;
}

.uploadZone.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(0, 95, 158, 0.08);
}

.hiddenInput {
  display: none;
}

.smallText {
  font-size: 13px;
}

.statusText {
  color: var(--accent);
}

.sectionHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.sectionHeader > div {
  min-width: 0;
}

.reportPage {
  display: grid;
  gap: calc(16px * var(--ui-space-scale));
}

.ppgReportTheme {
  --bg: #f7fcff;
  --bg-accent: #eef5fb;
  --panel: #ffffff;
  --panel-border: rgba(27, 55, 101, 0.12);
  --text: #1b3765;
  --muted: rgba(27, 55, 101, 0.7);
  --accent: #dd2726;
  --accent-strong: #c11f1f;
  --accent-soft: rgba(221, 39, 38, 0.1);
  --accent-blue: #1072ba;
  font-family: "Inter", "Manrope", "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #f7fcff 0%, #f1f7fc 100%);
  color: var(--text);
}

.ppgReportTheme select {
  font-family: inherit;
}

.ppgReportTheme h1,
.ppgReportTheme h2,
.ppgReportTheme h3,
.ppgReportTheme .reportName {
  font-family: "Inter Tight", "Inter", "Fraunces", serif;
  letter-spacing: -0.02em;
}

.ppgReportTheme .metricCard,
.ppgReportTheme .chartCard,
.ppgReportTheme .tableCard {
  background: #ffffff;
  border-color: rgba(27, 55, 101, 0.12);
  box-shadow: 0 20px 50px rgba(27, 55, 101, 0.08);
}

.reportHero {
  display: grid;
  gap: calc(4px * var(--ui-space-scale));
  padding: calc(2px * var(--ui-space-scale)) 0 calc(6px * var(--ui-space-scale));
  border-bottom: 1px solid rgba(27, 55, 101, 0.12);
  position: relative;
  overflow: visible;
}

.reportAlert {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 28px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-radius: 16px;
  border: 1px solid rgba(221, 39, 38, 0.28);
  background: rgba(221, 39, 38, 0.08);
  color: var(--text);
}

.reportAlertTitle {
  margin: 0 0 4px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.reportAlertCopy {
  margin: 0;
  color: rgba(27, 55, 101, 0.75);
  font-size: 14px;
}

.reportAlertList {
  list-style: disc;
  margin: 0 0 0 18px;
  padding: 0;
  color: rgba(27, 55, 101, 0.85);
  font-size: 13px;
}

.reportAlertHelp {
  flex: 1 1 420px;
  display: grid;
  gap: 4px;
  max-width: 680px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(221, 39, 38, 0.14);
  color: rgba(27, 55, 101, 0.85);
  font-size: 13px;
  line-height: 1.45;
}

.reportAlertHelp strong {
  color: var(--text);
}

.reportAlertActions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ppgReportTheme .reportHero::before {
  content: "";
  position: absolute;
  top: -140px;
  right: -180px;
  width: 440px;
  height: 440px;
  background: radial-gradient(circle, rgba(16, 114, 186, 0.18), transparent 65%);
  opacity: 0.6;
  pointer-events: none;
}

.reportHeroTop {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: calc(16px * var(--ui-space-scale));
  justify-content: space-between;
}

.reportLogo {
  display: flex;
  align-items: center;
  gap: calc(14px * var(--ui-space-scale));
}

.reportLogoImage {
  width: min(190px, 42vw);
  height: auto;
  display: block;
}

.reportLogoCopy {
  display: none;
}

.reportHeroBody {
  margin-top: calc(-10px * var(--ui-space-scale));
}

.reportMonogram {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(16, 114, 186, 0.12);
  color: var(--accent-blue);
  border: 1px solid rgba(16, 114, 186, 0.4);
  box-shadow: 0 12px 30px rgba(16, 114, 186, 0.18);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.reportName {
  margin: 0;
  font-size: 20px;
  color: var(--text);
}

.reportRole {
  margin: 2px 0 0;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(27, 55, 101, 0.65);
}

.reportHeroBody h2 {
  font-size: clamp(28px, 4vw, 44px);
  max-width: 680px;
  line-height: 1.05;
  margin: 0 0 calc(6px * var(--ui-space-scale));
}

.reportHeroBody .muted {
  margin: 0;
}

.reportTitleLine {
  display: block;
}

.landingPageCol {
  max-width: 350px;
  width: 350px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.reportEyebrow {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 11px;
}

.reportMeta {
  display: grid;
  gap: calc(8px * var(--ui-space-scale));
  align-items: flex-start;
  justify-items: end;
}

.reportHeaderActions {
  display: grid;
  gap: calc(12px * var(--ui-space-scale));
  justify-items: end;
}

.reportToolbar {
  display: flex;
  gap: calc(10px * var(--ui-space-scale));
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.reportSettings {
  position: relative;
  display: inline-flex;
}

.reportSettingsButton {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
}

.reportSettingsCaret {
  font-size: 12px;
  opacity: 0.7;
}

.reportSettingsPopover {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 240px;
  background: #fff;
  border: 1px solid rgba(27, 55, 101, 0.18);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 18px 40px rgba(27, 55, 101, 0.18);
  z-index: 40;
}

.reportSettingsTitle {
  font-weight: 600;
  margin-bottom: 4px;
}

.reportSettingsOptions {
  display: grid;
  gap: 8px;
  margin: 10px 0 12px;
}

.reportSettingsOption {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
}

.reportSettingsOption input {
  width: 16px;
  height: 16px;
}

.reportSettingsActions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.reportToggle {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(16, 114, 186, 0.08);
  border: 1px solid rgba(16, 114, 186, 0.2);
}

.reportToggle .secondaryButton {
  padding: calc(8px * var(--ui-space-scale)) calc(14px * var(--ui-space-scale));
  border-radius: 999px;
  border-color: transparent;
}

.reportToggleActive {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 18px 36px rgba(221, 39, 38, 0.2);
}

.reportDatePicker {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.reportDateTrigger {
  border-style: dashed;
  border-color: rgba(221, 39, 38, 0.4);
  cursor: pointer;
  gap: 6px;
  background: rgba(221, 39, 38, 0.06);
  color: var(--text);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.reportDateTrigger:hover,
.reportDateTrigger:focus-visible {
  border-color: rgba(221, 39, 38, 0.7);
  box-shadow: 0 12px 30px rgba(221, 39, 38, 0.18);
  transform: translateY(-1px);
}

.reportDateCaret {
  font-size: 12px;
  opacity: 0.8;
}

.reportDateAction {
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(221, 39, 38, 0.12);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.reportDatePopover {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: min(720px, 90vw);
  max-height: min(70vh, 680px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #ffffff;
  border: 1px solid rgba(27, 55, 101, 0.12);
  border-radius: 24px;
  padding: 18px;
  box-shadow: 0 28px 70px rgba(27, 55, 101, 0.18);
  z-index: 1000;
}

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

.reportDateTitle {
  margin: 0;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 11px;
  color: var(--accent);
}

.reportDateSubtitle {
  margin: 6px 0 0;
  color: var(--muted);
}

.reportDateClose {
  border: 1px solid rgba(27, 55, 101, 0.12);
  background: rgba(16, 114, 186, 0.08);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.reportDateGrid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
}

.reportDateOptions {
  display: grid;
  gap: 10px;
}

.reportDateOption {
  display: grid;
  gap: 4px;
  text-align: left;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(27, 55, 101, 0.1);
  background: rgba(16, 114, 186, 0.04);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.reportDateOption:hover,
.reportDateOption.active {
  border-color: rgba(221, 39, 38, 0.6);
  box-shadow: 0 12px 26px rgba(221, 39, 38, 0.16);
  transform: translateY(-1px);
}

.reportDateHelper {
  color: var(--muted);
  font-size: 12px;
}

.reportDateCustom {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(27, 55, 101, 0.1);
  background: rgba(16, 114, 186, 0.04);
}

.reportDateLabel {
  margin: 0;
  font-weight: 600;
}

.reportDateFields {
  display: grid;
  gap: 10px;
}

.reportDateFields label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.reportDateFields input {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(27, 55, 101, 0.2);
  background: #f7fbff;
  color: var(--text);
}

.reportDateHint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.reportDateApply {
  justify-content: center;
}

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

.ppgReportTheme .secondaryButton {
  background: rgba(16, 114, 186, 0.08);
  border-color: rgba(16, 114, 186, 0.24);
  color: var(--text);
}

.ppgReportTheme .primaryButton {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 20px 40px rgba(221, 39, 38, 0.2);
}

.ppgReportTheme .tag {
  background: rgba(16, 114, 186, 0.08);
  color: var(--text);
  border: 1px solid rgba(16, 114, 186, 0.2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
}

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

.closedDealsButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: calc(6px * var(--ui-space-scale)) calc(10px * var(--ui-space-scale));
  gap: calc(8px * var(--ui-space-scale));
  border: 1px solid rgba(16, 114, 186, 0.2);
  border-radius: 999px;
  background: rgba(16, 114, 186, 0.08);
  color: var(--text);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.closedDealsButton:hover {
  background: rgba(16, 114, 186, 0.14);
  border-color: rgba(16, 114, 186, 0.3);
}

.closedDealsInfoIcon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: rgba(16, 114, 186, 0.14);
  color: #1072ba;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  text-transform: none;
  letter-spacing: 0;
}

.closedDealsPanel {
  margin-top: 12px;
  padding: 10px;
  border: 1px solid rgba(16, 114, 186, 0.18);
  border-radius: 12px;
  background: rgba(16, 114, 186, 0.05);
}

.closedDealsList {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.closedDealItem {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid rgba(27, 55, 101, 0.1);
}

.closedDealItem strong,
.closedDealItem span {
  display: block;
}

.closedDealItem span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.closedDealValue {
  display: grid;
  justify-items: end;
  gap: 4px;
  color: var(--text);
}

.closedDealStatus {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
  font-weight: 800;
}

.closedDealStatus.won {
  color: #1072ba;
}

.closedDealStatus.lost {
  color: #dd2726;
}

.ppgReportTheme .metricValue {
  font-size: clamp(30px, 4vw, 44px);
}

.ppgReportTheme .table th,
.ppgReportTheme .table td {
  border-bottom: 1px solid rgba(27, 55, 101, 0.1);
}

.ppgReportTheme .table th {
  color: rgba(27, 55, 101, 0.75);
}

.ppgReportTheme.reportGate {
  display: grid;
  align-items: center;
}

.reportGatePanel {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: clamp(22px, 4vw, 42px);
  border-radius: 32px;
  border: 1px solid rgba(27, 55, 101, 0.12);
  background: #ffffff;
  box-shadow: 0 30px 70px rgba(27, 55, 101, 0.12);
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 12px;
}

.reportGatePanel::before {
  content: "";
  position: absolute;
  top: -120px;
  left: -120px;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(16, 114, 186, 0.2), transparent 65%);
  opacity: 0.7;
}

.reportGateEyebrow {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 11px;
  color: var(--accent);
  position: absolute;
  top: clamp(18px, 3vw, 26px);
  right: clamp(20px, 4vw, 32px);
}

.reportGateTitle {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.05;
  max-width: 620px;
}

.reportGateTitle span {
  display: block;
}

.reportGateCopy {
  margin: 0;
  color: var(--muted);
  max-width: 520px;
}

.reportGateForm {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  max-width: 520px;
}

.reportGateForm input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(27, 55, 101, 0.2);
  background: #f7fbff;
  color: var(--text);
}

.reportGateForm button {
  padding: 12px 18px;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 18px 36px rgba(221, 39, 38, 0.2);
}

.reportGateError {
  margin: 0;
  color: #c11f1f;
}

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

  .reportLogo {
    flex-direction: column;
    align-items: flex-start;
  }

  .reportLogoImage {
    width: min(220px, 70vw);
  }
}

.reportInsights {
  display: flex;
  flex-wrap: wrap;
  gap: calc(10px * var(--ui-space-scale));
}

.reportInsightItem {
  display: flex;
}

.helpBlock {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px dashed rgba(27, 55, 101, 0.2);
  background: rgba(16, 114, 186, 0.05);
  color: var(--text);
  font-size: 13px;
}

.helpBlock summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--accent-blue);
}

.helpBlock summary::-webkit-details-marker {
  display: none;
}

.helpBlock summary::after {
  content: "▾";
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  transition: transform 0.2s ease;
}

.helpBlock[open] summary::after {
  transform: rotate(180deg);
}

.helpBlockContent {
  margin-top: 8px;
  color: var(--muted);
}

.helpBlock ul {
  margin: 0;
  padding-left: 16px;
  display: grid;
  gap: 6px;
}

.helpBlock li {
  line-height: 1.4;
}

.helpBlock strong {
  color: var(--text);
  font-weight: 600;
}

.helpBlock.compact {
  margin-top: 12px;
  padding: 8px 10px;
  border-style: solid;
  background: rgba(27, 55, 101, 0.04);
}

.helpBlock.compact summary {
  font-size: 12px;
}

.helpBlock.compact li {
  font-size: 12px;
}

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

.reportFade {
  animation: reportRise 480ms ease both;
}

@keyframes reportRise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reportPrintArea {
  padding: calc(32px * var(--ui-space-scale));
  max-height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}

.printHidden {
  display: inline-flex;
}

@media print {
  html,
  body {
    background: #fff !important;
  }

  .printHidden {
    display: none !important;
  }

  .reportPrintArea {
    padding: 0 !important;
    max-height: none !important;
    overflow: visible !important;
  }

  .metricCard,
  .chartCard,
  .tableCard {
    box-shadow: none;
    border-color: rgba(0, 0, 0, 0.12);
  }

  .reportPage {
    gap: 12px;
  }

  .table {
    min-width: 0;
  }

  .helpBlock summary {
    display: none !important;
  }

  .helpBlock .helpBlockContent {
    display: block !important;
  }
}

.sectionHeader h3,
.sectionHeader p {
  overflow-wrap: anywhere;
}

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

.summaryGridScrollable {
  align-items: start;
}

.forecastTabs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.inventoryTableCard {
  margin-top: calc(6px * var(--ui-space-scale));
  padding-top: calc(16px * var(--ui-space-scale));
}

.inventorySectionHeader {
  gap: calc(18px * var(--ui-space-scale));
  margin-bottom: calc(12px * var(--ui-space-scale));
  padding-bottom: calc(10px * var(--ui-space-scale));
  border-bottom: 1px solid rgba(143, 165, 191, 0.12);
}

.inventorySectionCopy {
  display: grid;
  gap: 4px;
}

.inventorySectionCopy h3 {
  font-size: calc(20px * var(--ui-scale));
  letter-spacing: -0.02em;
}

.inventoryModeTabs {
  gap: calc(8px * var(--ui-space-scale));
  padding: calc(2px * var(--ui-space-scale));
  border-radius: calc(18px * var(--ui-scale));
  background: rgba(225, 233, 241, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.inventoryModeTabs .forecastTab {
  min-width: calc(170px * var(--ui-scale));
  padding: calc(10px * var(--ui-space-scale)) calc(18px * var(--ui-space-scale));
  border-radius: calc(16px * var(--ui-scale));
  background: transparent;
  box-shadow: none;
}

.inventoryModeTabs .forecastTab:not(.active) {
  border-color: transparent;
}

.inventoryModeTabs .forecastTab.active {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(241, 246, 251, 0.98));
  box-shadow:
    0 10px 24px rgba(0, 95, 158, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.forecastRunActions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
}

.forecastToggleGroup {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.forecastToggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  padding: 10px 14px;
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(25, 27, 30, 0.05);
}

.forecastToggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.forecastToggleTrack {
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: rgba(95, 103, 114, 0.24);
  border: 1px solid rgba(95, 103, 114, 0.18);
  position: relative;
  transition: background-color 0.18s ease, border-color 0.18s ease;
  flex: 0 0 auto;
}

.forecastToggleThumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(17, 24, 39, 0.2);
  transition: transform 0.18s ease;
}

.forecastToggle input:checked + .forecastToggleTrack {
  background: rgba(0, 95, 158, 0.22);
  border-color: rgba(0, 95, 158, 0.4);
}

.forecastToggle input:checked + .forecastToggleTrack .forecastToggleThumb {
  transform: translateX(18px);
}

.forecastToggle input:focus-visible + .forecastToggleTrack {
  box-shadow: 0 0 0 4px rgba(0, 95, 158, 0.12);
}

.fishbowlImportsToggle {
  margin-top: 12px;
  display: grid;
  gap: 6px;
}

.fishbowlImportsToggleLabel {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.fishbowlImportsToggleLabel span:last-child {
  font-weight: 600;
}

.devModeIndicator {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 50;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.85);
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.25);
  letter-spacing: 0.02em;
  border: none;
  cursor: pointer;
}

.devModePanel {
  position: fixed;
  left: 18px;
  bottom: 62px;
  z-index: 50;
  min-width: 220px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(17, 24, 39, 0.92);
  color: #f8fafc;
  font-size: 12px;
  line-height: 1.4;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.35);
  display: grid;
  gap: 6px;
}

.devModePanelRow {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.devModePanelRow strong {
  color: #cbd5f5;
  font-weight: 600;
}

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

.forecastModeTabs .forecastTab {
  min-width: 0;
}

.forecastMonthTabs .forecastTab {
  min-width: 120px;
  padding: 12px 14px;
}

.forecastTab {
  min-width: 180px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  color: var(--text);
  display: grid;
  gap: 6px;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(25, 27, 30, 0.05);
  max-width: 100%;
}

.forecastTab strong {
  font-size: 20px;
}

.forecastTab span,
.forecastTab strong {
  overflow-wrap: anywhere;
}

.forecastTab.active {
  border-color: rgba(0, 95, 158, 0.38);
  background: linear-gradient(180deg, rgba(0, 95, 158, 0.08), rgba(255, 255, 255, 0.94));
  box-shadow: 0 18px 32px rgba(0, 95, 158, 0.12);
}

.tabStatus {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.mappingRow {
  display: grid;
  gap: 8px;
}

.mappingRow select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.checkboxRow {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modalBackdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(17, 24, 39, 0.42);
}

.modalCard {
  width: min(980px, 100%);
  max-height: min(92vh, 960px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  padding: 22px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--panel-border);
  box-shadow: 0 30px 80px rgba(17, 24, 39, 0.22);
}

.modalFormGrid {
  min-height: 0;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
}

.modalFormFields {
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 18px;
  padding-right: 6px;
}

.modalField {
  min-width: 0;
}

.modalFieldFull {
  grid-column: 1 / -1;
}

.modalCheckboxField {
  align-items: flex-start;
  padding-top: 8px;
}

.modalActions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px solid rgba(143, 165, 191, 0.18);
  background: rgba(255, 255, 255, 0.98);
}

.summaryCard {
  padding: 14px;
  border-radius: 18px;
  background: rgba(93, 102, 112, 0.05);
  border: 1px solid rgba(143, 165, 191, 0.12);
  min-width: 0;
}

.summaryCardScrollable {
  max-height: 280px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sourceGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.assistantCard {
  display: grid;
  gap: 16px;
  min-width: 0;
  min-height: 70vh;
  border-color: rgba(0, 95, 158, 0.16);
  background:
    radial-gradient(circle at top left, rgba(84, 168, 224, 0.18), transparent 26%),
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.1), transparent 24%),
    linear-gradient(160deg, rgba(0, 76, 126, 0.96), rgba(0, 95, 158, 0.88) 52%, rgba(1, 70, 116, 0.96));
  box-shadow:
    0 28px 70px rgba(0, 52, 86, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.assistantCardEnabled {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  min-height: 0;
}

.assistantWorkspace {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  min-height: 0;
  height: 100%;
}

.assistantWorkspaceWithLogs {
  grid-template-rows: minmax(0, 1fr) minmax(220px, 32vh);
}

.assistantPageLayout {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: calc(10px * var(--ui-space-scale));
  min-width: 0;
  height: calc(100dvh - (64px * var(--ui-space-scale)));
  min-height: calc(100dvh - (64px * var(--ui-space-scale)));
  overflow: hidden;
}

.assistantPageLayout .pageHeader {
  margin-bottom: 0;
}

.assistantPageLayout > .assistantWorkspace {
  min-height: 0;
  overflow: hidden;
}

.assistantWorkspace > .assistantCard.assistantCardEnabled {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.assistantCardFullscreen {
  position: fixed;
  inset: 20px;
  z-index: 140;
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: auto;
  max-width: none;
  height: auto;
  max-height: calc(100dvh - 40px);
  margin: 0;
  padding: 24px;
  overflow: hidden;
  box-shadow: 0 32px 96px rgba(17, 24, 39, 0.28);
}

.assistantHeader {
  align-items: flex-start;
}

.assistantHeaderCompact {
  margin-bottom: 0;
}

.assistantHeaderActions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.assistantExamplesRow {
  display: grid;
  gap: 12px;
  min-width: 0;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}

.assistantExamplesLabel {
  color: rgba(241, 246, 251, 0.82);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.assistantExamplesControls {
  display: grid;
  gap: 12px;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.assistantExamplesControls select {
  flex: 1;
  min-width: 0;
  border-radius: 14px;
  border: 1px solid rgba(46, 49, 53, 0.1);
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
  padding: 12px 14px;
}

.assistantExamplesSelect {
  width: 100%;
}

.assistantExamplesActions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  justify-content: flex-end;
  flex-wrap: wrap;
  padding: 8px 10px;
  border-radius: 20px;
  border: 1px solid rgba(138, 155, 176, 0.22);
  background:
    linear-gradient(180deg, rgba(245, 248, 252, 0.96), rgba(224, 232, 242, 0.92)),
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.54), transparent 62%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    0 10px 22px rgba(14, 42, 76, 0.08);
}


.assistantExamplesSpacer {
  width: 1px;
  height: 22px;
  background: rgba(143, 165, 191, 0.22);
  margin: 0 4px;
}

.assistantCollapsedState {
  border-radius: 20px;
  border: 1px dashed rgba(0, 95, 158, 0.28);
  background: linear-gradient(180deg, rgba(0, 95, 158, 0.05), rgba(255, 255, 255, 0.8));
  padding: 18px;
}

.assistantCollapsedCopy {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
}

.assistantCollapsedCopy p,
.assistantCollapsedCopy strong {
  margin: 0;
}

.assistantMessages {
  display: grid;
  gap: 12px;
  flex: 1;
  min-width: 0;
  min-height: 0;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
  align-content: start;
  padding: 8px;
  border-radius: 22px;
  border: 1px solid rgba(46, 49, 53, 0.08);
  background: linear-gradient(180deg, rgba(240, 241, 243, 0.8), rgba(255, 255, 255, 0.72));
}

.assistantCardFullscreen .assistantMessages {
  flex: 1;
  min-height: 0;
  max-height: none;
}

.assistantMessage {
  max-width: 100%;
  min-width: 0;
  height: fit-content;
  align-self: start;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(46, 49, 53, 0.08);
  white-space: pre-wrap;
  box-shadow: 0 12px 28px rgba(25, 27, 30, 0.06);
}

.assistantMessageMeta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.assistantMessage p {
  margin: 0;
  line-height: 1.6;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.assistantMessageBot {
  width: min(100%, 1120px);
  justify-self: start;
  background: rgba(255, 255, 255, 0.9);
}

.assistantMessageUser {
  width: min(60%, 520px);
  margin-left: auto;
  background: linear-gradient(180deg, rgba(0, 95, 158, 0.08), rgba(255, 255, 255, 0.9));
  border-color: rgba(0, 95, 158, 0.12);
}

.assistantMessageRole {
  display: inline-block;
  color: var(--steel);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.assistantMessageExpand {
  border: 0;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.assistantMessageOverlay {
  position: fixed;
  inset: 18px;
  z-index: 150;
  display: grid;
  align-items: stretch;
  background: rgba(17, 24, 39, 0.28);
  backdrop-filter: blur(6px);
}

.assistantMessageOverlayCard {
  width: min(960px, 100%);
  max-width: 100%;
  margin: auto;
  display: grid;
  gap: 14px;
  padding: 24px;
  max-height: calc(100dvh - 36px);
}

.assistantMessageOverlayBody {
  display: grid;
  gap: 16px;
  overflow-y: auto;
  white-space: pre-wrap;
}

.assistantMessageOverlayBody p {
  margin: 0;
  line-height: 1.7;
}

.assistantComposer {
  display: grid;
  gap: 12px;
  margin-top: auto;
  margin: 14px;
  min-width: 0;
  padding: 16px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background:
    linear-gradient(180deg, rgba(244, 247, 251, 0.94), rgba(227, 236, 245, 0.88)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 12px 28px rgba(0, 40, 70, 0.12);
}

.assistantCardFullscreen .assistantComposer {
  margin-top: auto;
}

.assistantComposerRow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  min-width: 0;
  align-items: start;
}

.assistantComposer textarea {
  width: 100%;
  min-height: 58px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(46, 49, 53, 0.1);
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
  resize: vertical;
}

.assistantSendButton {
  justify-content: center;
  min-height: 58px;
  align-self: stretch;
  margin: 1px 1px 1px 0;
}

.assistantLoading {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.assistantVisibilityCard {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.assistantVisibilityCopy {
  min-width: 0;
}

.assistantVisibilityCopy h3 {
  margin: 6px 0 8px;
}

.assistantVisibilityCopy p {
  margin: 0;
}

.assistantVisibilityButton {
  flex-shrink: 0;
}

.forecastMinimumControl {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.forecastMinimumControl select {
  min-width: 160px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(46, 49, 53, 0.1);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  font-weight: 600;
}

.segmentedControl {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.segmentedButton {
  justify-content: center;
  min-width: 108px;
}

.assistantExportLink {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.assistantMessage .secondaryButton,
.assistantMessage .assistantExportLink {
  background: linear-gradient(180deg, #f1f4f7 0%, #e5eaef 100%);
  border-color: rgba(46, 49, 53, 0.12);
  color: var(--text);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 4px 12px rgba(31, 41, 55, 0.06);
}

.assistantMessage .secondaryButton:hover,
.assistantMessage .assistantExportLink:hover {
  background: linear-gradient(180deg, #f7f9fb 0%, #ebf0f4 100%);
  border-color: rgba(46, 49, 53, 0.18);
}

.assistantLogSection {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
}

.assistantLogList {
  display: grid;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.assistantLogItem {
  display: grid;
  gap: 10px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(46, 49, 53, 0.08);
  background: rgba(255, 255, 255, 0.72);
}

.assistantLogMeta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.assistantLogMeta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(93, 102, 112, 0.08);
}

.assistantLogCopy {
  display: grid;
  gap: 12px;
}

.assistantLogCopy strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  color: var(--steel);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.assistantLogCopy p {
  margin: 0;
  line-height: 1.6;
  white-space: pre-wrap;
}

.overviewAssistantCta {
  display: grid;
  gap: 18px;
  margin-top: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.9)),
    linear-gradient(135deg, rgba(0, 95, 158, 0.06), rgba(0, 95, 158, 0.02));
}

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

.overviewAssistantHeader h3,
.overviewAssistantQuestionsHeader strong {
  margin: 0;
}

.overviewAssistantHeader > div,
.overviewAssistantQuestionsHeader {
  display: grid;
  gap: 8px;
}

.overviewAssistantOpen {
  flex-shrink: 0;
}

.overviewAssistantAskForm {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.overviewAssistantInputWrap {
  display: grid;
  gap: 8px;
}

.overviewAssistantInputLabel {
  color: var(--steel);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.overviewAssistantInputWrap input {
  width: 100%;
  min-height: 54px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(46, 49, 53, 0.1);
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
}

.overviewAssistantAskButton {
  min-height: 54px;
  justify-content: center;
}

.overviewAssistantQuestions {
  display: grid;
  gap: 12px;
}

.overviewAssistantQuestionList {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
}

.overviewAssistantQuestion {
  display: inline-flex;
  align-items: center;
  min-height: 52px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(0, 95, 158, 0.14);
  background: linear-gradient(180deg, rgba(0, 95, 158, 0.06), rgba(255, 255, 255, 0.92));
  color: var(--text);
  font-weight: 600;
  line-height: 1.45;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease;
}

.overviewAssistantQuestion:hover,
.overviewAssistantQuestion:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(0, 95, 158, 0.28);
  box-shadow: 0 16px 30px rgba(0, 95, 158, 0.08);
}

.sourceCard {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(46, 49, 53, 0.1);
  background: rgba(255, 255, 255, 0.7);
}

.sourceCard.active {
  border-color: rgba(0, 95, 158, 0.24);
  background: linear-gradient(180deg, rgba(0, 95, 158, 0.06), rgba(255, 255, 255, 0.88));
}

.sourceCardHeader {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.sourceLabel {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

.sourceMetaRow {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  color: var(--muted);
  font-size: 13px;
}

.sourceTagMuted {
  background: rgba(93, 102, 112, 0.1);
  color: var(--steel);
}

.sourceToggleButton {
  justify-content: center;
}

.sourceToggleActive {
  border-color: rgba(0, 95, 158, 0.18);
  background: rgba(0, 95, 158, 0.06);
}

.sourceTagSuccess {
  background: rgba(0, 95, 158, 0.12);
  color: var(--accent-strong);
}

.sourceTagWarning {
  background: rgba(194, 120, 42, 0.14);
  color: #9a5f12;
}

.supplierInventorySearchCard {
  gap: 16px;
}

.supplierInventorySearchHeader {
  margin-bottom: 0;
}

.supplierInventorySearchGrid {
  align-items: start;
}

.supplierInventorySearchSideColumn {
  display: grid;
  gap: 14px;
}

.supplierInventorySearchForm,
.supplierInventoryRecentSearches {
  gap: 14px;
}

.supplierInventoryErrorReports {
  gap: 12px;
}

.supplierInventorySearchForm {
  background: linear-gradient(180deg, rgba(246, 250, 255, 0.98), rgba(234, 242, 251, 0.95));
  border-color: rgba(30, 85, 140, 0.18);
}

.supplierInventorySettingsControl {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.supplierInventorySettingsButton {
  position: relative;
}

.supplierInventorySettingsButton::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(24, 25, 28, 0.94);
  color: #f4f5f6;
  font-size: 12px;
  line-height: 1;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  transition: opacity 140ms ease;
  z-index: 40;
}

.supplierInventorySettingsButton:hover::after,
.supplierInventorySettingsButton:focus-visible::after {
  opacity: 1;
}

.supplierInventorySettingsPopover {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  min-width: 220px;
  border-radius: 14px;
  border: 1px solid rgba(46, 49, 53, 0.14);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 32px rgba(31, 41, 55, 0.12);
  z-index: 50;
}

.supplierInventorySettingsPopover .chartSelect {
  min-width: 100%;
}

.supplierInventorySettingsCheckbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
}

.supplierInventorySettingsCheckbox input {
  width: 16px;
  height: 16px;
}

.supplierInventoryColumnSettingsPopover {
  min-width: 280px;
}

.supplierInventoryColumnSettingsHeader {
  display: grid;
  gap: 4px;
}

.supplierInventoryColumnSettingsList {
  display: grid;
  gap: 8px;
}

.supplierInventoryColumnSettingsRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.supplierInventoryColumnSettingsLabel {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.supplierInventoryColumnSettingsActions {
  display: inline-flex;
  gap: 6px;
}

.supplierInventoryColumnSettingsHint {
  margin-left: 6px;
  font-size: 12px;
}

.supplierInventorySearchCardMaximized .supplierInventorySearchFilters {
  margin-top: 10px;
  padding-top: 14px;
}

body.supplier-inventory-results-maximized .contentInner {
  width: 100%;
  max-width: 100%;
}

body.supplier-inventory-results-maximized .pageHeader {
  display: none;
}

body.supplier-inventory-results-maximized .contentInner > :not(.supplierInventorySearchCard) {
  display: none;
}

body.supplier-inventory-results-maximized .sidebarDesktop {
  opacity: 0;
  transform: translateX(-100%);
  pointer-events: none;
}

body.supplier-inventory-results-maximized .sidebarRail,
body.supplier-inventory-results-maximized .sidebarRailHidden {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}


.supplierInventorySearchCardMaximized .supplierInventorySearchFilters {
  position: sticky;
  top: calc(env(safe-area-inset-top) + 10px);
  z-index: 12;
  background: var(--panel);
  padding-bottom: 12px;
  border-radius: calc(20px * var(--ui-scale));
  box-shadow: 0 12px 24px rgba(31, 41, 55, 0.08);
}

.supplierInventorySearchCardMaximized .supplierInventorySearchSelectRow {
  padding-left: calc(12px * var(--ui-space-scale));
  padding-right: calc(12px * var(--ui-space-scale));
}

.supplierInventorySearchCardMaximized .providerTabs {
  background: rgba(255, 255, 255, 0.9);
  padding: 10px;
  border-radius: calc(16px * var(--ui-scale));
  border: 1px solid rgba(143, 165, 191, 0.24);
}

.supplierInventorySearchTextarea {
  width: 100%;
  min-height: 136px;
  resize: vertical;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(46, 49, 53, 0.1);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  font: inherit;
  line-height: 1.5;
}

.supplierInventorySearchActions {
  justify-content: flex-start;
}

.supplierInventorySearchActionButton {
  background: linear-gradient(180deg, rgba(238, 242, 247, 0.98), rgba(225, 232, 240, 0.96));
  border-color: rgba(77, 91, 111, 0.16);
  box-shadow: 0 10px 22px rgba(31, 41, 55, 0.08);
}

.supplierInventorySearchActionButton:hover {
  background: linear-gradient(180deg, rgba(245, 248, 252, 1), rgba(231, 237, 244, 0.98));
  border-color: rgba(47, 61, 99, 0.22);
}

.supplierInventoryReportTextarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(46, 49, 53, 0.12);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  font: inherit;
  line-height: 1.5;
}

.supplierInventoryReportActions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-start;
}

.supplierInventoryErrorList {
  display: grid;
  gap: 10px;
}

.supplierInventoryErrorItem {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(46, 49, 53, 0.08);
  background: rgba(255, 255, 255, 0.78);
}

.supplierInventorySearchHelp,
.supplierInventorySearchSummary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.supplierInventorySearchFilters {
  display: grid;
  gap: 12px;
  margin-top: 20px;
  padding-top: 22px;
  border-top: 1px solid rgba(143, 165, 191, 0.26);
}

.supplierInventorySearchSelectRow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.supplierInventorySearchSelectRow .sourceLabel {
  margin: 0;
  white-space: nowrap;
}

.supplierInventorySearchSelectControls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  flex: 1 1 360px;
  min-width: 0;
}

.supplierInventorySearchSelectActions {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin-left: auto;
  flex: 0 0 auto;
}

.supplierInventorySearchSelectWrap {
  display: grid;
  width: 150px;
  min-width: 150px;
  max-width: 150px;
  flex: 0 0 150px;
}

.supplierInventorySearchSelectWrap .chartSelect {
  min-height: 42px;
  height: 42px;
  padding: 8px 12px;
  line-height: 1.2;
  background: linear-gradient(180deg, rgba(235, 240, 247, 0.98), rgba(223, 231, 241, 0.96));
  border-color: rgba(77, 91, 111, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 10px 22px rgba(31, 41, 55, 0.06);
}

.supplierInventorySearchFinishWrap {
  display: grid;
  width: 150px;
  min-width: 150px;
  max-width: 150px;
  flex: 0 0 150px;
}

.supplierInventorySearchFinishWrap .chartSelect {
  min-height: 42px;
  height: 42px;
  padding: 8px 12px;
  line-height: 1.2;
  background: linear-gradient(180deg, rgba(235, 240, 247, 0.98), rgba(223, 231, 241, 0.96));
  border-color: rgba(77, 91, 111, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 10px 22px rgba(31, 41, 55, 0.06);
}

.supplierInventorySearchTextFilter {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  min-height: 42px;
  flex: 1 1 220px;
  min-width: min(220px, 100%);
  max-width: 280px;
  border-radius: 12px;
  border: 1px solid rgba(77, 91, 111, 0.18);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.supplierInventorySearchTextFilter input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 0.95rem;
  color: inherit;
  outline: none;
}

.supplierInventorySearchTextFilter svg {
  color: rgba(44, 62, 80, 0.7);
}

.supplierInventoryRecentList {
  display: grid;
  gap: 10px;
  max-height: 380px;
  overflow: auto;
  padding-right: 6px;
}

.supplierInventoryRecentLink {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(46, 49, 53, 0.08);
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  text-decoration: none;
}

.supplierInventoryRecentLink:hover {
  border-color: rgba(0, 95, 158, 0.2);
  background: rgba(255, 255, 255, 0.92);
}

.supplierInventorySearchEmpty {
  margin-top: 0;
}

.supplierInventorySearchScroll {
  margin-top: 0;
}

.supplierInventorySearchTable thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(249, 251, 253, 0.98);
  box-shadow: inset 0 -1px 0 rgba(143, 165, 191, 0.14);
}

.supplierInventorySearchTable thead th.resizableTableHeader {
  position: relative;
  padding-right: calc(18px * var(--ui-space-scale));
}

.supplierInventorySearchTable thead th.resizableTableHeader > span {
  display: inline-block;
  padding-right: 8px;
}

.columnResizer {
  position: absolute;
  top: 0;
  right: 2px;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  border-right: 2px solid transparent;
}

.columnResizer:hover {
  border-right-color: rgba(0, 95, 158, 0.35);
}

.supplierInventorySearchTable td,
.supplierInventorySearchTable th {
  vertical-align: top;
}

.supplierInventorySearchTable tbody tr:nth-child(even) td {
  background: rgba(236, 240, 246, 0.7);
}

.sourcingSettingsCard {
  gap: 16px;
}

.sourcingSettingsHeader {
  margin-bottom: 0;
}

.sourcingSettingsSummary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.sourcingSettingsGrid {
  align-items: start;
}

.sourcingProviderStack {
  display: grid;
  gap: 12px;
}

.sourcingProviderCard {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(46, 49, 53, 0.08);
  background: rgba(255, 255, 255, 0.76);
}

.sourcingProviderCardHeader {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.sourceInlineLink {
  color: var(--accent-strong);
  font-weight: 700;
}

.sourcingSettingsWide {
  grid-column: 1 / -1;
}

.sourcingSettingsActions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.sourcingModeButtons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.sourcingWarningCard {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(194, 120, 42, 0.22);
  background: rgba(194, 120, 42, 0.08);
  color: #7a5218;
  line-height: 1.55;
}

.sourcingRefreshRow {
  display: flex;
  justify-content: flex-end;
}

.sourcingStatusError {
  color: #b44949;
}

.sourcingNoticeStack {
  display: grid;
  gap: 10px;
}

.sourcingNotice {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(143, 165, 191, 0.16);
  background: rgba(255, 255, 255, 0.82);
  line-height: 1.55;
}

.sourcingNoticeInfo {
  border-color: rgba(0, 95, 158, 0.18);
  background: linear-gradient(180deg, rgba(0, 95, 158, 0.05), rgba(255, 255, 255, 0.88));
}

.sourcingNoticeWarning {
  border-color: rgba(194, 120, 42, 0.2);
  background: linear-gradient(180deg, rgba(194, 120, 42, 0.06), rgba(255, 255, 255, 0.9));
}

.sourcingNoticeError {
  border-color: rgba(180, 73, 73, 0.2);
  background: linear-gradient(180deg, rgba(180, 73, 73, 0.06), rgba(255, 255, 255, 0.9));
}

.sourcingSummaryGrid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 16px;
  border-radius: 22px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.6), rgba(214, 230, 246, 0.35));
  border: 1px solid rgba(128, 154, 186, 0.25);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.sourcingSummaryGrid .summaryCard {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.75), rgba(244, 248, 252, 0.6));
  border-color: rgba(120, 145, 176, 0.18);
  box-shadow: 0 10px 24px rgba(33, 65, 95, 0.08);
}

.sourcingSummaryGrid .summaryLabel {
  color: rgba(73, 92, 114, 0.9);
}

.providerBrowserCard {
  gap: 16px;
}

.sourcingWorkspaceCard {
  gap: 18px;
}

.sourcingWorkspaceHeader {
  margin-bottom: 0;
}

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

.sourcingWorkspaceTab {
  min-width: 0;
}

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

.sourcingResultsCard {
  gap: 16px;
}

.sourcingResultsHeader {
  margin-bottom: 0;
}

.sourcingResultsBody {
  display: grid;
  gap: 18px;
}

.providerTabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 10px;
  min-width: 0;
  max-width: 100%;
}

.providerTab {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(46, 49, 53, 0.1);
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  min-width: 0;
}

.providerTabActive {
  border-color: rgba(0, 95, 158, 0.24);
  background: linear-gradient(180deg, rgba(0, 95, 158, 0.09), rgba(255, 255, 255, 0.9));
  box-shadow: 0 12px 28px rgba(0, 95, 158, 0.08);
}

.providerTabTitle {
  font-weight: 800;
}

.providerTabMeta {
  color: var(--muted);
  font-size: 13px;
}

.providerInventoryMeta {
  display: grid;
  gap: 12px;
}

.providerInventorySummary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.providerInventoryTools {
  justify-content: space-between;
  align-items: center;
}

.providerInventoryScroll {
  margin-top: 0;
}

.providerInventoryTable thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(249, 251, 253, 0.98);
  box-shadow: inset 0 -1px 0 rgba(143, 165, 191, 0.14);
}

.providerInventoryTable td,
.providerInventoryTable th {
  vertical-align: top;
}

.sourcingTableTools {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.sourcingTableSearch {
  margin-top: 0;
  min-width: min(100%, 320px);
}

.sourcingTableSearch input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(46, 49, 53, 0.1);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
}

.sourcingTableScroll {
  margin-top: 4px;
}

.sourcingTable thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(249, 251, 253, 0.98);
  box-shadow: inset 0 -1px 0 rgba(143, 165, 191, 0.14);
}

.sourcingTable td,
.sourcingTable th {
  vertical-align: top;
}

.summaryLabel {
  text-transform: capitalize;
  margin-bottom: 6px;
}

.summaryCard p {
  overflow-wrap: anywhere;
}

.forecastPanel {
  min-width: 0;
}

.tableScroll {
  display: block;
  overflow-x: auto;
  overflow-y: hidden;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.tableLink {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.tableLink:hover {
  text-decoration: underline;
}

.chartPieLegend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px 14px;
  margin-top: 16px;
}

.chartPieLegendItem {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.chartPieLegendSwatch {
  width: 12px;
  height: 12px;
  margin-top: 4px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.chartPieLegendText {
  min-width: 0;
}

.chartPieLegendLabel {
  display: block;
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.chartPieLegendMeta {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.errorCard {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(239, 68, 68, 0.25);
  background: rgba(239, 68, 68, 0.08);
}

.errorPayload {
  margin: 10px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: #f6d9d9;
  font-size: 12px;
}

.errorTag {
  gap: 8px;
  background: rgba(239, 68, 68, 0.12);
  color: #fecaca;
}

.compactButton {
  padding: calc(8px * var(--ui-space-scale)) calc(10px * var(--ui-space-scale));
  border-radius: calc(12px * var(--ui-scale));
}

.cellInput {
  width: 100%;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid rgba(143, 165, 191, 0.16);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.selectedButton {
  border-color: rgba(0, 95, 158, 0.35);
  background: rgba(0, 95, 158, 0.09);
}

.skipCandidate {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(239, 68, 68, 0.2);
  background: rgba(239, 68, 68, 0.05);
}

.skipCandidate input {
  margin-top: 3px;
}

.skipCandidate p {
  margin: 0;
}

.spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1100px) {
  .sidebarRail {
    display: none;
  }

  .shell.shellCollapsed .content {
    margin-left: 0;
  }

  .sidebarMobile {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(86vw, 360px);
    max-width: calc(100vw - max(12px, env(safe-area-inset-left)) - max(12px, env(safe-area-inset-right)));
    height: 100dvh;
    z-index: 30;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 14px;
    padding-top: calc(62px + env(safe-area-inset-top));
    padding-right: max(14px, env(safe-area-inset-right));
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
    padding-left: max(14px, env(safe-area-inset-left));
    overflow: hidden;
    overflow-x: hidden;
    box-shadow: 0 30px 80px rgba(17, 24, 39, 0.35);
  }

  .sidebar.sidebarHidden {
    display: grid;
    transform: translateX(-100%);
    opacity: 0;
  }

  .sidebarToggle {
    top: calc(12px + env(safe-area-inset-top));
    left: max(12px, env(safe-area-inset-left));
  }

  .sidebarToggleInside {
    top: calc(14px + env(safe-area-inset-top));
    right: max(14px, env(safe-area-inset-right));
    left: auto;
  }

  .nav {
    align-content: start;
    overflow-y: auto;
    padding-right: 4px;
    padding-bottom: 10px;
  }

  .content {
    margin-left: 0;
    width: 100%;
    max-width: 100%;
    padding:
      calc(76px + env(safe-area-inset-top))
      max(16px, env(safe-area-inset-right))
      calc(20px + env(safe-area-inset-bottom))
      max(16px, env(safe-area-inset-left));
    overflow-x: hidden;
  }

  .contentInner {
    width: 100%;
    gap: 16px;
  }

  .loginShell {
    padding: 20px 16px 24px;
    place-items: stretch;
  }

  .loginFrame {
    grid-template-columns: 1fr;
    gap: 16px;
    align-items: start;
  }

  .loginBrandPanel {
    padding: 22px;
  }

  .loginFormCard {
    padding: 24px 22px;
  }

  .loginHeading {
    font-size: 38px;
  }

  .loginLead {
    max-width: none;
    font-size: 16px;
  }

  .pageHeader {
    margin-bottom: 20px;
    gap: 14px;
  }

  .assistantPageLayout {
    gap: 8px;
    height: auto;
    min-height: calc(100dvh - 92px);
  }

  .pageHeader h2,
  .pageHeader h1 {
    font-size: clamp(28px, 5.2vw, 32px);
    line-height: 1.08;
  }

  .grid.two,
  .grid.three {
    grid-template-columns: 1fr;
  }

  .summaryGrid {
    grid-template-columns: 1fr;
  }

  .chartFilterRow {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .chartFilterActions {
    align-items: flex-start;
    flex-direction: column;
  }

  .stockRefreshControls,
  .stockRefreshMeta {
    justify-items: start;
    text-align: left;
  }

  .metricCard,
  .chartCard,
  .tableCard,
  .formCard,
  .hero {
    padding: 16px;
    border-radius: 20px;
    overflow: hidden;
  }

  .metricValue {
    font-size: 34px;
  }

  .brandImageWrap {
    max-width: 214px;
    padding-bottom: 10px;
  }

  .brandTitle {
    font-size: 28px;
    white-space: normal;
  }

  .sidebarLead {
    max-width: none;
    font-size: 14px;
    line-height: 1.45;
  }

  .sidebarTop {
    gap: 12px;
    padding-top: 10px;
  }

  .nav {
    padding-top: 18px;
    padding-bottom: 8px;
  }

  .sidebarBottom {
    gap: 10px;
    padding-top: 10px;
    padding-bottom: 0;
    border-top-color: rgba(255, 255, 255, 0.12);
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02)),
      linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent);
    border-radius: 18px 18px 0 0;
  }

  .summaryCard {
    padding: 12px;
  }

  .sourceCardHeader {
    flex-direction: column;
    align-items: stretch;
  }

  .sourcingProviderCardHeader {
    flex-direction: column;
    align-items: stretch;
  }

  .sourcingSummaryGrid {
    grid-template-columns: 1fr;
  }

  .sourcingWorkspaceTabs {
    grid-template-columns: 1fr;
  }

  .sourcingRefreshRow {
    justify-content: flex-start;
  }

  .sourcingTableTools {
    align-items: stretch;
    justify-content: flex-start;
  }

  .providerInventoryTools {
    justify-content: flex-start;
  }

  .sourcingTableSearch {
    min-width: 0;
    width: 100%;
  }

  .assistantHeaderActions {
    width: 100%;
    justify-content: flex-start;
  }

  .assistantVisibilityCard {
    align-items: flex-start;
    flex-direction: column;
  }

  .assistantVisibilityButton {
    width: 100%;
    justify-content: center;
  }

  .assistantExamplesControls {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  
  .assistantExamplesRow {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 8px;
  }

  .assistantPageLayout .pageHeader {
    margin-bottom: 0;
    gap: 6px;
  }

  .assistantPageLayout .pageHeader .eyebrow {
    margin-bottom: 4px;
    font-size: 11px;
    letter-spacing: 0.16em;
  }

  .assistantPageLayout .pageHeader h2 {
    font-size: clamp(18px, 6.4vw, 24px);
    line-height: 1;
    max-width: none;
    letter-spacing: -0.04em;
  }

  .assistantPageLayout .pageHeader .muted {
    max-width: none;
    font-size: 13px;
    line-height: 1.32;
  }

  .assistantCard {
    min-height: 0;
    gap: 8px;
    padding: 12px;
    border-radius: 20px;
  }

  .assistantExamplesLabel {
    font-size: 11px;
    letter-spacing: 0.14em;
  }

  .assistantExamplesControls select {
    min-height: 44px;
    padding: 10px 12px;
    font-size: 16px;
    border-radius: 15px;
  }

  .assistantExamplesActions {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    width: 100%;
    gap: 8px;
    padding: 4px;
    border-radius: 12px;
  }

  .assistantExamplesActions .secondaryButton {
    flex: 1 1 0;
    justify-content: center;
    min-width: 0;
    min-height: 34px;
    padding: 6px 8px;
    gap: 4px;
    font-size: 11px;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .assistantExamplesActions .secondaryButton svg {
    display: none;
  }

  .assistantMessages {
    min-height: 150px;
    max-height: min(38dvh, 340px);
    padding: 6px;
    border-radius: 18px;
    gap: 8px;
  }

  .assistantMessage {
    padding: 12px;
    border-radius: 16px;
  }

  .assistantMessageBot {
    width: 100%;
  }

  .assistantMessageUser {
    width: min(94%, 100%);
  }

  .assistantMessage p {
    font-size: 15px;
    line-height: 1.55;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .assistantComposer {
    margin: 8px 0 0;
    padding: 10px;
    border-radius: 16px;
  }

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

  .assistantComposer textarea {
    min-height: 64px;
    max-height: 22dvh;
    font-size: 16px;
    border-radius: 16px;
  }

  .assistantSendButton {
    width: 100%;
    min-height: 50px;
  }

  .assistantLogSection {
    gap: 10px;
  }

  .assistantLogList {
    max-height: 32dvh;
  }

  .overviewAssistantHeader {
    flex-direction: column;
    align-items: stretch;
  }

  .overviewAssistantOpen {
    width: 100%;
    justify-content: center;
  }

  .overviewAssistantAskForm {
    grid-template-columns: 1fr;
  }

  .overviewAssistantAskButton {
    width: 100%;
  }

  .assistantExamplesSpacer {
    display: none;
  }

  .forecastRunActions {
    width: 100%;
    justify-content: stretch;
  }

  .forecastToggleGroup {
    width: 100%;
    justify-items: stretch;
  }

  .forecastToggle {
    width: 100%;
    justify-content: center;
  }

  .assistantMessages {
    max-height: 360px;
  }

  .assistantCardFullscreen {
    inset: 12px;
    height: auto;
    max-height: calc(100dvh - 24px);
    padding: 18px;
  }

  .assistantMessageMeta {
    align-items: flex-start;
    flex-direction: column;
  }

  .assistantMessageOverlay {
    inset: 10px;
  }

  .assistantMessageOverlayCard {
    padding: 18px;
    max-height: calc(100dvh - 20px);
  }

  .forecastTabs {
    gap: 8px;
    margin-inline: 0;
    padding-inline: 0;
    overflow-x: visible;
    flex-wrap: wrap;
  }

  .forecastTab {
    min-width: 0;
    padding: 12px 14px;
    flex: 1 1 100%;
  }

  .forecastTab strong {
    font-size: 18px;
  }

  .forecastModeTabs,
  .forecastManufacturerTabs,
  .forecastMonthTabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }

  .forecastManufacturerTabs .forecastTab,
  .forecastMonthTabs .forecastTab {
    width: 100%;
  }

  .tableScroll {
    margin-inline: -4px;
    padding-inline: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .chartPieLegend {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .chartPieLegendLabel {
    font-size: 13px;
  }

  .table th,
  .table td {
    padding: 10px 8px;
  }

  .sectionHeader {
    align-items: flex-start;
    flex-direction: column;
  }

  .rowActions,
  .modalActions {
    width: 100%;
  }

  .rowActions > *,
  .modalActions > * {
    flex: 1 1 160px;
    justify-content: center;
  }

  .uploadZone {
    padding: 20px;
  }

  .formGrid input,
  .formGrid select,
  .textareaField,
  .cellInput,
  .mappingRow select {
    font-size: 16px;
  }

  .sidebarToggleCollapsed {
    top: calc(12px + env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
    left: auto;
  }
}

@media (max-width: 700px) {
  .loginShell {
    padding:
      calc(20px + env(safe-area-inset-top))
      14px
      calc(18px + env(safe-area-inset-bottom));
  }

  .loginBackdrop {
    background:
      radial-gradient(circle at top left, rgba(0, 95, 158, 0.22), transparent 36%),
      radial-gradient(circle at bottom right, rgba(93, 102, 112, 0.18), transparent 34%),
      linear-gradient(180deg, #eef0f3 0%, #d9dde1 100%);
  }

  .loginFrame {
    gap: 14px;
  }

  .loginBrandPanel,
  .loginFormCard {
    border-radius: 28px;
  }

  .loginBrandPanel {
    gap: 18px;
    padding: 18px;
  }

  .loginLogoWrap {
    width: min(100%, 220px);
    padding-bottom: 12px;
  }

  .loginHeading {
    font-size: clamp(26px, 8.8vw, 30px);
    line-height: 1.02;
  }

  .loginLead {
    font-size: 15px;
    line-height: 1.55;
  }

  .loginHighlights {
    gap: 10px;
  }

  .loginHighlight {
    padding: 14px 15px;
    border-radius: 18px;
  }

  .loginFormCard {
    padding: 20px 18px;
  }

  .loginFormTitle {
    font-size: 28px;
  }

  .loginFormLead {
    margin-top: 8px;
    font-size: 15px;
  }

  .loginForm {
    gap: 14px;
    margin-top: 18px;
  }

  .loginField input {
    min-height: 54px;
    border-radius: 16px;
    padding: 15px 16px;
  }

  .loginSubmit {
    min-height: 54px;
    border-radius: 16px;
  }

  .content {
    width: 100%;
    max-width: 100%;
    padding:
      calc(72px + env(safe-area-inset-top))
      max(12px, env(safe-area-inset-right))
      calc(16px + env(safe-area-inset-bottom))
      max(12px, env(safe-area-inset-left));
  }

  .contentInner {
    gap: 14px;
  }

  .assistantPageLayout {
    height: auto;
    min-height: calc(100dvh - 84px);
  }

  .pageHeader h2,
  .pageHeader h1 {
    font-size: clamp(24px, 9vw, 28px);
  }

  .brandTitle {
    font-size: 28px;
  }

  .sidebarMobile {
    width: min(82vw, 310px);
    gap: 10px;
    padding:
      calc(50px + env(safe-area-inset-top))
      max(12px, env(safe-area-inset-right))
      calc(12px + env(safe-area-inset-bottom))
      max(12px, env(safe-area-inset-left));
  }

  .sidebarTop {
    gap: 8px;
    padding-top: 2px;
  }

  .brandPanel {
    gap: 6px;
  }

  .brandImageWrap {
    max-width: 138px;
    padding-bottom: 8px;
  }

  .brandTitle {
    font-size: 18px;
  }

  .sidebarLead {
    display: none;
  }

  .sidebarToggleInside {
    top: calc(10px + env(safe-area-inset-top));
    right: max(10px, env(safe-area-inset-right));
  }

  .nav {
    gap: 8px;
    padding-top: 14px;
    padding-bottom: 6px;
  }

  .sidebarBottom {
    gap: 8px;
    padding-top: 8px;
    padding-bottom: 0;
    border-radius: 16px 16px 0 0;
  }

  .navLink,
  .secondaryButton,
  .primaryButton {
    min-height: 40px;
  }

  .navLink {
    padding: 9px 12px;
    font-size: 15px;
  }

  .assistantExamplesActions {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
  }

  .assistantExamplesActions .secondaryButton {
    flex: 1 1 0;
    min-width: 0;
    min-height: 32px;
    padding: 5px 7px;
    font-size: 10px;
    gap: 4px;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .assistantExamplesActions .secondaryButton svg {
    display: none;
  }

  .sourcingSettingsActions,
  .sourcingModeButtons {
    flex-direction: column;
  }

  .sourcingSettingsActions .secondaryButton,
  .sourcingModeButtons .secondaryButton {
    width: 100%;
    justify-content: center;
  }

  .providerTabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    margin-inline: -2px;
    padding-inline: 2px 0;
    padding-bottom: 4px;
    scroll-snap-type: x proximity;
  }

  .providerTab {
    flex: 0 0 min(240px, calc(100vw - 44px));
    padding: 12px 14px;
    scroll-snap-align: start;
  }

  .supplierInventorySearchActions {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 10px;
  }

  .supplierInventorySearchActionButton {
    width: auto;
    flex: 0 0 auto;
  }

  .supplierInventorySearchSelectRow {
    align-items: stretch;
    gap: 10px;
  }

  .supplierInventorySearchSelectRow .sourceLabel {
    white-space: normal;
  }

  .supplierInventorySearchSelectControls {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 8px;
    width: 100%;
  }

  .supplierInventorySearchSelectWrap {
    order: 1;
    width: 150px;
    min-width: 150px;
    max-width: 150px;
    flex: 0 0 150px;
  }

  .supplierInventorySearchFinishWrap {
    order: 2;
    width: 150px;
    min-width: 150px;
    max-width: 150px;
    flex: 0 0 150px;
  }

  .supplierInventorySearchTextFilter {
    order: 3;
    flex: 1 1 220px;
    min-width: 0;
    max-width: none;
  }

  .supplierInventorySearchSelectActions {
    order: 4;
    align-self: end;
    margin-left: auto;
  }

  .supplierInventorySearchSelectActions .secondaryButton {
    min-height: 42px;
    width: 42px;
    padding-inline: 0;
    justify-content: center;
  }

  .supplierInventorySearchForm .supplierInventorySearchActions > button[type="submit"] {
    order: 2;
    margin-left: auto;
  }

  .supplierInventorySearchForm .supplierInventorySearchActions > button[type="button"] {
    order: 1;
  }

  .forecastMonthTabs .forecastTab {
    min-width: 0;
  }

  .forecastManufacturerTabs,
  .forecastMonthTabs,
  .forecastModeTabs {
    grid-template-columns: 1fr;
  }

  .forecastTab {
    padding: 11px 12px;
  }

  .forecastTab strong {
    font-size: 16px;
  }

  .forecastExportButton {
    width: 100%;
    justify-content: center;
  }

  .forecastRunActions {
    justify-content: stretch;
  }

  .forecastToggle {
    width: 100%;
    justify-content: center;
  }

  .assistantComposerActions {
    align-items: stretch;
  }

  .assistantSendButton {
    width: 100%;
  }

  .assistantComposerRow {
    grid-template-columns: 1fr;
  }

  .chartSelect[multiple] {
    min-height: 112px;
  }
}

@media (max-width: 920px) {
  .modalCard {
    width: min(760px, 100%);
  }

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

@supports (height: 100dvh) {
  html,
  body,
  .shell,
  .content {
    min-height: 100dvh;
    height: 100dvh;
  }

  .sidebarDesktop,
  .sidebarMobile {
    min-height: 100dvh;
    height: 100dvh;
  }
}

