/* MeroSplit pages other than the home page: help and policy pages, the agent setup guide, and single-task pages
   (invitations, sign-in, email preferences, agent approval). Tokens, type, header, pill and footer match
   landing.css. Icons are Hugeicons free stroke-rounded (MIT License, Copyright (c) 2025 Hugeicons), inlined
   from templates/ledger/icons so pages with a strict Content-Security-Policy need no image source.
   Light by default, dark from the OS; html[data-theme] pins either one for local fixtures. */
/* Arial adjusted to Stack Sans Text's widths and vertical metrics, as in landing.css, so text keeps its size
   and position if the web font arrives after first paint. */
@font-face { font-family: "Stack Sans Fallback"; src: local("Arial"), local("ArialMT"); font-weight: 400; size-adjust: 108.4%; ascent-override: 92.25%; descent-override: 27.68%; line-gap-override: 0%; }
@font-face { font-family: "Stack Sans Fallback"; src: local("Arial"), local("ArialMT"); font-weight: 500; size-adjust: 109.6%; ascent-override: 91.24%; descent-override: 27.37%; line-gap-override: 0%; }
@font-face { font-family: "Stack Sans Fallback"; src: local("Arial Bold"), local("Arial-BoldMT"); font-weight: 600; size-adjust: 102.84%; ascent-override: 97.24%; descent-override: 29.17%; line-gap-override: 0%; }
@font-face { font-family: "Stack Sans Fallback"; src: local("Arial Bold"), local("Arial-BoldMT"); font-weight: 700; size-adjust: 102.16%; ascent-override: 97.89%; descent-override: 29.37%; line-gap-override: 0%; }

:root {
  color-scheme: light;
  --page: #F5F5F5; --paper: #FFFFFF; --ink: #161616; --quiet: #5C5C5C; --line: #DCDCDC;
  --amber: #FFB21E; --coral: #F2545B; --blue: #075DB4; --owed: #176B3A; --owes: #B42318;
  --bill-tile: #FFE8BC; --bill-icon: #161616; --trip-tile: #FCD4D6; --trip-icon: #161616;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #111111; --paper: #1C1C1C; --ink: #F5F5F5; --quiet: #B5B5B5; --line: #383838;
    --blue: #83B9FF; --owed: #78D9A0; --owes: #FF9B93;
    --bill-tile: #3A2E15; --bill-icon: #FFB21E; --trip-tile: #3D2224; --trip-icon: #F2545B;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #111111; --paper: #1C1C1C; --ink: #F5F5F5; --quiet: #B5B5B5; --line: #383838;
  --blue: #83B9FF; --owed: #78D9A0; --owes: #FF9B93;
  --bill-tile: #3A2E15; --bill-icon: #FFB21E; --trip-tile: #3D2224; --trip-icon: #F2545B;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 400 1.0625rem/1.6 "Stack Sans Text", "Stack Sans Fallback", system-ui, sans-serif; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 600; text-wrap: balance; }
code, pre { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .875em; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 2; padding: .6rem 1rem; border-radius: 10px; background: var(--paper); }
.skip:focus { top: 1rem; }
.wrap { width: min(76rem, 100% - 2.5rem); margin-inline: auto; }
.hi { width: 1.25em; height: 1.25em; flex-shrink: 0; }

/* Header, as on the home page. */
.top { display: flex; align-items: center; gap: 1rem 1.5rem; padding-block: 1.25rem; }
.brand { display: inline-flex; align-items: center; gap: .4em; min-height: 2.75rem; margin-right: auto; font-size: 1.25rem; font-weight: 600; line-height: 1; letter-spacing: -.015em; text-decoration: none; }
.brand svg { height: 1.12em; width: auto; flex-shrink: 0; }
.top-link, .pill, .actions > a { white-space: nowrap; text-decoration: none; }
.top-link { display: inline-flex; align-items: center; gap: .4em; min-height: 2.75rem; color: var(--quiet); }
.top-link:hover { color: var(--ink); text-decoration: underline; }
@media (max-width: 27rem) { .top-link { display: none; } }

/* Pill: the one button shape. Ink for the action, outlined for the way back. */
.pill, .actions > a { display: inline-flex; align-items: center; justify-content: center; gap: .45em; min-height: 2.75rem; padding: .55rem 1.15rem .55rem .95rem; border: 0; border-radius: 999px; background: var(--ink); color: var(--page); font: inherit; font-weight: 600; cursor: pointer; transition: background-color .15s; }
.pill:hover, .actions > a:hover { background: color-mix(in srgb, var(--ink) 80%, var(--page)); }
.pill.quiet, .actions > a.quiet { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.pill.quiet:hover, .actions > a.quiet:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.pill:disabled { opacity: .4; cursor: not-allowed; }
.pill:disabled:hover { background: var(--ink); }

/* Help, policy and setup pages: a list of pages (or of this page's sections) beside one reading column. */
.doc-layout { display: grid; grid-template-columns: 14rem minmax(0, 44rem); gap: clamp(2.5rem, 7vw, 6rem); align-items: start; padding-block: clamp(1.5rem, 4vw, 3rem) clamp(4rem, 9vw, 7rem); }
.pages { position: sticky; top: 1.5rem; }
.pages ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .2rem; }
.pages a { display: flex; align-items: center; gap: .65rem; min-height: 2.75rem; padding: .4rem .9rem .4rem .75rem; border-radius: 14px; color: var(--quiet); font-weight: 500; line-height: 1.25; text-decoration: none; }
.pages a:hover { color: var(--ink); }
.pages a[aria-current="page"] { background: var(--paper); color: var(--ink); }
.toc a { min-height: 2.25rem; padding-block: .3rem; font-size: .9375rem; }

.doc-icon { display: grid; place-items: center; width: 3.75rem; height: 3.75rem; margin-bottom: 1.5rem; border-radius: 18px; background: var(--paper); }
.doc-icon .hi { width: 2rem; height: 2rem; }
.doc h1 { font-size: clamp(2.25rem, 5vw, 3.5rem); line-height: 1.04; letter-spacing: -.03em; }
.doc > * + * { margin-top: 1rem; }
.doc > h1 + p { margin-top: 1.1rem; font-size: 1.1875rem; line-height: 1.5; color: var(--quiet); }
.doc > h2 { margin-top: 3rem; font-size: 1.375rem; line-height: 1.25; letter-spacing: -.015em; scroll-margin-top: 1.5rem; }
.doc > h2 + * { margin-top: .75rem; }
.doc p, .doc li { max-width: 40em; }
.doc ul { padding-left: 1.2rem; }
.doc ul > li::marker { color: var(--coral); }
.doc li + li { margin-top: .6rem; }
/* Ordered lists here are steps, so the number is the point. */
.doc ol { list-style: none; padding: 0; counter-reset: step; }
.doc ol > li { position: relative; min-height: 2rem; padding: .2rem 0 0 2.85rem; counter-increment: step; }
.doc ol > li::before { content: counter(step); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--ink); color: var(--page); font-size: .9375rem; font-weight: 600; }
.doc ol > li + li { margin-top: .9rem; }
.doc li > pre { margin-top: .75rem; }
.doc :not(pre) > code { padding: .1em .35em; border-radius: 6px; background: color-mix(in srgb, var(--ink) 7%, transparent); overflow-wrap: anywhere; }
.doc pre { margin-bottom: 0; padding: 1rem 1.15rem; border-radius: 14px; background: var(--paper); line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.doc details { padding: .35rem 1.15rem 1.15rem; border-radius: 18px; background: var(--paper); }
.doc details > * + * { margin-top: 1rem; }
.doc summary { display: flex; align-items: center; min-height: 2.75rem; font-weight: 600; cursor: pointer; }
.doc details pre { background: var(--page); }
.doc .contact { margin-top: 1.75rem; }
.doc .contact + p { margin-top: 1.25rem; }

@media (max-width: 56rem) {
  .doc-layout { grid-template-columns: minmax(0, 1fr); gap: 1.75rem; }
  /* The page list wraps into pills, so the current page is always in view; a page's own section list is
     left to its headings. */
  .pages { position: static; }
  .pages ul { display: flex; flex-wrap: wrap; gap: .5rem; }
  .pages a { padding: .4rem 1rem; border-radius: 999px; box-shadow: inset 0 0 0 1.5px var(--line); font-size: .9375rem; white-space: nowrap; }
  .pages a .hi { display: none; }
  .pages a[aria-current="page"] { background: var(--ink); color: var(--page); box-shadow: none; }
  .toc { display: none; }
}

/* Single-task pages: the mark, then one panel holding the question and its action. */
.task { min-height: 100svh; display: flex; flex-direction: column; }
.task-top { display: flex; justify-content: center; padding-top: 1.75rem; }
.task-top .brand { margin: 0; }
.task main { flex: 1; display: grid; place-items: center; padding: 1.75rem 1.25rem 3rem; }
.panel { width: min(100%, 28rem); padding: clamp(1.5rem, 6vw, 2.25rem); border-radius: 28px; background: var(--paper); }
.panel > * + * { margin-top: 1rem; }
.tile { display: grid; place-items: center; width: 3.25rem; height: 3.25rem; border-radius: 14px; background: var(--bill-tile); color: var(--bill-icon); flex-shrink: 0; }
.tile .hi { width: 1.6rem; height: 1.6rem; }
.tile.trip { background: var(--trip-tile); color: var(--trip-icon); }
.tile.plain { background: var(--page); color: var(--quiet); }
.panel > .tile + h1, .panel > .handshake + h1 { margin-top: 1.5rem; }
.panel h1 { font-size: clamp(1.75rem, 6.5vw, 2.25rem); line-height: 1.1; letter-spacing: -.025em; overflow-wrap: anywhere; }
.panel > h1 + p { margin-top: .75rem; color: var(--quiet); }
.panel p { overflow-wrap: anywhere; }
.actions, .panel form { display: grid; gap: .6rem; margin-top: 1.75rem; }
.actions .pill, .actions > a, .panel form .pill { width: 100%; min-height: 3.25rem; }
.note { color: var(--quiet); font-size: .9375rem; line-height: 1.5; }
.actions .note, .note.centered { text-align: center; }
.after { margin-top: 1.25rem; text-align: center; color: var(--quiet); font-size: .9375rem; }

/* Forms on task pages. */
label { font-weight: 600; font-size: .9375rem; }
input:not([type="hidden"]) { width: 100%; min-width: 0; min-height: 3.25rem; padding: .7rem 1rem; border: 1.5px solid var(--line); border-radius: 14px; background: var(--page); color: var(--ink); font: inherit; }
input:not([type="hidden"]):focus-visible { outline: 3px solid var(--blue); outline-offset: 1px; border-color: var(--ink); border-radius: 14px; }
input[aria-invalid="true"] { border-color: var(--owes); }
.panel form label + input { margin-top: -.15rem; }
.code-input { font-size: 1.5rem; font-weight: 600; letter-spacing: .14em; text-align: center; text-transform: uppercase; font-variant-numeric: tabular-nums; }
.code-input::placeholder { color: var(--line); }
.error { color: var(--owes); font-weight: 500; }
.error:empty { display: none; }
#google { min-height: 2.75rem; }

/* Agent approval. */
.handshake { display: flex; align-items: center; gap: .6rem; color: var(--quiet); }
.handshake .tile { background: var(--page); color: var(--ink); font-size: 1.375rem; font-weight: 600; }
.handshake .tile svg { width: 1.9rem; height: auto; }
.account { display: flex; align-items: center; gap: .85rem; padding: .85rem 1rem; border-radius: 18px; background: var(--page); }
.avatar { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 50%; background: var(--bill-tile); color: var(--bill-icon); font-weight: 600; flex-shrink: 0; }
.identity { min-width: 0; line-height: 1.35; }
.identity p + p { color: var(--quiet); font-size: .9375rem; }
.permissions { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: 1.1rem; }
.permissions li { display: flex; gap: .85rem; }
.permissions .tile { width: 2.5rem; height: 2.5rem; border-radius: 12px; background: var(--page); color: var(--ink); }
.permissions .tile .hi { width: 1.25rem; height: 1.25rem; }
.permissions h2 { font-size: 1rem; line-height: 1.4; }
.permissions p { color: var(--quiet); font-size: .9375rem; line-height: 1.5; }
.notice { display: flex; gap: .6rem; align-items: flex-start; font-size: .9375rem; line-height: 1.5; }
.notice .hi { margin-top: .05rem; color: var(--quiet); }
.server-code { display: grid; gap: .25rem; padding: .85rem 1rem; border-radius: 18px; background: var(--bill-tile); color: var(--bill-icon); }
.server-code strong { font-size: 1.375rem; letter-spacing: .12em; font-variant-numeric: tabular-nums; }
.server-code span { font-size: .9375rem; }

/* Footer, as on the home page. */
.foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .25rem 2rem; padding-block: 1.75rem 2.5rem; color: var(--quiet); font-size: .9375rem; }
.foot ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 1.25rem; }
.foot a { display: inline-flex; align-items: center; min-height: 2.75rem; }
.foot nav a { color: var(--quiet); text-decoration: none; }
.foot nav a:hover { color: var(--ink); text-decoration: underline; }
.foot p a { color: var(--ink); text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); }
.foot p a:hover { text-decoration-color: currentColor; }

@media (prefers-reduced-motion: reduce) { .pill, .actions > a { transition: none; } }
@media (forced-colors: active) {
  .pill, .actions > a, .panel, .pages a[aria-current="page"], .tile, .doc-icon, .account, .server-code, input { border: 1px solid CanvasText; }
}
