/* Provzo website — visual system.
 *
 * The colour tokens in tokens.css are generated from lib/theme/app_colors.dart,
 * so this file only ever refers to var(--name). Never hard-code a hex here: it
 * would drift from the app the first time the palette moves.
 *
 * The app's design language, followed deliberately:
 *   - borders, not shadows (one restrained shadow token exists, used sparingly)
 *   - no gradients, no glow  (design/logo/README.md calls those "the signature
 *     of generated design")
 *   - pill buttons, 18px cards, 14px controls
 *   - headlines with tight negative tracking
 *   - two teals: --brand for accents, --brand-fill for anything under white text
 */

/* ------------------------------------------------------------------ reset */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family:
    Roboto,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Noto Sans",
    "Noto Sans Malayalam",
    "Noto Sans Devanagari",
    "Noto Sans Tamil",
    Helvetica,
    Arial,
    sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

/* ------------------------------------------------------- type: app's scale */

h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--ink);
  font-weight: 700;
}

h1 {
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.032em;
}

h2 {
  font-size: clamp(1.5rem, 1.25rem + 1.1vw, 2.1rem);
  line-height: 1.18;
  letter-spacing: -0.022em;
}

h3 {
  font-size: 1.3rem;
  line-height: 1.26;
  letter-spacing: -0.015em;
}

h4 {
  font-size: 1.03rem;
  line-height: 1.34;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

a {
  color: var(--brand-fill);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--brand-pressed);
}

strong {
  font-weight: 700;
}

code,
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}

/* The all-caps eyebrow, matching labelSmall in app_theme.dart. */
.eyebrow {
  margin: 0 0 0.6rem;
  color: var(--brand-fill);
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.078em;
  text-transform: uppercase;
}

.eyebrow--muted {
  color: var(--ink-tertiary);
}

.lede {
  color: var(--ink-secondary);
  font-size: clamp(1.02rem, 0.98rem + 0.3vw, 1.19rem);
  line-height: 1.56;
}

.prose p + p {
  margin-top: 0.9rem;
}

.small {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--ink-secondary);
}

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

/* --------------------------------------------------------------- skip link */

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.8rem 1.2rem;
  background: var(--brand-fill);
  color: #fff;
  border-radius: 0 0 var(--radius-control) 0;
  font-weight: 600;
}

.skip:focus {
  left: 0;
}

/* --------------------------------------------------------------- structure */

.wrap {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
}

.wrap--narrow {
  max-width: 760px;
}

.section {
  padding: clamp(2.6rem, 2rem + 2.4vw, 4.6rem) 0;
}

.section--tight {
  padding: clamp(1.8rem, 1.4rem + 1.4vw, 2.8rem) 0;
}

.section--sunken {
  background: var(--surface-muted);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section__head {
  max-width: 62ch;
  margin-bottom: 1.9rem;
}

.section__head p {
  margin-top: 0.7rem;
}

.stack > * + * {
  margin-top: 1rem;
}

.stack--lg > * + * {
  margin-top: 1.7rem;
}

/* ------------------------------------------------------------------- grids */

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

.grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}

.grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}

.grid--4 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
}

.grid--tiles {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 232px), 1fr));
}

/* ------------------------------------------------------------------- cards */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 1.15rem 1.2rem;
}

.card--pad {
  padding: 1.6rem;
}

.card--wash {
  background: var(--brand-wash);
  border-color: var(--brand-wash-line);
}

.card--sunken {
  background: var(--surface-muted);
}

.card__title {
  margin: 0;
}

.card__body {
  margin-top: 0.5rem;
  color: var(--ink-secondary);
  font-size: 0.93rem;
  line-height: 1.55;
}

/* A card that is entirely one link. */
a.tile {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 1.05rem 1.1rem;
  color: var(--ink);
  text-decoration: none;
  transition:
    border-color 140ms ease,
    transform 140ms ease;
}

a.tile:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
  color: var(--ink);
}

a.tile .tile__name {
  font-weight: 700;
  letter-spacing: -0.01em;
}

a.tile .tile__meta {
  color: var(--ink-secondary);
  font-size: 0.82rem;
}

a.tile .tile__count {
  color: var(--brand-fill);
  font-size: 0.78rem;
  font-weight: 700;
}

/* ------------------------------------------------------------------ badges */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.3rem 0.66rem;
  border-radius: var(--radius-pill);
  background: var(--brand-wash);
  color: var(--brand-fill);
  border: 1px solid var(--brand-wash-line);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

/* Amber sits at about 3:1 on its own wash, which is fine for a dot or an icon
 * but under AA for text. So amber surfaces carry ink text and use amber only
 * for the mark itself. */
.badge--amber {
  background: var(--amber-wash);
  color: var(--ink);
  border-color: var(--amber-line);
}

.badge--amber.badge--dot::before {
  background: var(--amber);
}

.badge--neutral {
  background: var(--surface-sunken);
  color: var(--ink-secondary);
  border-color: var(--line-strong);
}

.badge--dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ----------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 50px;
  padding: 0.8rem 1.45rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-size: 0.97rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 140ms ease,
    border-color 140ms ease;
}

.btn--primary {
  background: var(--brand-fill);
  color: #fff;
}

.btn--primary:hover {
  background: var(--brand-pressed);
  color: #fff;
}

.btn--ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn--ghost:hover {
  border-color: var(--brand);
  color: var(--brand-fill);
}

.btn--onInk {
  background: var(--brand-wash);
  color: var(--navy);
}

.btn--onInk:hover {
  background: #fff;
  color: var(--navy);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

/* -------------------------------------------------------- header and nav */

.masthead {
  position: sticky;
  top: 0;
  z-index: 40;
  /* Opaque first: if color-mix is unsupported the bar stays readable rather
   * than turning transparent over scrolling content. */
  background: var(--canvas);
  background: color-mix(in srgb, var(--canvas) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.masthead__inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 66px;
}

.lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
  margin-right: auto;
}

.lockup__mark {
  display: block;
  width: 30px;
  height: 30px;
  flex: none;
}

.lockup__word {
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: -0.035em;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

/* :not(.btn) matters. Without it this rule beats .btn--primary on specificity
 * and repaints the call-to-action's white label in muted grey on teal. */
.nav a:not(.btn) {
  padding: 0.5rem 0.72rem;
  border-radius: var(--radius-pill);
  color: var(--ink-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

.nav a:not(.btn):hover {
  background: var(--surface-sunken);
  color: var(--ink);
}

.nav a:not(.btn)[aria-current="page"] {
  background: var(--brand-wash);
  color: var(--brand-fill);
}

.nav__cta {
  margin-left: 0.35rem;
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.45rem;
  min-height: 42px;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.87rem;
  font-weight: 600;
  cursor: pointer;
}

@media (max-width: 900px) {
  .nav-toggle {
    display: inline-flex;
  }

  .nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    padding: 0.8rem 20px 1.2rem;
    background: var(--canvas);
    border-bottom: 1px solid var(--line);
  }

  .nav[data-open="true"] {
    display: flex;
  }

  .nav a:not(.btn) {
    padding: 0.72rem 0.8rem;
  }

  .nav__cta {
    margin-left: 0;
    margin-top: 0.4rem;
  }
}

/* -------------------------------------------------------------- hero areas */

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  padding: clamp(2.8rem, 2rem + 4vw, 5.4rem) 0;
}

/* A flat hexagon lattice — the emblem's own shape, at low opacity. Flat fill,
 * no gradient, so it stays inside the brand's stated rules. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--hex-pattern);
  background-size: 78px 90px;
  opacity: 0.5;
  pointer-events: none;
}

.hero__inner {
  position: relative;
}

.hero__grid {
  display: grid;
  gap: clamp(1.6rem, 1rem + 2.4vw, 3rem);
  align-items: center;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
}

@media (max-width: 900px) {
  .hero__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.hero h1 {
  max-width: 20ch;
}

.hero .lede {
  max-width: 54ch;
  margin-top: 1rem;
}

.hero__actions {
  margin-top: 1.7rem;
}

.hero--compact {
  padding: clamp(2rem, 1.6rem + 1.8vw, 3rem) 0;
}

.hero--ink {
  background: var(--navy);
  border-bottom-color: var(--navy);
}

.hero--ink h1,
.hero--ink h2 {
  color: #fff;
}

.hero--ink .lede,
.hero--ink .small {
  color: var(--brand-wash);
}

.hero--ink .eyebrow {
  color: var(--brand-wash);
}

/* ------------------------------------------------------------------ search */

.search {
  position: relative;
}

.search__field {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  padding: 0.25rem 0.4rem 0.25rem 1.1rem;
}

.search__field:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-wash);
}

.search__field input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  padding: 0.75rem 0;
}

.search__field input::placeholder {
  color: var(--ink-tertiary);
}

.search__results {
  margin-top: 0.9rem;
}

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

.result-list a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.78rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  text-decoration: none;
  color: var(--ink);
}

.result-list a:hover {
  border-color: var(--brand);
}

.result-list .result__group {
  color: var(--ink-secondary);
  font-size: 0.79rem;
  flex: none;
}

/* --------------------------------------------------------------- callouts */

.note {
  display: flex;
  gap: 0.85rem;
  padding: 1.05rem 1.15rem;
  border-radius: var(--radius-card);
  background: var(--surface-muted);
  border: 1px solid var(--line);
  color: var(--ink-secondary);
  font-size: 0.9rem;
  line-height: 1.55;
}

.note strong {
  color: var(--ink);
}

.note__icon {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  color: var(--brand-fill);
}

.note--amber {
  background: var(--amber-wash);
  border-color: var(--amber-line);
  color: var(--ink);
}

.note--amber .note__icon {
  color: var(--amber);
}

.note--error {
  background: var(--error-wash);
  border-color: var(--error-line);
  color: var(--ink);
}

.note--error .note__icon {
  color: var(--error);
}

/* ------------------------------------------------------------------- lists */

.ticks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.62rem;
}

.ticks li {
  position: relative;
  padding-left: 1.7rem;
  color: var(--ink-secondary);
  line-height: 1.55;
}

.ticks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.34em;
  width: 12px;
  height: 7px;
  border-left: 2px solid var(--brand);
  border-bottom: 2px solid var(--brand);
  transform: rotate(-45deg);
}

.ticks--cross li::before {
  top: 0.42em;
  width: 11px;
  height: 11px;
  border: 0;
  transform: none;
  background: var(--cross-mark);
  background-size: contain;
}

.ticks li strong {
  color: var(--ink);
}

.steps {
  counter-reset: step;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding: 1.05rem 1.2rem 1.05rem 3.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 1.1rem;
  top: 1rem;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand-wash);
  color: var(--brand-fill);
  font-size: 0.79rem;
  font-weight: 700;
}

.steps li p {
  margin-top: 0.32rem;
  color: var(--ink-secondary);
  font-size: 0.92rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.chips a,
.chips span {
  display: inline-block;
  padding: 0.42rem 0.85rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.86rem;
  text-decoration: none;
}

.chips a:hover {
  border-color: var(--brand);
  color: var(--brand-fill);
}

.columns {
  columns: 2 220px;
  column-gap: 26px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.columns li {
  break-inside: avoid;
  padding: 0.28rem 0;
  font-size: 0.92rem;
  color: var(--ink-secondary);
}

/* -------------------------------------------------------------- data pairs */

.facts {
  display: grid;
  gap: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--surface);
}

.facts > div {
  display: grid;
  grid-template-columns: minmax(140px, 0.42fr) minmax(0, 1fr);
  gap: 0.6rem 1.2rem;
  padding: 0.9rem 1.15rem;
  border-top: 1px solid var(--line);
}

.facts > div:first-child {
  border-top: 0;
}

.facts dt {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 0.82rem;
  font-weight: 600;
}

.facts dd {
  margin: 0;
  font-size: 0.93rem;
  overflow-wrap: anywhere;
}

/* Unverified merchant facts are marked with a badge, not with colour alone, so
 * the distinction survives greyscale and screen readers. */
.facts dd .badge {
  font-weight: 700;
}

.stat-row {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
}

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 1.1rem 1.15rem;
}

.stat__num {
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--ink);
}

.stat__label {
  margin-top: 0.32rem;
  color: var(--ink-secondary);
  font-size: 0.83rem;
}

.hero--ink .stat {
  background: transparent;
  border-color: var(--navy-line);
}

.hero--ink .stat__num {
  color: #fff;
}

.hero--ink .stat__label {
  color: var(--brand-wash);
}

/* ------------------------------------------------------------ breadcrumbs */

.crumbs {
  padding: 0.9rem 0 0;
  font-size: 0.82rem;
  color: var(--ink-secondary);
}

.crumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
}

.crumbs li::after {
  content: "/";
  margin-left: 0.4rem;
  color: var(--ink-tertiary);
}

.crumbs li:last-child::after {
  content: "";
}

/* ---------------------------------------------------------------- policies */

.policy-body h3 {
  margin-top: 1.9rem;
  font-size: 1.06rem;
}

.policy-body p {
  margin-top: 0.55rem;
  color: var(--ink-secondary);
  line-height: 1.62;
  white-space: pre-line;
}

.toc {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.3rem;
}

.toc a {
  font-size: 0.9rem;
}

/* ------------------------------------------------------------------ footer */

.footer {
  background: var(--navy);
  color: var(--brand-wash);
  padding: clamp(2.4rem, 2rem + 1.6vw, 3.6rem) 0 1.6rem;
}

.footer a {
  color: var(--brand-wash);
  text-decoration: none;
  font-size: 0.88rem;
}

.footer a:hover {
  color: #fff;
  text-decoration: underline;
}

/* Six link columns plus the brand block.
 *
 * This used to be `minmax(0, 1.3fr) repeat(auto-fit, minmax(150px, 1fr))`,
 * which worked while there were four link columns and came apart at six:
 * auto-fit packed as many 150px tracks as fitted, pushed the remainder onto an
 * implicit second row, and left that row starting under the brand block
 * instead of lining up with the columns above it.
 *
 * An explicit track count fixes the alignment. The brand spans the full width
 * on its own row, so every link column starts on the same baseline and the
 * count steps down at each breakpoint rather than being negotiated. */
.footer__top {
  display: grid;
  gap: 2.1rem 1.6rem;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: start;
}

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

@media (max-width: 1080px) {
  .footer__top {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .footer__top {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 430px) {
  .footer__top {
    grid-template-columns: minmax(0, 1fr);
  }
}

.footer__brand .lockup__word,
.footer .lockup {
  color: #fff;
}

.footer__blurb {
  margin-top: 0.8rem;
  max-width: 34ch;
  font-size: 0.87rem;
  line-height: 1.6;
  color: var(--brand-wash);
  opacity: 0.86;
}

/* min-height reserves two lines whether the heading needs them or not.
 *
 * Without it a heading that wraps pushes its own column's links a line lower
 * than the other five, which reads as a broken grid even though the columns
 * themselves are aligned. Reserving the space unconditionally keeps every
 * column's first link on one baseline at any width and in any language. */
.footer h2 {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.085em;
  text-transform: uppercase;
  color: #fff;
  opacity: 0.72;
  margin-bottom: 0.8rem;
  min-height: 2.3em;
  line-height: 1.15;
}

.footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.48rem;
}

.footer__base {
  margin-top: 2.2rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--navy-line);
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.4rem;
  align-items: baseline;
  font-size: 0.8rem;
  opacity: 0.85;
}

.footer__base p {
  max-width: 78ch;
  line-height: 1.6;
}

/* -------------------------------------------------------------- utilities */

.center {
  text-align: center;
}

.hr {
  height: 1px;
  background: var(--line);
  border: 0;
  margin: 0;
}

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

/* -------------------------------------------------- focus, motion, print */

:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  a.tile:hover {
    transform: none;
  }
}

@media print {
  .masthead,
  .footer,
  .search,
  .nav-toggle {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .hero::before {
    display: none;
  }

  a {
    color: var(--ink);
  }
}

/* ---------------------------------------------------------------- support */

.chat {
  display: flex;
  flex-direction: column;
  min-height: 420px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  overflow: hidden;
}

.chat__head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface-muted);
}

.chat__head h3 {
  font-size: 1rem;
  margin-right: auto;
}

.chat__log {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 1.1rem;
  overflow-y: auto;
  max-height: 460px;
}

.msg {
  max-width: 82%;
  padding: 0.7rem 0.95rem;
  border-radius: var(--radius-card);
  font-size: 0.93rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.msg--guest {
  align-self: flex-end;
  background: var(--brand-fill);
  color: #fff;
  border-bottom-right-radius: 5px;
}

.msg--agent {
  align-self: flex-start;
  background: var(--surface-sunken);
  color: var(--ink);
  border-bottom-left-radius: 5px;
}

.msg--system {
  align-self: center;
  max-width: 100%;
  background: transparent;
  color: var(--ink-secondary);
  font-size: 0.82rem;
  text-align: center;
}

.msg__meta {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.72rem;
  opacity: 0.78;
}

.chat__form {
  display: flex;
  gap: 0.6rem;
  padding: 0.8rem;
  border-top: 1px solid var(--line);
  background: var(--surface-muted);
}

.chat__form textarea {
  flex: 1;
  min-height: 46px;
  max-height: 140px;
  resize: vertical;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
}

.chat__form textarea:focus {
  outline: 0;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-wash);
}

.field {
  display: block;
  margin-bottom: 0.9rem;
}

.field > span {
  display: block;
  margin-bottom: 0.34rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-secondary);
}

.field input,
.field select {
  width: 100%;
  min-height: 48px;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.field input:focus,
.field select:focus {
  outline: 0;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-wash);
}

/* Support console: conversation list beside the transcript. */
.console {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.6fr);
  align-items: start;
}

@media (max-width: 900px) {
  .console {
    grid-template-columns: minmax(0, 1fr);
  }
}

.convo-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  max-height: 520px;
  overflow-y: auto;
}

.convo-list button {
  width: 100%;
  text-align: left;
  display: grid;
  gap: 0.25rem;
  padding: 0.8rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.convo-list button:hover {
  border-color: var(--brand);
}

.convo-list button[aria-current="true"] {
  border-color: var(--brand);
  background: var(--brand-wash);
}

.convo-list .convo__who {
  font-weight: 700;
  font-size: 0.92rem;
}

.convo-list .convo__last {
  color: var(--ink-secondary);
  font-size: 0.82rem;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--ink-secondary);
}

/* Operator credit, bottom-left of the footer. */
.footer__credit {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--navy-line);
}

.footer__operator {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.012em;
  color: #fff;
  text-decoration: none;
}

.footer__operator:hover {
  color: #fff;
  text-decoration: underline;
}

/* An outbound marker, so a link leaving the site is not a surprise. Drawn as an
 * inline SVG rather than a glyph, because the arrow characters are missing from
 * a surprising number of font stacks and render as an empty box. */
.footer__operator svg {
  width: 11px;
  height: 11px;
  margin-left: 0.36rem;
  vertical-align: baseline;
  opacity: 0.85;
}

.footer__year {
  margin-left: auto;
  font-size: 0.78rem;
  opacity: 0.62;
}

@media (max-width: 520px) {
  .footer__year {
    margin-left: 0;
  }
}


/* ==========================================================================
 * Motion.
 *
 * Every rule in this block is scoped to `html.js-motion`, a class that site.js
 * adds only when two things are true: JavaScript ran, and the visitor has not
 * asked for reduced motion. That gate is the whole design, because the failure
 * mode of scroll-reveal is not an ugly animation — it is a page that stays
 * permanently blank when the animation never runs.
 *
 * Three ways this stays safe:
 *   - No JavaScript          -> the class is absent, nothing is ever hidden.
 *   - prefers-reduced-motion -> site.js does not add the class, nothing hidden.
 *   - JavaScript throws      -> the class is added last, after the observer is
 *                               wired, so a failure leaves content visible.
 *
 * The accessibility statement at /legal/accessibility/ promises that motion is
 * limited to small transitions and switched off on request. Keep it true:
 * distances stay under 20px, durations under 600ms, and nothing loops.
 * ========================================================================== */

html.js-motion [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 480ms cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 480ms cubic-bezier(0.22, 0.61, 0.36, 1);
  /* Staggered by index, capped so a 30-tile grid does not take 9 seconds. */
  transition-delay: calc(var(--reveal-index, 0) * 55ms);
}

html.js-motion [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* Belt and braces: if the class is ever present under reduced motion — a
 * preference changed after load, say — content must not stay hidden. */
@media (prefers-reduced-motion: reduce) {
  html.js-motion [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
    transition-delay: 0ms;
  }
}

/* ------------------------------------------------------------------ masthead
 * A hairline and a soft shadow once the page has scrolled, so the header
 * separates from content instead of floating on it. */
.masthead {
  transition:
    box-shadow 240ms ease,
    border-color 240ms ease,
    background-color 240ms ease;
}

html.js-motion .masthead.is-scrolled {
  box-shadow: 0 1px 0 var(--line), 0 6px 20px rgba(0, 0, 0, 0.06);
}

/* ------------------------------------------------------------- reading depth
 * A progress bar for long documents. The policy pages run to sixty-three
 * clauses, and knowing whether you are a third or nine tenths of the way
 * through a refund policy is genuinely useful. Fixed, 3px, non-interactive. */
.read-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: var(--brand-fill);
  z-index: 60;
  pointer-events: none;
}

/* ---------------------------------------------------------------------- toc
 * Scrollspy on the in-document contents list. The clause you are reading is
 * marked with weight and a rule, never with colour alone. */
.toc a {
  transition:
    color 180ms ease,
    border-color 180ms ease;
  border-left: 2px solid transparent;
  padding-left: 0.55rem;
  margin-left: -0.55rem;
  display: inline-block;
}

.toc a[aria-current="true"] {
  color: var(--brand-fill);
  font-weight: 600;
  border-left-color: var(--brand-fill);
}

/* ------------------------------------------------------------------ surfaces
 * Hover lift on the things that are already links. Small, and paired with the
 * existing focus ring rather than replacing it. */
html.js-motion a.tile,
html.js-motion .card {
  transition:
    transform 220ms cubic-bezier(0.22, 0.61, 0.36, 1),
    box-shadow 220ms ease,
    border-color 220ms ease;
}

html.js-motion a.tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.07);
}

/* Pressing should feel like pressing, so the lift collapses on click. */
html.js-motion a.tile:active {
  transform: translateY(0);
  box-shadow: none;
}

/* Counters animate from zero. `font-variant-numeric` keeps the digits from
 * reflowing the layout on every frame while the number climbs. */
.stat__num {
  font-variant-numeric: tabular-nums;
}


/* ==========================================================================
 * Motion, second pass.
 *
 * Same gate as above: everything is under `html.js-motion`, so a visitor who
 * asked for reduced motion, or whose JavaScript never ran, gets the plain site.
 *
 * Two brand rules are deliberately respected here rather than worked around:
 * the hexagon lattice stays a flat fill with no gradient, so it is animated by
 * transform only and never by colour; and no new colour is invented, so every
 * glow and wash below is an existing palette token at a different alpha.
 * ========================================================================== */

/* --------------------------------------------------------------- anchor jumps
 * The contents list jumps to a clause. Without a scroll margin the heading
 * lands under the masthead and the reader starts mid-sentence. */
.policy-body h3[id] {
  scroll-margin-top: 5.5rem;
}

html.js-motion {
  scroll-behavior: smooth;
}

/* ------------------------------------------------------------ reveal variants
 * One motion for everything reads mechanical. Cards settle, headings rise,
 * notes arrive from the side. All still under 20px and under 600ms. */
html.js-motion .card[data-reveal],
html.js-motion .tile[data-reveal] {
  transform: translateY(16px) scale(0.985);
}

html.js-motion .note[data-reveal] {
  transform: translateX(-14px);
}

html.js-motion .steps > li[data-reveal] {
  transform: translateY(12px);
}

html.js-motion .card[data-reveal].is-visible,
html.js-motion .tile[data-reveal].is-visible,
html.js-motion .note[data-reveal].is-visible,
html.js-motion .steps > li[data-reveal].is-visible {
  transform: none;
}

/* ------------------------------------------------------------- hero parallax
 * The lattice drifts at a fraction of scroll speed. `--hero-shift` is written
 * by site.js on a rAF-throttled scroll handler.
 *
 * The pseudo-element is inset beyond its box first, because translating an
 * element pinned to `inset: 0` would drag a bare edge into view. */
html.js-motion .hero::before {
  inset: -14% 0;
  transform: translate3d(0, var(--hero-shift, 0px), 0);
  will-change: transform;
}

/* ------------------------------------------------------------------- section
 * An accent rule that draws itself in when the heading is revealed. Purely
 * decorative, so it is a pseudo-element and never announced. */
html.js-motion .section__head {
  position: relative;
}

html.js-motion .section__head::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.55rem;
  height: 2px;
  width: 0;
  background: var(--brand-fill);
  border-radius: 2px;
  transition: width 620ms cubic-bezier(0.22, 0.61, 0.36, 1) 160ms;
}

html.js-motion .section__head.is-visible::after {
  width: 3.25rem;
}

/* -------------------------------------------------------------------- buttons
 * A light sweep across a filled button on hover, and a real press. The sweep
 * is white at low alpha rather than a new brand tint. */
html.js-motion .btn {
  position: relative;
  overflow: hidden;
  transition:
    transform 180ms cubic-bezier(0.22, 0.61, 0.36, 1),
    box-shadow 180ms ease,
    background-color 180ms ease,
    color 180ms ease;
}

html.js-motion .btn--primary::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 45%;
  background: linear-gradient(
    100deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.26) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: skewX(-18deg);
  pointer-events: none;
  opacity: 0;
}

html.js-motion .btn--primary:hover::after {
  animation: sweep 720ms ease-out;
}

@keyframes sweep {
  from {
    left: -60%;
    opacity: 1;
  }
  to {
    left: 120%;
    opacity: 0;
  }
}

html.js-motion .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
}

html.js-motion .btn:active {
  transform: translateY(0) scale(0.985);
  box-shadow: none;
}

/* ---------------------------------------------------------------------- tiles
 * A left accent that grows on hover, so the pointer target is obvious without
 * relying on the colour change alone. */
html.js-motion a.tile {
  position: relative;
  overflow: hidden;
}

html.js-motion a.tile::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--brand-fill);
  transform: scaleY(0);
  transform-origin: 50% 0;
  transition: transform 260ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

html.js-motion a.tile:hover::after,
html.js-motion a.tile:focus-visible::after {
  transform: scaleY(1);
}

/* ---------------------------------------------------------------------- cards
 * Cards are not links, so they lift less than a tile does. The border carries
 * most of the change. */
html.js-motion .card:hover {
  transform: translateY(-2px);
  border-color: var(--brand-wash-line);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.06);
}

/* --------------------------------------------------------------------- chips */
html.js-motion .chips a {
  transition:
    transform 180ms cubic-bezier(0.22, 0.61, 0.36, 1),
    background-color 180ms ease,
    border-color 180ms ease;
}

html.js-motion .chips a:hover {
  transform: translateY(-2px);
}

/* -------------------------------------------------------------------- footer
 * An underline that grows from the left, instead of the browser default
 * appearing all at once. */
html.js-motion .footer ul a {
  position: relative;
  text-decoration: none;
}

html.js-motion .footer ul a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 220ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

html.js-motion .footer ul a:hover::after,
html.js-motion .footer ul a:focus-visible::after {
  transform: scaleX(1);
}

/* ------------------------------------------------------------- reading depth
 * The progress bar gains a soft leading edge so the end of the bar is legible
 * against a pale surface. */
html.js-motion .read-progress {
  box-shadow: 0 0 10px var(--brand-wash-line);
}

/* --------------------------------------------------------------------- focus
 * The existing outline stays exactly as it is — it is the accessible part. A
 * soft halo is added outside it, which helps on busy surfaces. */
html.js-motion a:focus-visible,
html.js-motion button:focus-visible {
  box-shadow: 0 0 0 6px var(--brand-wash);
}

/* --------------------------------------------------------------- masthead nav
 * A small settle on the nav pill, matching the tile and chip behaviour. */
html.js-motion .nav a:not(.btn) {
  transition:
    background-color 180ms ease,
    color 180ms ease,
    transform 180ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

html.js-motion .nav a:not(.btn):hover {
  transform: translateY(-1px);
}

/* Everything in this block, switched off on request. The global reduced-motion
 * rule earlier already zeroes durations; this additionally neutralises the
 * decorative pseudo-elements and the smooth scrolling, which duration alone
 * does not cover. */
@media (prefers-reduced-motion: reduce) {
  html.js-motion {
    scroll-behavior: auto;
  }

  html.js-motion .hero::before {
    transform: none;
  }

  html.js-motion .section__head::after {
    width: 3.25rem;
    transition: none;
  }

  html.js-motion .btn--primary:hover::after {
    animation: none;
  }

  html.js-motion .card[data-reveal],
  html.js-motion .tile[data-reveal],
  html.js-motion .note[data-reveal],
  html.js-motion .steps > li[data-reveal] {
    transform: none;
  }
}


/* ==========================================================================
 * Design refinement.
 *
 * Uses the derived tokens from tokensCss(): an elevation scale, two gradients
 * blended between colours the palette already contains, and the two contrast
 * corrections. No new hue is introduced here — every value traces back to
 * lib/theme/app_colors.dart, and every pair below is asserted by the build.
 *
 * This block is last in the file on purpose. It overrides a handful of earlier
 * rules (the amber icon, the ink hero background, card shadows) and relies on
 * source order rather than on raising specificity, which keeps the earlier
 * rules readable as the base they still are.
 * ========================================================================== */

/* ---------------------------------------------------------- contrast fixes
 * The icon inside an amber note or badge is a graphical object and needs 3:1
 * on amberWash. Plain amber gives 2.94:1; --amber-strong gives 3.70:1. The
 * text in these components was already ink and is untouched. */
.note--amber .note__icon {
  color: var(--amber-strong);
}

.badge--amber.badge--dot::before {
  background: var(--amber-strong);
}

/* ------------------------------------------------------------------ surfaces
 * One elevation scale instead of a shadow invented per component. */
.card {
  box-shadow: var(--shadow-1);
}

a.tile {
  box-shadow: var(--shadow-1);
}

html.js-motion a.tile:hover {
  box-shadow: var(--shadow-3);
}

html.js-motion .card:hover {
  box-shadow: var(--shadow-3);
}

html.js-motion .btn:hover {
  box-shadow: var(--shadow-2);
}

/* --------------------------------------------------------------- dark hero
 * A gradient from navy to a navy-ink blend. It reads as depth rather than as a
 * second colour, and white text clears 4.5:1 at both ends — the build asserts
 * white on navy and white on ink for exactly this reason. */
.hero--ink {
  background: var(--grad-ink);
}

/* The lattice is a touch stronger on the dark hero, where a 0.14-alpha outline
 * on near-black all but disappears. */
.hero--ink::before {
  opacity: 0.85;
}

/* -------------------------------------------------------------- brand accents
 * The reading progress bar and the section rule share one brand gradient, so
 * the two accents on a policy page are visibly the same material. */
.read-progress {
  background: var(--grad-brand);
}

html.js-motion .section__head::after {
  background: var(--grad-brand);
}

/* ------------------------------------------------------------------- selection
 * Selected text used the browser default blue, which is the one colour on the
 * page belonging to nobody. */
::selection {
  background: var(--brand-wash);
  color: var(--ink);
}

/* --------------------------------------------------------------- scrollbars
 * Firefox and Chromium both honour this. The track stays the page surface so
 * the bar does not draw a hard edge down the side of the layout. */
html {
  scrollbar-color: var(--line-strong) var(--canvas);
}

/* ------------------------------------------------------------------- columns
 * These lists carry the district names — up to 75 of them on a state page — so
 * they get real column rules and a comfortable measure rather than stretching
 * to whatever the viewport allows. */
.columns {
  column-gap: 2.2rem;
  column-rule: 1px solid var(--line);
}

.columns li {
  break-inside: avoid;
}

/* -------------------------------------------------------------------- stats */
.stat {
  box-shadow: var(--shadow-1);
}

.hero--ink .stat {
  box-shadow: none;
}

/* ---------------------------------------------------------------- headings
 * Slightly tighter tracking on the largest sizes. At display sizes the default
 * spacing reads loose; at body sizes it is left alone. */
.hero h1 {
  letter-spacing: -0.036em;
}

/* --------------------------------------------------------------------- notes
 * A left accent bar, so the kind of a note is legible from its shape and not
 * only from its background tint. */
.note {
  border-left-width: 3px;
  box-shadow: var(--shadow-1);
}

.note--amber {
  border-left-color: var(--amber-strong);
}

.note--error {
  border-left-color: var(--error);
}

/* ----------------------------------------------------------------- dark mode
 * The gradients and shadows need adjusting rather than inheriting. A black
 * shadow on a near-black surface is invisible, and the ink hero gradient would
 * sit on an already-dark page with nothing to separate it. */
@media (prefers-color-scheme: dark) {
  .card,
  a.tile,
  .stat,
  .note {
    box-shadow: none;
  }

  html.js-motion a.tile:hover,
  html.js-motion .card:hover {
    box-shadow: none;
    border-color: var(--brand-wash-line);
  }

  .hero--ink {
    /* On dark the page is already navy, so the hero needs an edge instead of a
     * gradient that would vanish into the surrounding page. */
    background: var(--surface);
    border-bottom-color: var(--line-strong);
  }

  ::selection {
    background: var(--brand-wash);
    color: var(--navy);
  }

  html {
    scrollbar-color: var(--line-strong) var(--canvas);
  }

  .columns {
    column-rule-color: var(--line);
  }
}


/* ------------------------------------------------------------------ index list
 * The site index, where each entry is a link plus the page's own meta
 * description. Two columns on a wide screen, one on a narrow one; each entry is
 * kept whole so a title never sits at the bottom of one column with its
 * summary at the top of the next. */
.index-list {
  margin: 0;
  display: grid;
  gap: 1.15rem 2.2rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.index-list > div {
  break-inside: avoid;
  padding-bottom: 1.05rem;
  border-bottom: 1px solid var(--line);
}

.index-list dt {
  font-weight: 700;
  margin-bottom: 0.28rem;
}

.index-list dt a {
  color: var(--ink);
  text-decoration: none;
}

.index-list dt a:hover {
  color: var(--brand-fill);
  text-decoration: underline;
}

.index-list dd {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 0.88rem;
  line-height: 1.55;
}

@media (max-width: 820px) {
  .index-list {
    grid-template-columns: minmax(0, 1fr);
  }
}
