/*
 * Voly core — the small visual foundation shared by every current page.
 *
 * Loaded by BOTH the React shell (via index.html) and the server-rendered
 * sign-in, no-access, and error pages (apps/web/server/pages.ts). That sharing
 * is the point of the file existing: those pages are the first thing a new user
 * sees and the only thing a refused one sees. It contains the tokens, type,
 * controls and Venturi mark needed by the September 3 authentication
 * experience and the empty authenticated starting point.
 *
 * Served publicly and unauthenticated on purpose — the refusal page needs it,
 * and it is a stylesheet.
 */

:root {
  /* Nav rail */
  --side: #17191e;
  --side-hover: #22252b;
  --side-active: #2a2e35;
  --side-tx: #b9bec6;
  --side-mut: #7a808a;
  --side-rule: #262a30;

  /* Surfaces */
  --bg: #f7f8fa;
  --white: #ffffff;

  /* Ink */
  --ink: #17191c;
  --text: #43474e;
  --muted: #6e747d;
  --faint: #969ca6;

  /*
   * Brand blue. #1E6BFF is the one, and everything blue in the product derives
   * from it: the chip in the mark, every action, every focus ring. Nothing
   * outside this block may declare a blue — if a component needs a new shade,
   * it gets a token here.
   */
  --blue: #1e6bff;
  --blue-deep: #1a5ce0; /* pressed and active negotiation */
  --blue-tint: #eaf1ff; /* sealed/agreed and negotiation wash */
  --blue-edge: #c9cdd3; /* neutral outline border */

  /* Counsel is the only relationship-specific accent. */
  --purple-bg: #f1ebfe;
  --purple-tx: #7c3aed;
  --blue-ring: rgba(30, 107, 255, 0.25);

  /* Hairlines */
  --ring: #edeff2;
  --ring-2: #c9cdd3;

  /* Status. Green marks confirmed money, Synced, and the success badges below. */
  --g-bg: #e8f5ee;
  --g-tx: #15803d;
  --g-tx-strong: #13703a; /* green text on the green tint at 12px (AA) */
  --a-bg: #fef3e2;
  --a-tx: #b45309;
  --a-edge: #f2d7ae; /* amber hairline for review panels */
  --r-bg: #fdebeb;
  --r-tx: #b91c1c;
  --n-bg: #f1f2f4;
  --n-tx: #5a5f68;

  /* Status badges (StatusBadge): a verified secure connection, a closed Deal
     or finished work is success; the person must act is warning; broken is
     danger; paused, not connected or dead is neutral. */
  --success: var(--g-tx);
  --warning: var(--a-tx);
  --danger: var(--r-tx);
  --neutral: var(--muted);

  --dot-g: var(--blue);
  --dot-a: var(--a-tx);
  --dot-b: var(--blue);
  --dot-r: var(--r-tx);

  --font: "Hanken Grotesk", "Inter", Arial, sans-serif; /* interface */
  --font-mark: "Inter", Arial, sans-serif; /* Venturi wordmark only */
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /*
   * Shape, depth and type (September 29, 2026 Mercury-inspired refresh).
   * Every radius, shadow and heading weight in the product, the sign-in pages
   * and the landing page reads from these. Change a value here and it changes
   * everywhere; do not reintroduce literal radii or shadows in components.
   */
  --radius-xs: 6px; /* chips inside controls, small marks */
  --radius-sm: 8px; /* compact controls, menu options */
  --radius-md: 10px; /* small icon tiles, compact grouped rows */
  --radius-lg: 12px; /* inputs, selects, cards, panels, menus */
  --radius-xl: 14px; /* large cards and grouped sections */
  --radius-2xl: 18px; /* dialogs and hero panels */
  --radius-pill: 999px; /* buttons, pills, tabs, search */

  --shadow-xs: 0 1px 2px rgba(23, 25, 28, 0.04);
  --shadow-sm: 0 1px 2px rgba(23, 25, 28, 0.04), 0 2px 6px rgba(23, 25, 28, 0.04);
  --shadow-md: 0 1px 2px rgba(23, 25, 28, 0.05), 0 8px 24px rgba(23, 25, 28, 0.08);
  --shadow-lg: 0 2px 6px rgba(23, 25, 28, 0.06), 0 24px 60px rgba(23, 25, 28, 0.16);

  --weight-title: 450; /* page, section and dialog titles */
  --weight-strong: 580; /* card titles, names, emphasis */
  --weight-control: 500; /* buttons, tabs, navigation */
  --tracking-title: -0.02em;

  /*
   * Product type scale (September 30, 2026 readability pass). Every font size
   * in the authenticated product reads from these (src/workflow.css). The
   * server-rendered sign-in pages, landing page and legal pages keep their
   * approved literal sizes below and in their own renderers.
   * Nothing informative or interactive is set below --fs-meta.
   */
  --fs-caption: 12px; /* incidental only: Powered by Voly, letter tiles */
  --fs-meta: 13px; /* timestamps, counts, labels, pills, column headers */
  --fs-small: 14px; /* secondary lines, small buttons, supporting copy */
  --fs-body: 15px; /* body, list cells, previews, controls, navigation */
  --fs-name: 16px; /* row titles and names */
  --fs-heading: 18px; /* section headings */
  --fs-title: 22px; /* dialog, card and empty-state titles */
  --fs-stat: 24px; /* stat numbers */
  --fs-page-mobile: 28px; /* page title on phones */
  --fs-page: 32px; /* page title */
  --lh-meta: 18px;
  --lh-small: 20px;
  --lh-body: 22px;
  --lh-name: 22px;
  --lh-heading: 26px;
  --lh-title: 28px;

  /* Spacing: a 4px grid. Every padding, margin and gap uses these steps. */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  --control-h: 44px; /* every button, input and select; also the touch target */
  --control-h-sm: 32px;
  --ease: cubic-bezier(0.2, 0, 0, 1);
}

/* ---------- base ---------- */

* {
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/20px var(--font);
}

svg {
  display: inline-block;
  vertical-align: -2px;
  flex: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

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

a:hover {
  color: var(--blue-deep);
  text-decoration: none;
}

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

/* Browsers default headings to bold (700) at em-based sizes that sit off the
   type scale. Every heading starts from the scale; components size up from
   here. */
h2,
h3,
h4 {
  font-weight: var(--weight-strong);
  color: var(--ink);
}
h3 {
  font-size: 16px;
  line-height: 1.3;
}
h4 {
  font-size: 14px;
}

.mono {
  font-family: var(--mono);
}

/* ---------- type ---------- */

h1 {
  font-size: 25px;
  margin: 0;
  font-weight: var(--weight-title);
  color: var(--ink);
  letter-spacing: var(--tracking-title);
}

.sub {
  color: var(--muted);
  font-size: 13.5px;
  margin-top: var(--space-1);
}

/* ---------- card, button, pill ---------- */

.card {
  background: var(--white);
  border: 1px solid var(--ring);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

.card + .card {
  margin-top: var(--space-5);
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--ring);
  gap: var(--space-3);
}

.card-head h2 {
  font-size: 15px;
  margin: 0;
  font-weight: var(--weight-strong);
  color: var(--ink);
}

.card-body {
  padding: var(--space-5) var(--space-5);
}

/* ---------- controls ---------- */

/*
 * One button contract for the product, sign-in and landing pages: a pill with
 * a medium-weight label. Variants change color only, never shape or motion.
 */
.btn {
  background: var(--blue);
  color: #fff;
  border: 1px solid var(--blue);
  min-height: var(--control-h);
  padding: 0 var(--space-4);
  border-radius: var(--radius-pill);
  font-size: 14px;
  line-height: 20px;
  font-weight: var(--weight-control);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  box-shadow: var(--shadow-xs);
  transition:
    background-color 140ms var(--ease),
    border-color 140ms var(--ease),
    color 140ms var(--ease),
    box-shadow 140ms var(--ease),
    transform 90ms var(--ease);
}

.btn:hover {
  background: var(--blue-deep);
  border-color: var(--blue-deep);
  text-decoration: none;
}

.btn.outline {
  background: var(--white);
  color: var(--blue);
  border: 1px solid var(--blue-edge);
}

.btn.outline:hover {
  border-color: var(--blue);
  background: var(--blue-tint);
}

.btn.ghost {
  background: var(--white);
  color: var(--ink);
  border: 1px solid var(--ring-2);
}

.btn.ghost:hover {
  color: var(--ink);
  border-color: var(--faint);
  background: var(--bg);
}

.btn.sm {
  min-height: var(--control-h-sm);
  padding: 0 var(--space-3);
  font-size: 13px;
  line-height: 18px;
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--blue-ring);
}

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

.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: 12px;
  font-weight: var(--weight-control);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.pill.g {
  background: var(--g-bg);
  color: var(--g-tx);
}
.pill.a {
  background: var(--a-bg);
  color: var(--a-tx);
}
.pill.b {
  background: var(--blue-tint);
  color: var(--blue);
}
.pill.r {
  background: var(--r-bg);
  color: var(--r-tx);
}
.pill.n {
  background: var(--n-bg);
  color: var(--n-tx);
}

/* ---------- the mark ---------- */
/*
 * The Venturi lockup, rendered from live type rather than imported as an image —
 * see apps/web/server/branding.ts for why. Every metric below uses
 * --mark-scale: 1; everything is expressed against that variable
 * so the same markup scales proportionally anywhere else.
 *
 * This block and branding.ts are the only two files that render the mark.
 */

.voly-mark {
  --mark-scale: 1;
  display: inline-flex;
  align-items: center;
  gap: calc(10px * var(--mark-scale));
  line-height: 1;
  user-select: none;
}

/* Notion's public website uses its private NotionInter face. Venturi ships the
   open Inter source locally so the UI has the same metrics and character
   without making every visitor request a proprietary asset from notion.com. */
/* Interface typeface: Hanken Grotesk (SIL Open Font License), a variable face
   chosen as the closest licensed match to Mercury's proprietary Arcadia. */
@font-face {
  font-family: "Hanken Grotesk";
  src: url("/fonts/hanken-grotesk-variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-medium.woff2") format("woff2");
  font-style: normal;
  font-weight: var(--weight-control);
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-semibold.woff2") format("woff2");
  font-style: normal;
  font-weight: var(--weight-strong);
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-bold.woff2") format("woff2");
  font-style: normal;
  font-weight: var(--weight-strong);
  font-display: swap;
}

.voly-mark__word {
  font-family: var(--font-mark);
  font-weight: 700;
  font-size: calc(22px * var(--mark-scale));
  letter-spacing: -0.035em;
  color: var(--white);
}

.voly-mark__chip {
  width: calc(34px * var(--mark-scale));
  height: calc(34px * var(--mark-scale));
  border-radius: calc(11px * var(--mark-scale));
  background: var(--blue);
  color: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.voly-mark__chip svg {
  width: 70%;
  height: 70%;
}

/*
 * On a light surface, swap the word from white to ink. The blue tile works on
 * both dark and light surfaces.
 */
.voly-mark--on-light .voly-mark__word {
  color: var(--ink);
}

/* ---------- Stage 1 product and onboarding ---------- */
.product-center,
.onboarding-shell {
  min-height: 100vh;
  background: var(--bg);
}
.product-center {
  display: grid;
  place-items: center;
  padding: var(--space-6);
}
.product-card {
  width: min(520px, 100%);
  padding: var(--space-10);
  border: 1px solid var(--ring);
  border-radius: var(--radius-2xl);
  background: #fff;
  box-shadow: var(--shadow-lg);
}
.product-card h1 {
  margin-top: var(--space-10);
  font-size: var(--fs-title);
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.product-card p {
  margin: var(--space-3) 0 var(--space-6);
}
.product-card .btn {
  min-height: 44px;
}
.onboarding-shell {
  padding: 28px;
}
.onboarding-top {
  width: min(820px, 100%);
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: var(--fs-meta);
  font-weight: var(--weight-strong);
}
.onboarding-panel {
  width: min(720px, 100%);
  margin: var(--space-16) auto var(--space-10);
  padding: var(--space-12) 56px;
  border: 1px solid rgba(23, 25, 28, 0.1);
  border-radius: var(--radius-2xl);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-lg);
}
.progress {
  height: 3px;
  margin: calc(-1 * var(--space-12)) -56px var(--space-12);
  background: var(--ring);
  overflow: hidden;
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
}
.progress span {
  display: block;
  height: 100%;
  background: var(--blue);
  transition: width 0.2s ease;
}
.eyebrow {
  margin: 0 0 var(--space-2);
  color: var(--blue);
  font-size: 11px;
  font-weight: var(--weight-strong);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.onboarding-panel h1 {
  font-size: var(--fs-page);
  line-height: 1.15;
  letter-spacing: var(--tracking-title);
}
.lede {
  max-width: 570px;
  margin: var(--space-3) 0 var(--space-8);
  color: var(--muted);
  font-size: var(--fs-name);
  line-height: 1.65;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5) var(--space-4);
  margin: 0 0 28px;
}
.field {
  display: grid;
  gap: var(--space-2);
  color: var(--ink);
  font-size: var(--fs-meta);
  font-weight: var(--weight-strong);
}
.field input,
.field select,
.search input,
.csv-input {
  width: 100%;
  min-height: 44px;
  padding: var(--space-3) var(--space-3);
  border: 1px solid var(--ring-2);
  border-radius: var(--radius-lg);
  background: #fff;
  color: var(--ink);
  font: var(--fs-body)/1.4 var(--font);
  outline: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.field input:hover,
.field select:hover,
.search input:hover,
.csv-input:hover {
  border-color: var(--muted);
}
.field input:focus,
.field select:focus,
.search input:focus,
.csv-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-ring);
}
.btn.primary {
  min-height: 40px;
  justify-content: center;
}
.btn.wide {
  width: 100%;
  justify-content: center;
}
.button-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
}
.password-toggle {
  min-height: 46px;
  padding: var(--space-2) var(--space-3);
  justify-self: start;
}
.skip-row {
  margin-top: 28px;
  padding-top: var(--space-5);
  border-top: 1px solid var(--ring);
  text-align: center;
}
.skip-row button {
  min-height: 44px;
  padding: var(--space-2) var(--space-4);
  border: 0;
  background: none;
  color: var(--muted);
  font: var(--weight-strong) var(--fs-small) var(--font);
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.skip-row button:hover {
  background: var(--n-bg);
  color: var(--ink);
}
.skip-row button:focus-visible,
.setup-choice:focus-visible,
.close:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}
.choice-list {
  display: grid;
  gap: var(--space-3);
  margin-bottom: 28px;
}
.setup-choice {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  width: 100%;
  padding: var(--space-5);
  border: 1px solid var(--ring-2);
  border-radius: var(--radius-lg);
  background: #fff;
  text-align: left;
  transition:
    border-color 0.15s,
    box-shadow 0.15s,
    transform 0.15s;
}
.setup-choice:hover {
  border-color: var(--blue-edge);
  transform: translateY(-1px);
}
.setup-choice.selected {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-ring);
}
.setup-choice > i {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border: 1.5px solid #aeb3bc;
  border-radius: 50%;
  box-shadow: inset 0 0 0 4px #fff;
}
.setup-choice.selected > i {
  border-color: var(--blue);
  background: var(--blue);
}
.setup-choice b,
.setup-choice small {
  display: block;
}
.setup-choice b {
  color: var(--ink);
  font-size: var(--fs-body);
}
.setup-choice small {
  margin-top: var(--space-1);
  color: var(--muted);
  font-size: var(--fs-small);
  line-height: 1.5;
}
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  background: var(--bg);
}
.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px var(--space-5);
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-right: 1px solid var(--ring);
}
.rail nav {
  display: grid;
  gap: var(--space-1);
  margin-top: 56px;
}
.rail nav a,
.rail nav span {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: var(--fs-body);
  font-weight: var(--weight-control);
  transition: background-color 120ms var(--ease), color 120ms var(--ease);
}
.rail nav a svg,
.rail nav span svg {
  width: 17px;
  height: 17px;
  color: var(--muted);
}
.rail nav a:hover {
  background: var(--n-bg);
  color: var(--ink);
}
.rail nav .active {
  background: var(--n-bg);
  color: var(--ink);
}
.rail nav .active svg {
  color: var(--blue);
}
.rail nav span {
  opacity: 0.55;
}
.workspace {
  width: min(1180px, 100%);
  padding: 56px clamp(28px, 5vw, 72px);
}
.workspace-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--space-6);
}
.workspace-head h1 {
  font-size: var(--fs-page);
  line-height: 1.15;
  font-weight: var(--weight-title);
  letter-spacing: var(--tracking-title);
}
.workspace-head > div > p:last-child {
  margin: var(--space-2) 0 0;
  color: var(--muted);
}
.toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--space-5);
  margin: 36px 0 var(--space-4);
}
.search {
  display: grid;
  gap: var(--space-2);
  width: min(440px, 100%);
  font-size: var(--fs-meta);
  font-weight: var(--weight-strong);
  color: var(--ink);
}
.toolbar > div {
  display: flex;
  gap: var(--space-2);
}
.contact-table {
  overflow: hidden;
  border: 1px solid var(--ring);
  border-radius: var(--radius-xl);
  background: #fff;
  box-shadow: var(--shadow-md);
}
.contact-row {
  display: grid;
  grid-template-columns: 1.35fr 1fr 0.7fr 1fr;
  gap: var(--space-5);
  align-items: center;
  min-height: 70px;
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--ring);
  font-size: var(--fs-small);
}
.contact-row:last-child {
  border-bottom: 0;
}
.contact-row.heading {
  min-height: 42px;
  background: #fafafa;
  color: var(--muted);
  font-size: var(--fs-meta);
  font-weight: var(--weight-strong);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.contact-name {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}
.contact-name > i {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: var(--radius-md);
  background: var(--blue-tint);
  color: var(--blue);
  font-style: normal;
  font-size: var(--fs-meta);
  font-weight: var(--weight-strong);
}
.contact-name b,
.contact-name small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.contact-name b {
  color: var(--ink);
}
.contact-name small {
  margin-top: 2px;
  color: var(--muted);
  font-size: var(--fs-meta);
}
.empty-state {
  padding: 80px var(--space-6);
  text-align: center;
}
.empty-state h2 {
  margin: 0;
  color: var(--ink);
  font-size: var(--fs-title);
}
.empty-state p {
  margin: var(--space-2) 0 var(--space-6);
  color: var(--muted);
}
.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: var(--space-6);
  background: rgba(23, 25, 28, 0.42);
  backdrop-filter: blur(4px);
}
.dialog {
  width: min(620px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: var(--space-8);
  border-radius: var(--radius-2xl);
  background: #fff;
  box-shadow: var(--shadow-lg);
}
.dialog-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}
.dialog h2 {
  margin: 0;
  color: var(--ink);
  font-size: var(--fs-title);
  font-weight: var(--weight-title);
  letter-spacing: var(--tracking-title);
}
.dialog > p {
  color: var(--muted);
  line-height: 1.65;
}
.close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--muted);
  font-size: 26px;
  cursor: pointer;
}
.close:hover {
  background: var(--n-bg);
  color: var(--ink);
}
.csv-input {
  min-height: 180px;
  resize: vertical;
  font-family: var(--mono);
}
.notice {
  display: grid;
  gap: var(--space-1);
  margin: var(--space-5) 0;
  padding: var(--space-4);
  border: 1px solid var(--blue-edge);
  border-radius: var(--radius-lg);
  background: var(--blue-tint);
}
.notice b {
  color: var(--ink);
}
.notice span {
  color: var(--muted);
  font-size: var(--fs-small);
}
.mapping-list {
  display: grid;
  gap: var(--space-2);
  margin: var(--space-5) 0;
}
.mapping-head,
.mapping-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.9fr) minmax(130px, 1.15fr) minmax(120px, 0.9fr);
  align-items: center;
  gap: var(--space-3);
}
.mapping-head {
  padding: 0 var(--space-3) var(--space-1);
  color: var(--muted);
  font-size: var(--fs-meta);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.mapping-row {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--ring);
  border-radius: var(--radius-md);
  background: #fff;
}
.mapping-row code {
  overflow: hidden;
  color: var(--ink);
  font: var(--fs-meta)/1.4 var(--mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mapping-row select {
  min-width: 0;
  min-height: 38px;
  padding: var(--space-2) var(--space-2);
  border: 1px solid var(--ring-2);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font: var(--fs-meta)/1.3 var(--font);
}
.mapping-row select:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.dialog-message {
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--n-bg);
  color: var(--ink) !important;
}
.dialog .form-grid {
  margin-bottom: var(--space-6);
}
button:active,
.btn:active,
.skip-row button:active,
.close:active {
  transform: scale(0.98);
}
.setup-choice:active {
  transform: translateY(0) scale(0.995);
}
.setup-choice:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}
.form-error {
  margin: var(--space-5) 0 0;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--r-bg);
  color: var(--r-tx);
  font-size: var(--fs-small);
  font-weight: var(--weight-strong);
}
.onboarding-panel {
  overflow: hidden;
}
.progress {
  border-radius: 0;
}
.brand-home {
  display: inline-flex;
  color: inherit;
  text-decoration: none;
  border-radius: var(--radius-md);
}
.brand-home:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 4px;
}
.account {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.account-step {
  color: var(--muted);
}
.account-name {
  max-width: 190px;
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account a {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--muted);
  text-decoration: none;
}
.account a:hover {
  background: var(--n-bg);
  color: var(--ink);
}
.account a:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.crm-account {
  position: fixed;
  top: 20px;
  right: 28px;
  z-index: 10;
  font-size: var(--fs-meta);
  font-weight: var(--weight-strong);
}
.field input,
.field select,
.search input,
.csv-input {
  border-radius: var(--radius-lg);
  font-family: var(--font);
}
.field select option {
  font-family: var(--font);
}
.app-shell select {
  appearance: none;
  -webkit-appearance: none;
  min-height: 44px;
  padding: var(--space-3) var(--space-10) var(--space-3) var(--space-3);
  border: 1px solid var(--ring-2);
  border-radius: var(--radius-lg);
  background-color: var(--white);
  background-clip: padding-box;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 19px, calc(100% - 14px) 19px;
  background-size: 6px 6px;
  background-repeat: no-repeat;
}
.account {
  position: relative;
  display: block;
}
.account-trigger {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--ring-2);
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  font: var(--weight-strong) 12px/1 var(--font);
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s,
    box-shadow 0.15s;
}
.account-trigger:hover {
  border-color: var(--muted);
  background: var(--n-bg);
}
.account-trigger:focus-visible {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-ring);
}
.account-menu {
  position: absolute;
  top: 48px;
  right: 0;
  z-index: 20;
  width: 240px;
  padding: var(--space-4);
  border: 1px solid var(--ring);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-md);
}
.account-menu span,
.account-menu b,
.account-menu small {
  display: block;
}
.account-menu span {
  color: var(--muted);
  font-size: 11px;
  font-weight: var(--weight-strong);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.account-menu b {
  margin-top: var(--space-2);
  color: var(--ink);
  font-size: 14px;
}
.account-menu small {
  margin-top: var(--space-1);
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-menu a {
  display: block;
  margin-top: var(--space-4);
  padding: var(--space-3) 0 0;
  border-top: 1px solid var(--ring);
  border-radius: 0;
  color: var(--muted);
}
.account-menu a:hover {
  background: none;
  color: var(--ink);
}
.onboarding-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  margin-bottom: var(--space-2);
}
.onboarding-meta .eyebrow {
  margin: 0;
}
.onboarding-meta > span {
  color: var(--muted);
  font-size: var(--fs-meta);
  font-weight: var(--weight-strong);
}
.crm-account {
  top: 18px;
}
@media (max-width: 760px) {
  .onboarding-shell {
    padding: var(--space-5) var(--space-4) 0;
  }
  .onboarding-panel {
    margin-top: var(--space-8);
    padding: var(--space-8) var(--space-6) 0;
    border-radius: var(--radius-xl);
  }
  .progress {
    margin: calc(-1 * var(--space-8)) calc(-1 * var(--space-6)) var(--space-8);
  }
  .onboarding-panel h1 {
    font-size: var(--fs-page-mobile);
    line-height: 1.15;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .onboarding-panel > .skip-row {
    position: sticky;
    bottom: 0;
    z-index: 2;
    margin: var(--space-6) calc(-1 * var(--space-6)) 0;
    padding: var(--space-3) var(--space-6);
    background: rgba(255, 255, 255, 0.96);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    backdrop-filter: blur(12px);
  }
  .app-shell {
    display: block;
  }
  .rail {
    position: static;
    width: 100%;
    height: auto;
    padding: var(--space-5);
    display: flex;
    flex-direction: row;
    align-items: center;
  }
  .rail nav {
    display: none;
  }
  .workspace {
    padding: var(--space-8) var(--space-5);
  }
  .workspace-head {
    align-items: start;
  }
  .workspace-head h1 {
    font-size: var(--fs-page-mobile);
  }
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .toolbar > div {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .contact-row {
    grid-template-columns: 1fr;
    padding: var(--space-4) var(--space-5);
    gap: var(--space-2);
  }
  .contact-row.heading {
    display: none;
  }
  .contact-row > span:not(.contact-name) {
    padding-left: var(--space-12);
    color: var(--muted);
  }
  .dialog {
    padding: var(--space-6) var(--space-5);
  }
  .mapping-head,
  .mapping-row {
    grid-template-columns: minmax(90px, .8fr) minmax(110px, 1fr);
  }
  .mapping-head b:last-child {
    display: none;
  }
  .mapping-row select:last-child {
    grid-column: 2;
  }
  .dialog-backdrop {
    padding: var(--space-3);
  }
  .button-row .btn {
    min-height: 44px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .progress span,
  .setup-choice,
  .field input,
  .field select,
  .search input,
  .csv-input {
    transition: none;
  }
  .setup-choice:hover {
    transform: none;
  }
}
@media (max-width: 800px) {
  .landing-nav > .landing-nav-center {
    display: none !important;
  }
}
.concept-app {
  display: grid;
  grid-template-columns: 170px 1fr;
  min-height: 620px;
  overflow: hidden;
  border: 1px solid var(--ring);
  border-radius: var(--radius-xl);
  background: #f8f8f7;
  color: var(--ink);
  font-family: var(--font);
}
.concept-app aside {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-6) var(--space-5);
  background: var(--side);
  color: var(--side-tx);
}
.concept-app aside b {
  margin-bottom: var(--space-8);
  color: #fff;
  font-size: 17px;
}
.concept-app aside span {
  padding: var(--space-3) var(--space-3);
  border-radius: var(--radius-md);
  font-size: 12px;
}
.concept-app .concept-active {
  background: var(--blue);
  color: #fff;
}
.concept-main {
  min-width: 0;
  padding: 28px;
}
.concept-main > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}
.concept-main small {
  color: var(--muted);
  font-size: 10px;
  font-weight: var(--weight-strong);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.concept-main h3 {
  margin: var(--space-1) 0 0;
  font-size: 25px;
  letter-spacing: -0.035em;
}
.concept-main button {
  padding: var(--space-3) var(--space-4);
  border: 0;
  border-radius: var(--radius-md);
  background: var(--blue);
  color: #fff;
  font: var(--weight-strong) 12px/1 var(--font);
}
.concept-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
}
.concept-grid article {
  min-height: 220px;
  padding: var(--space-5);
  border: 1px solid var(--ring);
  border-radius: var(--radius-xl);
  background: #fff;
}
.concept-grid h4 {
  margin: var(--space-4) 0 var(--space-2);
  font-size: 17px;
}
.concept-grid p {
  margin: var(--space-1) 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}
.concept-grid dl {
  margin: var(--space-6) 0 0;
}
.concept-grid dl div,
.concept-grid li {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-top: 1px solid var(--ring);
  font-size: 11px;
}
.concept-grid dt {
  color: var(--muted);
}
.concept-grid dd {
  margin: 0;
  font-weight: var(--weight-strong);
}
.concept-grid ul {
  margin: var(--space-4) 0 0;
  padding: 0;
  list-style: none;
}
.concept-action {
  background: var(--blue-tint) !important;
}
.concept-action button {
  width: 100%;
  margin-top: var(--space-8);
}
.concept-people {
  display: flex;
  margin: var(--space-5) 0 var(--space-4);
}
.concept-people i {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-right: calc(-1 * var(--space-1));
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font: var(--weight-strong) 9px/1 var(--font);
}
.concept-people i:nth-child(2) {
  background: #27875e;
}
.concept-people i:nth-child(3) {
  background: var(--blue-deep);
}
.concept-people i:nth-child(4) {
  background: #c77c16;
}
.concept-meter {
  height: 7px;
  margin: 28px 0 var(--space-4);
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: var(--ring);
}
.concept-meter span {
  display: block;
  width: 75%;
  height: 100%;
  background: #27875e;
}
.concept-grid strong {
  display: block;
  margin-top: var(--space-5);
  font-size: 15px;
}
@media (max-width: 800px) {
  .concept-app {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .concept-app aside {
    display: none;
  }
  .concept-main {
    padding: var(--space-5);
  }
  .concept-main > header button {
    display: none;
  }
  .concept-grid {
    grid-template-columns: 1fr 1fr;
  }
  .concept-grid article {
    min-height: 190px;
  }
  .concept-grid article:nth-child(n + 5) {
    display: none;
  }
}
@media (max-width: 520px) {
  .concept-grid {
    grid-template-columns: 1fr;
  }
  .concept-grid article:nth-child(n + 3) {
    display: none;
  }
  .concept-main h3 {
    font-size: 20px;
  }
}
.gallery-tabs {
  display: inline-flex;
  gap: var(--space-1);
  margin-bottom: var(--space-6);
  padding: var(--space-1);
  border: 1px solid var(--ring);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.72);
}
.gallery-tabs button {
  min-width: 92px;
  padding: var(--space-3) var(--space-4);
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--muted);
  font: var(--weight-strong) 12px/1 var(--font);
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}
.gallery-tabs button:hover { color: var(--ink); }
.gallery-tabs button[aria-selected="true"] {
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.gallery-tabs button:focus-visible,
.gallery-arrow:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}
.gallery-shell { position: relative; perspective: 1400px; }
.gallery-track {
  display: flex;
  gap: var(--space-6);
  overflow-x: auto;
  padding: 28px max(8%, 56px) 36px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-inline: contain;
}
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-card {
  flex: 0 0 84%;
  overflow: hidden;
  border: 1px solid rgba(23, 25, 28, 0.12);
  border-radius: var(--radius-2xl);
  background: #fff;
  box-shadow: var(--shadow-lg);
  opacity: 0.68;
  scroll-snap-align: center;
  transform: scale(0.94) rotateY(2deg);
  transition: opacity 260ms ease, transform 260ms ease, box-shadow 260ms ease;
}
.gallery-card.is-active {
  opacity: 1;
  transform: scale(1) rotateY(0);
  box-shadow: var(--shadow-lg);
}
.gallery-shot {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: #eef1f6;
  margin: 0;
}
.gallery-shot::after {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  width: 16.35%;
  height: 10.7%;
  background: #f1f4f8;
  content: "";
  pointer-events: none;
}
.gallery-shot img {
  display: block;
  width: 100%;
  aspect-ratio: 1416 / 1008;
  object-fit: cover;
  object-position: top left;
  transition: transform 260ms ease;
}
.gallery-card > div { display: grid; gap: var(--space-1); padding: var(--space-5) var(--space-5) var(--space-5); }
.gallery-card b { font-size: 15px; }
.gallery-card span { color: var(--muted); font-size: 12px; line-height: 1.55; }
.gallery-arrow {
  position: absolute;
  z-index: 2;
  top: 45%;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(23, 25, 28, 0.12);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  font: var(--weight-control) 20px/1 var(--font);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.gallery-arrow:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.gallery-prev { left: 8px; }
.gallery-next { right: 8px; }
@media (max-width: 720px) {
  .gallery-tabs { display: flex; }
  .gallery-tabs button { flex: 1; min-width: 0; }
  .gallery-track { gap: var(--space-3); margin-inline: calc(-1 * var(--space-4)); padding: var(--space-4) 28px 28px; }
  .gallery-card { flex-basis: 92%; border-radius: var(--radius-xl); transform: scale(0.97); }
  .gallery-card.is-active { transform: scale(1); }
  .gallery-card > div { padding: var(--space-4) var(--space-4) var(--space-4); }
  .gallery-arrow { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .gallery-tabs button,
  .gallery-card,
  .gallery-shot img,
  .gallery-arrow { transition: none; }
}

/* Buttons and navigation keep their color changes but drop motion. */
@media (prefers-reduced-motion: reduce) {
  .btn,
  .rail nav a,
  .rail nav span {
    transition: none;
  }
  .btn:active {
    transform: none;
  }
}
