/*
 * Freight Right documentation — one brand, two themes.
 *
 * The palette is the mark's own navy (#22305E). Everything else is derived from it, so a link, a button, a focus
 * ring and an accent in a callout are visibly the same family. Dark mode is not the light theme inverted: its
 * surfaces are neutral-cool and its accent is lifted until it passes contrast on them.
 */

/* ------------------------------------------------------------------ brand */
:root {
  --fr-navy-900: #141d3a;
  --fr-navy-800: #1a2547;
  --fr-navy-700: #22305e;   /* the mark */
  --fr-navy-600: #2e4079;
  --fr-navy-500: #3a5197;
  --fr-blue-400: #5b7ad0;
  --fr-blue-300: #8fa4e0;
  --fr-blue-100: #dde4f7;
  --fr-blue-50:  #f1f4fc;

  --md-text-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --md-code-font: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* A centred column that stops growing on a very wide screen — the reason the old page drifted right. */
  --md-grid-max-width: 82rem;
}

/* ------------------------------------------------------------------ light */
[data-md-color-scheme='freightright'] {
  --md-primary-fg-color: var(--fr-navy-700);
  --md-primary-fg-color--light: var(--fr-navy-600);
  --md-primary-fg-color--dark: var(--fr-navy-900);
  --md-primary-bg-color: #ffffff;
  --md-primary-bg-color--light: rgba(255, 255, 255, 0.75);

  --md-accent-fg-color: var(--fr-navy-600);
  --md-accent-fg-color--transparent: rgba(46, 64, 121, 0.1);
  --md-accent-bg-color: #ffffff;

  --md-default-fg-color: #1c2333;
  --md-default-fg-color--light: #4a5468;
  --md-default-fg-color--lighter: #8b93a5;
  --md-default-fg-color--lightest: #e6e9f0;
  --md-default-bg-color: #ffffff;

  --md-typeset-color: #1c2333;
  --md-typeset-a-color: var(--fr-navy-600);
  --md-code-bg-color: var(--fr-blue-50);
  --md-code-fg-color: #24324d;

  --md-footer-bg-color: var(--fr-navy-900);
  --md-footer-bg-color--dark: #0f1629;

  --fr-surface: #ffffff;
  --fr-surface-sunken: var(--fr-blue-50);
  --fr-border: #e2e7f2;
  --fr-border-strong: #c9d2e6;
  --fr-muted: #5b6478;
}

/* ------------------------------------------------------------------ dark */
[data-md-color-scheme='slate'] {
  --md-hue: 225;
  --md-primary-fg-color: #101729;
  --md-primary-fg-color--light: #1b2542;
  --md-primary-fg-color--dark: #0b101e;
  --md-primary-bg-color: #eef1f8;

  --md-accent-fg-color: #9db4f0;
  --md-accent-fg-color--transparent: rgba(157, 180, 240, 0.12);

  --md-default-bg-color: #0f1523;
  --md-default-fg-color: #e8ecf5;
  --md-default-fg-color--light: #b9c2d6;
  --md-default-fg-color--lighter: #7f8ba6;
  --md-default-fg-color--lightest: #2a3348;

  --md-typeset-color: #e3e8f3;
  --md-typeset-a-color: #9db4f0;
  --md-code-bg-color: #161d2e;
  --md-code-fg-color: #dde4f7;

  --md-footer-bg-color: #0b101e;
  --md-footer-bg-color--dark: #080c17;

  --fr-surface: #141b2b;
  --fr-surface-sunken: #111827;
  --fr-border: #26304a;
  --fr-border-strong: #39456a;
  --fr-muted: #a6b0c7;
}

/* ------------------------------------------------------------------ typography */
.md-typeset {
  font-size: 0.85rem;     /* 17px on Material's 20px root */
  line-height: 1.7;
}
.md-typeset h1 {
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 1.95rem;
  line-height: 1.2;
  color: var(--md-default-fg-color);
  margin-bottom: 0.6em;
}
.md-typeset h2 {
  font-weight: 650;
  letter-spacing: -0.012em;
  font-size: 1.35rem;
  line-height: 1.3;
  margin-top: 2.2em;
  padding-top: 0.6em;
  border-top: 1px solid var(--fr-border);
}
.md-typeset h2:first-of-type { border-top: 0; padding-top: 0; margin-top: 1.6em; }
.md-typeset h3 { font-weight: 650; font-size: 1.08rem; letter-spacing: -0.006em; margin-top: 1.8em; }
.md-typeset h4 { font-weight: 650; font-size: 0.95rem; }
.md-typeset p, .md-typeset li { color: var(--md-typeset-color); }
.md-typeset a { text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
.md-typeset a:hover { text-decoration: underline; }

/* The header: sticky, quiet, and never louder than the page. */
.md-header { box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08); }
.md-header__title { font-weight: 600; letter-spacing: -0.01em; }
.md-header__button.md-logo :is(img, svg) { height: 1.5rem; width: auto; }

/* ------------------------------------------------------------------ navigation */
.md-nav { font-size: 0.72rem; }
.md-nav__title { font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fr-muted); }
.md-sidebar--primary .md-nav__item--section > .md-nav__link {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--fr-muted);
  margin-top: 1.1rem;
}
.md-nav__link {
  border-radius: 6px;
  padding: 0.28rem 0.5rem;
  margin: 0.05rem -0.5rem;
  transition: background-color 120ms ease, color 120ms ease;
}
.md-nav__link:hover { background: var(--md-accent-fg-color--transparent); color: var(--md-accent-fg-color); }
.md-nav__link--active,
.md-nav__item .md-nav__link--active {
  background: var(--md-accent-fg-color--transparent);
  color: var(--md-accent-fg-color);
  font-weight: 600;
}
.md-sidebar--secondary .md-nav__link--active { background: none; border-left: 2px solid var(--md-accent-fg-color); }

/* Keyboard focus must always be visible — on links, buttons, cards and code copy alike.
   (Material 9.7 renders the copy control as `.md-code__button`, not the older `.md-clipboard`.) */
.md-typeset a:focus-visible,
.md-nav__link:focus-visible,
.md-header__button:focus-visible,
.md-code__button:focus-visible,
.md-typeset .md-button:focus-visible,
.fr-card:focus-visible {
  outline: 2px solid var(--md-accent-fg-color);
  outline-offset: 2px;
  border-radius: 6px;
}
/* The header sits on navy: its own ring has to be light to be seen at all. */
.md-header__button:focus-visible { outline-color: var(--md-primary-bg-color); }
/* The search field shows nothing on focus by default, and the theme toggle's control is a visually hidden radio —
   so the ring goes on what the eye actually sees. */
.md-search__form:focus-within {
  outline: 2px solid var(--md-primary-bg-color);
  outline-offset: 2px;
  border-radius: 6px;
}
.md-header__option > input:focus-visible + label {
  outline: 2px solid var(--md-primary-bg-color);
  outline-offset: 3px;
  border-radius: 50%;
}

/* ------------------------------------------------------------------ hero */
.fr-hero {
  border: 1px solid var(--fr-border);
  background: linear-gradient(135deg, var(--fr-surface-sunken), var(--fr-surface) 65%);
  border-radius: 14px;
  padding: 2rem 1.9rem 1.7rem;
  margin: 0 0 2rem;
}
.fr-hero h1 { margin: 0 0 0.5rem; }
.fr-hero .md-button { margin: 0 0.5rem 0 0; }

/* Every page opens with one sentence in the same voice, hero or not. */
.md-typeset .fr-lede {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--fr-muted);
  max-width: 46rem;
  margin: -0.3rem 0 1.6rem;
}
.fr-hero .fr-lede { font-size: 1rem; margin: 0 0 1.2rem; }

/* ------------------------------------------------------------------ buttons */
.md-typeset .md-button {
  border-radius: 8px;
  border-width: 1px;
  font-weight: 600;
  padding: 0.55em 1.1em;
  transition: transform 80ms ease, background-color 120ms ease, color 120ms ease;
}
.md-typeset .md-button--primary {
  background: var(--md-accent-fg-color);
  border-color: var(--md-accent-fg-color);
  color: var(--md-primary-bg-color);
}
[data-md-color-scheme='slate'] .md-typeset .md-button--primary { color: #0f1523; }
.md-typeset .md-button:hover { transform: translateY(-1px); }
/* The plain button reads as a button in BOTH themes: on dark its colour is the accent, not the header navy. */
[data-md-color-scheme='slate'] .md-typeset .md-button:not(.md-button--primary) {
  color: var(--md-accent-fg-color);
  border-color: var(--md-accent-fg-color);
}
[data-md-color-scheme='slate'] .md-typeset .md-button:not(.md-button--primary):hover {
  background: var(--md-accent-fg-color);
  color: #0f1523;
}
[data-md-color-scheme='slate'] .md-typeset .md-button--primary:hover {
  background: #b9caf6;
  border-color: #b9caf6;
  color: #0f1523;
}
.md-typeset .md-button svg { height: 1em; vertical-align: -0.12em; fill: currentColor; }

/* ------------------------------------------------------------------ cards */
/* Two columns, not auto-fit: every card set on this site has four entries, and auto-fit laid them out 3 + 1 —
   an orphan beside a hole. Two rows of two is the only balanced answer at every width that has room for two. */
.fr-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  margin: 1.4rem 0 2rem;
}
.fr-card {
  display: block;
  border: 1px solid var(--fr-border);
  border-radius: 12px;
  background: var(--fr-surface);
  padding: 1.05rem 1.1rem;
  color: inherit !important;
  text-decoration: none !important;
  transition: border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}
.fr-card:hover {
  border-color: var(--fr-border-strong);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(20, 29, 58, 0.09);
}
.fr-card .fr-card__title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 650;
  font-size: 0.86rem;
  margin-bottom: 0.3rem;
  color: var(--md-default-fg-color);
}
.fr-card .fr-card__title svg { height: 1.05em; width: 1.05em; fill: var(--md-accent-fg-color); }
.fr-card p { margin: 0; font-size: 0.76rem; color: var(--fr-muted); line-height: 1.55; }

/* ------------------------------------------------------------------ steps */
.fr-steps { counter-reset: fr-step; list-style: none; margin: 1.3rem 0 2rem; padding: 0 0 0 0.9rem; }
.fr-steps > li {
  counter-increment: fr-step;
  position: relative;
  padding: 0 0 1.35rem 2.6rem;
  margin: 0;
  border-left: 1px solid var(--fr-border);
}
.fr-steps > li:last-child { border-left-color: transparent; padding-bottom: 0.2rem; }
.fr-steps > li::before {
  content: counter(fr-step);
  position: absolute;
  left: -0.85rem;
  top: -0.15rem;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background: var(--md-accent-fg-color);
  color: var(--md-primary-bg-color);
  font-size: 0.74rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}
[data-md-color-scheme='slate'] .fr-steps > li::before { color: #0f1523; }
.fr-steps > li > strong { display: block; font-size: 0.9rem; margin-bottom: 0.25rem; }
.fr-steps .highlight, .fr-steps pre { margin-top: 0.6rem; }

/* ------------------------------------------------------------------ examples */
.md-typeset ul.fr-asks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 1.2rem 0 2rem;
  padding: 0;
  list-style: none;
}
.md-typeset ul.fr-asks > li {
  margin: 0;
  border: 1px solid var(--fr-border);
  border-left: 3px solid var(--md-accent-fg-color);
  border-radius: 8px;
  background: var(--fr-surface-sunken);
  padding: 0.6rem 0.85rem;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--md-default-fg-color);
}

/* ------------------------------------------------------------------ tables, code, callouts */
.md-typeset table:not([class]) {
  border: 1px solid var(--fr-border);
  border-radius: 10px;
  overflow: hidden;
  font-size: 0.76rem;
  box-shadow: none;
}
.md-typeset table:not([class]) th {
  background: var(--fr-surface-sunken);
  font-weight: 650;
  color: var(--md-default-fg-color);
  border-bottom: 1px solid var(--fr-border);
}
.md-typeset table:not([class]) td { border-top: 1px solid var(--fr-border); vertical-align: top; }
/* A tool's name is one token: it must never be broken across lines to save a few pixels. */
.md-typeset table td:first-child code { white-space: nowrap; }
.md-typeset .md-typeset__table { overflow-x: auto; }
/* The tool overview: a name, a sentence, and two short columns — the sentence gets the room. */
.md-typeset .fr-toolmeta {
  font-size: 0.74rem;
  color: var(--fr-muted);
  margin-top: -0.4rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--fr-border);
}
.md-typeset h2 > code, .md-typeset h3 > code { font-size: 0.85em; }
/* The tool overview: a name with its kind, a sentence, and what it needs. Three columns fit; four did not.
   The name column shrinks to its content — a fixed share either wrapped `get_booking_operation` away from its badge
   or stole the width the sentence needs. */
/* Material wraps a table in a shrink-to-fit inline-block, against which `width: 100%` resolves circularly — the
   column shares came out nothing like the percentages until the wrapper became a block. */
/* Material renders the table as `display: inline-block` inside a shrink-to-fit wrapper. On an inline-block,
   `table-layout` and percentage column widths do nothing at all — which is why every share below was ignored until
   the table was told to be a table again. */
.fr-overview .md-typeset__table { display: block; }
.fr-overview table:not([class]) { display: table; width: 100%; table-layout: fixed; }
.fr-overview td:first-child, .fr-overview th:first-child { width: 36%; white-space: nowrap; }
.fr-overview td:nth-child(2), .fr-overview th:nth-child(2) { width: 46%; }
.fr-overview td:first-child code { font-size: 0.78em; }
/* The badge sits under the name, not beside it: `prepare_rate_request_booking` is 28 characters, and side by side
   the badge overhung the next column's first word. */
.fr-overview td:first-child .fr-kind { display: block; width: fit-content; margin: 0.3rem 0 0; }
.fr-overview td:nth-child(3), .fr-overview th:nth-child(3) { width: 18%; }
.md-typeset .fr-kind {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  vertical-align: 0.08em;
}
.md-typeset .fr-kind--read {
  color: var(--fr-muted);
  background: var(--fr-surface-sunken);
  border: 1px solid var(--fr-border-strong);
}
.md-typeset .fr-kind--write {
  color: #8a5a00;
  background: rgba(217, 149, 0, 0.14);
  border: 1px solid rgba(217, 149, 0, 0.35);
}
[data-md-color-scheme='slate'] .md-typeset .fr-kind--write {
  color: #f0c368;
  background: rgba(240, 195, 104, 0.12);
  border-color: rgba(240, 195, 104, 0.32);
}
.md-typeset table:not([class]) tr:hover td { background: var(--md-accent-fg-color--transparent); }

.md-typeset pre > code { border-radius: 10px; font-size: 0.74rem; }
.md-typeset .highlight { border-radius: 10px; }
.md-typeset code { border-radius: 5px; padding: 0.12em 0.36em; font-size: 0.82em; }
.md-code__nav { top: 0.4rem; right: 0.4rem; }
/* Reserve the button's room instead of letting it sit on top of the last characters of a short line — which is
   exactly what a one-line connector URL is on a phone. */
.md-typeset .highlight pre > code { padding-right: 2.4rem; }
.md-code__button { color: var(--fr-muted); transition: color 120ms ease, background-color 120ms ease; }
.md-code__button:hover { color: var(--md-accent-fg-color); background: var(--md-accent-fg-color--transparent); }

/* Content tabs — the quickstart's four clients. Material's default is nearly invisible against our surfaces. */
.md-typeset .tabbed-set { margin: 0.9rem 0 1.2rem; }
.md-typeset .tabbed-labels {
  box-shadow: none;
  border-bottom: 1px solid var(--fr-border);
  gap: 0.15rem;
}
.md-typeset .tabbed-labels > label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--fr-muted);
  padding: 0.5em 0.85em;
  border-radius: 8px 8px 0 0;
  transition: color 120ms ease, background-color 120ms ease;
}
.md-typeset .tabbed-labels > label:hover { color: var(--md-accent-fg-color); background: var(--md-accent-fg-color--transparent); }
.md-typeset .tabbed-set > input:checked + label { color: var(--md-accent-fg-color); }
.md-typeset .tabbed-labels::before { background: var(--md-accent-fg-color); height: 2px; }
.md-typeset .tabbed-content { padding-top: 0.5rem; }
.js .md-typeset .tabbed-labels > label > [href]:focus-visible {
  outline: 2px solid var(--md-accent-fg-color);
  outline-offset: 2px;
  border-radius: 4px;
}

.md-typeset .admonition, .md-typeset details {
  border-radius: 10px;
  border-width: 1px;
  border-left-width: 3px;
  font-size: 0.8rem;
  box-shadow: none;
  background: var(--fr-surface);
}
.md-typeset blockquote {
  border-left: 3px solid var(--md-accent-fg-color);
  color: var(--md-default-fg-color--light);
  background: var(--fr-surface-sunken);
  border-radius: 0 8px 8px 0;
  padding: 0.5rem 1rem;
}

/* ------------------------------------------------------------------ the copyable connector URL */
/* The URL is a real code block, not inline code: that is what Material mounts a copy button on, and copying it
   correctly is the single most important thing this site does. */
/* `min(…, 100%)`, never a bare minmax: a 20rem track is 400px on Material's 20px root and would push a 390px
   phone into horizontal scroll. */
.fr-endpoints {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(20rem, 100%), 1fr));
  gap: 0.9rem;
  margin: 1.1rem 0 1.8rem;
}
.fr-endpoint {
  border: 1px solid var(--fr-border);
  border-radius: 12px;
  background: var(--fr-surface);
  padding: 0.9rem 1rem 1rem;
}
.fr-endpoint__head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.55rem; }
.fr-endpoint__label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fr-muted);
}
.md-typeset .fr-endpoint .highlight { margin: 0; }
.md-typeset .fr-endpoint pre > code { background: var(--fr-surface-sunken); font-size: 0.72rem; }
.md-typeset .fr-endpoint__note {
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--fr-muted);
  margin: 0.6rem 0 0;
}
.fr-badge {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 0.18rem 0.6rem;
  border: 1px solid transparent;
}
.fr-badge--live { color: #0f7b52; background: rgba(15, 123, 82, 0.12); border-color: rgba(15, 123, 82, 0.3); }
.fr-badge--soon { color: var(--fr-muted); background: var(--fr-surface-sunken); border-color: var(--fr-border-strong); }
[data-md-color-scheme='slate'] .fr-badge--live { color: #6ddaa8; background: rgba(109, 218, 168, 0.12); border-color: rgba(109, 218, 168, 0.3); }

/* ------------------------------------------------------------------ small screens */
@media screen and (max-width: 76.1875em) {
  .md-nav--primary .md-nav__title { background: var(--md-primary-fg-color); color: var(--md-primary-bg-color); }
  .fr-hero { padding: 1.4rem 1.2rem; }
  .fr-endpoint__label { min-width: auto; }
}
@media screen and (max-width: 44.9375em) {
  .md-typeset h1 { font-size: 1.55rem; }
  .md-typeset h2 { font-size: 1.2rem; }
  .fr-cards, .md-typeset ul.fr-asks { grid-template-columns: 1fr; }
}
