/* Startup Movers portal styles. Tokens and rules follow DESIGN.md at the repo root.
   Fonts: Outfit + Plus Jakarta Sans stand in until a Degular licence covers the portal. */
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/static/fonts/plus-jakarta-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/static/fonts/plus-jakarta-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/static/fonts/plus-jakarta-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/static/fonts/plus-jakarta-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Outfit";
  src: url("/static/fonts/outfit-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Outfit";
  src: url("/static/fonts/outfit-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Outfit";
  src: url("/static/fonts/outfit-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Brand */
  --sm-blue: #0048fc;
  --sm-blue-600: #003bd1;
  --sm-blue-50: #eef3ff;
  --sm-sky: #d9e6ff;
  --sm-coral: #ff5757;
  --sm-coral-600: #d93b3b;
  --sm-green: #65d693;

  /* Neutrals */
  --sm-ink: #282828;
  --sm-text: #344054;
  --sm-muted: #667085;
  --sm-subtle: #98a2b3;
  --sm-border: #d0d5dd;
  --sm-border-soft: #eaecf0;
  --sm-bg: #f8f9fd;
  --sm-surface: #ffffff;
  --sm-navy: #1d2939;
  --sm-navy-ink: #eaecf0;

  /* Status: text / background pairs, all WCAG AA */
  --ok: #027a48;
  --ok-bg: #ecfdf3;
  --warn: #b54708;
  --warn-bg: #fffaeb;
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --info: #0048fc;
  --info-bg: #eef3ff;
  --neutral: #475467;
  --neutral-bg: #f2f4f7;

  /* Shape and depth */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 999px;
  --shadow-sm: 0 2px 6px rgba(0, 72, 252, 0.2);
  --shadow-card: 0 14px 24px rgba(0, 72, 252, 0.1);
  --shadow-pop: 0 10px 26px rgba(11, 27, 51, 0.09);
  --shadow-modal: 0 30px 80px rgba(0, 22, 77, 0.06);
  --focus-ring: 0 0 0 3px rgba(0, 72, 252, 0.2);
  --ease: cubic-bezier(0.2, 0, 0, 1);

  /* Type */
  --font-display: "Outfit", "Plus Jakarta Sans", system-ui, sans-serif;
  --font-text: "Plus Jakarta Sans", system-ui, sans-serif;

  --page-max: 1200px;
  --gutter: 32px;
}

* { box-sizing: border-box; }

/* Component display rules below must never un-hide elements. */
[hidden], input[type="hidden"] { display: none !important; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  background: var(--sm-bg);
  color: var(--sm-text);
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--sm-blue);
  text-decoration: none;
  font-weight: 600;
}

a:hover { text-decoration: underline; }

:focus-visible {
  outline: 3px solid rgba(0, 72, 252, 0.35);
  outline-offset: 2px;
}

h1, h2, h3, .journey-title {
  font-family: var(--font-display);
  color: var(--sm-ink);
  letter-spacing: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.2;
  font-weight: 600;
  margin: 0 0 8px;
}

h2 {
  font-size: 22px;
  line-height: 1.25;
  font-weight: 600;
  margin: 0 0 8px;
}

.hl { color: var(--sm-blue); }
.hl-green { color: var(--sm-green); }

.lede {
  color: var(--sm-muted);
  margin: 0 0 24px;
  font-size: 16px;
  max-width: 65ch;
}

.meta {
  font-size: 14px;
  color: var(--sm-muted);
}

.placeholder {
  color: var(--sm-muted);
  font-size: 15px;
}

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

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

/* ---------- Eyebrow badge and status pills ---------- */

.eyebrow,
.pill {
  display: flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  padding: 6px 16px;
  margin: 0 0 12px;
  background: var(--sm-blue-50);
  border-radius: var(--radius-pill);
  color: var(--sm-blue);
  font-family: var(--font-text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pill-sm { padding: 5px 14px; }
.card > .pill-sm { margin: 0 0 12px; }
.pill .sparkle { display: none; }

.admin-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  margin: 0;
  background: var(--sm-navy);
  border-radius: var(--radius-pill);
  color: var(--sm-navy-ink);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--neutral-bg);
  color: var(--neutral);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.04em;
}

.status-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.status-pill.info { background: var(--info-bg); color: var(--info); }
.status-pill.ok { background: var(--ok-bg); color: var(--ok); }
.status-pill.warn { background: var(--warn-bg); color: var(--warn); }
.status-pill.danger { background: var(--danger-bg); color: var(--danger); }

/* ---------- Chrome: top bar and page head ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--sm-surface);
  border-bottom: 1px solid var(--sm-border-soft);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(var(--page-max), calc(100% - 2 * var(--gutter)));
  min-height: 64px;
  margin: 0 auto;
  padding: 10px 0;
}

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

.brand:hover { text-decoration: none; }

.logo {
  display: block;
  height: 38px;
  width: auto;
}

.topbar-side {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--sm-muted);
  font-size: 14px;
  font-weight: 500;
}

.user-chip .avatar {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--sm-blue-50);
  color: var(--sm-blue);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.user-chip .email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page {
  width: min(var(--page-max), calc(100% - 2 * var(--gutter)));
  margin: 0 auto 56px;
}

.page-narrow { width: min(820px, calc(100% - 2 * var(--gutter))); }

.page-head {
  padding: 36px 0 24px;
}

.app-grid > .page-head { padding-bottom: 0; }
.page-head h1 { margin: 0 0 6px; }
.page-head .meta { margin: 0; }

/* Older layout hooks, still referenced by scripts. */
.app-top { display: contents; }

.app-grid {
  display: grid;
  gap: 24px;
}

/* ---------- Cards ---------- */

.card {
  background: var(--sm-surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  min-width: 0;
}

.card-accent { border-bottom: 4px solid var(--sm-blue); }

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 16px;
}

.card-head h2 { margin: 0; }

.feature-panel {
  background: linear-gradient(180deg, var(--sm-sky) 0%, var(--sm-bg) 100%);
  border-radius: var(--radius-xl);
  padding: 28px;
}

.services-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 4px;
}

.services-head .pill { margin: 0; }

.section-label,
.doc-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-label { margin: 0 0 12px; }

.line-icon,
.section-label .line-icon,
.doc-heading .line-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.doc-heading {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  margin: 20px 0 8px;
}

.doc-heading:first-child { margin-top: 4px; }

.doc-fold {
  margin: 16px 0 8px;
  padding: 4px 16px 8px;
  background: rgba(0, 72, 252, 0.03);
  border-radius: var(--radius-lg);
}

.doc-fold[open] {
  background: var(--sm-surface);
  box-shadow: var(--shadow-card);
  padding-bottom: 12px;
}

.doc-fold > .doc-heading {
  min-height: 44px;
  margin: 0;
  padding: 8px 0;
  cursor: pointer;
  list-style: none;
}

.doc-fold > .doc-heading::-webkit-details-marker,
.doc-fold > .doc-heading::marker { display: none; content: ""; }

.doc-fold > .doc-heading:focus-visible {
  outline: 2px solid var(--sm-blue);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.doc-heading-label { min-width: 0; }

.doc-count {
  color: var(--sm-muted);
  font-family: var(--font-text);
  font-size: 13px;
  font-weight: 500;
}

.doc-fold > .doc-heading::after {
  content: "▾";
  margin-left: auto;
  flex-shrink: 0;
  color: var(--sm-muted);
  font-size: 16px;
  line-height: 1;
  transition: transform 200ms var(--ease);
}

.doc-fold[open] > .doc-heading::after {
  transform: rotate(180deg);
}

.doc-fold .file-list { margin: 0; }

/* ---------- Forms ---------- */

label {
  display: block;
  margin: 0 0 6px;
  color: var(--sm-text);
  font-size: 14px;
  font-weight: 600;
}

input, select, textarea {
  display: block;
  width: 100%;
  min-height: 48px;
  margin: 0 0 16px;
  padding: 12px 14px;
  background: var(--sm-surface);
  border: 1px solid var(--sm-border);
  border-radius: var(--radius-sm);
  color: var(--sm-ink);
  font: inherit;
  font-size: 16px;
  transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease);
}

input::placeholder, textarea::placeholder { color: var(--sm-subtle); }

textarea { resize: vertical; min-height: 96px; }

select {
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23667085' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 8px;
}

select.service-active {
  width: auto;
  min-width: 8.5rem;
  margin: 0;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--sm-blue);
  box-shadow: var(--focus-ring);
}

input:disabled, select:disabled, textarea:disabled {
  background: var(--neutral-bg);
  color: var(--sm-muted);
}

input[type="checkbox"], input[type="radio"] {
  display: inline-block;
  width: 18px;
  height: 18px;
  min-height: 0;
  margin: 0;
  padding: 0;
  accent-color: var(--sm-blue);
  box-shadow: none;
}

input[type="file"] {
  padding: 10px;
  border-style: dashed;
  background: var(--sm-bg);
  cursor: pointer;
}

input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 7px 14px;
  border: 1px solid var(--sm-blue);
  border-radius: var(--radius-sm);
  background: var(--sm-surface);
  color: var(--sm-blue);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

label.inline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  font-weight: 500;
}

label.inline input { width: 18px; margin: 0; }

.cell-input {
  min-height: 36px;
  margin: 0;
  padding: 6px 10px;
  font-size: 14px;
}

.choice-list {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
}

label.choice {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 12px 14px;
  background: var(--sm-surface);
  border: 1px solid var(--sm-border);
  border-radius: var(--radius-sm);
  font-weight: 500;
  cursor: pointer;
  transition: background 150ms var(--ease), border-color 150ms var(--ease);
}

label.choice:hover { border-color: var(--sm-blue); }

label.choice:has(input:checked) {
  background: var(--sm-blue-50);
  border-color: var(--sm-blue);
  color: var(--sm-blue);
}

/* ---------- Buttons ---------- */

button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 24px;
  border: 1px solid var(--sm-blue);
  border-radius: var(--radius-md);
  background: var(--sm-blue);
  box-shadow: var(--shadow-sm);
  color: #fff;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: background 150ms var(--ease), border-color 150ms var(--ease), color 150ms var(--ease), box-shadow 150ms var(--ease);
}

button:hover, .btn:hover {
  background: var(--sm-blue-600);
  border-color: var(--sm-blue-600);
  text-decoration: none;
}

button.secondary, .btn.secondary {
  background: var(--sm-surface);
  border-color: var(--sm-blue);
  color: var(--sm-blue);
  box-shadow: none;
}

button.secondary:hover, .btn.secondary:hover { background: var(--sm-blue-50); }

button.outline, .btn.outline {
  background: transparent;
  border: 2px solid var(--sm-ink);
  color: var(--sm-ink);
  box-shadow: none;
}

button.outline:hover, .btn.outline:hover { background: var(--sm-blue-50); }

button.ghost, .btn.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--sm-muted);
  box-shadow: none;
}

button.ghost:hover, .btn.ghost:hover {
  background: var(--sm-blue-50);
  color: var(--sm-blue);
}

button.cta, .btn.cta {
  background: var(--sm-coral);
  border-color: var(--sm-coral);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  box-shadow: none;
}

button.cta:hover, .btn.cta:hover {
  background: var(--sm-coral-600);
  border-color: var(--sm-coral-600);
}

button.danger, .btn.danger {
  background: var(--sm-coral-600);
  border-color: var(--sm-coral-600);
  box-shadow: none;
}

button.btn-sm, .btn.btn-sm,
table.data button,
.file-list button,
.info-item-card button {
  min-height: 36px;
  padding: 8px 14px;
  font-size: 14px;
}

button.btn-block { width: 100%; }

button:disabled, .btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

button:disabled:hover {
  background: var(--sm-blue);
  border-color: var(--sm-blue);
}

button.secondary:disabled:hover { background: var(--sm-surface); border-color: var(--sm-blue); }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 8px 0 16px;
}

.toolbar .msg { margin: 0; min-height: 0; }

/* ---------- Messages ---------- */

.msg {
  margin: 0 0 12px;
  min-height: 1.2em;
  font-size: 14px;
  font-weight: 500;
  color: var(--sm-muted);
}

.msg:empty { min-height: 0; margin: 0; }

.msg.error,
.msg.ok {
  padding: 10px 14px;
  border-left: 4px solid currentColor;
  border-radius: var(--radius-sm);
}

.msg.error { background: var(--danger-bg); color: var(--danger); }
.msg.ok { background: var(--ok-bg); color: var(--ok); }
.meta.error { color: var(--danger); }

.otp-echo {
  display: none;
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--sm-blue-50);
  color: var(--sm-blue);
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-align: center;
}

.otp-echo.is-visible { display: block; }

.section-banner {
  margin: 0 0 16px;
  padding: 12px 16px;
  background: var(--info-bg);
  border-left: 4px solid var(--sm-blue);
  border-radius: var(--radius-sm);
  color: var(--sm-text);
  font-size: 15px;
}

/* ---------- Login ---------- */

body.page-login {
  overflow-x: hidden;
  background:
    radial-gradient(circle at 88% 8%, rgba(0, 72, 252, 0.14), transparent 38%),
    radial-gradient(circle at 6% 96%, rgba(101, 214, 147, 0.16), transparent 30%),
    var(--sm-bg);
}

.login-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 440px);
  align-items: center;
  gap: 64px;
  width: min(1120px, calc(100% - 2 * var(--gutter)));
  min-height: 100vh;
  margin: 0 auto;
  padding: 48px 0;
}

.login-hero .logo {
  height: 52px;
  margin: 0 0 8px;
}

.tagline {
  display: block;
  width: fit-content;
  margin: 0 0 40px;
  padding: 3px 10px;
  border-radius: 4px;
  background: var(--sm-coral-600);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.login-hero h1 {
  font-size: 44px;
  line-height: 1.12;
  font-weight: 700;
  margin: 0 0 16px;
}

.login-hero .lede { font-size: 18px; }

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

.trust-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--sm-ink);
  font-weight: 500;
}

.trust-list .icon-circle {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--sm-surface);
  box-shadow: var(--shadow-card);
}

.trust-list .icon-circle img { width: 34px; height: 34px; }

.login-card {
  padding: 40px;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-modal), var(--shadow-card);
}

.login-card h2 { font-size: 26px; margin: 0 0 6px; }
.login-card .lede { font-size: 15px; margin: 0 0 24px; }
.login-card button[type="submit"] { width: 100%; }

.login-card #code {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-align: center;
}

.login-foot {
  margin: 24px 0 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--sm-border-soft);
  font-size: 14px;
  color: var(--sm-muted);
  text-align: center;
}

.resend-row {
  margin: 12px 0 0;
  text-align: center;
}

/* Legacy single-column login shell. */
.shell {
  position: relative;
  z-index: 1;
  width: min(440px, calc(100% - 32px));
  margin: 64px auto 40px;
}

/* ---------- Customer dashboard ---------- */

.account {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--sm-surface);
  color: var(--sm-ink);
  border: 1px solid var(--sm-border);
  padding: 14px 16px;
  box-shadow: none;
}

.account.selected {
  border-color: var(--sm-blue);
  background: var(--sm-blue-50);
}

.deal-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.deal-list > .placeholder { grid-column: 1 / -1; margin: 0; }

.deal-group {
  grid-column: 1 / -1;
  margin: 8px 0 0;
  color: var(--sm-ink);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 650;
}

.deal {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 20px;
  background: var(--sm-surface);
  border: 1px solid var(--sm-border-soft);
  border-bottom: 4px solid var(--sm-border);
  border-radius: var(--radius-lg);
  transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease);
}

.deal.has-journey { border-bottom-color: var(--sm-blue); }

.deal.is-open {
  border-color: var(--sm-blue);
  box-shadow: var(--shadow-card);
}

.deal h2 {
  font-size: 18px;
  line-height: 1.3;
  margin: 0;
}

.deal p { margin: 0; }
.deal .meta { font-size: 13px; }
.deal button { margin-top: auto; }
.deal .meta + button, .deal .status-pill + button { margin-top: 8px; }

.deal-pocs {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.4;
}

.deal-poc {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px;
}

.deal-poc-label {
  color: var(--sm-muted);
  font-weight: 600;
  font-size: 12px;
}

.deal-poc-name {
  color: var(--sm-ink);
  font-weight: 600;
}

.deal-poc-email {
  color: var(--sm-blue);
  word-break: break-all;
}

.deal-poc-email:hover {
  text-decoration: underline;
}

.follow-up {
  color: var(--warn);
  font-size: 13px;
  font-weight: 700;
}

.journey-card { scroll-margin-top: 88px; }

.journey-title {
  font-size: 24px;
  margin: 0 0 8px;
}

.journey-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 24px;
}

.journey-progress .meta {
  flex-shrink: 0;
  margin: 0;
  font-weight: 600;
  color: var(--sm-ink);
}

.journey-track {
  flex: 1;
  height: 8px;
  margin: 0 0 16px;
  background: var(--sm-border-soft);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.journey-progress .journey-track { margin: 0; }

.journey-track span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--sm-blue);
  border-radius: var(--radius-pill);
  transition: width 250ms var(--ease);
}

#journey-section:not(:empty) {
  margin: 0 0 6px;
  color: var(--sm-blue);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.journey-prompt {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 8px;
}

.journey-prompt .doc-box-title {
  flex: 1;
  margin: 0;
  color: var(--sm-ink);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.35;
}

#journey-validation:not(:empty) { margin: 0 0 12px; }
#journey-validation:empty { margin: 0; }

.journey-form .toolbar {
  justify-content: space-between;
  margin: 8px 0 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--sm-border-soft);
}

.journey-stale {
  margin: 0 0 12px;
  padding: 10px 14px;
  background: var(--warn-bg);
  border-left: 4px solid var(--warn);
  border-radius: var(--radius-sm);
  color: var(--warn);
  font-size: 14px;
}

#journey-crm-msg { margin: 8px 0 18px; font-size: 15px; }
#journey-crm-msg.journey-crm-skipped { color: var(--warn); }
#journey-crm-msg.journey-crm-written { color: var(--ok); }
#journey-crm-msg.journey-crm-queued { color: var(--sm-blue); }

.journey-done {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  margin: 0 0 16px;
  background: var(--ok-bg);
  border-radius: var(--radius-md);
}

.journey-done .doc-box-status { margin: 0; }

/* ---------- Documents ---------- */

.file-list {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
}

.file-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--sm-border-soft);
  font-size: 14px;
}

.file-list li:last-child { border-bottom: 0; }

.file-list li > span {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--sm-ink);
  font-weight: 500;
}

.file-list li.placeholder {
  display: block;
  border-bottom: 0;
  padding: 4px 0 12px;
}

.file-list button { flex-shrink: 0; }

.upload-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.upload-row input[type="file"] { margin: 0; flex: 1; }

.box-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}

.doc-box {
  padding: 12px 0;
  border-bottom: 1px solid var(--sm-border-soft);
}

.doc-box-title {
  margin: 0 0 2px;
  font-weight: 600;
}

.doc-box-status {
  margin: 8px 0 4px;
  color: var(--ok);
  font-size: 14px;
  font-weight: 600;
}

.doc-box.on-file {
  background: var(--ok-bg);
  margin: 0 -12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  border-bottom: 0;
}

.doc-box.needed .upload-row { margin-top: 8px; }

.ai-review {
  margin: 16px 0 0;
  padding: 14px 16px;
  border-left: 4px solid var(--sm-blue);
  border-radius: var(--radius-sm);
  background: var(--info-bg);
}

.ai-review-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  color: var(--sm-ink);
  font-size: 15px;
  font-weight: 600;
}

.ai-review-status {
  margin: 0;
  color: var(--sm-muted);
  font-size: 14px;
}

.ai-review.waiting .ai-review-status::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid var(--sm-blue);
  border-right-color: transparent;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: -2px;
  animation: spin 0.8s linear infinite;
}

.ai-review.complete {
  background: var(--ok-bg);
  border-left-color: var(--ok);
}

.ai-review.complete .ai-review-status { color: var(--ok); }

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

/* ---------- Customer side panel ---------- */

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

.side-nav {
  position: sticky;
  top: 88px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 36px;
  padding: 8px;
  background: var(--sm-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.nav-company {
  margin: 0 0 6px;
  padding: 6px 6px 12px;
  border-bottom: 1px solid var(--sm-border-soft);
}

.nav-company label {
  margin: 0 0 4px;
  color: var(--sm-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-company select {
  min-height: 40px;
  margin: 0;
  padding: 8px 32px 8px 10px;
  font-size: 14px;
  font-weight: 600;
}

.nav-company-name {
  margin: 0;
  color: var(--sm-ink);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}

.nav-pocs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0 0;
}

.nav-pocs .nav-poc {
  margin: 0;
}

.nav-poc {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 10px 0 0;
}

.nav-poc-label {
  color: var(--sm-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-poc-name,
.nav-poc-email {
  color: var(--sm-ink);
  font-size: 13px;
  line-height: 1.35;
  word-break: break-word;
}

.nav-poc-email { font-weight: 600; }

.service-pocs {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 12px;
  padding: 12px 16px;
  background: var(--sm-surface-alt, #f8fafc);
  border: 1px solid var(--sm-border-soft, #e2e8f0);
  border-radius: var(--radius-md, 8px);
}

.service-poc {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.service-poc-label {
  color: var(--sm-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.service-poc-name {
  color: var(--sm-ink);
  font-size: 14px;
  font-weight: 600;
}

.service-poc-email {
  color: var(--sm-blue);
  font-size: 13px;
  word-break: break-all;
}

a.nav-btn {
  display: flex;
  align-items: center;
  text-decoration: none;
}

a.nav-btn:hover { text-decoration: none; }

.view { display: grid; gap: 24px; }
.view[hidden] { display: none; }

.back-link {
  display: inline-block;
  margin: 0 0 14px;
  font-size: 14px;
}

.form-head-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
}

.form-head-links .back-link { margin: 0; }

.form-head-links .text-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--sm-blue);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.form-head-links .text-link:hover { text-decoration: underline; }

/* Filling a form: only the question, not the services list or side panel. */
body.form-page.is-form-focus .side-nav { display: none; }
body.form-page.is-form-focus .side-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
body.form-page.is-form-focus .page-head { padding: 16px 0 8px; }
body.form-page.is-form-focus .page-head .eyebrow,
body.form-page.is-form-focus #service-description { display: none; }
body.form-page.is-form-focus .page-head h1 { margin: 0; font-size: 22px; }
body.form-page.is-form-focus .journey-head .pill { display: none; }

.card-note {
  margin: 0;
  padding: 8px 12px;
  border-left: 3px solid var(--sm-blue);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--sm-blue-50);
  color: var(--sm-ink);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
}

.journey-card .card-note { margin: 0 0 16px; font-size: 14px; }

.deal-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.deal-progress {
  color: var(--sm-muted);
  font-size: 13px;
  font-weight: 600;
}

.deal-progress.is-ok { color: var(--ok); }
.deal-progress.is-warn { color: var(--warn); }
.deal-progress.is-info { color: var(--sm-blue); }

.journey-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 12px;
}

.journey-head .pill { margin: 0; }

/* Review & submit */
.submit-panel {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 12px;
  padding: 16px;
  border: 1px solid rgba(2, 122, 72, 0.2);
  border-radius: var(--radius-md);
  background: var(--ok-bg);
  animation: ai-check-in 250ms var(--ease);
}

.submit-panel-icon {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--ok);
  color: #fff;
}

.submit-panel-icon svg { width: 20px; height: 20px; }

.submit-panel-title {
  margin: 0;
  color: var(--sm-ink);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
}

.submit-panel-text { margin: 2px 0 0; color: var(--sm-muted); font-size: 14px; }

.submit-panel.is-changed {
  border-color: rgba(181, 71, 8, 0.25);
  background: var(--warn-bg);
}

.submit-panel.is-changed .submit-panel-icon { background: var(--warn); }

#journey-complete .toolbar { justify-content: space-between; }

.answer-review {
  margin: 16px 0 0;
  padding: 0;
}

.answer-review dt {
  margin: 14px 0 4px;
  color: var(--sm-muted);
  font-size: 13px;
  font-weight: 600;
}

.answer-review dt:first-child { margin-top: 0; }

.answer-review dd {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--sm-border-soft);
  color: var(--sm-ink);
  font-size: 15px;
}

.answer-review .text-link {
  flex-shrink: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--sm-blue);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.answer-review .text-link:hover { text-decoration: underline; }

.sample-files {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 16px 0 0;
}

.sample-file {
  margin: 0;
  padding: 10px;
  border: 1px dashed var(--sm-border);
  border-radius: var(--radius-md);
  background: var(--sm-bg);
}

.sample-file img {
  display: block;
  width: 100%;
  max-width: 360px;
  height: auto;
  border-radius: 8px;
}

.sample-file figcaption {
  margin: 8px 0 0;
  color: var(--sm-muted);
  font-size: 12px;
}

.sample-file-link {
  display: inline-block;
  font-weight: 600;
  word-break: break-word;
}

/* Files attached to one form step */
.step-docs {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--sm-border-soft);
  border-radius: var(--radius-md);
  background: var(--sm-bg);
}

.step-docs-title {
  margin: 0 0 4px;
  color: var(--sm-ink);
  font-size: 13px;
  font-weight: 700;
}

.step-docs .file-list { margin: 0; }
.step-docs .file-list li { padding: 8px 0; }

.file-row-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.file-row-name {
  overflow-wrap: anywhere;
  color: var(--sm-ink);
  font-weight: 500;
}

.file-row-meta {
  color: var(--sm-muted);
  font-size: 12px;
  font-weight: 400;
}

/* ---------- AI document check (customer form) ---------- */

.ai-check {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 16px;
  padding: 14px 16px;
  overflow: hidden;
  border: 1px solid var(--sm-border-soft);
  border-radius: var(--radius-md);
  background: var(--sm-surface);
  animation: ai-check-in 250ms var(--ease);
}

.ai-check-icon {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
}

.ai-check-icon svg { width: 20px; height: 20px; }

.ai-check-body { min-width: 0; }

.ai-check-title {
  margin: 0;
  color: var(--sm-ink);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
}

.ai-check-text {
  margin: 2px 0 0;
  overflow: hidden;
  color: var(--sm-muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-check.is-rejected .ai-check-text,
.ai-check.is-warning .ai-check-text,
.ai-check.is-unavailable .ai-check-text { white-space: normal; }

/* Validating: blue, a spinning ring around a pulsing sparkle, and a shimmer along the bottom. */
.ai-check.is-validating {
  border-color: rgba(0, 72, 252, 0.2);
  background: var(--sm-blue-50);
}

.ai-check.is-validating .ai-check-icon {
  background: var(--sm-surface);
  color: var(--sm-blue);
}

.ai-check.is-validating .ai-check-icon::before {
  content: "";
  position: absolute;
  inset: -3px;
  border: 3px solid transparent;
  border-top-color: var(--sm-blue);
  border-right-color: rgba(0, 72, 252, 0.35);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.ai-check.is-validating .ai-check-icon svg { animation: ai-pulse 1.4s ease-in-out infinite; }

.ai-check.is-validating::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 40%;
  height: 3px;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, transparent, var(--sm-blue), transparent);
  animation: ai-shimmer 1.3s var(--ease) infinite;
}

.ai-check.is-verified,
.ai-check.is-accepted {
  border-color: rgba(2, 122, 72, 0.2);
  background: var(--ok-bg);
}

.ai-check.is-verified .ai-check-icon,
.ai-check.is-accepted .ai-check-icon {
  background: var(--ok);
  color: #fff;
  animation: ai-pop 320ms var(--ease);
}

.ai-check.is-rejected {
  border-color: rgba(180, 35, 24, 0.2);
  background: var(--danger-bg);
}

.ai-check.is-warning,
.ai-check.is-unavailable {
  border-color: rgba(181, 71, 8, 0.25);
  background: var(--warn-bg);
}

.ai-check.is-warning {
  align-items: flex-start;
}

.ai-check.is-warning .ai-check-icon {
  margin-top: 2px;
}

.ai-check-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.ai-check-actions button {
  font-size: 13px;
  padding: 6px 14px;
  height: auto;
  min-height: 32px;
  line-height: 1.4;
  cursor: pointer;
}

.ai-check-actions .btn-warning-accept {
  background: var(--sm-blue, #0048fc);
  color: #fff;
  border: 1px solid transparent;
  border-radius: var(--radius-sm, 6px);
  font-weight: 500;
}

.ai-check-actions .btn-warning-accept:hover {
  filter: brightness(0.92);
}

.ai-check-actions .btn-warning-reupload {
  background: var(--sm-surface, #fff);
  color: var(--sm-ink, #1f242f);
  border: 1px solid var(--sm-border-soft, #e4e7ec);
  border-radius: var(--radius-sm, 6px);
  font-weight: 500;
}

.ai-check-actions .btn-warning-reupload:hover {
  background: var(--sm-surface-hover, #f8f9fa);
}

.ai-check.is-warning .ai-check-icon,
.ai-check.is-unavailable .ai-check-icon {
  background: var(--warn);
  color: #fff;
  animation: ai-pop 320ms var(--ease);
}

.ai-check.is-rejected .ai-check-icon {
  background: var(--danger);
  color: #fff;
  animation: ai-pop 320ms var(--ease);
}

@keyframes ai-check-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

@keyframes ai-pulse {
  0%, 100% { transform: scale(0.85); opacity: 0.75; }
  50% { transform: scale(1.1); opacity: 1; }
}

@keyframes ai-shimmer {
  from { transform: translateX(-100%); }
  to { transform: translateX(250%); }
}

@keyframes ai-pop {
  0% { transform: scale(0.6); }
  70% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* ---------- AI validation (admin) ---------- */

.ai-doc-list {
  display: grid;
  gap: 16px;
  margin: 8px 0 0;
}

.ai-doc-card {
  padding: 20px;
  border: 1px solid var(--sm-border-soft);
  border-radius: var(--radius-lg);
  background: var(--sm-surface);
}

.ai-doc-card[hidden] { display: none; }

.ai-doc-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 4px;
}

.ai-doc-head .subhead { margin: 0 0 2px; }
.ai-doc-head .meta { margin: 0; font-size: 13px; }
.ai-doc-head .status-pill { flex-shrink: 0; }
.ai-doc-desc { margin: 4px 0 14px; }
.ai-doc-card textarea { min-height: 104px; }

.ai-doc-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 24px;
}

.ai-doc-controls .hint { margin: -8px 0 8px; }
.ai-doc-controls input[type="number"] { max-width: 140px; }
.ai-doc-card .toolbar { margin: 4px 0 0; }

.range-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  min-height: 48px;
}

.range-row output {
  min-width: 48px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  background: var(--sm-blue-50);
  color: var(--sm-blue);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

input[type="range"] {
  flex: 1;
  min-height: 0;
  height: 6px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--sm-blue) var(--fill, 30%), var(--sm-border-soft) var(--fill, 30%));
  appearance: none;
  cursor: pointer;
}

input[type="range"]:focus { box-shadow: var(--focus-ring); }

input[type="range"]::-webkit-slider-thumb {
  width: 20px;
  height: 20px;
  border: 3px solid var(--sm-surface);
  border-radius: 50%;
  background: var(--sm-blue);
  box-shadow: 0 1px 4px rgba(0, 72, 252, 0.4);
  appearance: none;
}

input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 3px solid var(--sm-surface);
  border-radius: 50%;
  background: var(--sm-blue);
  box-shadow: 0 1px 4px rgba(0, 72, 252, 0.4);
}

/* ---------- Tables ---------- */

.table-wrap {
  overflow-x: auto;
  margin: 0 -24px;
  padding: 0 24px;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

table.data th,
table.data td {
  padding: 12px 12px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--sm-border-soft);
}

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

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

table.data th {
  background: var(--sm-bg);
  color: var(--sm-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

table.data thead th:first-child { border-top-left-radius: var(--radius-sm); }
table.data thead th:last-child { border-top-right-radius: var(--radius-sm); }

table.data td { color: var(--sm-text); }
table.data tbody tr { transition: background 150ms var(--ease); }
table.data tbody tr:hover { background: var(--sm-blue-50); }
table.data tbody tr:last-child td { border-bottom: 0; }

.th-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

/* Tooltip "i" buttons */
.info {
  position: relative;
  display: inline-flex;
  text-transform: none;
  letter-spacing: 0;
}

.info::after {
  content: "";
  position: absolute;
  top: 100%;
  left: -8px;
  right: -8px;
  height: 12px;
}

button.info-i {
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 0;
  padding: 0;
  border: 1px solid var(--sm-border);
  border-radius: 50%;
  background: var(--sm-blue-50);
  box-shadow: none;
  color: var(--sm-blue);
  font-family: var(--font-display);
  font-size: 11px;
  font-style: italic;
  font-weight: 700;
  line-height: 1;
  cursor: help;
}

button.info-i:hover,
button.info-i:focus-visible {
  background: var(--sm-blue);
  border-color: var(--sm-blue);
  color: #fff;
}

.info-callout {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: 260px;
  padding: 12px 14px;
  background: var(--sm-surface);
  border: 1px solid var(--sm-border-soft);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-pop);
  color: var(--sm-text);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  text-transform: none;
  letter-spacing: 0;
  white-space: normal;
  z-index: 8;
}

.info-callout::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 50%;
  width: 8px;
  height: 8px;
  background: var(--sm-surface);
  border-left: 1px solid var(--sm-border-soft);
  border-top: 1px solid var(--sm-border-soft);
  transform: translateX(-50%) rotate(45deg);
}

.info-callout-end { left: auto; right: 0; transform: none; }
.info-callout-end::before { left: auto; right: 10px; transform: rotate(45deg); }

.info:hover .info-callout,
.info:focus-within .info-callout { display: block; }

/* ---------- Admin ---------- */

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

.admin-nav {
  position: sticky;
  top: 88px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  background: var(--sm-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.nav-btn {
  justify-content: flex-start;
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  background: transparent;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: var(--radius-sm);
  box-shadow: none;
  color: var(--sm-text);
  font-family: var(--font-text);
  font-size: 15px;
  font-weight: 600;
  text-align: left;
}

.nav-btn:hover {
  background: var(--sm-bg);
  color: var(--sm-blue);
}

.nav-btn.active {
  background: var(--sm-blue-50);
  border-left-color: var(--sm-blue);
  color: var(--sm-blue);
}

.admin-grid > section { display: grid; gap: 24px; }
.admin-grid > section[hidden] { display: none; }

.admin-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.admin-actions-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.admin-actions-row button { min-height: 40px; padding: 8px 16px; font-size: 14px; }

.admin-actions #sync-msg {
  margin: 0;
  max-width: 380px;
  padding: 0;
  border: 0;
  background: none;
  font-size: 12px;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.form-grid > .span-2 { grid-column: 1 / -1; }

.staff-list {
  list-style: none;
  padding: 16px 0 0;
  margin: 0;
  font-size: 14px;
}

.staff-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--sm-border-soft);
}

.staff-list li:last-child { border-bottom: 0; }

.staff-list .staff-meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.staff-list button.remove-admin {
  flex-shrink: 0;
  margin-left: auto;
  width: 32px;
  height: 32px;
  min-height: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  box-shadow: none;
  color: var(--danger);
}

.staff-list button.remove-admin svg {
  width: 11px;
  height: 11px;
  display: block;
  shape-rendering: geometricPrecision;
}

.staff-list button.remove-admin:hover,
.staff-list button.remove-admin:focus-visible { background: var(--danger-bg); }

.add-stage {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--sm-border-soft);
}

.subhead {
  margin: 0 0 12px;
  color: var(--sm-ink);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
}

.deal .awaiting-review {
  color: var(--ok);
  font-size: 14px;
  font-weight: 700;
}

.info-item-list {
  display: grid;
  gap: 10px;
  margin: 0 0 8px;
}

.info-item-card {
  padding: 14px 16px;
  background: var(--sm-surface);
  border: 1px solid var(--sm-border-soft);
  border-radius: var(--radius-md);
}

.info-item-card .item-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.info-item-card .item-actions .secondary { margin-top: 0; }

.item-sample-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 0 0 10px;
}
.item-sample-row img,
.item-sample-file {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--sm-border-soft);
  background: var(--sm-surface);
}

.item-sample-file {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
}

.crm-field-combo { position: relative; }

.crm-field-list {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  max-height: 220px;
  overflow: auto;
  margin: -12px 0 0;
  padding: 6px 0;
  list-style: none;
  background: var(--sm-surface);
  border: 1px solid var(--sm-border-soft);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-pop);
}

.crm-field-list li {
  padding: 8px 14px;
  cursor: pointer;
  font-size: 14px;
}

.crm-field-list li:hover,
.crm-field-list li[aria-selected="true"] { background: var(--sm-blue-50); }

.crm-field-list .meta { margin: 2px 0 0; font-size: 12px; }

.prompt-wrap {
  position: relative;
  width: 100%;
}

.prompt-variable-dropdown {
  position: absolute;
  z-index: 50;
  max-height: 220px;
  width: 290px;
  overflow-y: auto;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  background: var(--sm-surface, #ffffff);
  border: 1px solid var(--sm-border-soft, #e2e8f0);
  border-radius: var(--radius-sm, 6px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.prompt-variable-dropdown li {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  transition: background 0.1s ease;
}

.prompt-variable-dropdown li:hover,
.prompt-variable-dropdown li[aria-selected="true"] {
  background: var(--sm-blue-50, #eff6ff);
}

.prompt-variable-dropdown .var-token {
  font-family: var(--font-mono, monospace);
  font-weight: 600;
  color: var(--sm-blue-600, #2563eb);
}

.prompt-variable-dropdown .var-label {
  font-size: 11px;
  color: var(--sm-text-muted, #64748b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

#section-services .table-wrap { overflow-x: auto; }
#section-services table.data { table-layout: fixed; min-width: 720px; }

#section-services table.data th,
#section-services table.data td { vertical-align: top; }

#section-services table.data th { white-space: normal; overflow-wrap: anywhere; }

#section-services td:nth-child(3) { overflow-wrap: anywhere; }

#section-services th:nth-child(1),
#section-services td:nth-child(1) { width: 7.5rem; }

#section-services th:nth-child(2),
#section-services td.zoho-ids { width: 30%; }

#section-services .zoho-ids {
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
  line-height: 1.4;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--sm-muted);
}

#section-services th:nth-child(5),
#section-services td:nth-child(5),
#section-services th:nth-child(6),
#section-services td:nth-child(6) { width: 5rem; }

#section-services th:nth-child(7),
#section-services td:nth-child(7) { width: 6rem; }

#edit-zoho-service-id {
  min-height: 5.5rem;
  overflow-wrap: anywhere;
  word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  line-height: 1.4;
}

#section-stages .table-wrap { overflow: visible; }

/* Build version, pinned bottom-left so it never covers header actions. */
.version-badge {
  position: fixed;
  bottom: 10px;
  left: 10px;
  z-index: 50;
  padding: 2px 8px;
  border: 1px solid var(--sm-border-soft);
  border-radius: var(--radius-pill);
  background: var(--sm-surface);
  color: var(--sm-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  line-height: 1.6;
  letter-spacing: 0.02em;
  pointer-events: none;
}

/* ---------- Responsive ---------- */

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

  .admin-nav {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    padding: 4px;
  }

  .nav-btn {
    width: auto;
    flex-shrink: 0;
    border-left: 0;
    white-space: nowrap;
  }

  .nav-btn.active { background: var(--sm-blue); color: #fff; }
  .nav-btn.active:hover { background: var(--sm-blue-600); color: #fff; }
}

@media (max-width: 900px) {
  :root { --gutter: 24px; }

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

  .side-nav {
    position: static;
    flex-direction: row;
    margin-top: 16px;
    padding: 4px;
    overflow-x: auto;
  }

  .side-nav { flex-wrap: wrap; }
  .side-nav .nav-btn { width: auto; flex-shrink: 0; border-left: 0; }
  .nav-company { flex-basis: 100%; }
  .side-nav .nav-btn.active { background: var(--sm-blue); color: #fff; }

  .login-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
    min-height: 0;
    padding: 32px 0;
  }

  .login-hero h1 { font-size: 34px; }
  .tagline { margin-bottom: 24px; }
  .trust-list { display: none; }
}

@media (max-width: 640px) {
  :root { --gutter: 16px; }

  h1 { font-size: 26px; }
  .card { padding: 16px; }
  .table-wrap { margin: 0 -16px; padding: 0 16px; }
  .login-card { padding: 24px; }
  .login-hero h1 { font-size: 30px; }
  .login-hero .lede { font-size: 16px; margin-bottom: 0; }
  .page-head { padding: 24px 0 16px; }
  .logo { height: 32px; }
  .user-chip .email { display: none; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .admin-actions-row button { padding: 8px 12px; white-space: nowrap; }
  .admin-actions-row .user-chip,
  .brand .admin-badge { display: none; }
  .admin-actions #sync-msg { display: none; }
  .journey-form .toolbar button { flex: 1; }
  .ai-doc-controls { grid-template-columns: minmax(0, 1fr); }
  .ai-doc-head { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 150ms !important;
  }
}
