/*
 * Bylinewise design system (docs/design.md).
 * Paper and ink: warm paper surfaces, ink text, one ink-blue accent.
 * Claim and task statuses have their own tone families: ok, warn, bad, own, note, proposal.
 * A status is never colour alone: it also has an icon or glyph, a label and, in the text, an underline style.
 */

:root {
    --font-sans: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
    --font-serif: "Newsreader Variable", "Newsreader", Georgia, serif;
    --font-mono: "IBM Plex Mono", ui-monospace, monospace;

    --radius-sm: 4px;
    --radius: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;

    --background: oklch(0.972 0.008 85);
    --paper: oklch(0.992 0.004 85);
    --sunken: oklch(0.952 0.01 85);
    --foreground: oklch(0.22 0.014 260);
    --card: oklch(0.992 0.004 85);
    --popover: oklch(0.995 0.003 85);
    --primary: oklch(0.39 0.09 255);
    --primary-foreground: oklch(0.985 0.005 85);
    --secondary: oklch(0.935 0.012 85);
    --muted-foreground: oklch(0.47 0.016 260);
    --accent: oklch(0.93 0.02 250);
    --accent-foreground: oklch(0.3 0.08 255);
    --border: oklch(0.885 0.012 85);
    --border-strong: oklch(0.78 0.014 85);
    --input: oklch(0.83 0.013 85);
    --ring: oklch(0.5 0.12 255);
    --logo-ink: oklch(0 0 0);

    --ok: oklch(0.45 0.1 155);
    --ok-soft: oklch(0.94 0.035 155);
    --warn: oklch(0.47 0.1 65);
    --warn-soft: oklch(0.94 0.06 85);
    --bad: oklch(0.49 0.16 28);
    --bad-soft: oklch(0.94 0.035 28);
    --own: oklch(0.42 0.09 255);
    --own-soft: oklch(0.94 0.025 255);
    --note: oklch(0.47 0.014 260);
    --note-soft: oklch(0.935 0.006 260);
    --proposal: oklch(0.44 0.08 200);
    --proposal-soft: oklch(0.945 0.03 200);
    --highlight: oklch(0.88 0.11 90);

    --shadow-soft: 0 1px 0 oklch(0.2 0.02 260 / 4%), 0 8px 24px -12px oklch(0.2 0.02 260 / 18%);
    --shadow-lift: 0 1px 0 oklch(0.2 0.02 260 / 5%), 0 18px 40px -18px oklch(0.2 0.02 260 / 30%);

    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --background: oklch(0.19 0.01 260);
        --paper: oklch(0.225 0.011 260);
        --sunken: oklch(0.165 0.01 260);
        --foreground: oklch(0.93 0.01 85);
        --card: oklch(0.225 0.011 260);
        --popover: oklch(0.24 0.012 260);
        --primary: oklch(0.76 0.09 250);
        --primary-foreground: oklch(0.18 0.02 260);
        --secondary: oklch(0.28 0.012 260);
        --muted-foreground: oklch(0.72 0.012 85);
        --accent: oklch(0.3 0.04 255);
        --accent-foreground: oklch(0.9 0.04 250);
        --border: oklch(0.32 0.012 260);
        --border-strong: oklch(0.42 0.014 260);
        --input: oklch(0.4 0.014 260);
        --ring: oklch(0.72 0.1 250);
        --logo-ink: oklch(0.93 0.01 85);

        --ok: oklch(0.78 0.11 155);
        --ok-soft: oklch(0.3 0.04 155);
        --warn: oklch(0.82 0.11 80);
        --warn-soft: oklch(0.32 0.05 75);
        --bad: oklch(0.75 0.13 28);
        --bad-soft: oklch(0.3 0.05 28);
        --own: oklch(0.78 0.08 250);
        --own-soft: oklch(0.3 0.04 255);
        --note: oklch(0.75 0.012 85);
        --note-soft: oklch(0.28 0.008 260);
        --proposal: oklch(0.8 0.08 200);
        --proposal-soft: oklch(0.29 0.04 200);
        --highlight: oklch(0.5 0.1 90);

        color-scheme: dark;
    }
}

/* Base */

*,
*::before,
*::after {
    box-sizing: border-box;
    border-color: var(--border);
}

html {
    -webkit-font-smoothing: antialiased;
}

body {
    margin: 0;
    background: var(--background);
    color: var(--foreground);
    font: 15px/1.5 var(--font-sans);
}

h1,
h2,
h3,
p,
figure,
blockquote,
dl,
dd {
    margin: 0;
}

h1,
h2,
h3 {
    font-family: var(--font-serif);
    font-weight: 600;
    line-height: 1.2;
}

h2 {
    font-size: 1.25rem;
}

h3 {
    font-size: 1.0625rem;
}

ul,
ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

a {
    color: inherit;
    text-decoration: none;
}

p a,
.notice li a,
.text-link,
td a:not(.button),
dd a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

code {
    font: 0.86em var(--font-mono);
}

img {
    max-width: 100%;
}

details > summary {
    cursor: pointer;
}

:focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: 2px;
}

::selection {
    background: color-mix(in oklab, var(--highlight) 70%, transparent);
}

[hidden] {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Type */

.eyebrow {
    font: 11px/1.5 var(--font-mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted-foreground);
}

h2.eyebrow {
    margin-bottom: 12px;
    font-weight: 400;
}

.serif {
    font-family: var(--font-serif);
}

.mono {
    font-family: var(--font-mono);
}

.muted {
    color: var(--muted-foreground);
}

.small {
    font-size: 13px;
}

.tiny {
    font-size: 12px;
}

.prose-safe {
    overflow-wrap: anywhere;
    hyphens: auto;
}

.title {
    font: 600 1.25rem/1.25 var(--font-serif);
}

.lead {
    max-width: 42rem;
    color: var(--muted-foreground);
}

.error {
    color: var(--bad);
    font-size: 13px;
}

.error:empty {
    display: none;
}

.icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.spin {
    animation: spin 2.5s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse-dot {
    50% {
        opacity: 0.35;
    }
}

/* Spacing helpers: a vertical stack and a row of actions */

.stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.stack.tight {
    gap: 8px;
}

.stack.loose {
    gap: 28px;
}

.row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.row.between {
    justify-content: space-between;
    gap: 12px;
}

.row.end {
    justify-content: flex-end;
}

.row.center {
    justify-content: center;
}

.ink {
    color: var(--foreground);
}

.icon.ok {
    color: var(--ok);
}

.icon.warn {
    color: var(--warn);
}

.icon.bad {
    color: var(--bad);
}

.icon.own,
.icon.primary {
    color: var(--primary);
}

.icon.muted {
    color: var(--muted-foreground);
}

.row form,
.stack form {
    margin: 0;
}

.mt-1 {
    margin-top: 4px;
}

.mt-2 {
    margin-top: 8px;
}

.mt-3 {
    margin-top: 12px;
}

.mt-4 {
    margin-top: 16px;
}

.mt-6 {
    margin-top: 24px;
}

.mt-8 {
    margin-top: 32px;
}

.mb-3 {
    margin-bottom: 12px;
}

.mb-4 {
    margin-bottom: 16px;
}

.mb-6 {
    margin-bottom: 24px;
}

.mb-8 {
    margin-bottom: 32px;
}

/* Logo */

.logo {
    display: inline-flex;
    vertical-align: top;
}

.logo svg {
    width: auto;
    height: 36px;
    flex-shrink: 0;
}

.logo-ink {
    fill: var(--logo-ink);
}

.logo-quill {
    fill: var(--primary);
}

/* App shell: a sidebar on wide screens, a bar with a menu on narrow ones */

.skip {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 60;
    padding: 8px 12px;
    border-radius: var(--radius);
    background: var(--paper);
    transform: translateY(-200%);
}

.skip:focus {
    transform: none;
}

.shell {
    min-height: 100vh;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    background: color-mix(in oklab, var(--background) 95%, transparent);
    backdrop-filter: blur(8px);
}

.menu-button {
    display: inline-flex;
    padding: 8px;
    border: 0;
    border-radius: var(--radius);
    background: none;
    color: var(--foreground);
    cursor: pointer;
}

.menu-button:hover {
    background: var(--secondary);
}

.menu-button .icon {
    width: 20px;
    height: 20px;
}

.sidebar {
    flex-direction: column;
    padding: 20px 12px;
    color: var(--foreground);
}

/* On a narrow screen the sidebar is a popover the menu button opens, under the bar. */
.sidebar:popover-open {
    display: flex;
    position: fixed;
    inset: 53px 0 0;
    width: auto;
    height: auto;
    margin: 0;
    padding: 20px 16px;
    overflow-y: auto;
    border: 0;
    background: var(--background);
}

.sidebar > .logo-link {
    display: none;
    margin: 0 10px 28px;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius);
    color: var(--muted-foreground);
    font-size: 14px;
    transition: background-color 120ms, color 120ms;
}

.nav a:hover {
    background: var(--secondary);
    color: var(--foreground);
}

.nav a[aria-current="page"] {
    background: var(--paper);
    color: var(--foreground);
    font-weight: 500;
    box-shadow: var(--shadow-soft);
}

.nav-authors {
    margin-top: 28px;
}

.nav-authors .eyebrow {
    margin-bottom: 8px;
    padding: 0 10px;
}

.nav-authors a {
    padding: 6px 10px;
}

.nav-authors a[aria-current="page"] {
    background: none;
    box-shadow: none;
}

.nav-authors span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.initial {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: var(--accent-foreground);
    font: 600 11px/1 var(--font-serif);
}

.sidebar-foot {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: auto;
    padding-top: 32px;
}

.plan-card {
    display: block;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--paper);
    font-size: 13px;
}

.plan-card:hover {
    border-color: var(--border-strong);
}

.plan-card p:first-child {
    font-weight: 500;
}

.plan-card p + p {
    color: var(--muted-foreground);
}

.foot-links {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.foot-links a,
.foot-links button {
    display: flex;
    white-space: nowrap;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 6px 10px;
    border: 0;
    border-radius: var(--radius);
    background: none;
    color: var(--muted-foreground);
    font: 13px/1.5 var(--font-sans);
    text-align: left;
    cursor: pointer;
}

.foot-links a:hover,
.foot-links button:hover {
    color: var(--foreground);
}

.foot-links form {
    margin: 0;
}

.foot-links .email {
    min-width: 0;
    margin-left: auto;
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.main {
    width: 100%;
    max-width: 1120px;
    min-width: 0;
    margin: 0 auto;
    padding: 32px 16px;
}

.main.wide {
    max-width: none;
}

@media (min-width: 640px) {
    .main {
        padding: 32px;
    }
}

@media (min-width: 1024px) {
    .shell {
        display: grid;
        grid-template-columns: 248px minmax(0, 1fr);
    }

    .topbar {
        display: none;
    }

    .sidebar,
    .sidebar:popover-open {
        position: sticky;
        inset: auto;
        top: 0;
        display: flex;
        width: auto;
        height: 100vh;
        margin: 0;
        padding: 20px 12px;
        overflow-y: auto;
        border: 0;
        border-right: 1px solid var(--border);
        background: color-mix(in oklab, var(--sunken) 60%, transparent);
    }

    .sidebar > .logo-link {
        display: block;
    }

    .main {
        padding: 40px 48px;
    }
}

/* Pages outside the account: a plain header over a centred column */

.public-header {
    border-bottom: 1px solid var(--border);
}

.public-header > div {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: 1024px;
    margin: 0 auto;
    padding: 16px 24px;
}

.public-header.narrow > div {
    max-width: 768px;
}

.public-header nav {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 14px;
}

.public-header nav a {
    color: var(--muted-foreground);
}

.public-header nav a:hover,
.public-header nav a[aria-current="page"] {
    color: var(--foreground);
}

.public-header nav a[aria-current="page"] {
    font-weight: 500;
}

.public-main {
    max-width: 768px;
    margin: 0 auto;
    padding: 56px 24px;
}

.public-main h1 {
    margin-top: 12px;
    font-size: 2.6rem;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.public-main .lead {
    margin-top: 16px;
    font-size: 17px;
}

.explain {
    display: grid;
    gap: 32px;
    margin-top: 56px;
    padding-top: 40px;
    border-top: 1px solid var(--border);
}

.explain .icon {
    color: var(--primary);
}

.explain p:nth-of-type(1) {
    margin-top: 8px;
    font-weight: 500;
}

.explain p:nth-of-type(2) {
    margin-top: 4px;
    color: var(--muted-foreground);
    font-size: 14px;
}

@media (min-width: 640px) {
    .explain {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Legal pages: contents on the left, the text on the right */

.legal {
    display: grid;
    gap: 48px;
    max-width: 1024px;
    margin: 0 auto;
    padding: 48px 24px;
}

.legal-contents {
    display: none;
}

.legal-contents ol {
    position: sticky;
    top: 32px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--muted-foreground);
    font-size: 13px;
}

.legal-contents a:hover {
    color: var(--foreground);
}

.legal article {
    max-width: 68ch;
}

.legal h1 {
    margin-top: 8px;
    font-size: 3rem;
    letter-spacing: -0.02em;
}

.legal .article {
    margin-top: 40px;
    font-size: 1.0625rem;
}

@media (min-width: 1024px) {
    .legal {
        grid-template-columns: 200px minmax(0, 1fr);
    }

    .legal-contents {
        display: block;
    }
}

/* Sign-in: the promise on the left, the form on the right */

.entry {
    min-height: 100vh;
}

.entry-promise {
    padding: 40px 24px;
    border-bottom: 1px solid var(--border);
    background: color-mix(in oklab, var(--sunken) 70%, transparent);
}

.entry-promise > div {
    max-width: 36rem;
    margin-top: 56px;
}

.entry-promise h1 {
    margin-top: 16px;
    font-size: 2.6rem;
    line-height: 1.05;
    letter-spacing: -0.02em;
}

.entry-promise h1 em {
    color: var(--primary);
}

.entry-promise > div > p:last-child {
    max-width: 32rem;
    margin-top: 20px;
    color: var(--muted-foreground);
    font-size: 17px;
}

.promises {
    display: grid;
    gap: 28px 32px;
    max-width: 42rem;
    margin-top: 48px;
}

.promises li {
    padding-top: 12px;
    border-top: 1px solid var(--border-strong);
}

.promises li p:nth-child(1) {
    color: var(--muted-foreground);
    font: 12px var(--font-mono);
}

.promises li p:nth-child(2) {
    margin-top: 4px;
    font: 600 1.125rem/1.35 var(--font-serif);
}

.promises li p:nth-child(3) {
    margin-top: 4px;
    color: var(--muted-foreground);
    font-size: 14px;
}

.entry-fine {
    max-width: 32rem;
    margin-top: 48px;
    color: var(--muted-foreground);
    font-size: 13px;
}

.entry-form {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
}

.entry-form > div {
    width: 100%;
    max-width: 384px;
}

.entry-form h2 {
    font-size: 1.875rem;
    line-height: 1.2;
}

.entry-form .state-icon {
    width: 32px;
    height: 32px;
    margin-bottom: 16px;
}

.or {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--muted-foreground);
    font-size: 12px;
}

.or::before,
.or::after {
    content: "";
    flex: 1;
    border-top: 1px solid var(--border);
}

@media (min-width: 640px) {
    .entry-promise {
        padding: 56px 48px;
    }

    .entry-promise h1 {
        font-size: 3.4rem;
    }

    .promises {
        grid-template-columns: 1fr 1fr;
    }

    .entry-form {
        padding: 48px;
    }
}

@media (min-width: 1024px) {
    .entry {
        display: grid;
        grid-template-columns: 1.15fr 1fr;
    }

    .entry-promise {
        border-right: 1px solid var(--border);
        border-bottom: 0;
    }

    .entry-promise > div {
        margin-top: 96px;
    }
}

/* The home page of a visitor: full-width bands around a column of 1120px */

.landing-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background: color-mix(in oklab, var(--background) 95%, transparent);
    backdrop-filter: blur(8px);
}

.landing-header > div {
    max-width: 1120px;
    padding-block: 10px;
}

.public-header .landing-nav {
    display: none;
}

.landing > section {
    padding: 56px max(24px, calc((100% - 1120px) / 2));
    scroll-margin-top: 57px;
}

.landing-sunken {
    border-block: 1px solid var(--border);
    background: color-mix(in oklab, var(--sunken) 70%, transparent);
}

.landing h2 {
    font-size: 1.9rem;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.landing-head {
    max-width: 44rem;
}

.landing-head h2 {
    margin-top: 8px;
}

.landing-head .lead {
    margin-top: 12px;
    font-size: 17px;
}

.landing-hero {
    display: grid;
    gap: 40px;
    align-items: start;
}

.landing-hero > *,
.landing-feature > * {
    min-width: 0;
}

.landing-hero h1 {
    margin-top: 16px;
    font-size: 2.6rem;
    line-height: 1.08;
    letter-spacing: -0.02em;
}

.landing-hero h1 em {
    color: var(--primary);
}

.landing-hero .lead {
    margin-top: 20px;
    font-size: 17px;
}

/* A specimen of the portal, not the portal: nothing in it reacts. */
.specimen .claim,
.specimen .claim-sentence,
.specimen .decide {
    pointer-events: none;
}

.specimen-text {
    font: 1.0625rem/1.65 var(--font-serif);
}

.specimen-rule {
    font-size: 1.0625rem;
    line-height: 1.35;
}

.landing > .landing-band {
    padding-block: 20px;
    border-block: 1px solid var(--border);
    background: var(--paper);
}

.landing-assurances {
    display: grid;
    gap: 12px 24px;
    font-size: 14px;
}

.landing-assurances li {
    display: flex;
    align-items: center;
    gap: 8px;
}

.landing-pain {
    font-size: 1.25rem;
    line-height: 1.25;
}

.landing-note {
    max-width: 44rem;
}

.promises.landing-steps {
    max-width: none;
    margin-top: 32px;
}

.landing-feature {
    display: grid;
    gap: 32px;
    align-items: center;
}

.grid-3.landing-benefits {
    gap: 32px 24px;
}

.landing-compare th[scope="row"] {
    border-top: 1px solid var(--border);
    color: var(--foreground);
    background: transparent;
    font: 500 14px/1.5 var(--font-sans);
    letter-spacing: 0;
    text-transform: none;
}

.landing-compare .icon {
    margin-right: 2px;
    vertical-align: -3px;
}

.landing-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.landing-list li + li {
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.landing-faq {
    max-width: 44rem;
    border-top: 1px solid var(--border-strong);
}

.landing-faq details {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.landing-faq summary {
    font: 600 1.125rem/1.35 var(--font-serif);
}

.landing-faq p {
    margin-top: 8px;
}

.landing-action {
    text-align: center;
}

.landing-action .lead {
    margin: 12px auto 0;
    font-size: 17px;
}

.landing-footer {
    border-top: 1px solid var(--border);
}

.landing-footer > div {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: 1120px;
    margin: 0 auto;
    padding: 24px;
}

.landing-footer nav {
    gap: 8px 16px;
    color: var(--muted-foreground);
    font-size: 13px;
}

.landing-footer a:hover {
    color: var(--foreground);
}

@media (prefers-reduced-motion: no-preference) {
    html:has(.landing) {
        scroll-behavior: smooth;
    }
}

@media (max-width: 639px) {
    .landing-compare thead {
        display: none;
    }

    .landing-compare tr,
    .landing-compare th[scope="row"],
    .landing-compare td {
        display: block;
    }

    .table.landing-compare td {
        padding-top: 0;
        border-top: 0;
    }

    .landing-compare td::before {
        content: attr(data-label);
        display: block;
        color: var(--muted-foreground);
        font: 11px/1.5 var(--font-mono);
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }
}

@media (min-width: 640px) {
    .landing > section {
        padding-block: 72px;
    }

    .landing h2 {
        font-size: 2.25rem;
    }

    .landing-hero h1 {
        font-size: 3.4rem;
    }

    .landing-assurances {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 900px) {
    .public-header .landing-nav {
        display: flex;
    }
}

@media (min-width: 1024px) {
    .landing-hero {
        grid-template-columns: 1.1fr 1fr;
        gap: 56px;
    }

    .landing-feature {
        grid-template-columns: 1fr 1fr;
        gap: 56px;
    }

    .landing-assurances {
        grid-template-columns: repeat(4, auto);
        justify-content: space-between;
    }

    .promises.landing-steps {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Single message pages: errors and not found */

.message-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 0 16px;
    text-align: center;
}

.message-page > div {
    max-width: 28rem;
}

.message-page .logo {
    margin-bottom: 32px;
}

.message-page h1 {
    margin-top: 8px;
    font-size: 2.25rem;
}

.message-page p:not(.eyebrow) {
    margin-top: 12px;
    color: var(--muted-foreground);
}

/* Page header */

.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.page-header.plain {
    margin-bottom: 24px;
    padding-bottom: 0;
    border-bottom: 0;
}

.page-header > div:first-child {
    min-width: 0;
    max-width: 42rem;
}

.page-header .eyebrow {
    margin-bottom: 8px;
}

.page-header .eyebrow a:hover {
    color: var(--foreground);
}

.page-header h1 {
    font-size: 2.1rem;
    line-height: 1.1;
    letter-spacing: -0.02em;
    overflow-wrap: anywhere;
    hyphens: auto;
}

.page-header h1 + p,
.page-header h1 + div {
    margin-top: 8px;
    color: var(--muted-foreground);
}

.page-header .actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Author tabs */

.tabs {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--border);
}

.tabs a {
    margin-bottom: -1px;
    padding: 0 4px 12px;
    border-bottom: 2px solid transparent;
    color: var(--muted-foreground);
    font-size: 14px;
}

.tabs a:hover {
    color: var(--foreground);
}

.tabs a[aria-current="page"] {
    border-bottom-color: var(--primary);
    color: var(--foreground);
    font-weight: 500;
}

/* Layouts: content with a side column */

.split {
    display: grid;
    gap: 32px;
    align-items: start;
}

.split > * {
    min-width: 0;
}

.split.aside-above > aside {
    order: -1;
}

@media (min-width: 1024px) {
    .split {
        grid-template-columns: minmax(0, 1fr) var(--aside, 300px);
    }

    .split.aside-first {
        grid-template-columns: var(--aside, 380px) minmax(0, 1fr);
    }

    .split.aside-above > aside {
        order: 0;
    }

    .sticky {
        position: sticky;
        top: 24px;
    }
}

.grid-2 {
    display: grid;
    gap: 16px;
}

@media (min-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr 1fr;
    }
}

/* Buttons */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 36px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: var(--primary);
    color: var(--primary-foreground);
    box-shadow: var(--shadow-soft);
    font: 500 14px/1 var(--font-sans);
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 120ms, color 120ms;
}

.button:hover {
    background: color-mix(in oklab, var(--primary) 90%, transparent);
}

.button.secondary {
    border-color: var(--border-strong);
    background: var(--paper);
    color: var(--foreground);
    box-shadow: none;
}

.button.secondary:hover,
.button.ghost:hover,
.button.quiet:hover {
    background: var(--secondary);
    color: var(--foreground);
}

.button.ghost,
.button.quiet {
    background: transparent;
    color: var(--foreground);
    box-shadow: none;
}

.button.quiet {
    color: var(--muted-foreground);
}

.button.danger {
    border-color: color-mix(in oklab, var(--bad) 40%, transparent);
    background: var(--paper);
    color: var(--bad);
    box-shadow: none;
}

.button.danger:hover {
    background: var(--bad-soft);
}

.button.accept {
    background: var(--ok);
}

.button.accept:hover {
    background: color-mix(in oklab, var(--ok) 90%, transparent);
}

.button.proposal {
    background: var(--proposal);
}

.button.proposal:hover {
    background: color-mix(in oklab, var(--proposal) 90%, transparent);
}

.button.small {
    height: 32px;
    padding: 0 12px;
    font-size: 13px;
}

.button.large {
    height: 44px;
    padding: 0 20px;
    font-size: 15px;
}

.button.square {
    width: 36px;
    padding: 0;
}

.button.small.square {
    width: 32px;
}

.button.wide {
    width: 100%;
}

.button:disabled,
.button[aria-disabled="true"] {
    opacity: 0.55;
    cursor: not-allowed;
}

.link {
    padding: 0;
    border: 0;
    background: none;
    color: var(--primary);
    font: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

.link.danger {
    color: var(--bad);
}

.link:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* Cards and rows */

.card {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--card);
}

.card.pad-sm {
    padding: 16px;
}

.card.pad-lg {
    padding: 24px;
}

.card.flush {
    padding: 0;
    overflow: hidden;
}

.card > h2 + p,
.card-hint {
    margin-top: 2px;
    color: var(--muted-foreground);
    font-size: 13px;
}

.choice > summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    column-gap: 12px;
    list-style: none;
}

.choice > summary::-webkit-details-marker {
    display: none;
}

.choice-current {
    grid-column: 1;
    margin-top: 2px;
    color: var(--muted-foreground);
    font-size: 14px;
    overflow-wrap: anywhere;
}

.choice-toggle {
    grid-column: 2;
    grid-row: 1 / span 2;
}

.choice[open] .choice-change,
.choice:not([open]) .choice-hide {
    display: none;
}

a.card {
    display: block;
    transition: box-shadow 150ms;
}

a.card:hover {
    box-shadow: var(--shadow-lift);
}

.rows > * + * {
    border-top: 1px solid var(--border);
}

.rows > * {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    padding: 16px;
}

.rows > .off {
    background: color-mix(in oklab, var(--sunken) 50%, transparent);
}

.rows .grow {
    flex: 1 1 16rem;
    min-width: 0;
}

.row-title {
    font: 600 17px/1.35 var(--font-serif);
    overflow-wrap: anywhere;
    hyphens: auto;
}

a.row-title:hover {
    text-decoration: underline;
}

.row-meta {
    margin-top: 2px;
    color: var(--muted-foreground);
    font-size: 13px;
}

/* A data table inside a flush card */

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table th {
    padding: 10px 16px;
    color: var(--muted-foreground);
    font: 400 11px/1.5 var(--font-mono);
    letter-spacing: 0.08em;
    text-align: left;
    text-transform: uppercase;
    background: color-mix(in oklab, var(--sunken) 50%, transparent);
}

.table td {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    vertical-align: middle;
}

.table tfoot th {
    border-top: 1px solid var(--border);
    color: var(--foreground);
    font: 500 14px var(--font-sans);
    letter-spacing: 0;
    text-transform: none;
}

.table form {
    margin: 0;
}

.table .off td {
    color: var(--muted-foreground);
}

.table .num {
    font-family: var(--font-mono);
    font-size: 13px;
    white-space: nowrap;
}

.table-wrap {
    overflow-x: auto;
}

/* Badges and tones */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 6px;
    border: 1px solid;
    border-radius: var(--radius-sm);
    font: 500 12px/1 var(--font-sans);
    white-space: nowrap;
}

.badge .icon {
    width: 12px;
    height: 12px;
}

.badge .glyph {
    font: 600 11px/1 var(--font-mono);
}

.badge.ok {
    border-color: color-mix(in oklab, var(--ok) 30%, transparent);
    background: var(--ok-soft);
    color: var(--ok);
}

.badge.warn {
    border-color: color-mix(in oklab, var(--warn) 40%, transparent);
    background: var(--warn-soft);
    color: var(--warn);
}

.badge.bad {
    border-color: color-mix(in oklab, var(--bad) 40%, transparent);
    background: var(--bad-soft);
    color: var(--bad);
}

.badge.own {
    border-color: color-mix(in oklab, var(--own) 30%, transparent);
    background: var(--own-soft);
    color: var(--own);
}

.badge.note {
    border-color: color-mix(in oklab, var(--note) 25%, transparent);
    background: var(--note-soft);
    color: var(--note);
}

.badge.proposal {
    border-color: color-mix(in oklab, var(--proposal) 30%, transparent);
    background: var(--proposal-soft);
    color: var(--proposal);
}

.badge.plain {
    font-weight: 400;
}

/* Notices */

.notice {
    display: flex;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--sunken);
    font-size: 14px;
}

.notice > .icon {
    margin-top: 2px;
    color: var(--note);
}

.notice > div {
    flex: 1;
    min-width: 0;
    color: color-mix(in oklab, var(--foreground) 80%, transparent);
}

.notice-title {
    color: var(--foreground);
    font-weight: 500;
}

.notice-title + * {
    margin-top: 2px;
}

.notice ul {
    margin-top: 4px;
    padding-left: 16px;
    list-style: disc;
}

.notice > .notice-action {
    flex: none;
    align-self: center;
}

.notice.ok {
    border-color: color-mix(in oklab, var(--ok) 30%, transparent);
    background: var(--ok-soft);
}

.notice.warn {
    border-color: color-mix(in oklab, var(--warn) 40%, transparent);
    background: var(--warn-soft);
}

.notice.bad {
    border-color: color-mix(in oklab, var(--bad) 35%, transparent);
    background: var(--bad-soft);
}

.notice.own {
    border-color: color-mix(in oklab, var(--own) 25%, transparent);
    background: var(--own-soft);
}

.notice.proposal {
    border-color: color-mix(in oklab, var(--proposal) 30%, transparent);
    background: var(--proposal-soft);
}

.notice.ok > .icon {
    color: var(--ok);
}

.notice.warn > .icon {
    color: var(--warn);
}

.notice.bad > .icon {
    color: var(--bad);
}

.notice.own > .icon {
    color: var(--own);
}

.notice.proposal > .icon {
    color: var(--proposal);
}

/* Empty states */

.empty {
    padding: 48px 24px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    background: color-mix(in oklab, var(--paper) 60%, transparent);
    text-align: center;
}

.empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: var(--sunken);
    color: var(--muted-foreground);
}

.empty-icon .icon {
    width: 20px;
    height: 20px;
}

.empty > p:not(.empty-title) {
    max-width: 28rem;
    margin: 6px auto 0;
    color: var(--muted-foreground);
    font-size: 14px;
}

.empty-title {
    font: 600 1.25rem/1.3 var(--font-serif);
}

.empty .row {
    justify-content: center;
    margin-top: 20px;
}

/* Forms */

form {
    margin: 0;
}

label,
.label {
    font-size: 14px;
    font-weight: 500;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.field > label,
.field > legend,
.field > .label {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 0;
}

.optional {
    color: var(--muted-foreground);
    font-size: 12px;
    font-weight: 400;
}

.hint {
    color: var(--muted-foreground);
    font-size: 13px;
    font-weight: 400;
}

input:not([type]),
input[type="text"],
input[type="email"],
input[type="url"],
input[type="number"],
input[type="password"],
input[type="file"],
select,
textarea {
    width: 100%;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--input);
    border-radius: var(--radius);
    background: var(--paper);
    color: var(--foreground);
    font: 14px/1.5 var(--font-sans);
}

input[type="file"] {
    padding: 6px 12px;
}

textarea {
    min-height: 80px;
    padding: 8px 12px;
    resize: vertical;
}

::placeholder {
    color: color-mix(in oklab, var(--muted-foreground) 70%, transparent);
}

input.serif,
textarea.serif {
    font-family: var(--font-serif);
    font-size: 16px;
}

input.large {
    height: 44px;
    font: 18px var(--font-serif);
}

.input-mono {
    font-family: var(--font-mono);
}

.check {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-weight: 400;
    cursor: pointer;
}

.check input {
    width: 16px;
    height: 16px;
    margin: 3px 0 0;
    flex-shrink: 0;
    accent-color: var(--primary);
}

.check-box {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--paper);
}

.consent {
    padding: 12px;
    border: 1px solid color-mix(in oklab, var(--own) 25%, transparent);
    border-radius: var(--radius);
    background: var(--own-soft);
}

.dropzone {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    background: color-mix(in oklab, var(--sunken) 50%, transparent);
    font-size: 14px;
}

/* Segmented control: radio inputs, one of several values */

.segmented {
    display: inline-flex;
    flex-wrap: wrap;
    align-self: flex-start;
    padding: 2px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--sunken);
}

.segmented label {
    position: relative;
    cursor: pointer;
}

.segmented input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.segmented span {
    display: block;
    padding: 6px 12px;
    border-radius: 5px;
    color: var(--muted-foreground);
    font-size: 13px;
    font-weight: 500;
    transition: background-color 120ms, color 120ms;
}

.segmented input:checked + span {
    background: var(--paper);
    color: var(--foreground);
    box-shadow: var(--shadow-soft);
}

.segmented input:focus-visible + span {
    outline: 2px solid var(--ring);
    outline-offset: 1px;
}

.segmented a {
    display: block;
    padding: 6px 12px;
    border-radius: 5px;
    color: var(--muted-foreground);
    font-size: 13px;
    font-weight: 500;
}

.segmented a[aria-current="page"] {
    background: var(--paper);
    color: var(--foreground);
    box-shadow: var(--shadow-soft);
}

/* Switch: a checkbox that turns an option on and off */

input[type="checkbox"].switch {
    position: relative;
    width: 36px;
    height: 20px;
    margin: 0;
    flex-shrink: 0;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: var(--sunken);
    appearance: none;
    cursor: pointer;
    transition: background-color 120ms, border-color 120ms;
}

input[type="checkbox"].switch::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--paper);
    box-shadow: var(--shadow-soft);
    transition: transform 120ms;
}

input[type="checkbox"].switch:checked {
    border-color: var(--primary);
    background: var(--primary);
}

input[type="checkbox"].switch:checked::before {
    transform: translateX(16px);
}

.toggles > label {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    cursor: pointer;
}

.toggles > label + label {
    border-top: 1px solid var(--border);
}

.toggles .hint {
    display: block;
    margin-top: 2px;
}

/* Stages of a task */

.stages li {
    position: relative;
    display: flex;
    gap: 12px;
    padding-bottom: 20px;
}

.stages li:last-child {
    padding-bottom: 0;
}

.stages li:not(:last-child)::before {
    content: "";
    position: absolute;
    top: 24px;
    left: 11px;
    width: 1px;
    height: calc(100% - 20px);
    background: var(--border-strong);
}

.stages li.done:not(:last-child)::before {
    background: color-mix(in oklab, var(--ok) 50%, transparent);
}

.stage-dot {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    border: 1px solid var(--border-strong);
    border-radius: 50%;
    background: var(--paper);
    color: var(--muted-foreground);
    font: 600 11px/1 var(--font-mono);
}

.stage-dot .icon {
    width: 14px;
    height: 14px;
}

.stages .done .stage-dot {
    border-color: color-mix(in oklab, var(--ok) 40%, transparent);
    background: var(--ok-soft);
    color: var(--ok);
}

.stages .current .stage-dot {
    border-color: var(--primary);
    background: var(--primary);
    color: var(--primary-foreground);
}

.stages .current .stage-dot::after {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary-foreground);
    animation: pulse-dot 1.6s ease-in-out infinite;
}

.stages .waiting .stage-dot {
    border-color: var(--warn);
    background: var(--warn-soft);
    color: var(--warn);
}

.stages .failed .stage-dot {
    border-color: var(--bad);
    background: var(--bad-soft);
    color: var(--bad);
}

.stage-text {
    min-width: 0;
    padding-top: 2px;
    font-size: 14px;
}

.stages .next .stage-text {
    color: var(--muted-foreground);
}

.stages .current .stage-text,
.stages .waiting .stage-text,
.stages .failed .stage-text {
    font-weight: 600;
}

.stage-detail {
    margin-top: 2px;
    color: var(--muted-foreground);
    font-size: 13px;
    font-weight: 400;
}

/* Getting started */

.onboarding {
    display: grid;
    gap: 8px;
}

.onboarding li {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: color-mix(in oklab, var(--sunken) 50%, transparent);
    color: var(--muted-foreground);
    font-size: 14px;
}

.onboarding li p:first-child {
    font: 11px var(--font-mono);
    color: var(--muted-foreground);
}

.onboarding li p:last-child {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.onboarding .done {
    border-color: color-mix(in oklab, var(--ok) 30%, transparent);
    background: var(--ok-soft);
    color: var(--foreground);
}

.onboarding .done .icon {
    width: 14px;
    height: 14px;
    color: var(--ok);
}

.onboarding [aria-current="step"] {
    border-color: var(--primary);
    background: var(--paper);
    color: var(--foreground);
    box-shadow: var(--shadow-soft);
}

@media (min-width: 640px) {
    .onboarding {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Authors */

.avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: var(--radius);
    background: var(--accent);
    color: var(--accent-foreground);
    font: 600 1.25rem/1 var(--font-serif);
}

.author-card {
    height: 100%;
}

.author-card > div:first-child {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.author-card .title {
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.author-card .card-foot {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    color: var(--muted-foreground);
    font-size: 13px;
}

.author-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.author-head h1 {
    font-size: 2.1rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
    overflow-wrap: anywhere;
    hyphens: auto;
}

.author-head .eyebrow {
    margin-bottom: 8px;
}

.author-head .badge {
    margin-top: 8px;
}

/* Cards that wait for the author */

.attention {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    border: 1px solid color-mix(in oklab, var(--warn) 40%, transparent);
    border-radius: var(--radius-lg);
    background: color-mix(in oklab, var(--warn-soft) 60%, transparent);
}

.attention:hover {
    background: var(--warn-soft);
}

.attention p:first-child {
    font: 600 1.125rem/1.35 var(--font-serif);
    overflow-wrap: anywhere;
}

.attention p:last-child {
    margin-top: 4px;
    color: color-mix(in oklab, var(--foreground) 75%, transparent);
    font-size: 14px;
}

.attention .icon {
    transition: transform 150ms;
}

.attention:hover .icon {
    transform: translateX(2px);
}

/* Price */

.price-amount {
    margin-top: 8px;
    font: 600 1.65rem/1.2 var(--font-serif);
}

.price-terms {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    color: color-mix(in oklab, var(--foreground) 80%, transparent);
    font-size: 13px;
}

/* Voice profile */

.items > * + * {
    border-top: 1px solid var(--border);
}

.item {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr);
    gap: 8px 12px;
    align-items: start;
    padding: 12px 0;
}

.item:first-child {
    padding-top: 0;
}

.item.term {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

/* Grows with its text where the browser can, so a long rule is read whole. A set height would stop it growing. */
.item textarea {
    height: auto;
    field-sizing: content;
    min-height: 3.2em;
}

.item.new select,
.item.new input,
.item.new textarea {
    border-style: dashed;
}

.item .from {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    color: var(--muted-foreground);
    font-size: 12px;
}

/* The chip names the texts an item was learned from: it wraps, so that no title is cut off. */
.item .from .badge {
    align-items: flex-start;
    line-height: 1.3;
    white-space: normal;
    overflow-wrap: anywhere;
}

.item .from .badge .icon {
    margin-top: 2px;
}

.item .from .check {
    margin-left: auto;
    gap: 6px;
    font-size: 13px;
}

.item .from .check input {
    margin-top: 2px;
}

.items h3 {
    padding-top: 16px;
}

.items h3:first-child {
    padding-top: 0;
}

.items h3 + .hint {
    border-top: 0;
    padding: 2px 0 8px;
}

.items .hint + .item {
    border-top: 0;
}

.sample {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--paper);
}

.facts-list {
    display: flex;
    flex-direction: column;
}

.facts-list > div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 6px 0;
    font-size: 14px;
}

.facts-list > div + div {
    border-top: 1px solid var(--border);
}

.facts-list dt {
    flex: none;
    color: var(--muted-foreground);
}

.facts-list dd {
    min-width: 0;
    font: 13px var(--font-mono);
    text-align: right;
    overflow-wrap: anywhere;
}

/* Sources and excerpts */

.excerpt {
    padding-left: 12px;
    border-left: 2px solid var(--border-strong);
    color: color-mix(in oklab, var(--foreground) 90%, transparent);
    font: italic 15px/1.6 var(--font-serif);
    overflow-wrap: anywhere;
}

.excerpt::before {
    content: "“";
}

.excerpt::after {
    content: "”";
}

mark,
.mismatch {
    padding: 0 2px;
    border-bottom: 2px solid var(--warn);
    background: var(--highlight);
    color: var(--foreground);
    font-style: normal;
}

.source-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 13px;
}

.source-meta a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--primary);
    word-break: break-all;
}

.source-meta a:hover {
    text-decoration: underline;
}

.source-meta a .icon {
    width: 12px;
    height: 12px;
}

.source-meta .publisher {
    color: var(--foreground);
    font-weight: 500;
}

.source-meta dl {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 16px;
    color: var(--muted-foreground);
    font: 11.5px/1.5 var(--font-mono);
}

.source-meta dl div {
    display: flex;
    gap: 4px;
}

/* Article typography: the editor, versions and legal pages */

.article {
    color: var(--foreground);
    font: 1.1875rem/1.65 var(--font-serif);
    overflow-wrap: anywhere;
    hyphens: auto;
}

.article p {
    margin: 0 0 1.1em;
}

.article h2 {
    margin: 1.6em 0 0.5em;
    font-size: 1.6rem;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.article h3 {
    margin: 1.4em 0 0.4em;
    font-size: 1.3rem;
}

.article ul,
.article ol {
    margin: 0 0 1.1em;
    padding-left: 1.4em;
}

.article ul {
    list-style: disc;
}

.article ol {
    list-style: decimal;
}

.article li {
    margin-bottom: 0.3em;
}

.article li p {
    margin: 0;
}

.article blockquote {
    margin: 0 0 1.1em;
    padding-left: 1em;
    border-left: 3px solid var(--border-strong);
    color: var(--muted-foreground);
    font-style: italic;
}

.article strong,
.article b {
    font-weight: 650;
}

.article a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* A citation without an address: the editor keeps it as a link that leads nowhere, and it is not to look like one. */
.article a:not([href]),
.article a[href=""] {
    color: inherit;
    text-decoration: none;
}

.article hr {
    margin: 2em 0;
    border: 0;
    border-top: 1px solid var(--border);
}

/* Claim marks in the text: colour, underline style and a glyph, never colour alone */

.claim {
    padding: 0 1px;
    border-radius: 2px;
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
    text-decoration-skip-ink: none;
    cursor: pointer;
    transition: background-color 120ms;
}

.claim::after {
    margin-left: 1px;
    font: 600 0.62em/0 var(--font-mono);
    vertical-align: super;
}

.claim.status-supported {
    text-decoration-line: underline;
    text-decoration-color: color-mix(in oklab, var(--ok) 45%, transparent);
}

.claim.status-supported::after {
    content: "✓";
    color: var(--ok);
}

.claim.status-partial,
.claim.status-outdated,
.claim.status-unchecked {
    text-decoration-line: underline;
    text-decoration-style: wavy;
    text-decoration-color: var(--warn);
}

.claim.status-partial::after,
.claim.status-outdated::after,
.claim.status-unchecked::after {
    content: "?";
    color: var(--warn);
}

.claim.status-unsupported,
.claim.status-contradicted {
    text-decoration-line: underline;
    text-decoration-style: wavy;
    text-decoration-color: var(--bad);
}

.claim.status-unsupported::after,
.claim.status-contradicted::after {
    content: "!";
    color: var(--bad);
}

.claim.open.status-partial,
.claim.open.status-outdated,
.claim.open.status-unchecked {
    background: var(--warn-soft);
}

.claim.open.status-unsupported,
.claim.open.status-contradicted {
    background: var(--bad-soft);
}

.claim.status-author_claim {
    text-decoration-line: underline;
    text-decoration-style: dotted;
    text-decoration-color: var(--own);
}

.claim.status-author_claim::after {
    content: "◆";
    color: var(--own);
}

.claim.status-opinion {
    text-decoration-line: underline;
    text-decoration-style: dashed;
    text-decoration-thickness: 1px;
    text-decoration-color: color-mix(in oklab, var(--note) 45%, transparent);
}

/* Review: the text and its panel side by side */

.review {
    display: grid;
    gap: 40px;
    align-items: start;
    max-width: 1240px;
    margin: 0 auto;
}

.review > * {
    min-width: 0;
}

@media (min-width: 1100px) {
    .review {
        grid-template-columns: minmax(0, 1fr) 380px;
    }

    .review-panel {
        position: sticky;
        top: 16px;
        max-height: calc(100vh - 32px);
        overflow-y: auto;
        padding-right: 4px;
    }
}

.review-text {
    max-width: 46rem;
}

.text .title-input,
.text .subtitle-input {
    display: block;
    width: 100%;
    min-height: 0;
    height: auto;
    padding: 0;
    border: 0;
    background: transparent;
    font-family: var(--font-serif);
    resize: none;
    field-sizing: content;
}

.text .title-input {
    font-size: 2.1rem;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.text .subtitle-input {
    margin: 8px 0 16px;
    color: var(--muted-foreground);
    font-size: 1.25rem;
    line-height: 1.4;
}

.text .title-input:focus-visible,
.text .subtitle-input:focus-visible {
    outline-offset: 4px;
}

.toolbar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    margin: 0 -8px;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--paper);
    box-shadow: var(--shadow-soft);
}

@media (max-width: 1023px) {
    .toolbar {
        top: 53px;
    }
}

.toolbar button {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 0;
    border-radius: var(--radius);
    background: none;
    color: var(--foreground);
    font: 500 13px var(--font-sans);
    cursor: pointer;
}

.toolbar button:hover {
    background: var(--secondary);
}

.toolbar-gap {
    flex: 1;
}

.rewrite {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    font-size: 13px;
}

.rewrite .muted {
    margin-right: 4px;
}

.rewrite input {
    width: 160px;
    height: 32px;
    margin: 0 2px;
}

.rewrite [data-ask] {
    color: var(--proposal);
}

.proposal-box {
    margin: 16px 0;
    padding: 14px;
    border: 1px solid color-mix(in oklab, var(--proposal) 30%, transparent);
    border-radius: var(--radius-lg);
    background: var(--proposal-soft);
}

.proposal-box .eyebrow {
    color: var(--proposal);
}

.proposal-text {
    margin-top: 6px;
    font: 16px/1.6 var(--font-serif);
    white-space: pre-wrap;
}

.proposal-text.error {
    color: var(--bad);
    font: 14px var(--font-sans);
}

.findings {
    margin-top: 6px;
    padding-left: 16px;
    color: var(--warn);
    font-size: 13px;
    list-style: disc;
}

.findings:empty {
    display: none;
}

.proposal-box .row {
    margin-top: 12px;
}

.editor {
    min-height: 50vh;
    padding: 24px 0;
}

.editor .tiptap {
    min-height: 300px;
    outline: none;
}

.text {
    position: relative;
}

/* The address of the link the author clicked, under its words. */
.link-card {
    position: absolute;
    z-index: 10;
    max-width: min(28rem, 100%);
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--popover);
    box-shadow: var(--shadow-lift);
    font-size: 13px;
}

.link-card a {
    color: var(--primary);
    overflow-wrap: anywhere;
}

.link-card a:hover {
    text-decoration: underline;
}

.save-bar {
    position: sticky;
    bottom: 0;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-top: 1px solid var(--border);
    background: var(--background);
    font-size: 13px;
}

.panel-section {
    padding-bottom: 24px;
}

.panel-section + .panel-section {
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.panel-section > h2 {
    font-size: 1.25rem;
}

.panel-section > h2 + p {
    margin-top: 2px;
    color: var(--muted-foreground);
    font-size: 13px;
}

.claim-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--card);
    font-size: 14px;
}

.claim-card.flash {
    outline: 2px solid var(--ring);
    outline-offset: 1px;
}

.claim-sentence {
    font: 16px/1.5 var(--font-serif);
    overflow-wrap: anywhere;
    cursor: pointer;
}

.claim-sentence:hover {
    text-decoration: underline;
    text-decoration-color: var(--border-strong);
}

.strict {
    display: flex;
    gap: 6px;
    color: var(--muted-foreground);
    font-size: 13px;
}

.strict .icon {
    margin-top: 2px;
    width: 14px;
    height: 14px;
}

.decide {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.decide .add-link {
    display: flex;
    flex-basis: 100%;
    gap: 6px;
}

.add-link input {
    flex: 1;
    height: 32px;
}

.checking {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--own);
    font-size: 13px;
}

.approve-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.covers {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}

.cover-choice {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 10px;
    align-items: start;
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
}

.cover-choice input {
    margin-top: 4px;
    accent-color: var(--primary);
}

.cover-choice img {
    width: 100%;
    height: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.cover-choice input:checked + img {
    outline: 2px solid var(--ring);
    outline-offset: 2px;
}

.cover-choice .muted {
    grid-column: 2;
}

.chart {
    margin-top: 16px;
}

.chart img {
    width: 100%;
    height: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
}

.chart figcaption {
    margin-top: 4px;
    font-size: 13px;
}

/* Quick article: a picture saved in its block, and a field with its button beside it */

.picture-row {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

.picture-row img {
    width: 96px;
    height: 72px;
    object-fit: cover;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.input-action {
    display: flex;
    gap: 8px;
}

.input-action input {
    flex: 1;
    min-width: 0;
}

/* The row of an author's voices above their Texts and Voice pages */

.voice-switch {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
}

.note-text {
    padding: 12px 14px;
    border-left: 2px solid var(--border-strong);
    background: var(--sunken);
    font: 15px/1.6 var(--font-serif);
}

.journal {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
    font-size: 13px;
}

.journal .mono {
    margin-right: 6px;
    color: var(--muted-foreground);
    font-size: 12px;
}

.share {
    font: 600 1.25rem/1.3 var(--font-serif);
}

.rule-offer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--paper);
}

.rule-offer p {
    flex-basis: 100%;
    font-family: var(--font-serif);
}

.rule-offer select {
    width: auto;
    height: 32px;
}

.all-claims summary {
    color: var(--muted-foreground);
    font-size: 14px;
}

.all-claims ul {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}

.all-claims li {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
}

.copy-state:empty {
    display: none;
}

/* Versions */

.diff ins {
    background: var(--ok-soft);
    text-decoration: underline;
    text-decoration-color: var(--ok);
}

.diff del {
    background: var(--bad-soft);
    color: var(--muted-foreground);
    text-decoration: line-through;
}

/* Interview */

.questions {
    display: flex;
    flex-direction: column;
    gap: 20px;
    counter-reset: question;
}

.questions .field > label::before {
    counter-increment: question;
    content: counter(question) ".";
    color: var(--muted-foreground);
    font: 12px var(--font-mono);
}

.questions .field > label {
    font-size: 15px;
}

/* Keys */

.secret {
    font-family: var(--font-mono);
}

/* Dialogs: a popover the page opens without a script */

.dialog {
    width: calc(100% - 2rem);
    max-width: 32rem;
    max-height: 90vh;
    margin: auto;
    padding: 24px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    background: var(--popover);
    color: var(--foreground);
    box-shadow: var(--shadow-lift);
}

.dialog::backdrop {
    background: color-mix(in oklab, var(--foreground) 30%, transparent);
    backdrop-filter: blur(2px);
}

.dialog > h2 {
    padding-right: 32px;
    font-size: 1.5rem;
    line-height: 1.2;
}

.dialog > h2 + p {
    margin-top: 6px;
}

.dialog-close {
    position: absolute;
    top: 16px;
    right: 16px;
    display: inline-flex;
    padding: 4px;
    border: 0;
    border-radius: var(--radius);
    background: none;
    color: var(--muted-foreground);
    cursor: pointer;
}

.dialog-close:hover {
    background: var(--secondary);
    color: var(--foreground);
}

/* Odds and ends of the pages */

.center {
    text-align: center;
}

.label {
    font: 500 14px/1.5 var(--font-sans);
}

h2.label {
    font-family: var(--font-sans);
}

.icon.big {
    width: 24px;
    height: 24px;
}

.own-ink {
    color: var(--own);
}

.own-ink .icon {
    width: 12px;
    height: 12px;
}

.validation-summary-valid {
    display: none !important;
}

.notice.validation-summary-errors ul {
    margin: 0;
}

.narrow-card {
    max-width: 36rem;
    margin: 0 auto 24px;
}

input.narrow-input {
    width: 6rem;
}

.grid-2.fit {
    grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 640px) {
    .grid-2.fit {
        grid-template-columns: auto minmax(0, 1fr);
    }
}

.price-amount .small {
    font-family: var(--font-sans);
    font-weight: 400;
}

details > summary.row-title::-webkit-details-marker {
    display: none;
}

.author-name {
    max-width: 20rem;
}

.article-title {
    font-size: 2.1rem;
    line-height: 1.15;
    letter-spacing: -0.02em;
    overflow-wrap: anywhere;
    hyphens: auto;
}

.price {
    margin-top: 4px;
    color: var(--muted-foreground);
    font-size: 14px;
}

.warn-border {
    border-color: color-mix(in oklab, var(--warn) 50%, transparent);
}

.own-border {
    border-color: color-mix(in oklab, var(--own) 40%, transparent);
}

/* A rule the author's edits suggest, with one of the edits. */
.suggested-rule + .suggested-rule {
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.grid-3 {
    display: grid;
    gap: 16px;
}

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

    .grid-2.wide-gap {
        gap: 24px;
    }
}

@media (min-width: 1024px) {
    .split.wide-aside {
        --aside: 340px;
    }

    .split.wider-aside {
        --aside: 360px;
    }
}

.aside .item,
.aside .item.term {
    grid-template-columns: minmax(0, 1fr);
}

/* Add texts: one form at a time, as the segmented control picks it */

.methods form[data-method] {
    display: none;
}

.methods:has(input[value="Publication"]:checked) form[data-method="Publication"],
.methods:has(input[value="Links"]:checked) form[data-method="Links"],
.methods:has(input[value="Paste"]:checked) form[data-method="Paste"],
.methods:has(input[value="Files"]:checked) form[data-method="Files"] {
    display: flex;
}

.preview {
    max-width: 62ch;
    margin-top: 8px;
    color: var(--muted-foreground);
    font-size: 13px;
    white-space: pre-wrap;
}

details > summary.row-title {
    list-style: none;
}

/* Sources */

.source-card {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--paper);
}

.source-card.unread {
    border-style: dashed;
    background: var(--sunken);
}

.source-title {
    margin-bottom: 6px;
    font: 500 15px/1.35 var(--font-serif);
    overflow-wrap: anywhere;
}

/* Outline */

.title-choice {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.title-choice input[type="radio"] {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    accent-color: var(--primary);
}

fieldset.card {
    min-width: 0;
    margin: 0;
}

.section-plan {
    margin: 0;
}

.section-plan.new {
    border-style: dashed;
    background: transparent;
}

/* Plans */

.plans {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    gap: 16px;
}

.plan.current {
    border-color: var(--primary);
    box-shadow: var(--shadow-soft);
}

.plan .price-amount {
    margin-top: 4px;
}

.compare select {
    width: auto;
    max-width: 100%;
}

/* The author's platforms: a card each. */

.platforms {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Preview as on the platform: each platform's default column and type, on white, whatever the portal's theme. */

.platform-preview {
    max-width: 728px;
    margin: 24px auto 0;
    padding: 40px 32px 56px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: #fff;
    color: #1a1a1a;
    box-shadow: var(--shadow-soft);
    font: 19px/1.6 Georgia, "Times New Roman", serif;
}

.platform-preview h1 {
    margin: 0 0 8px;
    font-size: 2.1rem;
    line-height: 1.2;
}

.platform-preview h2 {
    margin: 1.6em 0 0.5em;
    font-size: 1.5rem;
}

.platform-preview h3 {
    margin: 1.4em 0 0.4em;
}

.platform-preview p,
.platform-preview ul,
.platform-preview ol {
    margin: 0 0 1em;
}

.platform-preview ul {
    padding-left: 1.4em;
    list-style: disc;
}

.platform-preview ol {
    padding-left: 1.4em;
    list-style: decimal;
}

.platform-preview .subtitle {
    margin: 0 0 24px;
    color: #6b6b6b;
    font-size: 1.2rem;
}

.platform-preview figure {
    margin: 28px 0;
}

.platform-preview img {
    display: block;
    width: 100%;
    height: auto;
}

.platform-preview figcaption {
    margin-top: 6px;
    color: #6b6b6b;
    font: 0.8rem/1.4 var(--font-sans);
    text-align: center;
}

.platform-preview a {
    color: inherit;
    text-decoration: underline;
}

.platform-preview blockquote {
    margin: 1em 0;
    padding-left: 20px;
    border-left: 3px solid #1a1a1a;
}

.platform-note {
    padding: 8px 12px;
    border-radius: 4px;
    background: #f4f4f4;
    color: #555;
    font: 0.85rem/1.4 var(--font-sans);
}

.platform-substack h1,
.platform-substack h2 {
    font-family: var(--font-sans);
    font-weight: 700;
}

.platform-wordpress {
    max-width: 680px;
    font: 18px/1.7 var(--font-sans);
}

.platform-wordpress .feature {
    margin: -40px -32px 32px;
}

.platform-ghost {
    max-width: 720px;
    font: 20px/1.6 Georgia, serif;
}

.platform-ghost h1 {
    font: 800 2.6rem/1.1 var(--font-sans);
}

.platform-ghost h2 {
    font-family: var(--font-sans);
    font-weight: 700;
}

.platform-ghost .feature {
    margin: 32px -32px;
}

/* Kit's default email: a narrow column of sans-serif type. */
.platform-kit {
    max-width: 640px;
    font: 17px/1.6 var(--font-sans);
}

.platform-kit h1 {
    font-size: 1.7rem;
}

@media (max-width: 640px) {
    .platform-preview {
        padding: 24px 16px 40px;
    }

    .platform-wordpress .feature,
    .platform-ghost .feature {
        margin-right: -16px;
        margin-left: -16px;
    }

    .item,
    .item.term {
        grid-template-columns: minmax(0, 1fr);
    }
}
