:root {
  color-scheme: light;
  font-family: "Segoe UI", Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: #17242d;
  background: #f3f5f6;
  --blue: #008db9;
  --blue-dark: #174d78;
  --navy: #103b60;
  --red: #c01722;
  --orange: #f06423;
  --ink: #17242d;
  --muted: #61727d;
  --line: #d9e1e5;
  --soft: #f5f7f8;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
}

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

button,
input {
  font: inherit;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  font-weight: 700;
  cursor: pointer;
}

.auth-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(24px, 5vw, 64px);
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.96), rgba(245, 249, 251, 0.9)),
    url("https://images.unsplash.com/photo-1486406146926-c627a92ad1ab?auto=format&fit=crop&w=1800&q=80");
  background-position: center;
  background-size: cover;
}

.auth-panel {
  width: min(760px, 100%);
  display: grid;
  justify-items: center;
  gap: 20px;
  padding: clamp(28px, 5vw, 48px);
  border: 1px solid rgba(0, 141, 185, 0.18);
  border-top: 7px solid var(--blue);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 24px 70px rgba(16, 59, 96, 0.18);
  text-align: center;
}

.auth-brand-lockup {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.innes-wordmark {
  width: min(240px, 72vw);
  min-height: 82px;
  display: block;
  object-fit: contain;
  padding: 16px 22px;
  border-radius: 6px;
  background: #ffffff;
  box-shadow:
    inset 0 -8px 0 rgba(0, 141, 185, 0.16),
    0 10px 28px rgba(16, 59, 96, 0.12);
}

.auth-brand-subtitle {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.auth-copy {
  display: grid;
  justify-items: center;
  gap: 12px;
}

.auth-copy .eyebrow {
  color: var(--orange);
}

.auth-copy h1 {
  margin: 0;
  max-width: 640px;
  color: var(--navy);
  font-size: clamp(2rem, 4.4vw, 3.55rem);
  line-height: 1.02;
}

.auth-copy p {
  max-width: 500px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

#gateLoginButton {
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 0 22px;
  background: var(--blue);
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(0, 141, 185, 0.25);
}

#gateLoginButton span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: #ffffff;
  color: var(--blue);
  font-weight: 950;
}

.portal-links {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 2px;
}

.portal-links a {
  min-height: 74px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 6px solid var(--blue);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.portal-links a:hover,
.portal-links a:focus-visible {
  border-color: rgba(0, 141, 185, 0.55);
  box-shadow: 0 14px 28px rgba(16, 59, 96, 0.12);
  transform: translateY(-1px);
}

.portal-links span {
  color: var(--orange);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.portal-links strong {
  color: var(--navy);
  font-size: 0.9rem;
  line-height: 1.2;
}

.future-modules {
  width: 100%;
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(0, 141, 185, 0.16);
  border-radius: 8px;
  background: #f6fafc;
  text-align: left;
}

.future-modules p {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.future-modules div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.future-modules span {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(16, 59, 96, 0.12);
  border-radius: 999px;
  background: #ffffff;
  color: var(--blue-dark);
  font-size: 0.78rem;
  font-weight: 850;
}

.gate-message {
  min-height: 24px;
  color: var(--muted);
  line-height: 1.4;
}

.app-shell[hidden],
.auth-gate[hidden] {
  display: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 14px clamp(18px, 4vw, 52px);
  border-bottom: 4px solid var(--blue);
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(14px);
}

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

.brand-mark {
  width: 86px;
  height: 46px;
  display: block;
  object-fit: contain;
  padding: 8px;
  border-radius: 6px;
  background: #ffffff;
  box-shadow: inset 0 -5px 0 rgba(0, 141, 185, 0.24);
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
}

nav {
  display: flex;
  justify-content: center;
  gap: clamp(10px, 1.3vw, 22px);
  min-width: 0;
  overflow-x: auto;
  padding: 3px 0 6px;
  color: #2d4655;
  font-size: 0.96rem;
  font-weight: 750;
  scrollbar-width: thin;
  white-space: nowrap;
}

.session-actions {
  display: flex;
  gap: 10px;
}

#loginButton {
  background: var(--blue);
  color: #ffffff;
}

.secondary {
  background: #e8eef2;
  color: var(--ink);
}

.hero {
  min-height: 560px;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: end;
  padding: clamp(32px, 6vw, 78px);
  color: #ffffff;
  background:
    linear-gradient(100deg, rgba(13, 52, 83, 0.98) 0%, rgba(16, 59, 96, 0.9) 50%, rgba(0, 141, 185, 0.6) 51%, rgba(0, 141, 185, 0.16) 100%),
    url("https://images.unsplash.com/photo-1486406146926-c627a92ad1ab?auto=format&fit=crop&w=1800&q=80");
  background-position: center;
  background-size: cover;
}

.hero-content {
  max-width: 900px;
}

.eyebrow,
.label {
  margin: 0;
  color: var(--orange);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #9fd9ff;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  max-width: 820px;
  margin-top: 14px;
  font-size: clamp(2.35rem, 6vw, 5.6rem);
  line-height: 0.96;
}

.hero-content > p:not(.eyebrow) {
  max-width: 720px;
  margin-top: 22px;
  color: #dbe9f2;
  font-size: 1.12rem;
  line-height: 1.65;
}

.search-box {
  max-width: 820px;
  min-height: 58px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  margin-top: 32px;
  padding: 8px;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
}

.search-box span {
  padding-left: 12px;
  color: var(--blue);
  font-size: 1.5rem;
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
}

.search-box button {
  background: var(--orange);
  color: #ffffff;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.hero-links a,
.text-link {
  color: #ffffff;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.portal-roadmap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 22px;
  max-width: 760px;
}

.portal-roadmap span {
  min-height: 46px;
  display: grid;
  align-items: center;
  padding: 0 14px;
  border-left: 9px solid var(--orange);
  background: rgba(255, 255, 255, 0.92);
  color: var(--navy);
  font-size: 0.88rem;
  font-weight: 850;
}

.access-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(14px);
}

.status-card {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ffffff;
  line-height: 1.45;
}

.status-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #28c97b;
}

.session {
  padding: 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
}

.session p + p {
  margin-top: 6px;
}

.access-steps {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
}

.access-steps strong {
  color: var(--blue-dark);
}

.access-steps span {
  color: var(--muted);
  line-height: 1.35;
}

.message {
  min-height: 24px;
  color: #e9f5fb;
  line-height: 1.45;
}

.section-strip,
.agent-section,
.customers-section,
.sales-map,
.workspace,
.process-band {
  padding: clamp(34px, 6vw, 72px);
}

.agent-section {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(340px, 1.1fr);
  gap: clamp(20px, 4vw, 44px);
  align-items: center;
  background: #ffffff;
}

.customers-section {
  background: #f8fbfc;
}

.customer-toolbar {
  display: grid;
  grid-template-columns: minmax(320px, 0.78fr) minmax(220px, 0.22fr);
  gap: 14px;
  align-items: stretch;
  margin-bottom: 18px;
}

.customer-search {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(3, minmax(116px, 0.55fr)) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.customer-search label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.customer-search label span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.customer-search input {
  width: 100%;
  min-height: 42px;
  min-width: 0;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: 0;
  color: var(--ink);
}

.customer-search button {
  min-height: 42px;
  background: var(--blue);
  color: #ffffff;
}

.customer-status,
.customer-summary {
  color: var(--muted);
  line-height: 1.45;
}

.customer-table {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(16, 59, 96, 0.08);
}

.customer-table-body {
  display: grid;
}

.customer-row {
  display: grid;
  grid-template-columns: 1.25fr 1.1fr 0.8fr 0.85fr 0.75fr;
  min-height: 68px;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

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

.customer-head {
  min-height: 50px;
  background: #edf5f8;
  color: var(--blue-dark);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.customer-row span {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.customer-row strong,
.customer-row small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.customer-row small {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.25;
}

.customer-ok {
  color: #087a4a;
}

.customer-hold {
  color: var(--red);
}

.customer-empty {
  padding: 18px;
  color: var(--muted);
  line-height: 1.45;
}

.customer-summary {
  margin-top: 12px;
}

.client-page {
  min-height: 100vh;
  background: #f4f7f9;
}

.client-workspace {
  display: grid;
  gap: 18px;
  padding: clamp(18px, 3vw, 38px);
}

.client-query-panel,
.client-results,
.client-detail {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.client-query-panel {
  display: grid;
  gap: 18px;
  padding: clamp(18px, 3vw, 28px);
}

.client-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, auto);
  gap: 18px;
  align-items: start;
}

.client-heading h1,
.client-heading h2 {
  max-width: none;
  margin-top: 8px;
  color: var(--ink);
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1;
}

.client-heading p:not(.eyebrow) {
  max-width: 900px;
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.55;
}

.client-session {
  display: grid;
  gap: 5px;
  padding: 12px 14px;
  border-left: 5px solid var(--blue);
  background: #eef7fa;
  color: var(--blue-dark);
  font-weight: 850;
}

.client-session small {
  color: var(--muted);
  font-weight: 650;
}

.client-back-link {
  justify-self: end;
  color: var(--blue);
}

.client-search-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.5fr) repeat(3, minmax(130px, 0.45fr)) auto;
  gap: 12px;
  align-items: end;
}

.client-search-grid label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.client-search-grid label span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.client-search-grid input {
  width: 100%;
  min-height: 44px;
  min-width: 0;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: 0;
  color: var(--ink);
  background: #ffffff;
}

.client-search-grid input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 141, 185, 0.12);
}

.client-search-grid button {
  min-height: 44px;
  background: var(--blue);
  color: #ffffff;
}

.client-status {
  color: var(--muted);
  line-height: 1.45;
}

.client-results-layout {
  display: grid;
  grid-template-columns: minmax(620px, 1fr) minmax(320px, 0.38fr);
  gap: 18px;
  align-items: start;
}

.client-results {
  overflow: hidden;
}

.client-results-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.client-results-header strong {
  color: var(--ink);
}

.client-table {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(220px, 1.25fr) minmax(180px, 1fr) minmax(150px, 0.7fr) minmax(150px, 0.8fr) minmax(140px, 0.65fr);
  gap: 12px;
  align-items: center;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}

.client-table-docs {
  grid-template-columns: minmax(220px, 1.25fr) minmax(170px, 0.9fr) minmax(150px, 0.75fr) minmax(150px, 0.75fr) minmax(150px, 0.75fr) minmax(130px, 0.65fr);
}

.client-table-head {
  background: #edf5f8;
  color: var(--blue-dark);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.client-table-body {
  display: grid;
}

.client-result-row {
  border-width: 0 0 1px;
  border-radius: 0;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.client-result-row:hover,
.client-result-row:focus-visible {
  background: #f5fbfd;
  outline: 0;
}

.client-result-row span {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.client-result-row strong,
.client-result-row small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.client-result-row small {
  color: var(--muted);
  font-weight: 650;
}

.client-metric-button {
  min-height: 0;
  justify-self: start;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--blue-dark);
  font-weight: 900;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.client-metric-button:hover,
.client-metric-button:focus-visible {
  color: var(--blue);
  outline: 0;
}

.client-detail {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 14px;
  padding: 18px;
}

.client-detail h2 {
  color: var(--ink);
  font-size: 1.45rem;
  line-height: 1.12;
}

.client-detail-muted {
  color: var(--muted);
  line-height: 1.45;
}

.client-detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.client-detail-grid div {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fbfc;
}

.client-detail-grid span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.client-detail-grid strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.client-document-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: #fbfdfe;
}

.client-document-panel[hidden] {
  display: none;
}

.client-document-heading {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
}

.client-document-heading strong {
  color: var(--ink);
}

.client-document-title {
  color: var(--blue-dark);
  font-size: 1.12rem;
}

.client-document-list {
  display: grid;
  gap: 10px;
}

.client-document-item {
  display: grid;
  grid-template-columns: minmax(150px, 0.6fr) minmax(120px, 0.35fr) minmax(320px, 1.4fr);
  gap: 14px;
  align-items: start;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--blue);
  border-radius: 6px;
  background: #ffffff;
}

.client-document-item strong,
.client-document-item span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.client-document-item span {
  color: var(--muted);
  line-height: 1.35;
}

.client-document-item > b {
  color: var(--ink);
  font-size: 1rem;
}

.client-document-titlecell {
  display: grid;
  gap: 10px;
  align-content: start;
  justify-items: start;
}

.client-detail-toggle {
  min-height: 34px;
  padding: 8px 13px;
  border: 1px solid var(--blue);
  border-radius: 6px;
  background: #ffffff;
  color: var(--blue-dark);
  font-size: 0.85rem;
  font-weight: 850;
}

.client-detail-toggle:hover,
.client-detail-toggle:focus-visible {
  background: var(--pale);
  color: var(--blue);
  outline: 0;
}

.client-document-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
}

.client-document-fields span {
  display: grid;
  gap: 3px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fbfc;
}

.client-document-fields em {
  color: var(--muted);
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 850;
  text-transform: uppercase;
}

.client-document-fields strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 0.88rem;
}

.client-order-lines {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.client-order-lines[hidden] {
  display: none;
}

.client-order-lines-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.84rem;
}

.client-order-lines-heading strong {
  color: var(--blue-dark);
}

.client-order-line {
  display: grid;
  grid-template-columns: minmax(120px, 0.6fr) minmax(260px, 1.2fr) repeat(3, minmax(90px, 0.35fr)) minmax(170px, 0.55fr);
  gap: 8px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fbfc;
}

.client-order-line > strong {
  color: var(--ink);
  font-size: 0.9rem;
}

.client-order-line span {
  color: var(--muted);
  font-size: 0.84rem;
}

.client-order-line span:not(:nth-child(2)) {
  display: grid;
  gap: 2px;
}

.client-order-line em {
  color: var(--muted);
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 850;
  text-transform: uppercase;
}

.client-order-line b {
  color: var(--ink);
  font-size: 0.85rem;
}

.client-order-line small {
  color: var(--muted);
  font-weight: 750;
  line-height: 1.35;
}

.client-order-lines-more {
  color: var(--muted);
  font-size: 0.88rem;
}

.agent-copy {
  display: grid;
  gap: 16px;
}

.agent-copy h2 {
  color: var(--ink);
  font-size: clamp(1.9rem, 4vw, 3.4rem);
  line-height: 1.05;
}

.agent-copy p:not(.eyebrow) {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.65;
}

.agent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
}

.agent-actions button {
  background: var(--orange);
  color: #ffffff;
}

.agent-actions a {
  color: var(--blue);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.agent-panel {
  display: grid;
  gap: 14px;
  padding: clamp(18px, 3vw, 30px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafc;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.chat-header > span {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--blue);
  color: #ffffff;
  font-weight: 900;
}

.chat-header small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
}

.chat-log {
  display: grid;
  gap: 12px;
  min-height: 156px;
  align-content: start;
}

.chat-message {
  max-width: 88%;
  padding: 14px;
  border-radius: 8px;
  line-height: 1.5;
}

.chat-message.user {
  justify-self: end;
  background: var(--blue);
  color: #ffffff;
}

.chat-message.assistant {
  justify-self: start;
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--ink);
}

.agent-capabilities {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.agent-capabilities span {
  min-height: 44px;
  display: grid;
  place-items: center;
  padding: 8px;
  border-radius: 6px;
  background: #e5f4f8;
  color: var(--blue-dark);
  font-size: 0.86rem;
  font-weight: 800;
  text-align: center;
}

.agent-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 4px;
}

.agent-form input {
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  outline: 0;
}

.agent-form input:focus {
  border-color: var(--blue);
}

.agent-form button {
  background: var(--blue);
  color: #ffffff;
}

.section-heading {
  display: grid;
  gap: 8px;
  margin-bottom: 24px;
}

.section-heading > p:not(.eyebrow) {
  max-width: 820px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.section-heading h2,
.panel-header h2 {
  color: var(--ink);
  font-size: clamp(1.65rem, 3.2vw, 2.8rem);
  line-height: 1.08;
}

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

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

.department-card {
  min-height: 230px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.department-card.connected {
  border-color: rgba(0, 141, 185, 0.42);
  box-shadow: inset 0 4px 0 var(--blue);
}

.department-card.planned {
  background: linear-gradient(180deg, #ffffff, #f7fafc);
}

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

.department-card-header small {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: #e7eef3;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  text-transform: uppercase;
}

.department-card.connected .department-card-header small {
  background: #e4f7ef;
  color: #087a4a;
}

.department-card h3 {
  margin-top: 12px;
}

.department-card p {
  margin-top: 0;
}

.department-card a,
.department-card em {
  margin-top: auto;
  color: var(--blue);
  font-style: normal;
  font-weight: 850;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.department-card em {
  color: var(--muted);
  text-decoration: none;
}

.sales-map {
  background: #ffffff;
}

.org-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(360px, 1.3fr);
  gap: 18px;
  align-items: stretch;
}

.leader-card {
  min-height: 100%;
  border-color: rgba(11, 92, 171, 0.45);
  background: linear-gradient(180deg, #ffffff, #edf5fb);
}

.leader-card span {
  background: var(--blue);
  color: #ffffff;
}

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

article {
  min-height: 190px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

article span {
  display: inline-grid;
  min-width: 42px;
  height: 32px;
  place-items: center;
  border-radius: 6px;
  background: #e5f4f8;
  color: var(--blue);
  font-weight: 900;
}

article h3 {
  margin-top: 26px;
  font-size: 1.05rem;
}

article p {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.5;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(340px, 1.15fr);
  gap: 18px;
  background: #ffffff;
}

.folder-panel,
.documents-panel {
  padding: clamp(18px, 3vw, 30px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

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

.folder-tree li {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: #2f434e;
  font-weight: 650;
}

.folder-tree li:first-child {
  border-color: var(--blue);
  color: var(--blue-dark);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.text-link {
  align-self: start;
  color: var(--blue);
  white-space: nowrap;
}

.doc-table {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.doc-table [role="row"] {
  display: grid;
  grid-template-columns: 1fr 1.2fr 0.6fr;
  min-height: 54px;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
}

.doc-table [role="row"]:last-child {
  border-bottom: 0;
}

.doc-table [role="columnheader"] {
  color: var(--blue-dark);
  font-weight: 900;
}

.doc-table span {
  min-width: 0;
}

.process-band {
  background: #edf3f7;
}

.process-grid article span {
  background: var(--blue);
  color: #ffffff;
}

@media (max-width: 980px) {
  .topbar,
  .hero,
  .agent-section,
  .client-heading,
  .client-results-layout,
  .customer-toolbar,
  .workspace {
    grid-template-columns: 1fr;
  }

  .client-detail {
    position: static;
  }

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

  nav {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .department-grid,
  .agent-capabilities,
  .role-grid,
  .process-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .org-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .topbar {
    gap: 14px;
  }

  .session-actions,
  .hero-links,
  .panel-header {
    flex-direction: column;
  }

  .search-box {
    grid-template-columns: auto 1fr;
  }

  .portal-roadmap {
    grid-template-columns: 1fr 1fr;
  }

  .search-box button,
  .agent-form button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .agent-form {
    grid-template-columns: 1fr;
  }

  .department-grid,
    .agent-capabilities,
    .role-grid,
    .process-grid,
    .customer-row,
    .doc-table [role="row"],
    .portal-links {
    grid-template-columns: 1fr;
  }

  .customer-search {
    grid-template-columns: 1fr;
  }

  .client-search-grid,
  .client-table,
  .client-document-item,
  .client-document-fields,
  .client-order-line {
    grid-template-columns: 1fr;
  }

  .client-results-header,
  .client-document-heading,
  .client-order-lines-heading {
    flex-direction: column;
  }
}
