/* Design tokens. Deep indigo text, violet actions, a warm amber accent on an
   off-white page (all text pairs meet WCAG AA). No external fonts or CDNs. */
:root {
  /* colour */
  --ink: #1E1B4B; --violet: #6D28D9; --violet-dark: #5B21B6; --violet-soft: #EDE9FE;
  --amber: #F59E0B; --amber-soft: #FEF3C7;
  --paper: #FAFAF9; --card: #FFFFFF; --line: #E7E5E4; --muted: #57534E;
  --error: #B91C1C; --ok: #047857;
  /* shape and space */
  --radius: 10px; --radius-small: 8px; --gap: 1rem; --gap-large: 2rem;
  --shadow: 0 1px 2px rgba(30, 27, 75, .06), 0 4px 16px rgba(30, 27, 75, .06);
  /* type */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --text-small: .875rem; --text-lead: 1.2rem; --text-hero: clamp(1.8rem, 5vw, 2.8rem);
  font-family: var(--font);
  color: var(--ink); background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; line-height: 1.5; }
a { color: var(--violet-dark); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--card); padding: .5rem; z-index: 10; }
.top { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap); padding: .75rem 1rem; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: .5rem; color: var(--ink); text-decoration: none; }
.wordmark { height: 32px; width: auto; }
.badge { background: var(--amber); color: var(--ink); font-size: .75rem; font-weight: 700; padding: .1rem .5rem; border-radius: 999px; }
.area-admin .top { background: var(--ink); color: var(--paper); }
.area-admin .top a, .area-admin .brand { color: var(--paper); }
.nav { display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
.nav a { text-decoration: none; padding: .25rem 0; }
.nav a[aria-current="page"] { font-weight: 700; border-bottom: 2px solid var(--amber); }
.account { margin-left: auto; display: flex; gap: .75rem; align-items: center; }
.account form { margin: 0; }
.demo-banner { background: #FEF3C7; color: var(--ink); text-align: center; font-size: .875rem; padding: .25rem 1rem; }
.main { max-width: 1040px; margin: 0 auto; padding: 1.5rem 1rem 3rem; display: grid; gap: var(--gap); }
.foot { text-align: center; color: var(--muted); font-size: .875rem; padding: 1rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; min-width: 0; overflow-x: auto; position: relative; }
/* position: relative makes the card the containing block of its visually hidden labels, so a
   label in a table that scrolls inside the card is clipped with it instead of widening the page. */
.card.narrow { max-width: 460px; width: 100%; margin: 0 auto; }
.grid { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.tile { text-decoration: none; color: inherit; }
.tile h2 { font-size: 1.05rem; margin: 0 0 .25rem; }
.tile.disabled { opacity: .7; }
.hero { padding: 3rem 0; text-align: center; }
.lead { font-size: 1.2rem; color: var(--muted); }
.eyebrow { text-transform: uppercase; letter-spacing: .05em; font-size: .75rem; color: var(--violet-dark); margin: 0; }
h1 { margin: .25rem 0 .75rem; font-size: 1.6rem; }
h2 { font-size: 1.2rem; }
.stack { display: grid; gap: .75rem; }
.inline { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; }
label { display: grid; gap: .25rem; font-weight: 600; font-size: .95rem; }
input, select { font: inherit; padding: .55rem .65rem; border: 1px solid #78716C; border-radius: 8px; background: #fff; color: var(--ink); width: 100%; }
/* Focus rings and control borders need 3:1 against what is behind them: ink on the light page,
   amber on the dark operator header and WeFund card (tests/accessibility.test.mjs). */
input:focus, select:focus, button:focus, a:focus { outline: 3px solid var(--ink); outline-offset: 2px; }
.area-admin .top :focus, .wefund :focus { outline-color: var(--amber); }
button, .button { font: inherit; font-weight: 600; background: var(--violet); color: #fff; border: 0; border-radius: 8px; padding: .6rem 1rem; cursor: pointer; text-decoration: none; display: inline-block; }
button:hover, .button:hover { background: var(--violet-dark); }
button.secondary { background: var(--card); color: var(--violet-dark); border: 1px solid var(--violet); }
button.link { background: none; color: inherit; padding: 0; text-decoration: underline; font-weight: 400; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; word-break: break-all; }
.small { font-size: .85rem; }
.error { color: var(--error); font-weight: 600; }
/* The field a refused form is about (form-errors.mjs): a thicker red border and the message under it. */
[aria-invalid="true"] { border: 2px solid var(--error); }
.field-error { display: block; color: var(--error); font-weight: 600; font-size: .9rem; margin-top: -.35rem; }
.ok { color: var(--ok); font-weight: 600; }
.notice { background: #EDE9FE; border-radius: 8px; padding: .75rem 1rem; margin: 0 0 .75rem; }
.secret { font-family: ui-monospace, monospace; font-size: 1.1rem; letter-spacing: .1em; background: var(--paper); padding: .5rem; border-radius: 6px; word-break: break-all; }
.codes { columns: 2; font-size: .95rem; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1rem; }
.facts dt { font-weight: 600; }
.facts dd { margin: 0; }
.events { list-style: none; padding: 0; margin: 0; display: grid; gap: .25rem; }
/* Public site */
.actions { margin-left: auto; display: flex; gap: 1rem; align-items: center; }
.small-button { padding: .4rem .9rem; }
.button.secondary-button { background: var(--card); color: var(--violet-dark); border: 1px solid var(--violet); }
.button.secondary-button:hover { background: var(--violet-soft); }
.area-public .hero { padding: 2.5rem 0 1.5rem; max-width: 760px; margin: 0 auto; }
.area-public .hero h1 { font-size: var(--text-hero); line-height: 1.15; letter-spacing: -.01em; }
.cta { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; }
.hero .cta { margin: 1.25rem 0 .5rem; }
.features { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.feature h2, .feature h3 { margin: 0 0 .35rem; font-size: 1.1rem; }
.feature p { margin: 0; }
.plans { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.plan { display: flex; flex-direction: column; gap: .25rem; box-shadow: var(--shadow); }
.plan h3 { margin: 0; font-size: 1.25rem; }
.plan p { margin: 0 0 .25rem; }
.plan .button { margin-top: auto; text-align: center; }
.plan.chosen { border: 2px solid var(--violet); }
.price { font-size: 2rem; font-weight: 800; }
.per { color: var(--muted); margin-left: .25rem; }
.ticks { padding-left: 1.1rem; margin: .5rem 0 1rem; font-size: .95rem; }
.ticks li::marker { color: var(--violet); }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.compare caption { text-align: left; font-weight: 700; padding: .75rem .5rem; }
.compare th[scope="row"] { font-weight: 600; }
.compare td, .compare thead th { min-width: 7rem; }
.faq details { border-bottom: 1px solid var(--line); padding: .75rem 0; }
.faq details:last-child { border-bottom: 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: .5rem 0 0; }
.prose { max-width: 760px; width: 100%; margin: 0 auto; }
.prose h2 { font-size: 1.1rem; margin-top: 1.5rem; }
.draft { background: var(--amber-soft); border-left: 4px solid var(--amber); padding: .75rem 1rem; border-radius: var(--radius-small); }
.wefund { background: var(--ink); color: var(--paper); border: 0; }
.wefund h2 { color: var(--amber); margin-top: 0; }
.steps { padding-left: 1.25rem; }
.foot-links { display: flex; flex-wrap: wrap; justify-content: center; gap: .25rem 1.25rem; margin-bottom: .5rem; }
.foot-links a { color: var(--muted); }
/* Sign-up and onboarding */
.results { list-style: none; padding: 0; margin: .75rem 0; display: grid; gap: .5rem; }
.results li { display: grid; gap: .1rem; padding: .5rem .75rem; border: 1px solid var(--line); border-radius: var(--radius-small); }
.company h3 { margin: 0; }
.company .facts { margin: .75rem 0; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-small); padding: .5rem .75rem; display: grid; gap: .35rem; }
legend { font-weight: 600; padding: 0 .25rem; }
label.choice { display: flex; gap: .5rem; align-items: flex-start; font-weight: 400; }
label.choice input { width: auto; margin-top: .3rem; }
.guarantee h2 { display: flex; align-items: center; gap: .5rem; margin-top: 0; }
.guarantee ul { padding-left: 1.1rem; margin: 0; display: grid; gap: .35rem; }
.dd-mark { font-weight: 800; font-size: .8rem; border: 2px solid var(--ink); border-radius: 6px; padding: 0 .3rem; }
.checklist ol { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.checklist li { display: flex; flex-wrap: wrap; gap: .25rem .75rem; align-items: center; }
.checklist .mark { width: 1.4rem; height: 1.4rem; border-radius: 999px; border: 2px solid var(--violet); display: inline-grid; place-items: center; font-size: .8rem; font-weight: 800; }
.checklist .done .mark { background: var(--ok); border-color: var(--ok); color: #fff; }
.checklist form { margin: 0; }
.progress { width: 100%; height: .5rem; accent-color: var(--violet); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* Billing */
.notice.warn { background: var(--amber-soft); border-left: 4px solid var(--amber); }
.doc-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--gap); margin-bottom: 1rem; }
.doc-head h1 { margin: 0; }
.seller { font-style: normal; font-size: var(--text-small); color: var(--muted); }
.lines { margin: 1rem 0; }
.num { text-align: right; white-space: nowrap; }
.lines tfoot th { text-align: right; }
form.plan { gap: .35rem; }
/* Dashboard, company profile and team */
.dashboard .tile p { margin: .25rem 0 0; }
a.tile:hover { border-color: var(--violet); }
.tile.wefund p { color: var(--paper); }
.due-overdue { color: var(--error); font-weight: 700; }
.due-soon { color: #92400E; font-weight: 600; }
.plain { list-style: none; padding: 0; margin: 0; }
.people { list-style: none; padding: 0; margin: 0; display: grid; }
.people > li { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: .5rem 1rem; padding: .75rem 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.people > li:last-child { border-bottom: 0; }
.people .role { font-weight: 600; }
.person-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: end; }
.person-actions form { margin: 0; }
.person-actions label { font-weight: 400; }
.person-actions select { width: auto; }
.person-actions details summary { cursor: pointer; color: var(--violet-dark); text-decoration: underline; }
.person-actions details form { margin-top: .5rem; max-width: 32rem; }
@media (max-width: 640px) { .people > li { grid-template-columns: 1fr; } }
/* Compliance calendar */
textarea { font: inherit; padding: .55rem .65rem; border: 1px solid #78716C; border-radius: 8px; background: #fff; color: var(--ink); width: 100%; resize: vertical; }
textarea:focus { outline: 3px solid var(--ink); outline-offset: 2px; }
.pair { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.month { font-size: 1rem; margin: 1rem 0 .25rem; color: var(--violet-dark); }
.dates { list-style: none; padding: 0; margin: 0; display: grid; }
.dates > li { display: grid; grid-template-columns: 10rem minmax(0, 1fr) auto; gap: .25rem 1rem; padding: .6rem 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.dates > li:last-child { border-bottom: 0; }
.dates .when { font-weight: 600; }
.dates .is-done .item-title { text-decoration: line-through; color: var(--muted); }
.item-actions { display: flex; flex-wrap: wrap; gap: .5rem .75rem; align-items: center; justify-content: flex-end; }
.item-actions form { margin: 0; }
.tag { display: inline-block; font-size: .75rem; font-weight: 600; background: var(--violet-soft); color: var(--violet-dark); border-radius: 999px; padding: 0 .5rem; white-space: nowrap; }
.due-done { color: var(--ok); font-weight: 600; }
@media (max-width: 640px) { .dates > li { grid-template-columns: 1fr; } .item-actions { justify-content: flex-start; } }
@media print {
  .top, .demo-banner, .foot, .print-hide, .skip { display: none !important; }
  body, .card { background: #fff; }
  .card { border: 0; padding: 0; }
  .main { padding: 0; max-width: none; }
}
@media (max-width: 640px) { .facts { grid-template-columns: 1fr; } .facts dd { margin-bottom: .35rem; } }
/* File vault */
.files, .folders { list-style: none; padding: 0; margin: 0; display: grid; }
.files > li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .25rem 1rem; padding: .6rem 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.folders > li { display: flex; flex-wrap: wrap; gap: .25rem .75rem; align-items: baseline; padding: .5rem 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.files > li:last-child, .folders > li:last-child { border-bottom: 0; }
.file-name { font-weight: 600; }
.folders a { font-weight: 600; }
.search { margin-top: .75rem; }
.search input { min-width: 0; }
input[type="file"] { max-width: 100%; }
@media (max-width: 640px) { .files > li { grid-template-columns: 1fr; } }
/* Contracts */
.templates { list-style: none; padding: 0; margin: 0; display: grid; }
.templates > li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .25rem 1rem; align-items: center; padding: .6rem 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.templates > li:last-child { border-bottom: 0; }
.templates p { margin: .15rem 0 0; }
.contract-text { max-width: 46rem; line-height: 1.6; overflow-wrap: anywhere; }
.contract-text h1 { font-size: 1.5rem; }
.contract-text h2 { font-size: 1.05rem; margin: 1.25rem 0 .25rem; }
.contract-text .doc-title { font-size: 1.5rem; margin: 0 0 .75rem; }
.contract-text h3 { font-size: 1.05rem; margin: 1.25rem 0 .25rem; }
.contract-text p { margin: 0 0 .75rem; }
.contract-text ul { margin: 0 0 .75rem; padding-left: 1.25rem; }
.contract-foot { border-top: 1px solid var(--line); margin-top: 1.5rem; padding-top: .5rem; }
.contract-edit textarea[name="body"] { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: .9rem; line-height: 1.5; }
@media (max-width: 640px) { .templates > li { grid-template-columns: 1fr; } }
@media print { .contract-text { max-width: none; } .contract-text h2, .contract-text h3 { break-after: avoid; } .contract-foot { break-inside: avoid; } }

/* E-signing and the contract tracker */
.facts { display: grid; grid-template-columns: minmax(8rem, 14rem) minmax(0, 1fr); gap: .35rem 1rem; margin: 0 0 1rem; overflow-wrap: anywhere; }
.facts dt { font-weight: 600; }
.facts dd { margin: 0; }
.signer-facts { border-top: 1px solid var(--line); padding-top: .75rem; }
details summary { cursor: pointer; margin: 1rem 0 .5rem; color: var(--violet-dark); }
@media (max-width: 640px) { .facts { grid-template-columns: 1fr; } .facts dd { margin-bottom: .35rem; } }
@media print { .certificate { break-after: page; } .facts, .signer-facts { break-inside: avoid; } }

/* Advice: answers, expert replies and the general-information line */
.qa { border-left: 4px solid var(--violet); padding-left: .9rem; margin: 0 0 1rem; }
.qa-question, .plain-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.qa-question { font-weight: 600; }
.qa-refused { border-left-color: var(--amber); }
.general-info { background: var(--amber-soft); border-radius: var(--radius-small); padding: .5rem .75rem; }

/* Notifications, activity and the email library */
.filters { display: flex; flex-wrap: wrap; gap: .35rem .5rem; margin: 0 0 1rem; }
.filters a { padding: .15rem .6rem; border: 1px solid var(--line); border-radius: 999px; font-size: .9rem; text-decoration: none; }
.filters a[aria-current] { background: var(--violet-soft); color: var(--violet-dark); font-weight: 600; border-color: var(--violet); }
.notifications > li.unread .file-name::before { content: ""; display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; background: var(--amber); margin-right: .4rem; }
.notifications p { margin: .15rem 0 0; }
.email-body { white-space: pre-wrap; overflow-wrap: anywhere; font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: .9rem; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius-small); padding: .75rem; margin: 0; }

@media (max-width: 640px) {
  .account { margin-left: 0; width: 100%; justify-content: space-between; }
  .actions { margin-left: 0; }
  .area-public .top { gap: .5rem 1rem; }
  .codes { columns: 1; }
  h1 { font-size: 1.35rem; }
}
