/* Freehold Mail. World: Polder Parcels (see .impeccable/surfaces). Self-hosted only: system fonts, own icons. */

/* ---- Tokens ----------------------------------------------------------------------------------- */
:root {
    color-scheme: light;
    --ground: #eef3f6;          /* pale sky over the polder */
    --ground-2: #e1e9ee;        /* second neutral: panels, open rows */
    --surface: #ffffff;
    --ink: #17231c;
    --ink-2: #3f5046;
    --muted: #5b6b61;
    --line: #d6e0d9;
    --line-strong: #b4c4b9;

    --field: #1e5b3a;           /* the rail */
    --field-deep: #164a2e;
    --field-ink: #ecf3ee;
    --field-muted: #b0cdb9;
    --ditch: #2f6383;           /* links, focus, rules */
    --rape: #f0c02f;            /* primary action, selection */
    --rape-strong: #e0ad17;
    --rape-ink: #1d1805;
    --rape-wash: #fff6d6;       /* new mail, until seen */
    --tulip: #c23b27;           /* danger */
    --ok: #2e7d4f;
    /* Website: the field band, ditch water, and fixed ink on rapeseed */
    --web-field: #1e5b3a;
    --web-field-deep: #164a2e;
    --ditch-water: #8cbad8;
    --ditch-glint: #e8f4fb;
    --rape-edge: #b8890f;
    --night: #17231c;
    --night-hover: #2c3b31;

    /* One field colour per address, in this order. */
    --f0: #2e7d4f; --f1: #3c6e8f; --f2: #d9a816; --f3: #9a7352; --f4: #c9452f; --f5: #6f8f3a;
    /* Label colours: tags the user picks. Always drawn round; address colours are always square. */
    --l0: #8e4a9f; --l1: #1f7f7a; --l2: #d0603f; --l3: #4b55a6; --l4: #c03d78; --l5: #5f7d2a; --l6: #a07a3a; --l7: #5c6878;

    --radius: 6px;
    --radius-lg: 10px;
    --shadow: 0 1px 2px rgb(23 35 28 / .06), 0 4px 14px rgb(23 35 28 / .06);
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", "DejaVu Sans Mono", Menlo, monospace;
    --ease: cubic-bezier(.2, .8, .2, 1);
}

@media (prefers-color-scheme: dark) {
    /* The polder at dusk. */
    :root {
        color-scheme: dark;
        --ground: #0e1813;
        --ground-2: #16261d;
        --surface: #142219;
        --ink: #e4ede6;
        --ink-2: #c1cfc6;
        --muted: #9aaea2;
        --line: #26392e;
        --line-strong: #39523f;
        --field: #0c2116;
        --field-deep: #07170e;
        --field-ink: #dfeae2;
        --field-muted: #93b19d;
        --ditch: #8cbad8;
        --rape-wash: #373b1d;
        --tulip: #f08e7b;
        --ok: #6cc596;
        --web-field: #17402a;
        --web-field-deep: #0d2617;
        --f0: #5fbb86; --f1: #7aaccd; --f2: #f0c02f; --f3: #c9a27f; --f4: #ef7c65; --f5: #a5c56b;
        --l0: #c08ad0; --l1: #5cc4bd; --l2: #f08c6e; --l3: #8e98e6; --l4: #ec7fae; --l5: #a3c062; --l6: #d6b06b; --l7: #a3adbd;
        --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 6px 18px rgb(0 0 0 / .25);
    }
}

/* ---- Base and browser surfaces ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--line-strong) transparent; }
body {
    margin: 0; background: var(--ground); color: var(--ink);
    font: 400 16px/1.5 var(--font); caret-color: var(--ditch); accent-color: var(--field);
    display: flex; flex-direction: column; min-height: 100vh;
}
::selection { background: color-mix(in srgb, var(--rape) 55%, transparent); color: var(--ink); }
a { color: var(--ditch); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--ditch); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.015em; font-weight: 700; text-wrap: balance; }
p { text-wrap: pretty; }
code { font-family: var(--mono); font-size: .9em; background: var(--ground-2); padding: .1em .35em; border-radius: 4px; }
time, .count, .num, table td { font-variant-numeric: tabular-nums; }
.icon { width: 1.2em; height: 1.2em; flex: none; vertical-align: -.22em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap-anywhere { overflow-wrap: anywhere; word-break: break-word; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 12px; z-index: 20; background: var(--surface); padding: .5rem .9rem; border-radius: var(--radius); }

/* ---- Controls --------------------------------------------------------------------------------- */
.button, .tool {
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    font: 700 .9375rem/1 var(--font); text-decoration: none; cursor: pointer;
    min-height: 40px; padding: 0 1rem; border-radius: var(--radius);
    transition: background-color .16s var(--ease), border-color .16s var(--ease), color .16s var(--ease);
}
.button { background: var(--rape); color: var(--rape-ink); border: 1px solid var(--rape-strong); }
.button:hover { background: var(--rape-strong); color: var(--rape-ink); }
.button.ghost, .tool { background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); font-weight: 400; }
.button.ghost:hover, .tool:hover { border-color: var(--ink-2); background: var(--ground); }
.button.danger, .tool.danger:hover { background: var(--tulip); border-color: var(--tulip); color: #fff; }
.button.ghost.danger { background: var(--surface); color: var(--tulip); border-color: color-mix(in srgb, var(--tulip) 45%, var(--line-strong)); }
.button.ghost.danger:hover { background: color-mix(in srgb, var(--tulip) 8%, var(--surface)); border-color: var(--tulip); }
.button.small, .tool { min-height: 36px; padding: 0 .8rem; font-size: .875rem; }
.button.wide { width: 100%; }
.tool.icon-only { width: 36px; padding: 0; }
.tool.labelled .label { white-space: nowrap; }
.tool.flagged { color: var(--f2); }
button:disabled, .button[aria-disabled=true] { opacity: .55; cursor: not-allowed; }

input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], input:not([type]), select, textarea {
    font: inherit; color: var(--ink); background: var(--surface);
    border: 1px solid var(--line-strong); border-radius: var(--radius);
    min-height: 40px; padding: .5rem .75rem; width: 100%; min-width: 0;
    transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
textarea { line-height: 1.55; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ditch); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ditch) 25%, transparent); }
::placeholder { color: color-mix(in srgb, var(--muted) 85%, transparent); }
label { display: flex; flex-direction: column; gap: .35rem; font-weight: 700; font-size: .9375rem; }
label.check { flex-direction: row; align-items: flex-start; gap: .6rem; font-weight: 400; }
label.check input { margin-top: .3rem; width: 18px; height: 18px; }
label.option { flex-direction: row; align-items: flex-start; gap: .65rem; font-weight: 400; padding: .35rem 0; }
label.option input { margin-top: .3rem; width: 18px; height: 18px; }
.indent { margin-left: 1.7rem; margin-bottom: .5rem; }
.validation-message { color: var(--tulip); font-size: .875rem; margin: -.2rem 0 0; }

.stack { display: flex; flex-direction: column; gap: .9rem; }
.row { display: flex; gap: .6rem; align-items: flex-end; flex-wrap: wrap; }
.row .grow { flex: 1 1 14rem; }
.narrow-input { width: 6.5rem; }
.inline-form { display: inline; margin: 0; }

.notice { background: var(--rape-wash); color: var(--ink); border-radius: var(--radius); padding: .75rem 1rem; margin: .9rem 0; }
.notice.error { background: color-mix(in srgb, var(--tulip) 12%, var(--surface)); color: var(--tulip); }
.notice.success { background: color-mix(in srgb, var(--ok) 13%, var(--surface)); color: color-mix(in srgb, var(--ok) 80%, var(--ink)); }
.notice[hidden] { display: none; }

.badge { display: inline-block; font-size: .78rem; font-weight: 700; padding: .15rem .55rem; border-radius: 999px; background: color-mix(in srgb, var(--ok) 14%, var(--surface)); color: color-mix(in srgb, var(--ok) 85%, var(--ink)); vertical-align: middle; white-space: nowrap; }
.badge.frozen, .badge.degraded, .badge.leaving, .badge.closed { background: color-mix(in srgb, var(--tulip) 13%, var(--surface)); color: var(--tulip); }
.badge.pendingverification, .badge.verified, .badge.detached { background: var(--rape-wash); color: var(--ink); }

/* ---- Website (freeholdmail.com) --------------------------------------------------------------- */
@font-face {
    font-family: "Archivo";
    src: url("fonts/archivo-wdth.woff2") format("woff2");
    font-weight: 100 900; font-stretch: 62% 125%; font-display: swap;
}
.wrap { width: 100%; max-width: 76rem; margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .wrap { padding: 0 32px; } }
.brand-mark .plot-a { fill: var(--field); } .brand-mark .plot-b { fill: var(--rape); }
.brand-mark .plot-c { fill: var(--f5); } .brand-mark .plot-d { fill: var(--f1); }
.site-header { background: var(--ground); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 72px; flex-wrap: wrap; padding-top: .5rem; padding-bottom: .5rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--ink); text-decoration: none; font: 700 1.15rem/1 "Archivo", var(--font); font-stretch: 110%; }
.site-header nav { display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap; }
.site-header nav a:not(.button) { color: var(--ink-2); text-decoration: none; font-size: .95rem; }
.site-header nav a:not(.button):hover { color: var(--ink); text-decoration: underline; }
main { flex: 1; }
.site-main > .legal, .site-main > .narrow { width: 100%; max-width: 46rem; margin: 0 auto; padding: 2rem 16px 4rem; }
.display, .site-main h1 { font-family: "Archivo", var(--font); font-weight: 800; font-stretch: 120%; letter-spacing: -.03em; }
.lead { font-size: 1.25rem; line-height: 1.5; color: var(--ink-2); max-width: 44rem; }

.home-sky { padding: clamp(1.5rem, 5vh, 3.5rem) 0 clamp(2rem, 5vh, 3rem); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 24rem; gap: 2rem 3.5rem; align-items: center; }
.home-sky .display { font-size: clamp(3rem, 6.2vw, 6rem); line-height: .92; font-stretch: 125%; margin: 0 0 1.4rem; letter-spacing: -.035em; text-wrap: balance; }
.hero-copy .lead { margin: 0; max-width: 38rem; }

/* The invite plot: the one rapeseed field on the website. */
.claim { background: var(--rape); color: var(--rape-ink); border-radius: var(--radius); padding: 1.4rem 1.5rem 1.3rem; scroll-margin-top: 1rem; }
.claim h2 { font: 800 1.75rem/1.05 "Archivo", var(--font); font-stretch: 118%; margin: 0 0 .3rem; color: var(--rape-ink); }
.claim p { color: color-mix(in srgb, var(--rape-ink) 85%, transparent); }
.claim-form { display: flex; flex-direction: column; gap: .6rem; }
.claim-form > p:first-of-type { margin-bottom: .2rem; }
.claim-form label { color: var(--rape-ink); font-size: .875rem; gap: .25rem; }
.claim-form input, .claim-form textarea { background: #fff; border-color: var(--rape-edge); color: var(--night); min-height: 40px; }
details.note summary { cursor: pointer; font-size: .875rem; color: var(--rape-ink); width: fit-content; list-style: none; display: inline-flex; align-items: center; gap: .3rem; font-weight: 700; }
details.note summary::-webkit-details-marker { display: none; }
details.note summary .icon { transition: transform .16s var(--ease); }
details.note[open] summary .icon { transform: rotate(90deg); }
details.note[open] summary { margin-bottom: .4rem; }
.claim-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.button.dark { background: var(--night); border-color: var(--night); color: #fff; margin-top: .2rem; }
.button.dark:hover { background: var(--night-hover); color: #fff; }
.claim-small { font-size: .8rem; margin: .1rem 0 0; }
.claim-small a, .claim-done a { color: var(--rape-ink); }
.claim-error { background: #fff; color: var(--tulip); border-radius: 4px; padding: .45rem .6rem; font-size: .875rem; font-weight: 700; }
.claim-done h2 { margin-bottom: .5rem; }

/* The annotated inbox: real app markup laid out like a figure, numbered markers on the address panel's right
   edge, ditch-water leader lines to the notes. The figure's rows are a subgrid of the notes' rows, so each
   marker and its note start on the same line whatever the text length. */
.home-show { padding: .5rem 0 4.5rem; }
.annotated { display: grid; grid-template-columns: minmax(0, 1fr) 18.5rem; grid-template-rows: repeat(5, auto); column-gap: 3.8rem; }
.app-figure {
    grid-column: 1; grid-row: 1 / 6; margin: 0; display: grid; grid-template-columns: 13.5rem minmax(0, 1fr) 17.5rem; grid-template-rows: subgrid;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); font-size: .875rem;
}
/* The figure is a picture of the app: not selectable, no text cursor. The caption stays normal text. */
.app-figure > :not(figcaption) { -webkit-user-select: none; user-select: none; cursor: default; }
.app-figure .f0 { --pc: var(--f0); } .app-figure .f1 { --pc: var(--f1); } .app-figure .f2 { --pc: var(--f2); } .app-figure .f3 { --pc: var(--f3); }
.app-figure i { width: 12px; height: 12px; border-radius: 2px; flex: none; background: var(--pc); }
.af-rail { grid-column: 1; grid-row: 1 / 5; background: var(--web-field); color: var(--field-ink); padding: 1rem .75rem; display: flex; flex-direction: column; gap: .2rem; border-radius: var(--radius-lg) 0 0 0; min-width: 0; }
.af-brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; padding: .1rem .4rem .7rem; }
.af-rail .brand-mark .plot-a { fill: var(--field-ink); }
.af-write { display: flex; align-items: center; justify-content: center; gap: .45rem; background: var(--rape); color: var(--rape-ink); border-radius: var(--radius); min-height: 40px; font-weight: 700; margin-bottom: .5rem; }
.af-folder, .af-plot { display: flex; align-items: center; gap: .55rem; min-height: 34px; padding: 0 .55rem; border-radius: var(--radius); color: var(--field-ink); }
.af-folder .icon { color: var(--field-muted); }
.af-folder.on { background: var(--field-deep); font-weight: 700; } .af-folder.on .icon { color: var(--rape); }
.af-folder b { margin-left: auto; background: var(--rape); color: var(--rape-ink); border-radius: 999px; padding: 0 .5rem; font-size: .8rem; }
.af-caps { font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--field-muted); padding: 1rem .55rem .35rem; }
.af-plot { font-size: .8125rem; min-width: 0; }
.af-plot span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.af-rail i.f0 { background: #8fc0a2; }
.af-settings { margin-top: auto; padding-top: .6rem; border-top: 1px solid color-mix(in srgb, var(--field-ink) 18%, transparent); display: flex; flex-direction: column; gap: .2rem; }
.af-top { grid-column: 2 / 4; grid-row: 1; position: relative; min-width: 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent); }
.af-list { grid-column: 2; grid-row: 2 / 5; min-width: 0; }
.af-title { padding: 1.1rem 1rem 0; font-size: 1.6rem; font-weight: 700; line-height: 1.2; letter-spacing: -.02em; }
.af-search { display: flex; align-items: center; gap: .45rem; margin: .7rem 1rem .6rem; min-height: 38px; padding: 0 .7rem; background: var(--ground); border: 1px solid var(--line); border-radius: var(--radius); color: var(--muted); }
.af-parcels { display: flex; gap: .35rem; padding: 0 1rem .9rem; overflow: hidden; }
.af-parcels span { border-radius: var(--radius); padding: .35rem .6rem; font-weight: 700; font-size: .8125rem; white-space: nowrap; background: color-mix(in srgb, var(--pc) 22%, var(--surface)); border: 1px solid color-mix(in srgb, var(--pc) 60%, var(--surface)); }
.af-parcels .all { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.af-row { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; column-gap: .65rem; row-gap: .1rem; align-items: center; padding: .75rem 1rem; }
.af-row + .af-row { border-top: 1px solid color-mix(in srgb, var(--line) 55%, transparent); }
.af-row b { font-weight: 400; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.af-row time { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.af-row strong, .af-row span { grid-column: 2 / 4; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.af-row strong { font-weight: 400; }
.af-row span { color: var(--muted); font-size: .8125rem; }
.af-row.new { background: var(--rape-wash); } .af-row.new b, .af-row.new strong { font-weight: 700; }
.af-panel { grid-column: 3; grid-row: 2 / 5; display: grid; grid-template-rows: subgrid; border-left: 1px solid var(--ditch); min-width: 0; }
.af-block { position: relative; padding: 1rem 2rem 1.1rem 1.2rem; min-width: 0; }
.af-block + .af-block { border-top: 1px solid var(--line); }
.af-block p { margin: .45rem 0 0; color: var(--muted); font-size: .8125rem; }
.af-block .af-label { margin: 0 0 .5rem; color: var(--ink); font-weight: 700; font-size: .8125rem; }
.af-block .af-path { margin: 0 0 .6rem; font-size: .8rem; color: var(--muted); }
.af-addr { display: flex; align-items: center; gap: .55rem; min-width: 0; }
.af-addr strong { overflow-wrap: anywhere; }
.af-radio { display: flex; align-items: center; gap: .55rem; min-height: 28px; }
.af-radio::before { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--line-strong); background: var(--surface); flex: none; }
.af-radio.on::before { border-color: var(--ink); background: radial-gradient(circle, var(--ink) 0 4px, var(--surface) 4.5px); }
.af-switch { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.af-switch span:last-child { min-width: 0; overflow-wrap: anywhere; font-size: .8125rem; }
.af-toggle { position: relative; width: 34px; height: 20px; border-radius: 999px; background: var(--line-strong); flex: none; }
.af-toggle::after { content: ""; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); }
.af-button { display: inline-flex; align-items: center; gap: .45rem; min-height: 36px; padding: 0 .8rem; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); white-space: nowrap; }
.af-button.danger { background: var(--tulip); border-color: var(--tulip); color: #fff; font-weight: 700; }
.af-mark, .note-n { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 4px; background: var(--ditch-water); color: var(--web-field-deep); font-weight: 700; font-variant-numeric: tabular-nums; }
/* Each annotated part, its water line, the marker on the edge and the note share one axis (--mark-y from the block's top). */
.m1 { --mark-y: 8.16rem; } .m2 { --mark-y: 5.4rem; } .m3 { --mark-y: 6.34rem; } .m4 { --mark-y: 5.7rem; }
.af-mark { position: absolute; top: calc(var(--mark-y) - 1rem); right: -1rem; z-index: 2; box-shadow: 0 0 0 4px var(--ground); }
.af-at { display: flex; align-items: center; }
.af-at::after { content: ""; flex: 1 1 1rem; min-width: 1rem; height: 2px; margin: 0 -2rem 0 .7rem; background: var(--ditch-water); }
.af-parcels.af-at::after { margin-right: -1rem; }
.app-figure figcaption { grid-column: 1 / -1; grid-row: 5; padding: .65rem 1rem; color: var(--muted); font-size: .8rem; border-top: 1px solid var(--line); }
.notes { display: contents; list-style: none; }
.notes li { position: relative; grid-column: 2; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; padding: calc(var(--mark-y) - 1rem) 0 1.4rem; }
.notes li.m1 { margin-bottom: -4rem; } /* its marker sits low in the top bar; let the text run on instead of stretching the bar */
.notes .note-n { display: none; } /* the marker on the figure carries the number; phones show it here */
.notes li:nth-child(1) { grid-row: 1; } .notes li:nth-child(2) { grid-row: 2; } .notes li:nth-child(3) { grid-row: 3; } .notes li:nth-child(4) { grid-row: 4; }
.notes li::before { content: ""; position: absolute; top: calc(var(--mark-y) - 1px); left: -2.8rem; width: 2.5rem; height: 2px; background: var(--ditch-water); }
.notes h3 { margin: .3rem 0 .35rem; font: 700 1.2rem/1.15 "Archivo", var(--font); font-stretch: 110%; }
.notes p { margin: 0; color: var(--ink-2); font-size: .9375rem; }

.home-field { background: var(--web-field); color: var(--field-ink); padding: 3.5rem 0 3.6rem; }
.field-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .6rem 3rem; margin-bottom: 2rem; }
.field-head h2 { color: #fff; margin: 0; }
.field-head p { margin: 0; max-width: 30rem; color: var(--field-muted); font-size: 1rem; }
.way-out { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.1rem; position: relative; }
.way-out::before, .way-out::after { content: ""; position: absolute; left: 1.4rem; right: 1.4rem; top: 2.3rem; height: 3px; border-radius: 2px; z-index: 1; pointer-events: none; }
.way-out::before { background: var(--ditch-water); }
.way-out::after { /* one pulse of water runs along the way out as the band scrolls into view; still where unsupported */
    width: 9rem; right: auto; z-index: 2; background: linear-gradient(90deg, transparent, var(--ditch-glint), transparent); opacity: 0;
}
@supports (animation-timeline: view()) {
    .way-out::after { animation: ditch-pulse linear both; animation-timeline: view(); animation-range: entry 40% cover 45%; }
}
@keyframes ditch-pulse { from { transform: translateX(0); opacity: 0; } 15% { opacity: 1; } to { transform: translateX(min(64vw, 60rem)); opacity: 0; } }
.way-out > li { position: relative; background: var(--web-field-deep); border-radius: var(--radius); padding: 1.3rem 1.3rem 1.4rem; display: flex; flex-direction: column; align-items: flex-start; }
.way-out .ui-chip { margin-top: auto; }
.step-n { position: relative; z-index: 3; display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 4px; background: var(--ditch-water); color: var(--web-field-deep); box-shadow: 0 0 0 4px var(--web-field-deep); font-weight: 700; }
.way-out h3 { font: 700 1.5rem/1.1 "Archivo", var(--font); font-stretch: 112%; margin: 1.1rem 0 .5rem; color: #fff; }
.way-out p { margin: 0 0 1rem; color: var(--field-muted); font-size: 1rem; }
.ui-chip { display: inline-flex; align-items: center; gap: .45rem; background: color-mix(in srgb, var(--web-field-deep) 55%, #000); color: var(--field-ink); border-radius: 4px; padding: .4rem .6rem; font-size: .8rem; }

.field-head h2, .home-promises h2, .home-who h2 { font: 800 clamp(1.7rem, 3vw, 2.4rem)/1.08 "Archivo", var(--font); font-stretch: 112%; letter-spacing: -.02em; }
.home-promises h2, .home-who h2 { margin: 0 0 1rem; }

.home-promises { background: var(--surface); padding: 4.5rem 0; border-top: 1px solid var(--ditch); }
.promise-list { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); margin: 1.6rem 0 0; }
.promise-list dt, .promise-list dd { padding: 1.05rem 0; border-top: 1px solid color-mix(in srgb, var(--ditch) 30%, transparent); margin: 0; }
.promise-list dt { font-weight: 700; font-size: 1.15rem; padding-right: 2rem; }
.promise-list dd { color: var(--ink-2); }
.promise-list dd a { white-space: nowrap; margin-left: .3rem; }

.home-who { padding: 4rem 0; }
.who-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
.who-grid h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
.who-grid p { color: var(--ink-2); font-size: 1rem; margin: 0; }

.home-close { background: var(--web-field); color: var(--field-ink); padding: 2.4rem 0; }
.close-row { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem 3rem; flex-wrap: wrap; }
.close-row p { margin: 0; max-width: 46rem; font-size: 1rem; }
.close-row strong { color: #fff; }

/* Help: start from the situation, answer in numbered steps with the app's buttons drawn as they look. */
.help-sky { padding: clamp(1.8rem, 5vh, 3.2rem) 0 3rem; }
.help-sky h1 { font-size: clamp(2.3rem, 5vw, 3.6rem); line-height: 1; letter-spacing: -.03em; margin: 0 0 .9rem; text-wrap: balance; }
.help-index { display: grid; gap: 2.2rem; margin-top: 2.4rem; max-width: 52rem; }
.help-index h2 { font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 .55rem; }
.help-index ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid color-mix(in srgb, var(--ditch) 30%, transparent); }
.qa { border-bottom: 1px solid color-mix(in srgb, var(--ditch) 30%, transparent); }
.qa summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 52px; padding: .7rem .3rem; cursor: pointer; color: var(--ink); font-weight: 700; font-size: 1.05rem; transition: color .16s var(--ease), background-color .16s var(--ease); }
.qa summary::-webkit-details-marker { display: none; }
.qa summary .icon { flex: none; color: var(--ditch); transition: transform .16s var(--ease); }
.qa summary:hover { color: var(--ditch); background: color-mix(in srgb, var(--ditch) 6%, transparent); }
.qa summary:focus-visible { outline: 2px solid var(--ditch); outline-offset: 2px; }
.qa[open] summary .icon { transform: rotate(90deg); }
.qa[open] summary { color: var(--ditch); }
.qa-body { padding: .3rem .3rem 1.6rem; }
.qa-body > p { margin: 0 0 1rem; color: var(--ink-2); }
.help-steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; gap: 1rem; }
.help-steps li { counter-increment: step; position: relative; padding-left: 2.9rem; min-height: 2rem; line-height: 1.7; }
.help-steps li::before { content: counter(step); position: absolute; left: 0; top: .05rem; display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 4px; background: var(--ditch-water); color: var(--web-field-deep); font-weight: 700; font-variant-numeric: tabular-nums; }
.ui-btn { display: inline-block; padding: 0 .55rem; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); box-shadow: 0 1px 0 var(--line-strong); font-weight: 700; font-size: .9em; line-height: 1.6; white-space: nowrap; }
.ui-path, .ui-choice { font-weight: 700; color: var(--ink); }
.ui-link { color: var(--ditch); text-decoration: underline; text-underline-offset: .2em; }
.help-aside { margin: 1.2rem 0 0; padding: .75rem 1rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); font-size: .9375rem; }
.help-settings { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .55rem 1.2rem; margin: 1rem 0 0 2.9rem; padding: 1rem 1.1rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); font-size: .9375rem; }
.help-settings dt { font-weight: 700; }
.help-settings dd { margin: 0; overflow-wrap: anywhere; }
.help-settings code { font-size: .95em; }
.help-close { background: var(--web-field); color: var(--field-ink); padding: 2.6rem 0; }
.help-close strong { color: #fff; }
.help-mail { font: 800 clamp(1.3rem, 3vw, 1.9rem)/1.1 "Archivo", var(--font); font-stretch: 112%; color: #fff; text-underline-offset: .2em; overflow-wrap: anywhere; }
.help-mail:hover { color: var(--field-ink); }

.narrow { max-width: 40rem; padding: 2rem 0; }
.legal { max-width: 46rem; }
.legal h1 { font-size: clamp(2rem, 5vw, 2.8rem); margin: .4rem 0 1.25rem; }
.legal h2 { font-size: 1.3rem; margin-top: 2.25rem; }
.legal li { margin: .3rem 0; }
.legal table { width: 100%; border-collapse: collapse; font-size: .92rem; margin: 1rem 0; display: block; overflow-x: auto; }
.legal th, .legal td { border-bottom: 1px solid var(--line); padding: .55rem .6rem; text-align: left; vertical-align: top; }
.legal th { background: var(--ground-2); font-weight: 700; }
.legal table:has(thead th:empty) thead { display: none; }
.draft-note { display: inline-block; background: var(--rape-wash); font-size: .85rem; padding: .25rem .7rem; border-radius: 999px; margin: 0; }
.site-footer { background: var(--field-deep); color: var(--field-muted); font-size: .92rem; padding: 2.2rem 0; }
.footer-grid { display: flex; justify-content: space-between; gap: 1.5rem 3rem; flex-wrap: wrap; }
.footer-grid p { margin: .3rem 0 0; }
.footer-grid strong { color: var(--field-ink); }
.site-footer nav { display: flex; flex-direction: column; gap: .25rem; }
.site-footer a { color: var(--field-ink); }
.site-footer a:hover { color: #fff; }

@media (max-width: 1080px) {
    .app-figure { grid-template-columns: minmax(0, 1fr) 16rem; }
    .af-rail { display: none; }
    .af-list { grid-column: 1; }
    .af-panel { grid-column: 2; }
    .af-list { border-radius: var(--radius-lg) 0 0 0; }
}
@media (max-width: 900px) {
    .hero-grid { grid-template-columns: minmax(0, 1fr); }
    .claim { max-width: 32rem; }
    .annotated { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
    .app-figure { grid-row: auto; grid-template-columns: minmax(0, 1fr); grid-template-rows: none; overflow: hidden; }
    .af-top, .af-list, .af-panel, .app-figure figcaption { grid-column: 1; grid-row: auto; }
    .af-parcels { padding-right: 3.4rem; }
    .af-panel { display: block; border-left: 0; border-top: 1px solid var(--ditch); }
    .af-mark { right: .8rem; box-shadow: none; }
    .af-block .af-mark { top: .9rem; }
    .af-at::after { display: none; }
    .af-row:nth-child(n+6) { display: none; }
    .notes { display: flex; flex-direction: column; margin: 1.6rem 0 0; padding: 0; }
    .notes li, .notes li:nth-child(n) { grid-row: auto; grid-column: auto; margin-bottom: 0; grid-template-columns: 2rem minmax(0, 1fr); column-gap: .8rem; padding: .7rem 0; }
    .notes .note-n { display: inline-grid; }
    .notes h3, .notes p { grid-column: 2; }
    .notes li::before { display: none; }
    .way-out { grid-template-columns: 1fr; padding-left: 1.6rem; }
    .way-out::before { left: .45rem; right: auto; top: 0; bottom: 0; width: 3px; height: auto; }
    .way-out::after { display: none; }
    .who-grid { grid-template-columns: 1fr; gap: 2rem; }
    .help-settings { grid-template-columns: minmax(0, 1fr); margin-left: 0; gap: .15rem; }
    .help-settings dd + dt { margin-top: .5rem; }
    .promise-list { grid-template-columns: 1fr; }
    .promise-list dd { border-top: 0; padding-top: 0; }
}
@media (max-width: 520px) {
    .site-header nav { gap: .9rem; }
    .claim { padding: 1.2rem 1.1rem; }
}
@media (prefers-reduced-motion: reduce) { .way-out::after { display: none; } }

/* Sign-in and signup (website layout) */
.auth-card { width: calc(100% - 32px); max-width: 27rem; margin: 2.5rem auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.8rem 1.7rem; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 1.6rem; margin-top: 0; }
.divider { display: flex; align-items: center; gap: .7rem; color: var(--muted); font-size: .875rem; margin: 1.2rem 0; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

/* ---- App shell: the field-green rail ---------------------------------------------------------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; flex: 1; }
.shell > *, .mailview > *, .rail > * { min-width: 0; }
.rail {
    background: var(--field); color: var(--field-ink);
    position: sticky; top: 0; height: 100vh; overflow-y: auto; scrollbar-color: var(--field-muted) transparent;
    display: flex; flex-direction: column; gap: 1.1rem; padding: 1.1rem .8rem 1rem;
}
.rail a { color: var(--field-ink); text-decoration: none; }
.rail-top { display: flex; align-items: center; justify-content: space-between; }
.rail-brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1.08rem; padding: .3rem .5rem; }
.rail .brand-mark .plot-a { fill: var(--field-ink); } .rail .brand-mark .plot-c { fill: #8fc0a2; } .rail .brand-mark .plot-d { fill: #7fa9c6; }
.rail-menu { display: none; }
.rail-write {
    display: flex; align-items: center; justify-content: center; gap: .5rem; min-height: 44px;
    background: var(--rape); color: var(--rape-ink) !important; font-weight: 700; border-radius: var(--radius);
    transition: background-color .16s var(--ease);
}
.rail-write:hover { background: var(--rape-strong); }
.rail-folders { display: flex; flex-direction: column; gap: 2px; }
.rail-folders a, .rail-settings a {
    display: flex; align-items: center; gap: .7rem; min-height: 40px; padding: 0 .7rem; border-radius: var(--radius);
    transition: background-color .16s var(--ease);
}
.rail-folders a:hover, .rail-settings a:hover { background: color-mix(in srgb, var(--field-deep) 70%, transparent); }
.rail-folders a.on, .rail-settings a.active { background: var(--field-deep); font-weight: 700; }
.rail-folders a.on .icon, .rail-settings a.active .icon { color: var(--rape); }
.rail-folders .name { flex: 1; }
.rail-folders a.depth-1 { padding-left: 1.9rem; } .rail-folders a.depth-2 { padding-left: 3.1rem; } .rail-folders a.depth-3 { padding-left: 4.3rem; }
.rail-folders a.rail-manage { color: var(--field-muted); font-size: .875rem; }
.rail-folders a.rail-manage .icon { opacity: .8; }
.rail-folders .count { font-size: .8rem; font-weight: 700; background: var(--rape); color: var(--rape-ink); border-radius: 999px; padding: .05rem .5rem; }
.rail-plots h2 { font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--field-muted); margin: 0 .7rem .45rem; }
.rail-plots .plot { display: flex; align-items: center; gap: .6rem; min-height: 34px; padding: 0 .7rem; border-radius: var(--radius); font-size: .875rem; }
.rail-plots .plot:hover { background: color-mix(in srgb, var(--field-deep) 70%, transparent); }
.rail-plots .addr { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.swatch { width: 10px; height: 18px; border-radius: 2px; flex: none; background: var(--field-muted); }
.f0 .swatch, .mark.f0 { background: var(--f0); } .f1 .swatch, .mark.f1 { background: var(--f1); }
.f2 .swatch, .mark.f2 { background: var(--f2); } .f3 .swatch, .mark.f3 { background: var(--f3); }
.f4 .swatch, .mark.f4 { background: var(--f4); } .f5 .swatch, .mark.f5 { background: var(--f5); }
.rail .f0 .swatch { background: #8fc0a2; }
.rail-bottom { margin-top: auto; border-top: 1px solid color-mix(in srgb, var(--field-ink) 18%, transparent); padding-top: .8rem; display: flex; flex-direction: column; gap: 2px; }
.rail-settings .icon { color: var(--field-muted); }
.signout { display: flex; flex-direction: column; gap: .2rem; margin: .5rem .7rem 0; }
.signout .who { font-size: .8rem; color: var(--field-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.signout button { all: unset; display: inline-flex; align-items: center; gap: .5rem; cursor: pointer; color: var(--field-ink); font-size: .9rem; padding: .3rem 0; }
.signout button:hover { text-decoration: underline; }
.signout button:focus-visible { outline: 2px solid var(--rape); }
.rail :focus-visible { outline-color: var(--rape); }

.work { min-width: 0; padding: 1.8rem 2.2rem 3rem; }
.work:has(> .mailview) { padding: 0; }
.work > h1 { font-size: 1.75rem; margin: .2rem 0 .6rem; overflow-wrap: anywhere; }
.work h2 { font-size: 1.15rem; margin: 0 0 .5rem; }
.work > p:first-child > a, .back { display: inline-flex; align-items: center; gap: .35rem; text-decoration: none; font-size: .9rem; }

/* Account pages */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.3rem 1.4rem; margin: 1rem 0; }
.card.hint { background: var(--rape-wash); border-color: transparent; }
.grid.two { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; margin: 0 0 1rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
table.list { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: .95rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
table.list .num { text-align: right; font-variant-numeric: tabular-nums; }
table.list th, table.list td { text-align: left; padding: .65rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list th { color: var(--muted); font-weight: 700; font-size: .82rem; background: var(--ground-2); }
table.list td { overflow-wrap: anywhere; }
table.list tr:last-child td { border-bottom: 0; }
tr.dim td { opacity: .55; }
.table-scroll { overflow-x: auto; }
table.records code { font-size: .82rem; }
.pass { color: var(--ok); font-weight: 700; }
.fail { color: var(--tulip); font-weight: 700; }
ul.checks { list-style: none; padding: 0; margin: .5rem 0; }
ul.checks li.pass::before { content: "✓ "; }
ul.checks li.fail::before { content: "✗ "; }
ul.rows { list-style: none; padding: 0; margin: .5rem 0 1rem; }
ul.rows li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.row-actions { display: flex; gap: .5rem; flex-wrap: wrap; flex: none; }
/* Labels: round dots and pills (address markers are square, so the two never read alike). */
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--l7); }
.dot.big { width: 14px; height: 14px; }
.dot.l0 { background: var(--l0); } .dot.l1 { background: var(--l1); } .dot.l2 { background: var(--l2); } .dot.l3 { background: var(--l3); }
.dot.l4 { background: var(--l4); } .dot.l5 { background: var(--l5); } .dot.l6 { background: var(--l6); } .dot.l7 { background: var(--l7); }
.label-chips { display: inline-flex; flex-wrap: wrap; gap: .3rem; margin-left: .45rem; vertical-align: 1px; }
.label-chip { display: inline-flex; align-items: center; gap: .3rem; padding: 0 .45rem; border: 1px solid var(--line-strong); border-radius: 999px; font-size: .72rem; font-weight: 700; line-height: 1.5; color: var(--ink-2); background: var(--surface); white-space: nowrap; }
.label-chip .dot { width: 7px; height: 7px; }
.subject + .label-chips { display: flex; margin: .4rem 0 0; }
.rail-labels { margin-top: .4rem; }
.rail-labels .plot .dot { margin: 0 .1rem; }
.rail-labels .manage { color: var(--field-muted); }
.rail .dot.l0 { background: #c08ad0; } .rail .dot.l1 { background: #5cc4bd; } .rail .dot.l2 { background: #f08c6e; } .rail .dot.l3 { background: #8e98e6; }
.rail .dot.l4 { background: #ec7fae; } .rail .dot.l5 { background: #a3c062; } .rail .dot.l6 { background: #d6b06b; } .rail .dot.l7 { background: #a3adbd; }
.colour-choice { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.colour-choice legend { font-weight: 700; font-size: .9375rem; margin-bottom: .35rem; padding: 0; }
.colour-choice label { position: relative; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; }
.colour-choice input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.colour-choice .dot { width: 20px; height: 20px; }
.colour-choice input:checked + .dot { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--ink); }
.colour-choice input:focus-visible + .dot { outline: 2px solid var(--ditch); outline-offset: 4px; }
.label-rows li { align-items: flex-start; flex-wrap: wrap; }
.label-rows form { flex: 1 1 22rem; }
.label-rows .row { align-items: center; }
/* Quick filters and saved views above the message list */
.quick-filters { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; padding: 0 1.3rem .8rem; }
.chip { display: inline-flex; align-items: center; gap: .35rem; min-height: 32px; padding: 0 .7rem; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--ink-2); text-decoration: none; font-size: .8125rem; font-weight: 700; background: var(--surface); }
.chip .icon { width: 15px; height: 15px; }
.chip:hover { border-color: var(--ink-2); color: var(--ink); }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.save-view { display: flex; gap: .35rem; margin-left: auto; }
.save-view input { min-height: 32px; padding: .2rem .6rem; width: 11rem; font-size: .875rem; }
.save-view .tool { min-height: 32px; }
.view-note { margin: 0 1.3rem .8rem; }
.rail-views .plot .icon { width: 15px; height: 15px; color: var(--field-muted); }
@media (max-width: 600px) { .save-view { margin-left: 0; width: 100%; } .save-view input { flex: 1; width: auto; } }

/* Arrange the menu */
.arrange li { flex-wrap: wrap; }
.arrange li.depth-1 { padding-left: 1.5rem; } .arrange li.depth-2 { padding-left: 3rem; } .arrange li.depth-3 { padding-left: 4.5rem; }
.arrange li.is-hidden .arrange-name { color: var(--muted); }
.arrange-name { min-width: 0; overflow-wrap: anywhere; }

/* Filters */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.page-head h1 { margin-bottom: .4rem; }
.filter-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; }
.filter-list li { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem 1.5rem; flex-wrap: wrap; margin: 0; }
.filter-list li.off .filter-text { opacity: .65; }
.filter-text { flex: 1 1 22rem; min-width: 0; }
.filter-text p { margin: .15rem 0; overflow-wrap: anywhere; }
.filter-name { display: block; margin-bottom: .2rem; }
.filter-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.filter-form { display: grid; gap: 1rem; max-width: 52rem; }
.filter-form .card { margin: 0; }
.conditions { list-style: none; margin: .9rem 0 .5rem; padding: 0; display: grid; gap: .6rem; }
.conditions li { display: grid; grid-template-columns: 11rem 10rem minmax(0, 1fr); gap: .5rem; }
.conditions label { font-weight: 400; }
.inline-label { display: inline-flex; font-weight: 400; }
.then { display: grid; gap: .7rem; }
.then .check span { display: inline-flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.then select { width: auto; min-width: 12rem; }
.crumb { margin: 0 0 .4rem; }
.crumb a { display: inline-flex; align-items: center; gap: .3rem; font-size: .875rem; }
.make-filter { display: inline-flex; align-items: center; gap: .35rem; margin-top: .45rem; font-size: .8125rem; color: var(--ditch); }
@media (max-width: 600px) { .conditions li { grid-template-columns: 1fr 1fr; } .conditions li .grow { grid-column: 1 / -1; } }
.folder-rows li { flex-wrap: wrap; align-items: flex-end; }
.folder-rows li.depth-1 { padding-left: 1.5rem; } .folder-rows li.depth-2 { padding-left: 3rem; } .folder-rows li.depth-3 { padding-left: 4.5rem; }
.folder-rows form { flex: 1 1 20rem; }
.folder-side { display: flex; align-items: center; gap: .8rem; flex: none; }
.request-note { margin: .3rem 0 .2rem; color: var(--ink-2); overflow-wrap: anywhere; }
.message-empty { margin: 1.2rem 0 0; color: var(--muted); }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 0 0 1.1rem; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; }
.segmented a { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 44px; padding: .45rem .6rem; color: var(--ink); text-decoration: none; font-size: .875rem; line-height: 1.25; }
.segmented a + a { border-left: 1px solid var(--line-strong); }
.segmented a:hover { background: var(--ground); }
.segmented a[aria-current] { background: var(--ink); color: var(--surface); font-weight: 700; }
.recovery-key h2 { margin-top: 0; }
.recovery-key-code { margin: .8rem 0; text-align: center; font-size: 1.2rem; letter-spacing: .08em; padding: .8rem; border: 1px dashed var(--line-strong); border-radius: var(--radius); }
ul.rows li > div { min-width: 0; overflow-wrap: anywhere; }
.address-input { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.address-input input, .address-input select { flex: 1 1 6rem; width: auto; }
.address-input > span { font-weight: 400; }
.optional { font-weight: 400; }
.secret { background: var(--rape-wash); border-radius: var(--radius); padding: .9rem 1rem; margin: .8rem 0; }
.secret p { margin: 0 0 .4rem; }
code.big { display: block; font-size: 1.05rem; padding: .55rem .65rem; background: var(--surface); user-select: all; }
details.fates { margin: .8rem 0; }
details.fates summary { cursor: pointer; color: var(--ditch); }
.steps-list li { margin: .3rem 0; }

/* Sign-in settings: hints under fields, the setup steps, the QR code and recovery codes. */
.stack > .field-hint { margin: -.55rem 0 0; }
.stack.separated { margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
details.note > .stack:first-of-type { margin-top: .9rem; }
ol.steps { margin: .4rem 0 0; padding-left: 1.3rem; display: grid; gap: 1.1rem; }
ol.steps li { padding-left: .25rem; }
ol.steps li::marker { font-weight: 700; color: var(--ditch); }
ol.steps .row { margin-top: .6rem; max-width: 22rem; }
.qr-box { display: flex; gap: 1.1rem; align-items: center; flex-wrap: wrap; margin-top: .6rem; }
.qr-box p { flex: 1 1 14rem; margin: 0; min-width: 0; }
svg.qr { width: 184px; height: 184px; flex: none; border-radius: var(--radius); border: 1px solid var(--line); }
.card.recovery { border-color: var(--rape-strong); background: var(--rape-wash); }
ol.codes { list-style: none; margin: .9rem 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: .4rem .9rem; counter-reset: code; }
ol.codes li { counter-increment: code; display: flex; align-items: baseline; gap: .5rem; }
ol.codes li::before { content: counter(code) "."; color: var(--muted); font-size: .8rem; min-width: 1.4em; text-align: right; }
ol.codes code { font-size: 1rem; letter-spacing: .02em; background: var(--surface); padding: .2rem .45rem; border-radius: 6px; user-select: all; }
@media print {
    body:has(.card.recovery) :is(.rail, .card:not(.recovery), .notice) { display: none !important; }
    .card.recovery { border: 0; background: none; }
}
.footer-inline { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ---- Inbox ------------------------------------------------------------------------------------ */
.mailview { display: grid; grid-template-columns: minmax(340px, 30rem) 1fr; height: 100vh; }
.list-pane { display: flex; flex-direction: column; min-width: 0; overflow-y: auto; background: var(--surface); border-right: 1px solid var(--ditch); }
.list-pane > * { flex-shrink: 0; } /* the pane scrolls as a whole; a sideways-scrolling parcel strip must not be squeezed */
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.3rem 1.3rem .9rem; }
.list-head h1 { margin: 0; font-size: 1.9rem; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search { position: relative; flex: 0 1 15rem; }
.search .icon { position: absolute; left: .65rem; top: 50%; translate: 0 -50%; color: var(--muted); pointer-events: none; }
.search input { padding-left: 2.1rem; background: var(--ground); border-color: var(--line); }

.parcels { display: flex; gap: .5rem; overflow-x: auto; padding: 0 1.3rem .9rem; scrollbar-width: none; mask-image: linear-gradient(to right, #000 calc(100% - 1.3rem), transparent); }
.parcels::-webkit-scrollbar { display: none; }
.parcel {
    flex: 1 0 auto; min-width: 7.5rem; display: flex; flex-direction: column; gap: .15rem;
    padding: .55rem .75rem; border-radius: var(--radius); text-decoration: none; color: var(--ink);
    background: color-mix(in srgb, var(--pc, var(--ink)) 22%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--pc, var(--ink)) 60%, var(--surface));
    transition: background-color .16s var(--ease), color .16s var(--ease);
}
.parcel .addr { font-weight: 700; font-size: .875rem; white-space: nowrap; display: flex; align-items: center; gap: .45rem; }
.parcel .block { width: 12px; height: 12px; border-radius: 2px; background: var(--pc, var(--ink)); flex: none; }
.parcel.on .block { background: #fff; }
.parcel.f2.on .block, .parcel.all.on .block { background: currentColor; }
.parcel .at { font-weight: 400; color: var(--muted); }
.parcel .num { font-size: .8rem; color: var(--ink-2); }
.parcel:hover { background: color-mix(in srgb, var(--pc, var(--ink)) 32%, var(--surface)); }
.parcel.on { background: var(--pc, var(--ink)); border-color: var(--pc, var(--ink)); color: #fff; }
.parcel.on .at, .parcel.on .num { color: color-mix(in srgb, #fff 82%, transparent); }
.parcel.f2.on, .parcel.f2.on .at, .parcel.f2.on .num { color: var(--rape-ink); }
.parcel.all.on { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.parcel.all.on .num { color: color-mix(in srgb, var(--surface) 80%, transparent); }
.parcel.f0 { --pc: var(--f0); } .parcel.f1 { --pc: var(--f1); } .parcel.f2 { --pc: var(--f2); }
.parcel.f3 { --pc: var(--f3); } .parcel.f4 { --pc: var(--f4); } .parcel.f5 { --pc: var(--f5); }

.list-pane > .notice { margin: 0 1.3rem .8rem; }
.bulk { display: flex; align-items: center; gap: .4rem; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; mask-image: linear-gradient(to right, #000 calc(100% - 1.3rem), transparent); padding: .55rem 1.3rem .55rem 1rem; border-top: 1px solid var(--ditch); border-bottom: 1px solid color-mix(in srgb, var(--ditch) 35%, transparent); background: var(--surface); position: sticky; top: 0; z-index: 1; }
.check-all { display: inline-flex; padding: 0 .3rem; }
.bulk .tool { min-height: 40px; font-size: .875rem; flex: none; }

ul.messages { list-style: none; margin: 0; padding: 0; }
.msg { display: flex; align-items: flex-start; border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent); transition: background-color .16s var(--ease), box-shadow .16s var(--ease); }
.msg > .pick { display: grid; place-items: center; width: 44px; min-height: 44px; margin: .3rem 0 0 .4rem; flex: none; cursor: pointer; }
.msg > .pick input { width: 18px; height: 18px; margin: 0; }
.msg > a {
    flex: 1; min-width: 0; display: grid; grid-template-columns: 12px 1fr auto; column-gap: .65rem; row-gap: .1rem;
    grid-template-areas: "mark who meta" ". subject subject" ". preview preview";
    padding: .8rem 1.3rem .8rem .6rem; color: var(--ink); text-decoration: none;
}
.msg:hover { background: var(--ground); }
.msg.new { background: var(--rape-wash); }
.msg.open { background: var(--ground-2); box-shadow: inset 0 0 0 2px var(--rape); }
.msg.open .mark { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--rape); }
.mark { grid-area: mark; width: 12px; height: 12px; border-radius: 2px; margin-top: .3rem; }
.mark.none { background: transparent; border: 1.5px solid var(--line-strong); }
.msg .who { grid-area: who; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg .subject { grid-area: subject; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9375rem; }
.msg .preview { grid-area: preview; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: .875rem; }
.msg.new .who, .msg.new .subject { font-weight: 700; }
.msg .meta { grid-area: meta; display: flex; align-items: center; gap: .35rem; color: var(--muted); font-size: .8rem; }
.msg .flagged { color: var(--f2); }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .9rem 1.3rem; font-size: .875rem; color: var(--muted); }
.pager a { display: inline-flex; align-items: center; gap: .3rem; }
.empty { padding: 3rem 1.6rem; text-align: center; color: var(--muted); }
.empty-title { font-size: 1.1rem; font-weight: 700; color: var(--ink); margin-bottom: .3rem; }

.reader-pane { min-width: 0; overflow-y: auto; background: var(--ground); }
.reader-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem; padding: 2rem; text-align: center; color: var(--ink-2); }
.reader-empty .brand-mark { opacity: .9; margin-bottom: .6rem; }
.reader-empty p { margin: 0; max-width: 26rem; }
.reader { padding: 1.3rem 2rem 2.5rem; max-width: 64rem; }
.reader .back { display: none; margin-bottom: .6rem; }
.reader-tools { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.reader-tools .tool, .reader-tools .button { padding: 0 .7rem; }
.reader-tools .tool.icon-only { padding: 0; }
.tools-gap { flex: 1; }
.tools-secondary { display: flex; align-items: center; gap: .35rem; flex-wrap: nowrap; }
.reader-tools .move { display: inline-flex; gap: .3rem; }
.reader-tools select { width: 7.5rem; min-height: 36px; padding: 0 .5rem; font-size: .875rem; }
.reader .subject { font-size: 2.1rem; letter-spacing: -.02em; margin: 0 0 .9rem; overflow-wrap: anywhere; }
.from-line { display: flex; justify-content: space-between; align-items: baseline; gap: .3rem 1rem; flex-wrap: wrap; }
.from-line .from { min-width: 0; overflow-wrap: anywhere; }
.from-line .email { color: var(--muted); font-size: .9rem; margin-left: .35rem; }
.from-line time { color: var(--muted); font-size: .875rem; }
.to-line { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; color: var(--muted); font-size: .875rem; margin: .4rem 0 1.1rem; }
.tag { max-width: 100%; overflow-wrap: anywhere; display: inline-flex; align-items: center; gap: .4rem; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: .1rem .5rem; color: var(--ink); font-size: .82rem; }
.tag .swatch { width: 8px; height: 14px; }
.notice.pictures { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; font-size: .9rem; }
.notice.pictures span { flex: 1 1 18rem; }
ul.attachments { list-style: none; padding: 0; margin: .6rem 0 1rem; display: flex; flex-wrap: wrap; gap: .5rem; }
ul.attachments a, .chip { display: inline-flex; align-items: center; gap: .45rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .45rem .7rem; color: var(--ink); text-decoration: none; font-size: .875rem; }
ul.attachments a:hover { border-color: var(--ditch); }
ul.attachments .size, .chip .size { color: var(--muted); }
iframe.message-body { width: 100%; height: 70vh; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; display: block; box-shadow: var(--shadow); }

/* Compose */
.compose-page { max-width: 52rem; padding: 1.4rem 2rem 3rem; }
.compose-head h1 { font-size: 1.6rem; margin: .4rem 0 1rem; }
.compose { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.3rem 1.4rem; box-shadow: var(--shadow); }
.compose textarea { min-height: 18rem; }
.compose .attach { font-weight: 700; }
.compose .attach > span { display: inline-flex; align-items: center; gap: .4rem; }
.compose input[type=file] { font: inherit; font-weight: 400; font-size: .9rem; }
.compose-actions { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding-top: .4rem; }
.compose-actions .cancel { margin-left: auto; color: var(--muted); font-size: .9rem; }
details.more-recipients summary { cursor: pointer; color: var(--ditch); font-size: .9rem; width: fit-content; }
details.more-recipients[open] summary { margin-bottom: .8rem; }

/* ---- Phones and small tablets ----------------------------------------------------------------- */
@media (max-width: 900px) {
    .shell { grid-template-columns: 1fr; }
    .rail { position: sticky; top: 0; z-index: 10; height: auto; overflow: visible; padding: .55rem .8rem; gap: .55rem; }
    .rail-menu { display: block; position: relative; }
    .rail-menu summary { list-style: none; cursor: pointer; display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius); }
    .rail-menu summary::-webkit-details-marker { display: none; }
    .rail-menu[open] summary { background: var(--field-deep); }
    .rail-menu .rail-settings { position: absolute; right: 0; top: 46px; width: min(18rem, 86vw); background: var(--field); border-radius: var(--radius-lg); padding: .5rem; box-shadow: 0 10px 30px rgb(0 0 0 / .3); display: flex; flex-direction: column; gap: 2px; }
    .rail-bottom, .rail-plots { display: none; }
    .rail-write { min-height: 40px; }
    .rail-folders { flex-direction: row; overflow-x: auto; gap: .3rem; scrollbar-width: none; }
    .rail-folders a[class*="depth-"] { padding-left: .7rem; }
    .rail-folders a { flex: none; min-height: 36px; padding: 0 .65rem; }
    .work { padding: 1.2rem 1rem 2.5rem; }
    .mailview { grid-template-columns: 1fr; height: auto; }
    .list-pane { overflow: visible; border-right: 0; }
    .reader-pane { display: none; overflow: visible; }
    .mailview.reading .list-pane { display: none; }
    .mailview.reading .reader-pane { display: block; }
    .reader { padding: 1rem 1rem 2rem; }
    .reader .back { display: inline-flex; }
    .list-head { flex-wrap: wrap; padding: 1rem 1rem .7rem; }
    .search { flex: 1 1 100%; }
    .parcels { padding: 0 1rem .8rem; }
    .bulk { padding: .5rem 1rem; }
    .msg > a { padding-right: 1rem; }
    .from-line .email { display: block; margin-left: 0; overflow-wrap: normal; }
    iframe.message-body { height: 65vh; }
    .compose-page { padding: 1rem; }
    .compose { padding: 1rem; }
}
@media (max-width: 600px) {
    .tool.labelled { width: 40px; padding: 0; }
    .tool.labelled .label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .reader-tools .tools-gap { display: none; }
    .reader-tools .move select { width: 6.5rem; }
    .tool, .button.small { min-height: 40px; }
}
@media (max-width: 520px) {
    .facts { grid-template-columns: 1fr; gap: 0; }
    .facts dd { margin-bottom: .55rem; }
    .card { padding: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; scroll-behavior: auto !important; }
}
