/* ============================================================
   SplitEasy — marketing site
   Visual language: engraved travel documents. Intaglio indigo
   ink on cool security paper, one stamp-crimson accent.
   ============================================================ */

:root {
    --ink:        #17203d;
    --ink-2:      #46527f;
    --ink-3:      #6b7599;
    --paper:      #e7eaf1;
    --paper-2:    #dde2ed;
    --card:       #fbfcfe;
    --stamp:      #c4365b;
    --stamp-soft: #f2dbe2;
    --rule:       #c6cdde;

    --display: "Bodoni Moda", Georgia, "Times New Roman", serif;
    --body:    "IBM Plex Sans", system-ui, -apple-system, sans-serif;
    --mono:    "IBM Plex Mono", ui-monospace, "Cascadia Mono", monospace;

    --shell: 1140px;
    --gutter: 24px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--body);
    font-size: 17px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 400; line-height: 1.08; letter-spacing: -0.015em; }
p { margin: 0; }
img { max-width: 100%; display: block; }
a { color: inherit; }

h1:focus { outline: none; }

:focus-visible {
    outline: 2px solid var(--stamp);
    outline-offset: 3px;
    border-radius: 2px;
}

/* ---------- shell ---------- */

.shell {
    width: 100%;
    max-width: var(--shell);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.shell--narrow { max-width: 760px; }

/* ---------- eyebrow / labels ---------- */

.eyebrow {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-3);
    margin: 0 0 20px;
}

.eyebrow--stamp { color: var(--stamp); }

/* ---------- type scale ---------- */

.display {
    font-family: var(--display);
    font-size: clamp(3rem, 8vw, 5.75rem);
    line-height: 0.98;
    letter-spacing: -0.03em;
}

.display em { font-style: italic; }

.h2 {
    font-family: var(--display);
    font-size: clamp(2rem, 4.4vw, 3.1rem);
    line-height: 1.04;
    letter-spacing: -0.02em;
}

.lede {
    font-size: clamp(1.05rem, 1.9vw, 1.3rem);
    line-height: 1.5;
    color: var(--ink-2);
    max-width: 46ch;
}

.prose { color: var(--ink-2); max-width: 62ch; }
.prose + .prose { margin-top: 1em; }

/* ---------- buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--mono);
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    padding: 14px 24px;
    border: 1px solid var(--ink);
    background: var(--ink);
    color: var(--card);
    transition: background .16s ease, color .16s ease, transform .16s ease;
}

.btn:hover { background: var(--stamp); border-color: var(--stamp); }
.btn:active { transform: translateY(1px); }

/* A form's submit is disabled until it can be submitted, so it has to look it. Without this a
   disabled button was indistinguishable from a live one, right down to the hover — pressing it
   did nothing and the page gave no reason why. */
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn:disabled:hover { background: var(--ink); border-color: var(--ink); }
.btn:disabled:active { transform: none; }

.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--card); border-color: var(--ink); }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

/* ---------- masthead ---------- */

.masthead {
    border-bottom: 1px solid var(--rule);
    background: var(--paper);
    position: sticky;
    top: 0;
    z-index: 20;
}

.masthead__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 72px;
}

.wordmark {
    font-family: var(--display);
    font-size: 1.45rem;
    letter-spacing: -0.02em;
    text-decoration: none;
    display: inline-flex;
    align-items: baseline;
}

.wordmark span { font-style: italic; color: var(--stamp); }

.nav { display: flex; align-items: center; gap: 28px; }

.nav__link {
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--ink-2);
    padding: 4px 0;
    border-bottom: 1px solid transparent;
}

.nav__link:hover { color: var(--ink); border-bottom-color: var(--stamp); }

.nav .btn { padding: 10px 18px; }

@media (max-width: 860px) {
    .nav__link { display: none; }
    .masthead__inner { min-height: 64px; }
}

/* ---------- sections ---------- */

.section { padding-block: clamp(64px, 9vw, 118px); }
.section--rule { border-top: 1px solid var(--rule); }
.section--ink { background: var(--ink); color: var(--paper); }
.section--ink .lede,
.section--ink .prose { color: #aab3d0; }
.section--ink .eyebrow { color: #7d88ad; }
.section--ink .btn { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.section--ink .btn:hover { background: var(--stamp); border-color: var(--stamp); color: var(--card); }

.section__head { max-width: 60ch; margin-bottom: 56px; }
.section__head .lede { margin-top: 20px; }

/* ---------- hero ---------- */

.hero { padding-block: clamp(56px, 7vw, 96px); }

.hero__grid {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: clamp(40px, 6vw, 88px);
    align-items: center;
}

.hero__note {
    margin-top: 28px;
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.04em;
    color: var(--ink-3);
}

@media (max-width: 960px) {
    .hero__grid { grid-template-columns: 1fr; }
}

/* ---------- signature: the settlement document ---------- */

.doc {
    position: relative;
    background: var(--card);
    border: 1px solid var(--ink);
    box-shadow: 6px 6px 0 var(--paper-2);
    padding: 28px 26px 22px;
}

.doc__head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-3);
    padding-bottom: 14px;
    border-bottom: 2px solid var(--ink);
}

.doc__caption {
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-3);
    margin: 20px 0 8px;
}

.row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid var(--rule);
}

.row__name { font-size: 15px; }
.row__name b { font-weight: 500; }

.row__amt {
    font-family: var(--mono);
    font-size: 15px;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

.row--total {
    border-bottom: none;
    border-top: 2px solid var(--ink);
    margin-top: 2px;
    padding-top: 12px;
}

.row--total .row__name,
.row--total .row__amt { font-weight: 600; }

.row--settle .row__amt { color: var(--stamp); }

.arrow { color: var(--ink-3); padding-inline: 6px; }

.doc__foot {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--rule);
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-3);
}

.stamp {
    position: absolute;
    right: -18px;
    bottom: 30px;
    transform: rotate(-9deg);
    border: 2px solid var(--stamp);
    color: var(--stamp);
    background: var(--stamp-soft);
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    padding: 8px 14px;
}

/* Staggered reveal — the reconciliation resolving.
   Delay comes from a --d custom property set per row in the markup,
   so it can't drift if rows are reordered or added. */
.doc .row { animation: settle .5s var(--d, 0s) both ease-out; }
.doc .doc__foot { animation: settle .5s .68s both ease-out; }
.doc .stamp { animation: stamped .32s .84s both cubic-bezier(.2,1.5,.4,1); }

@keyframes settle {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}

@keyframes stamped {
    from { opacity: 0; transform: rotate(-9deg) scale(1.5); }
    to   { opacity: 1; transform: rotate(-9deg) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-delay: 0ms !important;
        transition-duration: .001ms !important;
    }
}

/* ---------- steps (a real sequence, so numbered) ---------- */

.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--rule);
    border-block: 1px solid var(--rule);
}

.step { background: var(--paper); padding: 36px 28px 40px; }

.step__num {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.16em;
    color: var(--stamp);
    display: block;
    margin-bottom: 22px;
}

.step__body { margin-top: 12px; color: var(--ink-2); font-size: 15.5px; }

@media (max-width: 820px) {
    .steps { grid-template-columns: 1fr; }
}

/* ---------- split methods ---------- */

.methods { border-top: 1px solid var(--rule); }

.method {
    display: grid;
    grid-template-columns: 150px 1fr 1.3fr;
    gap: 28px;
    align-items: baseline;
    padding: 26px 0;
    border-bottom: 1px solid var(--rule);
}

.method__key {
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--stamp);
}

.method__name { font-family: var(--display); font-size: 1.35rem; }
.method__desc { color: var(--ink-2); font-size: 15.5px; }

@media (max-width: 820px) {
    .method { grid-template-columns: 1fr; gap: 6px; }
}

/* ---------- plans ---------- */

.plans {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.plan {
    background: var(--card);
    border: 1px solid var(--rule);
    padding: 34px 30px 38px;
    display: flex;
    flex-direction: column;
}

.plan--lead { border-color: var(--ink); box-shadow: 6px 6px 0 var(--paper-2); }

.plan__name {
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-3);
}

.plan__price {
    font-family: var(--display);
    font-size: 3rem;
    line-height: 1;
    margin: 18px 0 6px;
}

.plan__price small {
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.1em;
    color: var(--ink-3);
    text-transform: uppercase;
}

.plan__list { list-style: none; margin: 26px 0 32px; padding: 0; }

.plan__list li {
    padding: 9px 0 9px 22px;
    border-bottom: 1px solid var(--rule);
    font-size: 15.5px;
    color: var(--ink-2);
    position: relative;
}

.plan__list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 18px;
    width: 9px;
    height: 1px;
    background: var(--stamp);
}

.plan .btn { margin-top: auto; justify-content: center; }

@media (max-width: 820px) {
    .plans { grid-template-columns: 1fr; }
}

/* ---------- faq ---------- */

.qa { border-top: 1px solid var(--rule); }

.qa__item { border-bottom: 1px solid var(--rule); padding: 26px 0; }
.qa__q { font-family: var(--display); font-size: 1.3rem; }
.qa__a { margin-top: 10px; color: var(--ink-2); max-width: 68ch; font-size: 15.5px; }

/* ---------- closing band ---------- */

.closer { text-align: center; }
.closer .lede { margin-inline: auto; margin-top: 20px; }
.closer .btn-row { justify-content: center; }

/* ---------- footer ---------- */

.foot {
    border-top: 1px solid var(--rule);
    padding-block: 48px 56px;
    font-size: 14px;
}

.foot__grid {
    display: flex;
    flex-wrap: wrap;
    gap: 40px 64px;
    justify-content: space-between;
}

.foot__col h4 {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-3);
    margin: 0 0 14px;
    font-weight: 400;
}

.foot__col ul { list-style: none; margin: 0; padding: 0; }
.foot__col li { margin-bottom: 8px; }
.foot__col a { text-decoration: none; color: var(--ink-2); }
.foot__col a:hover { color: var(--stamp); }

.foot__base {
    margin-top: 44px;
    padding-top: 20px;
    border-top: 1px solid var(--rule);
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    color: var(--ink-3);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

/* ---------- long-form / legal pages ---------- */

.doc-page { padding-block: clamp(56px, 7vw, 88px); }
.doc-page h2 { font-family: var(--display); font-size: 1.5rem; margin: 40px 0 12px; }
.doc-page p { color: var(--ink-2); margin-bottom: 12px; }
.doc-page ul { color: var(--ink-2); padding-left: 20px; }
.doc-page li { margin-bottom: 6px; }

.notice {
    border-left: 2px solid var(--stamp);
    background: var(--stamp-soft);
    padding: 16px 20px;
    font-size: 15px;
    margin: 28px 0;
    color: var(--ink);
}

/* A definition list reads better than a table for "what we collect, and why": the pairing is
   the content, and a table would need a horizontal scroller on a phone to say the same thing. */
.doc-page dl { margin: 0; }
.doc-page dt { font-family: var(--mono); font-size: 13px; letter-spacing: 0.06em; margin-top: 20px; }
.doc-page dd { color: var(--ink-2); margin: 4px 0 0; }
.doc-page dd em { font-style: normal; color: var(--ink-3); font-size: 15px; }

/* ---------- cookie choice ---------- */

/* Four states, and the order below is the whole of the logic:
     1. no cookie                     — the server renders it bare and this rule shows it
     2. cookie present                — the server adds .consent--answered and it is hidden
     3. just answered on this page    — the head script stamps <html> and it hides without a reload
     4. "ask me again" on /privacy    — the same attribute, set to unset, outweighs (2) and shows it
   Specificity does the work in that last pair, which is why neither needs !important. */
.consent {
    display: flex;
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 40;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px 24px;
    padding: 18px var(--gutter);
    background: var(--card);
    border-top: 1px solid var(--rule);
    box-shadow: 0 -12px 32px rgba(23, 32, 61, .08);
}

.consent--answered { display: none; }

html[data-consent="granted"] .consent,
html[data-consent="denied"] .consent { display: none; }

html[data-consent="unset"] .consent.consent--answered { display: flex; }

/* Without script there is no tag, no cookie and nothing to consent to — and the buttons would do
   nothing if pressed, leaving a bar across the foot of every page that cannot be dismissed.
   A media query rather than <noscript><style>: the parser keeps noscript's contents inert, but
   enhanced navigation re-parses the head through the DOM, at which point that style becomes live
   and hides the banner for everybody. It did, and only from the second page onwards. */
@media (scripting: none) {
    .consent { display: none; }
}

.consent__text {
    color: var(--ink-2);
    font-size: 15px;
    max-width: 68ch;
}

.consent__actions { display: flex; gap: 12px; flex-shrink: 0; }
.consent .btn { padding: 10px 20px; font-size: 12px; }

/* ---------- signed-in app ---------- */

.form-panel { max-width: 460px; margin-inline: auto; }

.field { display: block; margin-top: 24px; }

.field__label {
    display: block;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-3);
    margin-bottom: 8px;
}

.field__input {
    width: 100%;
    font-family: var(--body);
    font-size: 16px;
    color: var(--ink);
    background: var(--card);
    border: 1px solid var(--rule);
    padding: 12px 14px;
}

.field__input:focus { outline: 2px solid var(--stamp); outline-offset: 1px; border-color: var(--stamp); }

.field__error, .validation-message {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: var(--stamp);
}

.trip-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 4px 20px;
    padding: 22px 0;
    border-bottom: 1px solid var(--rule);
    text-decoration: none;
    transition: background .14s ease;
}

.trip-row:hover { background: var(--paper-2); }

.trip-row__name { font-family: var(--display); font-size: 1.5rem; letter-spacing: -0.02em; }

.trip-row .avatar { grid-row: 1 / span 2; align-self: center; }

.trip-row__meta {
    grid-column: 2;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-3);
}

.trip-row__balance {
    grid-row: 1 / span 2;
    grid-column: 3;
    align-self: center;
    font-family: var(--mono);
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    color: var(--ink-2);
    text-align: right;
}

.trip-row__balance.is-owing { color: var(--stamp); }

/* The people list puts its actions in this column, and two bare buttons side by side ran into
   each other as one word. */
.trip-row__balance .linkbutton + .linkbutton { margin-left: 14px; }

.empty {
    border: 1px dashed var(--rule);
    padding: 56px 24px;
    text-align: center;
}

.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
    gap: clamp(32px, 5vw, 72px);
    align-items: start;
}

@media (max-width: 940px) {
    .detail-grid { grid-template-columns: 1fr; }
}

/* The balance panel reuses .doc from the marketing hero, so the app shows the same
   settlement statement the landing page promises. */
.row__name--avatar {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2px 10px;
    align-items: center;
}

.row__name--avatar .avatar { grid-row: 1 / span 2; }
.row__name--avatar .row__sub { grid-column: 2; }

.row__sub {
    display: block;
    margin-top: 3px;
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.06em;
    color: var(--ink-3);
}

.row__amt.is-owing { color: var(--stamp); }

.expense-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 3px 20px;
    padding: 18px 0;
    border-bottom: 1px solid var(--rule);
}

.expense-row__desc { font-size: 16px; font-weight: 500; }

.expense-row__amt {
    font-family: var(--mono);
    font-size: 15px;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.expense-row__meta,
.expense-row__conv {
    grid-column: 1;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.06em;
    color: var(--ink-3);
}

.expense-row__conv { grid-column: 2; text-align: right; color: var(--stamp); }

/* The same row as a button, for picking someone out of a list. Without the reset the browser's
   own button chrome draws a grey box around each one and the list stops looking like a list. */
.expense-row--pick {
    width: 100%;
    background: none;
    border: 0;
    border-bottom: 1px solid var(--rule);
    text-align: left;
    font: inherit;
    color: inherit;
    cursor: pointer;
    transition: background .14s ease;
}
.expense-row--pick:hover { background: var(--paper-2); }
.expense-row--pick:hover .expense-row__amt { color: var(--stamp); }

/* ---------- split editor ---------- */

.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.field__hint {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    color: var(--ink-3);
}

/* Set apart from the label rather than added to its text, so a field that is not required
   reads as one at a glance instead of on a second pass. */
.field__optional {
    margin-left: 8px;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-3);
}

.split-types { display: flex; gap: 8px; flex-wrap: wrap; }

.split-type {
    font-family: var(--mono);
    font-size: 13px;
    letter-spacing: 0.06em;
    padding: 10px 16px;
    background: var(--card);
    color: var(--ink-2);
    border: 1px solid var(--rule);
    cursor: pointer;
    transition: background .14s ease, color .14s ease, border-color .14s ease;
}

.split-type:hover { border-color: var(--ink-3); }
.split-type.is-active { background: var(--ink); border-color: var(--ink); color: var(--card); }

.split-edit {
    display: grid;
    grid-template-columns: 1fr 110px 110px;
    gap: 16px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--rule);
}

.split-edit.is-out { opacity: .45; }

.split-edit__who { display: flex; align-items: center; gap: 10px; font-size: 15px; cursor: pointer; }
.split-edit__who input { accent-color: var(--stamp); width: 16px; height: 16px; }

.field__input--slim { padding: 8px 10px; font-size: 14px; text-align: right; }

.split-edit__preview {
    font-family: var(--mono);
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    text-align: right;
    color: var(--ink-3);
}

.split-total {
    margin-top: 18px;
    padding: 14px 16px;
    background: var(--stamp-soft);
    border-left: 2px solid var(--stamp);
    font-family: var(--mono);
    font-size: 13px;
    letter-spacing: 0.04em;
    color: var(--ink);
}

.split-total.is-ok { background: var(--paper-2); border-left-color: var(--ink-2); color: var(--ink-2); }

@media (max-width: 620px) {
    .field-pair { grid-template-columns: 1fr; }
    .split-edit { grid-template-columns: 1fr 90px; }
    .split-edit__preview { grid-column: 2; text-align: right; }
}

/* ---------- trip cover ---------- */

.trip-header {
    position: relative;
    margin-bottom: 44px;
    border: 1px solid var(--ink);
    overflow: hidden;
}

.trip-header__image {
    width: 100%;
    height: clamp(180px, 26vw, 300px);
    object-fit: cover;
    display: block;
}

.trip-header__text {
    position: absolute;
    inset: auto 0 0 0;
    padding: 28px 26px 22px;
    /* The photograph is the user's; the type has to stay readable over any of them. */
    background: linear-gradient(to top, rgba(10, 14, 30, .88), rgba(10, 14, 30, 0));
    color: var(--paper);
}

.trip-header__text .eyebrow { color: #f0b8c6; margin-bottom: 8px; }
.trip-header__text .h2 { color: var(--paper); }

.cover-preview {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 28px 0 8px;
    padding: 16px;
    border: 1px solid var(--rule);
    background: var(--card);
}

.cover-preview img {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
}

/* ---------- avatars ---------- */

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: 50%;
    color: #fff;
    font-family: var(--mono);
    font-size: 13px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    user-select: none;
}

.avatar--sm { width: 28px; height: 28px; flex-basis: 28px; font-size: 11px; }

.avatar--square { border-radius: 4px; }

.masthead__user {
    display: flex;
    align-items: center;
    gap: 18px;
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.08em;
    color: var(--ink-3);
}

.masthead__user form { margin: 0; }

.linkbutton {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    color: var(--ink-2);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    border-bottom: 1px solid transparent;
}

.linkbutton:hover { color: var(--stamp); border-bottom-color: var(--stamp); }

/* Hangs under a settle-up row rather than sitting inside it: the row itself is a link to the
   payment form, and a link inside a link is not markup a browser will honour. */
.row__aside {
    display: flex;
    justify-content: flex-end;
    padding: 6px 0 10px;
}

/* ---------- blazor framework ui ---------- */

#blazor-error-ui {
    color: var(--card);
    background: var(--ink);
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0,0,0,.2);
    display: none;
    left: 0;
    padding: 12px 16px;
    position: fixed;
    width: 100%;
    z-index: 1000;
    font-size: 14px;
}

#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 16px; top: 10px; }

.blazor-error-boundary { background: var(--stamp); padding: 1rem; color: #fff; }
.blazor-error-boundary::after { content: "An error has occurred."; }

/* A suggested settlement is a link: tapping it opens a pre-filled payment. */
.row--action { text-decoration: none; cursor: pointer; }
.row--action:hover { background: var(--paper-2); }

/* ---------------------------------------------------------------------------
   Charts.

   Boxes with widths and heights on them, not SVG and not a charting library:
   the app pages render static SSR, and everything below works with no script
   at all — including the hover readouts, which are plain CSS.

   The mark specs are deliberate and worth keeping: bars capped at 24px so the
   slot always keeps some air, a 4px rounded data-end with the baseline end left
   square, a 2px gap of surface colour doing the separating instead of a border,
   and hairline solid rules. Series colours are not defined here — they come from
   ChartPalette, which is validated for colour-vision separation and shared with
   the phone.
   --------------------------------------------------------------------------- */

.charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 44px;
}

.charts > .chart--wide { grid-column: 1 / -1; }

@media (max-width: 940px) {
    .charts { grid-template-columns: 1fr; }
}

.chart {
    margin: 0;
    padding: 22px 24px 18px;
    background: var(--card);
    border: 1px solid var(--rule);
    border-radius: 6px;
}

.chart__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.chart__title {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--ink-2);
}

.chart__aside { font-size: 12px; color: var(--ink-3); }

.chart__empty { font-size: 14px; color: var(--ink-3); margin: 0; }

/* The legend is always present past one series; the direct labels on the marks
   supplement it rather than replace it. */
.chart__legend { display: flex; gap: 14px; flex-wrap: wrap; }

.key {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    color: var(--ink-2);
}

.key__swatch { width: 10px; height: 10px; border-radius: 2px; flex: none; }
.key__value { font-variant-numeric: tabular-nums; }
.key__share { color: var(--ink-3); }

/* --- Columns over time --- */

.chart__plot {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 150px;
    border-bottom: 1px solid var(--rule);
}

.col {
    position: relative;
    flex: 1 1 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
}

/* The fill colour is set inline from ChartPalette, not here: the palette is
   validated in one place and shared with the phone, and a hex in this file would
   be a second copy free to drift. */
.col__bar {
    display: block;
    width: 100%;
    max-width: 24px;
    border-radius: 4px 4px 0 0;
}

/* A day with nothing on it keeps its slot and shows a hairline on the baseline,
   so the columns stay spaced by time rather than by when money happened to move. */
.col--quiet .col__bar { height: 1px !important; background: var(--rule) !important; }

.col__value {
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    color: var(--ink-2);
    margin-bottom: 5px;
    white-space: nowrap;
}

/* The hover readout. Positioned over the plot and never inside a clipped box,
   so a long label at the edge is legible rather than cropped. */
.col__hover {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    padding: 5px 9px;
    background: var(--ink);
    color: var(--paper);
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .12s ease;
    z-index: 2;
}

.col:hover .col__hover { opacity: 1; }

.chart__axis { display: flex; gap: 2px; margin-top: 8px; }

.chart__tick {
    flex: 1 1 0;
    font-size: 10px;
    color: var(--ink-3);
    text-align: center;
    white-space: nowrap;
    overflow: visible;
}

/* Every chart has a table twin, so no value is reachable only by hovering. */
.chart__data { margin-top: 16px; font-size: 13px; }
.chart__data summary { cursor: pointer; color: var(--ink-3); font-size: 12px; }
.chart__data table { width: 100%; border-collapse: collapse; margin-top: 12px; }

.chart__data th,
.chart__data td {
    text-align: left;
    padding: 5px 0;
    border-bottom: 1px solid var(--rule);
    font-weight: 400;
}

.chart__data td { text-align: right; font-variant-numeric: tabular-nums; }

/* --- Horizontal bars, one row per person --- */

.barlist { display: flex; flex-direction: column; gap: 16px; }

.barlist__row {
    display: grid;
    grid-template-columns: minmax(96px, 150px) 1fr;
    align-items: center;
    gap: 16px;
}

.barlist__who {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 14px;
    min-width: 0;
}

.barlist__who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.barlist__bars { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.bar { display: flex; align-items: center; gap: 8px; }

.bar__fill {
    display: block;
    height: 10px;
    border-radius: 0 4px 4px 0;
    flex: none;
}

.bar__value {
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    color: var(--ink-2);
    white-space: nowrap;
}

/* --- One part-to-whole bar --- */

.stack {
    display: flex;
    gap: 2px;
    height: 26px;
    margin-bottom: 16px;
}

.stack__seg { display: block; height: 100%; border-radius: 2px; }

.stack__keys { display: flex; flex-wrap: wrap; gap: 8px 22px; }

/* ---------------------------------------------------------------------------
   The activity feed.
   --------------------------------------------------------------------------- */

.feed { list-style: none; margin: 0; padding: 0; }

.feed__item {
    display: grid;
    grid-template-columns: 104px 1fr auto;
    gap: 16px;
    align-items: baseline;
    padding: 12px 0;
    border-bottom: 1px solid var(--rule);
    font-size: 15px;
}

/* Times align in a column, so tabular figures earn their place here. */
.feed__when {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--ink-3);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.feed__what { color: var(--ink); }
.feed__amt { font-variant-numeric: tabular-nums; color: var(--ink-2); white-space: nowrap; }

@media (max-width: 620px) {
    .feed__item { grid-template-columns: 1fr auto; }
    .feed__when { grid-column: 1 / -1; }
}

/* A quiet row of downloads under the buttons: available, not advertised. */
.export {
    margin-top: 18px;
    font-size: 13px;
    color: var(--ink-3);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.export a { color: var(--ink-2); }
.export a:hover { color: var(--stamp); }

/* ---------------------------------------------------------------------------
   Sharing a trip.
   --------------------------------------------------------------------------- */

.share-grid { max-width: 560px; }

.row--share { align-items: center; }
.row--share form { margin: 0; }

.share-issued {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 20px 0 6px;
    border-bottom: 1px solid var(--rule);
    margin-bottom: 6px;
}

.share-issued__lede { margin: 0; font-size: 15px; color: var(--ink); }

.share-issued__field { display: block; width: 100%; }

/* Painted on white and given a margin of its own. A code drawn straight onto a
   tinted card, or butted against other ink, is the ordinary reason a scan fails. */
.qr {
    display: block;
    background: #fff;
    border: 1px solid var(--rule);
    border-radius: 4px;
    padding: 6px;
}

/* --- Stat tiles ---
   A count is not a chart. Four numbers get four tiles rather than a bar chart
   of four bars, which would encode as length something already written down. */

.tiles { display: flex; flex-wrap: wrap; gap: 30px; }

.tile { display: flex; flex-direction: column; gap: 4px; }

.tile__label {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--ink-3);
}

/* Proportional figures, not tabular: these stand alone rather than lining up in
   a column, and equal-width digits make a short number look loose at this size. */
.tile__value { font-size: 22px; font-weight: 500; color: var(--ink); }

/* The grain control. Links, not a dropdown — the page is server-rendered and
   ships no script, and each grain is a URL worth being able to share. */
.grain { display: inline-flex; gap: 4px; }

.grain a {
    font-size: 12px;
    padding: 3px 9px;
    border-radius: 999px;
    text-decoration: none;
    color: var(--ink-3);
    border: 1px solid transparent;
}

.grain a:hover { color: var(--ink-2); }

.grain a.is-active {
    color: var(--ink);
    border-color: var(--rule);
    background: var(--paper-2);
}
