/* bimi.diy public and customer-area stylesheet (spec 900 stage A,
   docs/ui-review/stage-a/loop1-changes.md). Uses only tokens from tokens.css.
   Breakpoints (mobile first): 420 (sm), 768 (md), 1024 (lg). No uppercase, no weight above 600,
   no hover lift, no text-shadow. */
@layer reset, base, layout, components, utilities;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  * { margin: 0; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  img, svg { display: block; max-width: 100%; }
  img { height: auto; }
  input, button, textarea, select { font: inherit; color: inherit; }
  ul[class], ol[class] { list-style: none; padding: 0; }
  fieldset { border: 0; padding: 0; min-width: 0; }
}

@layer base {
  html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + var(--space-4)); }

  body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: var(--leading-body);
    color: var(--body);
    background: var(--surface);
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
    min-block-size: 100dvh; display: flex; flex-direction: column;
  }
  main { flex: 1 0 auto; }
  main:focus { outline: none; }

  h1, h2, h3, h4 { color: var(--ink); font-weight: var(--weight-semibold); text-wrap: balance; overflow-wrap: break-word; }
  h1 { font-size: var(--text-3xl); line-height: var(--leading-tight); letter-spacing: var(--tracking-tight); }
  h2 { font-size: var(--text-2xl); line-height: var(--leading-snug); letter-spacing: var(--tracking-tight); }
  h3 { font-size: var(--text-md); line-height: var(--leading-snug); letter-spacing: var(--tracking-snug); }
  h4 { font-size: var(--text-base); line-height: var(--leading-snug); }
  p { text-wrap: pretty; }
  strong, b { font-weight: var(--weight-semibold); }

  a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; transition: color var(--dur-fast); }
  a:hover { color: var(--accent-hover); text-decoration-thickness: 2px; }

  code, kbd, samp {
    font-family: var(--font-mono); font-size: .9em; background: var(--surface-sunken);
    border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 var(--space-1); overflow-wrap: anywhere;
  }
  pre { font-family: var(--font-mono); }
  pre code { background: none; border: 0; padding: 0; }

  ::selection { background: var(--accent); color: var(--on-dark-fg); }

  :focus-visible { outline: var(--focus-width) solid var(--focus); outline-offset: var(--focus-offset); }

  /* Bare controls (customer-area filters and bulk actions) look like .field controls. */
  :where(input:not([type=checkbox], [type=radio], [type=hidden], [type=submit], [type=button], [type=file]), select, textarea) {
    min-height: var(--control-h); padding: var(--space-3) var(--space-4); font-size: var(--text-base);
    color: var(--ink); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-md);
    max-width: 100%; transition: border-color var(--dur-fast);
  }
  :where(input:not([type=checkbox], [type=radio], [type=hidden], [type=submit], [type=button], [type=file]), select, textarea):hover { border-color: var(--muted); }
  :where(input, select, textarea):focus-visible { border-color: var(--accent); }
  :where(select) {
    appearance: none; -webkit-appearance: none; padding-right: var(--space-7);
    background-image: var(--chevron); background-repeat: no-repeat; background-position: right var(--space-4) center; background-size: 14px;
  }
  ::placeholder { color: var(--muted); opacity: 1; }
  input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 1.25rem; height: 1.25rem; }
}

@layer layout {
  .container { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }
  .section { padding-block: var(--space-section); }
  .section--page { background: var(--surface); }
  .section--sunken, .section--alt { background: var(--surface-sunken); }
  .split { display: grid; gap: var(--space-6); }
  @media (min-width: 1024px) {
    .split { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--space-8); align-items: start; }
    .split__aside { position: sticky; top: calc(var(--header-h) + var(--space-6)); padding-top: var(--space-2); }
  }
  .page-grid { display: grid; gap: var(--space-7); }
  @media (min-width: 1024px) { .page-grid { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; gap: var(--space-8); } }
}

@layer components {
  /* ---------- Surfaces and focus contexts ---------- */
  .on-dark { --focus: var(--on-dark-fg); color: var(--on-dark-fg); }
  /* Dark-surface rules stop at light islands (cards, form cards, the inbox drawing). */
  .on-dark :is(h1, h2, h3):not(:where(.form-card, .card, .on-light, .inbox-demo__window) *) { color: var(--on-dark-fg); }
  .on-dark a:not(.btn):not(:where(.form-card, .card, .on-light, .inbox-demo__window) *) { color: var(--accent-on-dark); }
  .on-dark a:not(.btn):not(:where(.form-card, .card, .on-light, .inbox-demo__window) *):hover { color: var(--accent-on-dark-hover); }
  .on-dark code:not(:where(.form-card, .card, .on-light, .inbox-demo__window) *) { background: var(--on-dark-line); border-color: transparent; color: var(--on-dark-fg); }
  .on-light, .card, .form-card { --focus: var(--accent); }

  /* ---------- Skip link ---------- */
  .skip-link {
    --focus: var(--ink);
    position: absolute; left: var(--space-4); top: -4rem; z-index: 100;
    background: var(--surface); color: var(--ink); padding: var(--space-3) var(--space-4); border-radius: var(--radius-md);
    font-weight: 600; text-decoration: none; transition: top var(--dur-base);
  }
  .skip-link:focus { top: var(--space-2); }
  .skip-link:focus-visible { outline-offset: -5px; }

  /* ---------- Header ---------- */
  .site-header {
    position: sticky; top: 0; z-index: 50;
    background: var(--ink); border-bottom: 1px solid var(--on-dark-line); color: var(--on-dark-fg);
  }
  .site-header__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--space-4); min-height: var(--header-h); }
  .header-actions { display: flex; align-items: center; gap: var(--space-2); }
  .header-actions form { display: flex; }

  .site-nav ul, .site-footer ul { list-style: none; padding: 0; }
  .site-nav ul { display: flex; flex-wrap: wrap; }
  .site-nav a {
    display: inline-flex; align-items: center; min-height: var(--target); padding-inline: var(--space-3);
    font-size: var(--text-sm); font-weight: 500; color: var(--on-dark-muted); text-decoration: none; white-space: nowrap;
  }
  .on-dark .site-nav a:not(.btn) { color: var(--on-dark-muted); }
  .on-dark .site-nav a:not(.btn):hover, .on-dark .site-nav a[aria-current="page"] { color: var(--on-dark-fg); }

  .menu-toggle {
    display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--target); padding-inline: var(--space-3);
    background: transparent; color: var(--on-dark-fg); border: 1px solid var(--on-dark-border); border-radius: var(--radius-md);
    font-size: var(--text-sm); font-weight: 500; cursor: pointer; transition: border-color var(--dur-fast);
  }
  .menu-toggle:hover { border-color: var(--on-dark-fg); }
  .menu-toggle__bars { width: 18px; height: 12px; position: relative; border-block: 2px solid currentColor; }
  .menu-toggle__bars::after { content: ""; position: absolute; left: 0; right: 0; top: 3px; height: 2px; background: currentColor; }
  .no-js .menu-toggle { display: none; }
  @media (max-width: 767px) {
    .menu-toggle { margin-left: auto; }
    .header-actions:not(:has(> :not(.header-cta))) { display: none; }
  }
  .header-actions .header-cta { display: none; }

  @media (max-width: 767px) {
    .site-nav { order: 3; flex-basis: 100%; }
    .js .site-nav { display: none; }
    .js .site-nav.is-open {
      display: block; max-height: calc(100dvh - var(--header-h)); overflow-y: auto; overscroll-behavior: contain;
      padding-block: var(--space-2) var(--space-5);
    }
    .js .site-nav ul { flex-direction: column; flex-wrap: nowrap; }
    .js .site-nav li + li { border-top: 1px solid var(--on-dark-line); }
    .js .site-nav a:not(.btn) { width: 100%; min-height: var(--target-row); font-size: var(--text-base); padding-inline: var(--space-4); }
    .js .site-nav a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--accent-on-dark); }
    .js .site-nav li.site-nav__cta { border-top: 0; padding-top: var(--space-4); }
    .no-js .site-nav__cta { display: none; }
    html.nav-open { overflow: hidden; }
  }
  @media (min-width: 768px) {
    .menu-toggle { display: none; }
    .site-nav { margin-inline: auto; }
    .site-nav ul { gap: var(--space-1); }
    .site-nav a:not(.btn):hover, .site-nav a[aria-current="page"] {
      text-decoration: underline; text-decoration-color: var(--accent-on-dark); text-decoration-thickness: 2px; text-underline-offset: .55em;
    }
    .site-nav__cta { display: none; }
    .header-actions .header-cta { display: inline-flex; }
    .header-actions { margin-left: auto; }
  }

  /* ---------- Account menu (spec 411) ---------- */
  .header-actions { position: relative; }
  .account-menu { position: relative; }
  .account-menu__button {
    display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--target); max-width: 16rem;
    padding: 0 var(--space-2); border: 1px solid var(--on-dark-border); border-radius: var(--radius-md);
    color: var(--on-dark-fg); font-size: var(--text-sm); font-weight: var(--weight-medium); cursor: pointer; list-style: none;
    transition: border-color var(--dur-fast);
  }
  .account-menu__button::-webkit-details-marker { display: none; }
  .account-menu__button:hover, .account-menu[open] .account-menu__button { border-color: var(--on-dark-fg); }
  .account-menu__avatar {
    display: inline-grid; place-items: center; flex: none; inline-size: 1.75rem; block-size: 1.75rem; border-radius: var(--radius-full);
    background: var(--accent-on-dark); color: var(--ink); font-size: var(--text-xs); font-weight: var(--weight-semibold);
  }
  .account-menu__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .account-menu__caret { flex: none; inline-size: .5rem; block-size: .5rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); }
  .account-menu[open] .account-menu__caret { transform: translateY(2px) rotate(-135deg); }
  .account-menu__panel {
    position: absolute; right: 0; top: calc(100% + var(--space-2)); z-index: 60; inline-size: min(18rem, calc(100vw - 2 * var(--gutter)));
    background: var(--surface); color: var(--ink); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
    padding: var(--space-2);
  }
  .account-menu__who { margin: 0; padding: var(--space-2) var(--space-3); font-size: var(--text-sm); color: var(--muted); overflow-wrap: anywhere; border-bottom: 1px solid var(--border); }
  .account-menu__who strong { color: var(--ink); font-weight: var(--weight-medium); }
  .account-menu__panel ul { list-style: none; margin: 0; padding: var(--space-1) 0; }
  .account-menu__panel a, .account-menu__signout {
    display: flex; align-items: center; inline-size: 100%; min-height: var(--target); padding-inline: var(--space-3); border-radius: var(--radius-sm);
    color: var(--ink); font: inherit; font-size: var(--text-sm); text-decoration: none; background: none; border: 0; cursor: pointer; text-align: left;
  }
  .account-menu__panel a:hover, .account-menu__signout:hover { background: var(--surface-sunken); }
  .account-menu__panel a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--accent); font-weight: var(--weight-medium); }
  .account-menu__panel form { display: block; border-top: 1px solid var(--border); padding-top: var(--space-1); }
  .account-menu__panel :focus-visible { outline: var(--focus-width) solid var(--focus); outline-offset: -2px; }
  @media (max-width: 767px) {
    .account-menu__name { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .account-menu__button { padding-inline: var(--space-2); }
    .header-login { margin-left: var(--space-2); }
  }
  /* The narrowest phones fit the wordmark, Menu and Log in on one row by showing the menu icon only. */
  @media (max-width: 399px) {
    .site-header__inner { gap: 0 var(--space-2); }
    .menu-toggle__label { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .header-login { margin-left: 0; }
  }

  /* Save these results on a check result (spec 411 req 4) */
  .save-check { margin-block: var(--space-6); max-inline-size: 36rem; }
  .save-check h2 { margin-top: 0; }
  .save-check > p:not(.save-check__foot) { margin-bottom: var(--space-5); }
  .save-check__foot { margin: var(--space-4) 0 0; font-size: var(--text-sm); }

  /* Slim customer-area footer (900 FOLLOWUPS item 9): legal and help links only. */
  .app-footer { border-top: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: var(--text-sm); }
  .app-footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-5); padding-block: var(--space-4); }
  .app-footer p { margin: 0; }
  .app-footer ul { display: flex; flex-wrap: wrap; gap: 0 var(--space-4); list-style: none; margin: 0; padding: 0; }
  .app-footer a { display: inline-flex; align-items: center; min-height: var(--target); color: var(--muted); text-decoration: underline; text-underline-offset: .2em; }
  .app-footer a:hover { color: var(--ink); }

  /* ---------- Wordmark ---------- */
  .brand { display: inline-flex; align-items: center; min-height: var(--target); text-decoration: none; color: var(--ink); }
  .on-dark .brand, .on-dark a.brand:not(.btn), .on-dark a.brand:not(.btn):hover { color: var(--on-dark-fg); }
  .brand__mark {
    display: inline-flex; align-items: center;
    font-weight: 600; font-size: var(--text-lg); letter-spacing: var(--tracking-snug); line-height: 1;
  }
  .brand__tld { color: var(--accent); }
  .on-dark .brand__tld { color: var(--accent-on-dark); }
  .brand__glyph, .inbox-demo__avatar--logo::before {
    flex: none; width: 1.375rem; height: 1.375rem; border-radius: var(--radius-full); border: 2px solid currentColor; position: relative;
  }
  .brand__glyph { margin-right: var(--space-2); }
  .brand__glyph::after {
    content: ""; position: absolute; inset: 0; margin: auto; width: 6px; height: 6px; border-radius: var(--radius-full); background: var(--accent);
  }
  .on-dark .brand__glyph::after { background: var(--accent-on-dark); }

  /* ---------- Eyebrow, section heads ---------- */
  .eyebrow {
    font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 500; letter-spacing: var(--tracking-mono);
    color: var(--accent); margin-bottom: var(--space-3);
  }
  .on-dark .eyebrow, .eyebrow--onDark { color: var(--accent-on-dark); }
  .eyebrow--rule { display: flex; align-items: center; gap: var(--space-3); }
  .eyebrow--rule::before { content: ""; flex: none; width: var(--space-5); height: 2px; background: currentColor; }

  .section-title { font-size: var(--text-3xl); font-weight: 600; line-height: var(--leading-snug); letter-spacing: var(--tracking-tight); max-width: 20ch; }
  .section-head { display: grid; gap: var(--space-3); margin-bottom: var(--space-6); }
  .section-head__lede { font-size: var(--text-md); color: var(--muted); max-width: var(--measure); }
  @media (min-width: 768px) { .section-head { margin-bottom: var(--space-7); } }
  @media (min-width: 1024px) {
    .section-head:has(.section-head__lede) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: end; gap: var(--space-8); }
  }
  /* Direct children of a section container get one rhythm; grid containers are excluded. */
  .section > .container:not(:where(.page-grid, .visit__grid, .split)) > * + * { margin-top: var(--space-5); }
  .note { margin-top: var(--space-5); color: var(--muted); max-width: var(--measure); }
  .muted { color: var(--muted); }
  .billing-note { margin-top: var(--space-5); }

  /* ---------- Buttons ---------- */
  .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
    min-height: var(--control-h); padding: var(--space-3) var(--space-5);
    font: inherit; font-size: var(--text-sm); font-weight: 600; line-height: 1.2; text-align: center; text-decoration: none;
    border: 1px solid var(--border-strong); border-radius: var(--radius-md); background: var(--surface); color: var(--ink);
    cursor: pointer; transition: background-color var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast);
  }
  .btn:hover { border-color: var(--ink); background: var(--surface-sunken); color: var(--ink); text-decoration: none; }
  .btn:active { background: var(--border); }
  .btn--outline { background: var(--surface); }
  .btn--primary { background: var(--accent); border-color: var(--accent); color: var(--on-dark-fg); }
  .btn--primary:hover, .btn--primary:active { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-dark-fg); }
  .on-dark .btn--primary:not(:where(.form-card, .card, .on-light) *) { background: var(--accent-on-dark); border-color: var(--accent-on-dark); color: var(--ink); }
  .on-dark .btn--primary:not(:where(.form-card, .card, .on-light) *):hover,
  .on-dark .btn--primary:not(:where(.form-card, .card, .on-light) *):active { background: var(--accent-on-dark-hover); border-color: var(--accent-on-dark-hover); color: var(--ink); }
  .btn--ghost-on-dark { background: transparent; color: var(--on-dark-fg); border-color: var(--on-dark-border); }
  .btn--ghost-on-dark:hover, .btn--ghost-on-dark:active { background: var(--on-dark-line); border-color: var(--on-dark-fg); color: var(--on-dark-fg); }
  .btn--danger { background: var(--fail); border-color: var(--fail); color: var(--on-dark-fg); }
  .btn--danger:hover { background: var(--fail); color: var(--on-dark-fg); filter: brightness(.88); }
  .btn--sm { min-height: var(--target); padding: var(--space-2) var(--space-4); }
  .btn--block { width: 100%; }
  @media (max-width: 419px) { .btn--block-mobile { width: 100%; } }
  .btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }

  .actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin-top: var(--space-6); }
  @media (max-width: 419px) { .actions .btn { width: 100%; } .actions--inline .btn { width: auto; } }

  /* ---------- Links ---------- */
  /* .back-link mirrors .more-link (one standalone-link family; the chevron points the other way). */
  .more-link, .back-link {
    display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--target);
    font-size: var(--text-sm); font-weight: 600; text-underline-offset: .25em;
  }
  .more-link { padding-right: var(--space-1); }
  .back-link { padding-left: var(--space-1); }
  .more-link::after, .back-link::before {
    content: ""; flex: none; width: .45em; height: .45em; border: solid currentColor; border-width: 2px 2px 0 0; transform: rotate(45deg);
  }
  .back-link::before { transform: rotate(-135deg); }
  @media (prefers-reduced-motion: no-preference) {
    .more-link::after, .back-link::before { transition: translate var(--dur-base) var(--ease); }
    .more-link:hover::after, .more-link:focus-visible::after { translate: 3px 0; }
    .back-link:hover::before, .back-link:focus-visible::before { translate: -3px 0; }
  }
  .text-link { display: inline-flex; align-items: center; min-height: var(--target); font-weight: 600; }
  .text-link--ink { color: var(--ink); }

  /* ---------- Hero (home) ---------- */
  .hero { position: relative; z-index: 1; background: var(--ink); }
  .hero__inner { position: relative; display: grid; gap: var(--space-7); padding-block: var(--space-6) var(--space-8); }
  .hero__title {
    font-size: var(--text-4xl); font-weight: 600; line-height: var(--leading-tight); letter-spacing: var(--tracking-tight);
    max-width: 16ch; overflow-wrap: anywhere; margin-block: var(--space-2) var(--space-4);
  }
  .hero__accent { color: var(--accent-on-dark); }
  .hero__lede { font-size: var(--text-base); color: var(--on-dark-muted); max-width: 36rem; }
  .hero__form { margin-top: var(--space-5); max-width: 32rem; }
  .hero__aside { margin-top: var(--space-4); font-size: var(--text-sm); color: var(--on-dark-muted); }
  .hero__aside a { display: inline-flex; align-items: center; min-height: var(--target); font-weight: 600; }
  @media (min-width: 768px) { .hero__lede { font-size: var(--text-lg); } }
  @media (min-width: 1024px) {
    .hero::before {
      content: ""; position: absolute; inset: 0; pointer-events: none;
      background-image: radial-gradient(var(--on-dark-dot) 1px, transparent 1px); background-size: var(--space-5) var(--space-5);
      -webkit-mask-image: linear-gradient(90deg, transparent 40%, black 75%); mask-image: linear-gradient(90deg, transparent 40%, black 75%);
    }
    .hero__inner { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: var(--space-8); align-items: center; padding-block: var(--space-8) var(--space-9); }
    .hero__title { max-width: 14ch; }
    .hero__aside { padding-inline: var(--space-6); }
    .hero__visual { align-self: center; }
  }

  /* ---------- Inbox schematic (decorative; caption carries the meaning) ---------- */
  .inbox-demo { width: 100%; max-width: 28rem; justify-self: center; }
  .inbox-demo__window { --focus: var(--accent); background: var(--surface); color: var(--body); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
  .inbox-demo__bar { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--muted); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); }
  .inbox-demo__row { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); gap: var(--space-3); align-items: center; padding: var(--space-4); border-bottom: 1px solid var(--border); }
  .inbox-demo__row:last-child { border-bottom: 0; }
  .inbox-demo__row--brand { background: var(--accent-soft); }
  .inbox-demo__avatar { width: 2.5rem; height: 2.5rem; border-radius: var(--radius-full); background: var(--border); }
  .inbox-demo__avatar--logo { display: grid; place-items: center; background: var(--accent); color: var(--on-dark-fg); position: relative; }
  .inbox-demo__avatar--logo::before { content: ""; width: 1.25rem; height: 1.25rem; }
  .inbox-demo__avatar--logo::after {
    content: ""; position: absolute; inset: 0; margin: auto; width: 6px; height: 6px; border-radius: var(--radius-full); background: var(--on-dark-fg);
  }
  .inbox-demo__lines { display: grid; gap: var(--space-2); justify-items: start; }
  .inbox-demo__sender, .inbox-demo__subject { display: block; border-radius: var(--radius-full); }
  .inbox-demo__sender { height: .625rem; width: 45%; background: var(--border-strong); }
  .inbox-demo__subject { height: .5rem; width: 80%; background: var(--border); }
  .inbox-demo__row--brand .inbox-demo__sender { background: var(--ink); }
  .inbox-demo__row--brand .inbox-demo__subject { background: var(--border-strong); }
  .inbox-demo__auth, .inbox-demo__rec { display: inline-flex; align-items: baseline; gap: var(--space-2); }
  .inbox-demo__auth { font-family: var(--font-mono); font-size: var(--text-xs); line-height: 1.3; color: var(--pass); }
  .inbox-demo__auth::before, .inbox-demo__rec::before {
    content: ""; flex: none; width: .35rem; height: .65rem; border: solid currentColor; border-width: 0 2px 2px 0; transform: translateY(-.1rem) rotate(42deg);
  }
  .inbox-demo__records {
    position: relative; margin-top: var(--space-3);
    background: var(--ink-2); color: var(--on-dark-fg); border: 1px solid var(--on-dark-line); border-radius: var(--radius-lg);
    padding: var(--space-4); box-shadow: var(--shadow-lg); display: grid; gap: var(--space-3);
    font-family: var(--font-mono); font-size: var(--text-xs); line-height: 1.5;
  }
  .inbox-demo__rec { color: var(--accent-on-dark); min-width: 0; }
  .inbox-demo__rec > span:last-child { min-width: 0; }
  .inbox-demo__host { display: block; color: var(--on-dark-muted); overflow-wrap: break-word; }
  .inbox-demo__val { color: var(--accent-on-dark); overflow-wrap: break-word; }
  @media (max-width: 767px) { .inbox-demo__records { display: none; } }
  .inbox-demo__caption { margin-top: var(--space-4); font-size: var(--text-sm); color: var(--on-dark-muted); text-align: center; }
  @media (min-width: 1024px) {
    .inbox-demo__records { width: 88%; margin: var(--space-6) 0 0 auto; }
    .inbox-demo__records::before {
      content: ""; position: absolute; left: var(--space-6); bottom: 100%; height: var(--space-6); border-left: 2px dashed var(--on-dark-border);
    }
  }
  @media (prefers-reduced-motion: no-preference) {
    .inbox-demo__row--brand .inbox-demo__avatar--logo { animation: logo-resolve 500ms var(--ease) 400ms both; }
    .inbox-demo__auth { animation: fade-in 500ms var(--ease) 600ms both; }
  }
  @keyframes logo-resolve { from { background-color: var(--border); } }
  @keyframes fade-in { from { opacity: 0; } }

  /* ---------- Cards ---------- */
  .card, .side-card {
    --focus: var(--accent); background: var(--surface); color: var(--body); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: var(--space-5); box-shadow: var(--shadow-ring), var(--shadow-sm);
  }
  @media (min-width: 768px) { .card, .side-card { padding: var(--space-6); } }
  .card__title, .side-card__title { font-size: var(--text-md); font-weight: 600; color: var(--ink); margin-bottom: var(--space-2); }
  .card p { color: var(--muted); }
  .side-card .btn { margin-top: var(--space-4); }
  .side-card p > a:only-child { display: inline-flex; align-items: center; min-height: var(--target); }
  .card-grid { display: grid; gap: var(--space-4); }
  @media (min-width: 768px) {
    .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5); }
    .card-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  }
  .card__label {
    display: inline-block; font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 500; letter-spacing: var(--tracking-mono);
    color: var(--accent); background: var(--accent-soft); border-radius: var(--radius-sm); padding: var(--space-1) var(--space-2); margin-bottom: var(--space-3);
  }
  .card-grid--problems .card__label {
    display: block; margin: calc(-1 * var(--space-5)) calc(-1 * var(--space-5)) var(--space-4);
    padding: var(--space-3) var(--space-5); background: var(--surface-sunken); border-bottom: 1px solid var(--border);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
  @media (min-width: 768px) {
    .card-grid--problems .card__label { margin: calc(-1 * var(--space-6)) calc(-1 * var(--space-6)) var(--space-4); padding-inline: var(--space-6); }
  }

  /* ---------- Timeline ---------- */
  .timeline { counter-reset: step; display: grid; position: relative; }
  .prose .timeline { padding-left: 0; }
  .timeline__step, .timeline--dots > li { counter-increment: step; position: relative; padding: 0 0 var(--space-6) calc(2.25rem + var(--space-4)); }
  .prose .timeline > li + li { margin-top: 0; }
  .timeline__step:last-child, .timeline--dots > li:last-child { padding-bottom: 0; }
  .timeline__step::after, .timeline--dots > li::after {
    content: ""; position: absolute; left: calc(1.125rem - 1px); top: 2.25rem; bottom: 0; width: 2px; background: var(--border-strong);
  }
  .timeline__step:last-child::after, .timeline--dots > li:last-child::after { content: none; }
  .timeline__step::before {
    content: counter(step, decimal-leading-zero); position: absolute; left: 0; top: 0; width: 2.25rem; height: 2.25rem;
    display: grid; place-items: center; border-radius: var(--radius-full); border: 2px solid var(--accent);
    background: var(--surface); color: var(--accent); font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 500;
  }
  .timeline__step:first-child::before { background: var(--accent); color: var(--on-dark-fg); }
  .timeline__title { font-size: var(--text-md); line-height: 2.25rem; margin-bottom: var(--space-1); }
  .timeline__step p { color: var(--muted); max-width: var(--measure); }
  .timeline--dots > li::before {
    content: ""; position: absolute; left: .5625rem; top: .6875rem; width: 1.125rem; height: 1.125rem;
    border-radius: var(--radius-full); border: 2px solid var(--accent); background: var(--surface);
  }
  .timeline--dots > li:first-child::before { background: var(--accent); }
  .timeline--dots > li > h2 { font-size: var(--text-xl); margin-top: 0; margin-bottom: var(--space-2); line-height: 2.25rem; }
  .timeline--dots > li > p + p { margin-top: var(--space-2); }

  /* ---------- Plans ---------- */
  .plan-card { display: flex; flex-direction: column; }
  .plan-card__name { order: -1; font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 500; letter-spacing: var(--tracking-mono); color: var(--accent); margin: 0; }
  .plan-card__price {
    font-size: var(--text-2xl); font-weight: 600; color: var(--ink); letter-spacing: var(--tracking-tight); line-height: var(--leading-snug);
    font-variant-numeric: tabular-nums; margin-block: var(--space-2) var(--space-1);
  }
  .card .plan-card__price { color: var(--ink); }
  .plan-card__price > [aria-hidden] { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: var(--space-1); }
  .plan-card__amount { white-space: nowrap; }
  .plan-card__unit { font-size: var(--text-sm); font-weight: 400; color: var(--muted); letter-spacing: 0; }
  .plan-card__domains { font-family: var(--font-mono); font-size: var(--text-xs); }
  .plan-card__features {
    flex: 1; display: grid; align-content: start; gap: var(--space-2); margin-top: var(--space-4); padding-top: var(--space-4);
    border-top: 1px solid var(--border); font-size: var(--text-sm); color: var(--body);
  }
  .plan-card__features li { display: flex; gap: var(--space-2); align-items: baseline; }
  .plan-card__features li::before, .list-check li::before {
    content: ""; flex: none; width: .35rem; height: .65rem; border: solid var(--accent); border-width: 0 2px 2px 0; transform: translateY(-.1rem) rotate(42deg);
  }
  .section .container > .plans__more { margin-top: var(--space-6); }
  .plan-card--current { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent), var(--shadow-sm); }
  .plan-card__action { margin-top: auto; padding-top: var(--space-4); }
  .plan-card__features + .plan-card__action { margin-top: 0; }

  /* ---------- FAQ disclosure ---------- */
  .faq-list { max-width: var(--measure); border-top: 1px solid var(--border); }
  .faq-group + .faq-group { margin-top: var(--space-7); }
  .faq-item { border-bottom: 1px solid var(--border); }
  .prose .faq-item { margin-top: 0; }
  .faq-item > summary {
    display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
    min-height: var(--target-row); padding-block: var(--space-3); font-size: var(--text-md); font-weight: 600; color: var(--ink);
    cursor: pointer; list-style: none; transition: color var(--dur-fast);
  }
  .faq-item > summary::-webkit-details-marker { display: none; }
  .faq-item > summary:hover { color: var(--accent); }
  .faq-item > summary::after {
    content: ""; flex: none; width: 1rem; height: 1rem; color: var(--accent);
    background: linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat, linear-gradient(currentColor, currentColor) center / 2px 100% no-repeat;
    transition: background-size var(--dur-base) var(--ease);
  }
  .faq-item[open] > summary::after { background-size: 100% 2px, 2px 0; }
  .faq-item > :not(summary) { padding-bottom: var(--space-5); color: var(--body); max-width: var(--measure); }

  /* ---------- Forms ---------- */
  .form-card {
    background: var(--surface); color: var(--body); border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: var(--space-5); box-shadow: var(--shadow-md);
  }
  .on-dark .form-card { border-color: transparent; box-shadow: var(--shadow-lg); }
  @media (min-width: 768px) { .form-card { padding: var(--space-6); } }
  .form-card__title { font-size: var(--text-xl); font-weight: 600; color: var(--ink); margin-bottom: var(--space-4); }
  .form-card__submit { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-4); }

  .field-row { display: grid; gap: 0 var(--space-4); }
  @media (min-width: 560px) { .field-row { grid-template-columns: 1fr 1fr; } }
  .field { display: grid; gap: var(--space-2); margin-bottom: var(--space-5); }
  .field label, .field legend { font-size: var(--text-sm); font-weight: 600; color: var(--ink); }
  .req, .opt { font-weight: 400; color: var(--muted); }
  .hint { font-size: var(--text-sm); color: var(--muted); line-height: 1.45; }
  .field input:not([type=checkbox], [type=radio]), .field textarea, .field select { width: 100%; }
  .field textarea { resize: vertical; min-height: 7rem; }
  .field-invalid input, .field-invalid textarea, .field-invalid select { border-color: var(--fail); border-width: 2px; }
  .field-error { display: flex; gap: var(--space-2); align-items: baseline; color: var(--fail); font-size: var(--text-sm); font-weight: 600; }
  .field-error::before {
    content: "!"; flex: none; display: inline-grid; place-items: center; width: 1.1em; height: 1.1em; border-radius: var(--radius-full);
    background: var(--fail); color: var(--on-dark-fg); font-size: var(--text-xs); line-height: 1; transform: translateY(.1em);
  }
  .check { display: grid; grid-template-columns: auto 1fr; gap: var(--space-3); align-items: start; margin-bottom: var(--space-4); font-size: var(--text-sm); color: var(--body); line-height: 1.5; }
  .check input { width: 1.5rem; height: 1.5rem; margin-top: var(--space-3); }
  .check label { padding-block: var(--space-3); }
  .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

  /* File control: the selector button looks and behaves like .btn; the input itself has no border. */
  .field input[type=file] {
    inline-size: 100%; max-inline-size: 100%; min-block-size: var(--target); padding: 0; border: 0; background: none;
    font-size: var(--text-sm); color: var(--muted);
  }
  .field input[type=file]::file-selector-button {
    font: inherit; font-size: var(--text-sm); font-weight: 600; color: var(--ink); cursor: pointer;
    min-block-size: var(--target); padding: var(--space-2) var(--space-4); margin-inline-end: var(--space-3);
    background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-md);
    transition: background-color var(--dur-fast), border-color var(--dur-fast);
  }
  .field input[type=file]::file-selector-button:hover { background: var(--surface-sunken); border-color: var(--ink); }

  /* Sign-in pages (layout/auth.html): one centred card on a sunken section. */
  .auth-shell__card {
    max-inline-size: 28rem;
    margin-inline: auto;
  }
  .auth-shell__card > * + * { margin-top: var(--space-4); }
  .auth-shell__card h1 { font-size: var(--text-2xl); letter-spacing: var(--tracking-tight); }
  .auth-shell__card .field:last-of-type { margin-bottom: var(--space-5); }
  .auth-shell__foot { border-top: 1px solid var(--border); padding-top: var(--space-4); font-size: var(--text-sm); color: var(--muted); }
  .auth-shell__foot a { display: inline-flex; align-items: center; min-height: var(--target); }
  .auth-shell__foot > p + p { margin-top: var(--space-1); }
  @media (max-width: 419px) {
    .auth-shell { background: var(--surface); }
    .auth-shell__card { border-color: transparent; box-shadow: none; padding-inline: 0; }
  }

  .check-form__actions { display: grid; gap: var(--space-3); }
  .check-form__more { margin: 0; }
  .check-form__more > summary {
    display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--target);
    font-size: var(--text-sm); font-weight: 600; color: var(--accent); cursor: pointer; list-style: none;
  }
  .check-form__more > summary::-webkit-details-marker { display: none; }
  .check-form__more > summary::before {
    content: ""; flex: none; width: 16px; height: 16px; background: var(--chevron-accent) center / 14px no-repeat; transition: transform var(--dur-base) var(--ease);
  }
  .check-form__more[open] > summary::before { transform: rotate(180deg); }
  .check-form__more[open] > .field { margin-top: var(--space-3); margin-bottom: var(--space-2); }
  @media (min-width: 420px) {
    .check-form__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3) var(--space-4); }
    .check-form__actions:has(> details[open]) > details { flex-basis: 100%; }
    .check-form__actions .form-card__submit { margin-left: auto; }
  }

  .error-summary {
    margin-bottom: var(--space-5); padding: var(--space-4) var(--space-5); border: 2px solid var(--fail); border-left-width: 6px;
    border-radius: var(--radius-md); background: var(--fail-soft); color: var(--body);
  }
  .error-summary__title { font-size: var(--text-md); color: var(--fail); margin-bottom: var(--space-2); }
  .error-summary ul { padding-left: var(--space-5); }
  .error-summary a { color: var(--fail); font-weight: 600; }
  .form-success { padding: var(--space-5); border-radius: var(--radius-md); background: var(--pass-soft); color: var(--body); border: 1px solid var(--pass); }
  .form-success__title { font-size: var(--text-md); font-weight: 600; color: var(--pass); margin-bottom: var(--space-2); }

  /* ---------- Flash and alerts ---------- */
  .flash, .alert {
    display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-4);
    padding: var(--space-4) var(--space-5); border: 1px solid var(--border-strong); border-left-width: 4px; border-radius: var(--radius-md);
    background: var(--surface); color: var(--body);
  }
  .flash { margin: var(--space-5) auto 0; width: min(100% - 2 * var(--gutter), var(--container)); }
  .container .flash, .section .flash { width: auto; margin: 0 0 var(--space-5); }
  .flash--success, .alert--success { border-color: var(--pass); background: var(--pass-soft); }
  .flash--error, .alert--error { border-color: var(--fail); background: var(--fail-soft); }
  .flash--warn, .alert--warn { border-color: var(--warn); background: var(--warn-soft); }
  .flash--info, .alert--info { border-color: var(--info); background: var(--info-soft); }
  .flash--success strong { color: var(--pass); }
  .flash--error strong { color: var(--fail); }
  .flash .btn { min-height: var(--target); padding: var(--space-2) var(--space-4); }

  /* ---------- Badges ---------- */
  .badge {
    display: inline-flex; align-items: center; gap: var(--space-1); font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 500;
    line-height: 1.4; padding: var(--space-1) var(--space-2); border-radius: var(--radius-full); border: 1px solid currentColor;
    background: var(--surface-sunken); color: var(--body); text-decoration: none; white-space: nowrap;
  }
  .badge--pass { color: var(--pass); background: var(--pass-soft); }
  .badge--warn { color: var(--warn); background: var(--warn-soft); }
  .badge--fail { color: var(--fail); background: var(--fail-soft); }
  .badge--info { color: var(--info); background: var(--info-soft); }
  .badge--accent { color: var(--accent); background: var(--accent-soft); }
  a.badge:hover { text-decoration: underline; }
  @media (max-width: 1023px) { a.badge { min-height: var(--target); padding-inline: var(--space-3); } }

  /* ---------- Check results (public check and customer summary) ---------- */
  .check-verdict { font-size: var(--text-lg); font-weight: 600; color: var(--ink); margin-block: var(--space-2); }
  .check-list { display: grid; gap: var(--space-4); margin-block: var(--space-6); max-inline-size: var(--measure); }
  .check-list > li { min-width: 0; }
  .check-item {
    background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--border-strong);
    border-radius: var(--radius-md); padding: var(--space-4) var(--space-5); box-shadow: var(--shadow-ring);
  }
  .check-item { overflow-wrap: anywhere; }
  .check-item > * + * { margin-top: var(--space-2); }
  .check-item--pass { border-left-color: var(--pass); }
  .check-item--warn { border-left-color: var(--warn); }
  .check-item--fail { border-left-color: var(--fail); }
  .check-item__title { font-size: var(--text-md); }
  .check-item--pass .check-status { color: var(--pass); }
  .check-item--warn .check-status { color: var(--warn); }
  .check-item--fail .check-status { color: var(--fail); }
  .check-item--skip .check-status { color: var(--muted); }
  /* One mono-on-sunken record look: check details, record values and standalone code blocks. */
  .check-detail, .code-block {
    display: block; font-family: var(--font-mono); font-size: var(--text-xs); background: var(--surface-sunken);
    border: 1px solid var(--border); padding: var(--space-3); border-radius: var(--radius-sm); overflow-wrap: break-word;
  }
  .check-detail { overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
  .code-block code { background: none; border: 0; padding: 0; font-size: inherit; user-select: all; }
  .record { display: grid; grid-template-columns: fit-content(45%) minmax(0, 1fr); gap: var(--space-2) var(--space-4); margin-block: var(--space-4); }
  .record dt { color: var(--muted); font-size: var(--text-sm); }
  .record dd { margin: 0; overflow-wrap: anywhere; }
  .record code, .check-fix code { user-select: all; }

  /* ---------- Tables and customer-area helpers ---------- */
  .table-wrap { position: relative; overflow-x: auto; margin-block: var(--space-4) var(--space-5); }
  .table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
  .table th, .table td { text-align: left; padding: var(--space-3); border-bottom: 1px solid var(--border); vertical-align: top; }
  .table thead th { font-size: var(--text-xs); font-weight: 600; color: var(--muted); background: var(--surface-sunken); }
  .table tbody tr:hover { background: var(--accent-soft); }
  .table a:not(.badge) { display: inline-flex; align-items: center; min-height: 1.5rem; }
  .table input[type=checkbox] { width: 1.5rem; height: 1.5rem; }
  @media (max-width: 1023px) { .table a:not(.badge) { min-height: var(--target); } }
  .table .num { text-align: right; font-variant-numeric: tabular-nums; }
  /* Below 1024 a fit-content table keeps natural column widths and the .table-wrap scrolls. */
  @media (max-width: 1023px) {
    .table--fit-content { inline-size: max-content; min-inline-size: 100%; }
    .table--fit-content thead th { white-space: nowrap; }
  }
  .row-select { display: inline-grid; place-items: center; min-inline-size: var(--target); min-block-size: var(--target); margin: calc(-1 * var(--space-3)); cursor: pointer; }
  .cell-form { display: grid; gap: var(--space-2); justify-items: start; }
  .cell-form :is(input, select) { inline-size: 100%; min-inline-size: 11rem; }
  @media (min-width: 768px) { .cell-form--inline :is(input, select) { inline-size: auto; } }
  @media (min-width: 768px) { .cell-form--inline { display: flex; flex-wrap: wrap; align-items: center; } }
  .list-plain, .plain { list-style: none; padding: 0; display: grid; gap: var(--space-2); }
  .board-filters, .bulk-actions {
    display: grid; gap: var(--space-3) var(--space-4); align-items: end;
    padding: var(--space-4); background: var(--surface-sunken); border-radius: var(--radius-md); margin-block: var(--space-4);
  }
  .bulk-actions legend { float: left; inline-size: 100%; padding: 0; margin-bottom: var(--space-1); }
  .board-filters__item { display: grid; gap: var(--space-1); }
  .board-filters__item input, .board-filters__item select { inline-size: 100%; }
  .board-filters__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
  .board-filters label, .bulk-actions label, .bulk-actions legend { font-size: var(--text-sm); font-weight: 600; color: var(--ink); }
  @media (min-width: 768px) { .board-filters, .bulk-actions { grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); } }
  .app main > .section > .container > * + * { margin-top: var(--space-4); }
  .app main h1 { margin-bottom: var(--space-2); }
  .app main h2 { margin-top: var(--space-7); font-size: var(--text-xl); }
  .app main p > a:only-child { display: inline-flex; align-items: center; min-height: var(--target); }
  .card > h2:first-child { margin-top: 0; }
  .app main .card:not(.plan-card) > * + * { margin-top: var(--space-4); }
  .card--danger { border-left: 4px solid var(--fail); }
  .app main .card + .card, .app main section.card { margin-top: var(--space-5); }
  .app main section > * + * { margin-top: var(--space-4); }
  form.inline { display: inline; }
  .dkim-selectors { list-style: none; padding: 0; display: grid; gap: var(--space-2); }
  .dkim-selectors li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); overflow-wrap: anywhere; }
  .dkim-lines { padding-left: var(--space-5); overflow-wrap: anywhere; }

  /* ---------- Page hero (interior pages) ---------- */
  .page-hero { background: var(--ink-2); padding-block: var(--space-7) var(--space-8); }
  .page-hero__title { font-size: var(--text-3xl); font-weight: 600; letter-spacing: var(--tracking-tight); line-height: var(--leading-snug); max-width: 22ch; }
  .red-on-dark { color: var(--accent-on-dark); }
  .page-hero__lede { margin-top: var(--space-4); font-size: var(--text-md); color: var(--on-dark-muted); max-width: var(--measure); }
  .page-hero .actions { margin-top: var(--space-5); }

  .crumbs { margin-bottom: var(--space-4); }
  .crumbs ol { padding: 0; list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--space-2); font-family: var(--font-mono); font-size: var(--text-xs); color: var(--on-dark-muted); }
  .crumbs li { display: inline-flex; align-items: center; }
  .crumbs li + li::before { content: "/"; margin-right: var(--space-2); color: var(--on-dark-border); }
  .on-dark .crumbs a:not(.btn) { color: var(--on-dark-fg); text-decoration: none; display: inline-flex; align-items: center; min-height: var(--target); }
  .on-dark .crumbs a:not(.btn):hover { text-decoration: underline; color: var(--on-dark-fg); }
  @media (min-width: 1024px) { .on-dark .crumbs a:not(.btn) { min-height: 1.5rem; } }

  /* ---------- Prose ---------- */
  .prose { max-width: var(--measure); color: var(--body); line-height: 1.7; }
  .prose > * + * { margin-top: var(--space-4); }
  .prose h2 { font-size: var(--text-2xl); margin-top: var(--space-7); }
  .prose h3 { font-size: var(--text-xl); margin-top: var(--space-6); }
  .prose > :first-child { margin-top: 0; }
  .prose ul, .prose ol { padding-left: var(--space-5); }
  .prose li + li { margin-top: var(--space-2); }
  .prose blockquote { padding-left: var(--space-4); border-left: 3px solid var(--accent); font-weight: 500; }
  .prose img { border-radius: var(--radius-md); }
  .prose table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
  .prose th, .prose td { text-align: left; padding: var(--space-3) var(--space-2); border-bottom: 1px solid var(--border); }
  .updated { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--muted); }
  .on-dark .updated { color: var(--on-dark-muted); }

  /* ---------- Contact ---------- */
  .visit__grid { display: grid; gap: var(--space-7); }
  @media (min-width: 1024px) { .visit__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: var(--space-8); align-items: start; } }
  .contact-list { display: grid; border-top: 1px solid var(--border); }
  .contact-list div { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: var(--space-4); padding-block: var(--space-3); border-bottom: 1px solid var(--border); align-items: center; }
  .contact-list dt { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--muted); }
  .contact-list dd { font-weight: 600; overflow-wrap: anywhere; }
  .contact-list dd > a { display: inline-flex; align-items: center; min-height: var(--target); }

  /* ---------- Help center (blog) ---------- */
  .chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
  .chips li { font-size: var(--text-sm); font-weight: 500; padding: var(--space-2) var(--space-4); border: 1px solid var(--border-strong); border-radius: var(--radius-full); background: var(--surface); color: var(--body); }
  .chips-nav { margin-bottom: var(--space-6); }
  .chips-nav a { display: inline-flex; align-items: center; min-height: var(--target); padding-inline: var(--space-4); margin: calc(-1 * var(--space-2)) calc(-1 * var(--space-4)); color: inherit; text-decoration: none; }
  .chips-nav li:has(a[aria-current]) { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
  .tiles { display: grid; gap: var(--space-5); }
  @media (min-width: 640px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  @media (min-width: 1024px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
  .tile { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-ring), var(--shadow-sm); transition: box-shadow var(--dur-base); }
  .tile:hover { box-shadow: var(--shadow-md); }
  .tile__media { aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-sunken); }
  .tile__media img { width: 100%; height: 100%; object-fit: cover; }
  .tile__body { padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-2); flex: 1; }
  .tile__kicker { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--accent); }
  .tile__title { font-size: var(--text-lg); }
  .tile__title a { color: inherit; text-decoration: none; }
  .tile__title a::after { content: ""; position: absolute; inset: 0; }
  .tile:focus-within { outline: var(--focus-width) solid var(--focus); outline-offset: var(--focus-offset); }
  .tile__title a:focus-visible { outline: none; }
  .empty { padding: var(--space-7) var(--space-5); border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); background: var(--surface-sunken); text-align: center; color: var(--muted); }
  .empty__title { font-size: var(--text-lg); font-weight: 600; color: var(--ink); margin-bottom: var(--space-2); }
  .empty .btn { margin-top: var(--space-4); }
  .pager { display: flex; align-items: center; justify-content: center; gap: var(--space-4); margin-top: var(--space-7); font-weight: 600; }
  .post-cover { max-width: var(--measure); margin-bottom: var(--space-6); border-radius: var(--radius-lg); overflow: hidden; }
  .post-tags { max-width: var(--measure); margin-top: var(--space-6); }
  .post-share { max-width: var(--measure); display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); margin-top: var(--space-6); padding-top: var(--space-4); border-top: 1px solid var(--border); }
  .post-share a { display: inline-flex; align-items: center; min-height: var(--target); font-weight: 600; }

  /* ---------- CTA band ---------- */
  .cta-band { background: var(--ink-2); padding-block: var(--space-8); }
  .cta-band__inner { display: grid; gap: var(--space-5); }
  .cta-band__inner::before { content: ""; width: var(--space-8); height: 2px; background: var(--accent-on-dark-a40); }
  .cta-band__title { font-size: var(--text-2xl); font-weight: 600; letter-spacing: var(--tracking-tight); line-height: var(--leading-snug); max-width: 24ch; }
  .cta-band__title span { color: var(--accent-on-dark); }
  .cta-band .actions { margin-top: 0; }
  @media (min-width: 1024px) {
    .cta-band__inner { grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: var(--space-8); }
    .cta-band__inner::before { grid-column: 1 / -1; }
  }

  /* ---------- Footer ---------- */
  .site-footer { background: var(--ink); color: var(--on-dark-muted); padding-top: var(--space-8); border-top: 1px solid var(--on-dark-line); }
  .footer__grid { display: grid; gap: var(--space-6) var(--space-5); grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer__brand { grid-column: 1 / -1; }
  @media (min-width: 1024px) {
    .footer__grid { grid-template-columns: minmax(0, 2fr) repeat(4, minmax(0, 1fr)); }
    .footer__brand { grid-column: auto; }
  }
  .brand--footer { min-height: 0; }
  .footer__tagline { font-size: var(--text-sm); color: var(--on-dark-muted); max-width: 32ch; margin-block: var(--space-3); }
  .footer__h { font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 500; letter-spacing: var(--tracking-mono); color: var(--on-dark-fg); margin-bottom: var(--space-2); }
  .site-footer ul { display: grid; }
  .on-dark.site-footer a:not(.btn) { color: var(--on-dark-fg); text-decoration: none; display: inline-flex; align-items: center; min-height: var(--target); }
  .on-dark.site-footer a:not(.btn):hover { text-decoration: underline; text-decoration-color: var(--accent-on-dark); color: var(--on-dark-fg); }
  @media (min-width: 1024px) { .on-dark.site-footer li a:not(.btn) { min-height: 2rem; } }
  .footer__social { margin-top: var(--space-2); }
  .site-footer address { font-style: normal; }
  .footer__base {
    display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: var(--space-3) var(--space-6);
    margin-top: var(--space-7); padding-block: var(--space-5) var(--space-6); border-top: 1px solid var(--on-dark-line); font-size: var(--text-xs);
  }
  .site-credits { color: var(--on-dark-muted); }
  .on-dark .site-credits a:not(.btn) { display: inline; min-height: 0; text-decoration: underline; text-decoration-color: var(--on-dark-border); }
  @media (max-width: 1023px) { .on-dark .site-credits a:not(.btn) { display: inline-flex; min-height: var(--target); } }
  @media (min-width: 768px) { .footer__base .site-credits { text-align: right; } }

  /* ---------- Logo inbox preview (spec 404). The watermark is an overlay, never part of the file. ---------- */
  .logo-thumb { vertical-align: middle; border-radius: 50%; background: var(--logo-preview-light); }
  .logo-preview-grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr)); margin-block: var(--space-4); }
  .logo-preview { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); padding: var(--space-4); border-radius: var(--radius-md); overflow: hidden; min-inline-size: 0; }
  .logo-preview::after {
    content: "Preview" / ""; position: absolute; inset: 20% 25%; display: flex; align-items: center; justify-content: center;
    font-size: var(--text-2xl); font-weight: 600; letter-spacing: .1em; color: var(--logo-preview-mark); transform: rotate(-18deg); pointer-events: none;
  }
  .logo-preview--light { background: var(--logo-preview-light); border: 1px solid var(--logo-preview-border); }
  .logo-preview--dark { background: var(--logo-preview-dark); }
  .logo-preview__img { display: block; background: var(--logo-preview-light); }
  .logo-preview__img--circle { border-radius: 50%; }
  /* Traced logo comparison (spec 413 req 6): original and trace at the same size on a checkerboard,
     so transparency shows. */
  .logo-inspection { color: var(--muted); }
  .logo-compare { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(min(12rem, 100%), 1fr)); margin-block: var(--space-4); }
  .logo-compare__item { margin: 0; display: grid; justify-items: center; gap: var(--space-2); padding: var(--space-4); border: 1px solid var(--logo-preview-border); border-radius: var(--radius-md);
    background: repeating-conic-gradient(var(--logo-preview-mark) 0 25%, var(--logo-preview-light) 0 50%) 50% / 16px 16px; }
  .logo-compare__img { display: block; inline-size: min(12rem, 100%); block-size: auto; aspect-ratio: 1; }
  .logo-compare__item figcaption { font-weight: 600; background: var(--logo-preview-light); color: var(--logo-preview-dark); padding: 0 var(--space-2); border-radius: var(--radius-sm); }
  .logo-versions { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fill, minmax(min(10rem, 100%), 1fr)); margin-block: var(--space-4); }
  .logo-version { margin: 0; display: grid; justify-items: center; align-content: start; gap: var(--space-2); padding: var(--space-3); border: 1px solid var(--logo-preview-border); border-radius: var(--radius-md); text-align: center; }
  .logo-version--current { border-color: var(--accent); border-width: 2px; }
  .logo-version__img { display: block; inline-size: min(8rem, 100%); block-size: auto; aspect-ratio: 1; background: var(--logo-preview-light); }
  .logo-version__current { margin: 0; font-weight: 600; }
  .logo-retrace { margin-block: var(--space-4); }
  /* Bulk domain add (spec 417). */
  .bulk-add { margin-block-start: var(--space-4); }
  .bulk-add > summary { cursor: pointer; font-weight: 600; color: var(--accent); min-block-size: var(--target); display: flex; align-items: center; }
  .bulk-add[open] > form { margin-block-start: var(--space-3); }
  .bulk-results { margin: var(--space-3) 0; padding-inline-start: var(--space-4); display: grid; gap: var(--space-1); }
  .bulk-results__item--exists, .bulk-results__item--duplicate { color: var(--muted); }
  .bulk-results__item--invalid, .bulk-results__item--limit, .bulk-results__item--failed { color: var(--warn); }
  .logo-retrace summary { cursor: pointer; font-weight: 600; min-block-size: var(--target); display: flex; align-items: center; }
  .check-row label { display: inline-flex; gap: var(--space-2); align-items: flex-start; min-block-size: var(--target); }
  .check-row input { margin-block-start: .3em; inline-size: 1.1rem; block-size: 1.1rem; }
}

/* Public invoice page (spec 314 req 8): printable sheet; the site chrome is hidden in print. */
@layer components {
  .invoice-sheet { max-width: 52rem; margin: 0 auto; background: var(--surface); color: var(--ink); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-6); }
  @media (max-width: 419px) { .invoice-sheet { padding: var(--space-4); } }
  .invoice-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-5); margin-bottom: var(--space-5); }
  .invoice-head h1 { font-size: var(--text-2xl); margin: 0; }
  .invoice-status { margin: var(--space-2) 0 0; font-weight: 600; }
  .invoice-status--paid { color: var(--pass); }
  .invoice-status--overdue { color: var(--fail); text-decoration: underline; }
  .invoice-seller { text-align: right; font-size: var(--text-sm); }
  .invoice-parties { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-5); margin-bottom: var(--space-5); }
  .invoice-parties h2 { font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 500; color: var(--muted); margin: 0 0 var(--space-2); }
  .invoice-dates { display: grid; grid-template-columns: max-content auto; gap: var(--space-1) var(--space-4); margin: 0; }
  .invoice-dates dt { color: var(--muted); }
  .invoice-dates dd { margin: 0; }
  .invoice-lines { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
  .invoice-lines th, .invoice-lines td { text-align: left; padding: var(--space-3) var(--space-2); border-bottom: 1px solid var(--border); vertical-align: top; }
  .invoice-lines th { font-size: var(--text-xs); color: var(--muted); }
  .invoice-lines .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
  .invoice-lines small { color: var(--muted); }
  .invoice-totals { display: grid; grid-template-columns: auto max-content; gap: var(--space-1) var(--space-5); width: max-content; margin: var(--space-4) 0 var(--space-5) auto; font-variant-numeric: tabular-nums; }
  .invoice-totals dd { margin: 0; text-align: right; }
  .invoice-totals .due { font-weight: 600; font-size: var(--text-md); }
  .invoice-notes, .invoice-footer { font-size: var(--text-sm); color: var(--muted); }
  .invoice-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-5); }
  @media (max-width: 419px) { .invoice-pay { inline-size: 100%; } }
  .invoice-pay { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: end; }
}
@media print {
  .site-header, .site-footer, .invoice-actions, .skip-link, .no-print { display: none !important; }
  .invoice-sheet { border: 0; padding: 0; max-width: none; }
  .section--page { padding: 0; }
}

@layer utilities {
  .sr-only, .visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
  }
}
