/* SoloInvoicer
   One stylesheet for the marketing site, the app screens, and the client page.
   Sections: tokens, base, controls, invoice sheet, marketing, app, client page, print. */

@font-face {
  font-family: "Schibsted Grotesk";
  src: url("/assets/fonts/SchibstedGrotesk-Variable.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */

:root {
  --paper: #ffffff;
  --desk: #eef1f5;
  --graphite: #23272f;
  --ink: #1f3d8c;
  --ink-deep: #172e6b;
  --carbon: #f5e38a;
  --paid: #1c7a4e;
  --overdue: #b42318;

  /* Derived neutrals, all from graphite on paper or desk. */
  --muted: #555d6b;      /* 6.4:1 on paper, 5.6:1 on desk */
  --rule: #d6dbe3;
  --rule-strong: #b9c0cc;
  --desk-deep: #e2e6ec;

  --paid-tint: #e2f1e9;
  --overdue-tint: #fbe7e5;

  --font: "Schibsted Grotesk", ui-sans-serif, system-ui, sans-serif;

  /* Type scale, roughly a major third from 17px body. */
  --t-small: 0.875rem;   /* 14 */
  --t-body: 1.0625rem;   /* 17 */
  --t-lead: 1.25rem;     /* 20 */
  --t-h3: 1.3125rem;     /* 21 */
  --t-h2: clamp(1.75rem, 1.2rem + 1.6vw, 2.375rem);
  --t-h1: clamp(2.375rem, 1.4rem + 3.4vw, 3.75rem);

  --margin: clamp(20px, 5vw, 64px);
  --max: 1200px;
  --gutter: clamp(16px, 2.4vw, 32px);

  --sheet-shadow: 0 1px 2px rgb(35 39 47 / 0.06), 0 18px 40px -12px rgb(35 39 47 / 0.22);
}

/* ---------- Base ---------- */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--desk);
  color: var(--graphite);
  font-family: var(--font);
  font-size: var(--t-body);
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--carbon); color: var(--graphite); }

h1, h2, h3 {
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.022em;
  line-height: 1.1;
  text-wrap: balance;
}

h3 { font-size: var(--t-h3); font-weight: 700; letter-spacing: -0.012em; line-height: 1.25; }

p { margin: 0; text-wrap: pretty; }

a { color: var(--ink); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  border-radius: 2px;
}

.num,
.sheet,
table.ledger {
  font-variant-numeric: tabular-nums lining-nums;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 12px; top: -60px;
  background: var(--paper);
  padding: 10px 14px;
  z-index: 10;
}
.skip-link:focus { top: 12px; }

/* ---------- Controls ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-weight: 650;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { background: var(--ink-deep); border-color: var(--ink-deep); }
.btn:active { transform: translateY(1px); }

.btn-small { min-height: 38px; padding: 0 14px; font-size: 0.9375rem; }

.btn-quiet {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--rule-strong);
}
.btn-quiet:hover { background: var(--paper); border-color: var(--ink); }

.text-link { font-weight: 600; }

/* Statuses. Only these may use the paid and overdue colours. */
.status {
  display: inline-block;
  padding: 2px 9px 3px;
  border-radius: 4px;
  font-size: var(--t-small);
  font-weight: 650;
  line-height: 1.4;
  white-space: nowrap;
  background: var(--desk);
  color: var(--graphite);
  box-shadow: inset 0 0 0 1px var(--rule);
}
.status-paid { background: var(--paid-tint); color: var(--paid); box-shadow: inset 0 0 0 1px #bcdccb; }
.status-overdue { background: var(--overdue-tint); color: var(--overdue); box-shadow: inset 0 0 0 1px #f2c3be; }
.status-draft { background: var(--paper); color: var(--muted); box-shadow: inset 0 0 0 1px var(--rule-strong); }

/* ---------- Invoice sheet ---------- */

.sheet {
  position: relative;
  background: var(--paper);
  border-radius: 3px;
  box-shadow: var(--sheet-shadow);
  padding: clamp(22px, 3.4vw, 44px);
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--graphite);
}

.sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 22px;
  border-bottom: 2px solid var(--graphite);
}

.sheet-from { font-size: var(--t-small); color: var(--muted); }
.sheet-from strong { display: block; color: var(--graphite); font-size: 1.0625rem; font-weight: 750; letter-spacing: -0.01em; }

.sheet-id { text-align: right; }
.sheet-id .doc-type { font-size: var(--t-small); color: var(--muted); }
.sheet-id .doc-number { display: block; white-space: nowrap; font-size: 1.375rem; font-weight: 800; letter-spacing: -0.015em; line-height: 1.2; margin-bottom: 6px; }

.sheet-parties {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px 28px;
  padding: 20px 0 24px;
}

.sheet-label { display: block; font-size: var(--t-small); color: var(--muted); }

.bill-to strong { font-weight: 650; }

.sheet-dates { margin: 0; display: grid; grid-template-columns: auto auto; gap: 2px 18px; align-content: start; }
.sheet-dates dt { color: var(--muted); font-size: var(--t-small); line-height: 1.75; }
.sheet-dates dd { margin: 0; text-align: right; font-weight: 550; }
.sheet-dates .late { color: var(--overdue); font-weight: 650; }

table.lines {
  width: 100%;
  border-collapse: collapse;
}
table.lines th {
  font-size: var(--t-small);
  font-weight: 550;
  color: var(--muted);
  text-align: left;
  padding: 0 0 8px;
  border-bottom: 1px solid var(--rule);
}
table.lines td {
  padding: 11px 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
table.lines .r { text-align: right; padding-left: 14px; white-space: nowrap; }
table.lines td.desc { padding-right: 8px; }
table.lines td.desc small { display: block; color: var(--muted); font-size: var(--t-small); }

.sheet-totals {
  margin: 0 0 0 auto;
  width: min(100%, 300px);
  display: grid;
  grid-template-columns: 1fr auto;
  padding-top: 12px;
}
.sheet-totals dt, .sheet-totals dd { margin: 0; padding: 3px 0; }
.sheet-totals dt { color: var(--muted); }
.sheet-totals dd { text-align: right; }

.sheet-totals .total-row {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 2px solid var(--graphite);
  display: flex;
  align-items: flex-end;
}
.sheet-totals dt.total-row { padding-bottom: 6px; }
.sheet-totals dd.total-row { justify-content: flex-end; }
.sheet-totals dt.total-row { color: var(--graphite); font-weight: 650; }
.sheet-totals dd.total-row {
  font-size: clamp(1.75rem, 1.3rem + 1.4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.05;
}

.sheet-totals .due-row { font-weight: 650; color: var(--graphite); }
.sheet-totals .due-row { margin-top: 6px; }
.sheet-totals dd.due-row { padding: 3px 0 3px 8px; background: var(--carbon); border-radius: 2px; }
.sheet-totals dt.due-row { padding-left: 8px; background: var(--carbon); border-radius: 2px 0 0 2px; }
.sheet-totals dd.due-row { padding-right: 8px; border-radius: 0 2px 2px 0; }

.sheet-foot {
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  font-size: var(--t-small);
  color: var(--muted);
}
.sheet-foot .pay-line strong { color: var(--graphite); font-weight: 600; }

/* ---------- Marketing ---------- */

.wrap {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--margin));
  margin: 0 auto;
  padding: 0 var(--margin);
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
}

.site-header { padding: 22px 0; }
.site-header .wrap { display: flex; align-items: center; gap: 36px; }

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.025em;
  text-decoration: none;
}
.wordmark svg { width: 24px; height: 28px; flex: none; }

.site-nav { display: flex; align-items: center; gap: 28px; flex: 1; }
.site-nav a { color: var(--graphite); text-decoration: none; font-weight: 520; }
.site-nav a:hover { color: var(--ink); text-decoration: underline; }
.site-nav a.btn, .site-nav a.btn:hover { color: #fff; text-decoration: none; }
.site-nav .nav-end { margin-left: auto; display: flex; align-items: center; gap: 24px; }

body:not(.app-body) #main > section { padding: clamp(64px, 9vw, 120px) 0; }

/* Section heads are centered above the content they introduce. */
.section-head { grid-column: 1 / -1; max-width: 42rem; margin: 0 auto clamp(40px, 5vw, 64px); text-align: center; }
.section-head h2 { font-size: var(--t-h2); }
.section-head p { margin: 14px auto 0; font-size: var(--t-lead); color: var(--muted); max-width: 34em; line-height: 1.5; }

/* Hero */

#main > .hero { padding: clamp(32px, 6vw, 80px) 0 clamp(72px, 9vw, 128px); }
.hero .grid { align-items: center; row-gap: 56px; }
.hero-copy { grid-column: 1 / span 5; }
.hero-copy h1 { font-size: var(--t-h1); font-weight: 850; letter-spacing: -0.032em; line-height: 1.02; }
.hero-copy p { margin-top: 22px; font-size: var(--t-lead); line-height: 1.5; max-width: 26em; }
.hero-actions { margin-top: 34px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 26px; }
.hero-note { margin-top: 18px; font-size: var(--t-small); color: var(--muted); }

.hero-sheet-col { grid-column: 7 / span 6; }
.hero .sheet { rotate: 0.6deg; }

/* The one motion moment: Sent becomes Paid. A rubber stamp lands, the sheet takes
   the knock, and the status and paid date update. Without JS the Paid state shows. */
.paid-field { display: contents; }
.js .hero .sheet[data-state="sent"] .status-paid { display: none; }
.js .hero .sheet[data-state="paid"] .status-sent { display: none; }
.js .hero .sheet[data-state="sent"] .paid-field dd,
.js .hero .sheet[data-state="sent"] .paid-field dt { opacity: 0; }
.js .hero .sheet[data-state="sent"] .stamp { opacity: 0; }

.js .hero .sheet[data-state="paid"] .stamp { animation: stamp-down 300ms cubic-bezier(.5, 0, .75, 0) both; }
.js .hero .sheet[data-state="paid"] { animation: knock 360ms ease-out 280ms both; }
.js .hero .sheet[data-state="paid"] .paid-field dt,
.js .hero .sheet[data-state="paid"] .paid-field dd { transition: opacity 300ms ease 380ms; }

@keyframes stamp-down {
  from { transform: rotate(-4deg) scale(1.9); opacity: 0; }
  60% { opacity: .9; }
  to { transform: rotate(-9deg) scale(1); opacity: .9; }
}
@keyframes knock {
  0% { translate: 0 0; }
  30% { translate: 0 3px; }
  100% { translate: 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.artifact {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--rule-strong);
  border-radius: 6px;
  background: var(--paper);
  font-size: 0.9375rem;
  line-height: 1.4;
  overflow: hidden;
}
.a-where { padding: 6px 14px; background: var(--desk); border-bottom: 1px solid var(--rule); font-size: 0.8125rem; color: var(--muted); }
.a-body { flex: 1; padding: 14px; }
.a-line { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; }
.artifact .a-desc { font-weight: 600; min-width: 0; }
.artifact .a-calc { color: var(--muted); white-space: nowrap; }
.artifact .a-amount { font-weight: 700; white-space: nowrap; }
/* The editor snippet: all three lines of INV-0042 and its total. */
.a-lines { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 6px 0; }
.a-lines .a-amount { padding-left: 16px; }
.a-lines .a-desc { font-weight: 500; }
.a-total-label { margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--rule); font-weight: 650; }
.a-lines .a-total { margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--rule); }
.a-mail { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; }
.mail-from { font-weight: 700; }
.mail-subject { color: var(--muted); }
.mail-link { margin-top: 10px; padding: 5px 12px; border-radius: 5px; background: var(--ink); color: #fff; font-size: var(--t-small); font-weight: 650; }

/* Invoice anatomy */
.anatomy { position: relative; grid-column: 1 / -1; }
.anatomy-stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 540px) minmax(0, 1fr);
}
.anatomy-stage .proof { grid-column: 2; }
.callouts { list-style: none; margin: 0; padding: 0; }
.callout { max-width: 300px; }
.callout h3 { font-size: 1.0625rem; margin-bottom: 4px; }
.callout p { color: var(--muted); font-size: 1rem; line-height: 1.5; }

.marker {
  display: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
  font-variant-numeric: lining-nums;
  flex: none;
}

/* Desktop: callouts sit beside the sheet at the height of the part they describe.
   site.js sets each callout's top, width, and --leader length. */
@media (min-width: 1100px) {
  .js .callouts { position: absolute; inset: 0; pointer-events: none; }
  .js .callout { position: absolute; pointer-events: auto; transform: translateY(-14px); }
  .js .callout .marker { display: none; }
  .js .callout[data-side="left"] { left: 0; text-align: right; }
  .js .callout[data-side="right"] { right: 0; }
  .js .callout::after {
    content: "";
    position: absolute;
    top: 13px;
    width: var(--leader, 40px);
    border-top: 1px solid var(--graphite);
  }
  .js .callout[data-side="left"]::after { left: calc(100% + 16px); }
  .js .callout[data-side="right"]::after { right: calc(100% + 16px); }
  .js .callout::before {
    content: "";
    position: absolute;
    top: 10px;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--graphite);
  }
  .js .callout[data-side="left"]::before { left: calc(100% + 16px + var(--leader, 40px) - 3px); }
  .js .callout[data-side="right"]::before { right: calc(100% + 16px + var(--leader, 40px) - 3px); }
}

/* Narrower: numbered markers on the sheet and a matching list below it. */
@media (max-width: 1099.98px), (scripting: none) {
  .anatomy-stage { grid-template-columns: minmax(0, 640px); justify-content: center; }
  .anatomy-stage .proof { grid-column: 1; }
  .marker { display: inline-block; }
  .sheet .marker { position: absolute; }
  .callouts { margin: 40px auto 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px var(--gutter); max-width: 640px; }
  .callout { display: flex; gap: 14px; max-width: none; }
  .callout .marker { margin-top: 2px; }
}

[data-part] { position: relative; }
.sheet .marker[data-for="client"] { left: -34px; top: 0; }
.sheet .marker[data-for="due"] { right: -34px; top: 0; }
.sheet .marker[data-for="pay"] { left: -34px; top: -2px; }
.sheet .marker[data-for="pdf"] { right: -34px; top: -2px; }

.part-highlight { background: color-mix(in srgb, var(--carbon) 55%, transparent); border-radius: 2px; box-shadow: 0 0 0 6px color-mix(in srgb, var(--carbon) 55%, transparent); }

.pricing-foot { max-width: 40em; margin: 32px auto 0; text-align: center; color: var(--muted); }

/* Closing line */
body:not(.app-body) #main > .closing { padding: clamp(72px, 10vw, 136px) 0; text-align: center; border-top: 1px solid var(--rule); }
.closing h2 { font-size: var(--t-h2); max-width: 18em; margin: 0 auto; }
.closing p { margin-top: 14px; color: var(--muted); font-size: var(--t-lead); }
.closing .btn { margin-top: 28px; }

/* Footer */
.site-footer { position: relative; padding: 56px 0 64px; border-top: 1px solid var(--rule-strong); font-size: 0.9375rem; background: var(--desk); }
.site-footer .grid { row-gap: 28px; }
.footer-brand { grid-column: 1 / span 4; }
.footer-brand p { margin-top: 10px; color: var(--muted); max-width: 22em; }
.footer-links { grid-column: 6 / span 3; list-style: none; margin: 0; padding: 0; }
.footer-links li + li { margin-top: 6px; }
.footer-links a { color: var(--graphite); text-decoration: none; }
.footer-links a:hover { color: var(--ink); text-decoration: underline; }
.footer-meta { grid-column: 9 / span 4; color: var(--muted); }
.footer-meta p { max-width: 22em; text-wrap: balance; }
.footer-meta p + p { margin-top: 10px; }

/* Plain pages: privacy, terms, 404 */
.page-plain { padding: clamp(40px, 6vw, 80px) 0 clamp(72px, 9vw, 120px); }
.page-plain .prose { max-width: 40em; margin: 0 auto; }
.prose h1 { font-size: var(--t-h2); margin-bottom: 10px; }
.prose h2 { font-size: 1.3125rem; letter-spacing: -0.012em; margin: 40px 0 10px; }
.prose p, .prose ul { margin: 0 0 14px; }
.prose ul { padding-left: 1.2em; }
.prose .updated { color: var(--muted); margin-bottom: 32px; }

.not-found { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.not-found h1 { font-size: var(--t-h1); }
.not-found p { margin-top: 18px; font-size: var(--t-lead); max-width: 26em; }
.not-found .sb-link { margin-top: 28px; font-size: var(--t-small); }
.not-found .hero-actions { margin-top: 28px; }

@media (max-width: 960px) {
  .hero-copy, .hero-sheet-col { grid-column: 1 / -1; }
  .hero-sheet-col { width: 100%; max-width: 620px; margin: 0 auto; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-links { grid-column: 1 / span 6; }
  .footer-meta { grid-column: 7 / span 6; }
  .not-found { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .callouts { grid-template-columns: 1fr; }
  .footer-links, .footer-meta { grid-column: 1 / -1; }
  .hero .sheet { rotate: none; }
}
/* Header: below 860px, account actions share the wordmark's row and the content links get a row of their own. */
@media (max-width: 859.98px) {
  .site-header .wrap { flex-wrap: wrap; gap: 14px 20px; }
  .site-nav { order: 3; flex-basis: 100%; gap: 18px; font-size: 0.9375rem; white-space: nowrap; }
  .site-nav a { padding-block: 6px; }
  .site-nav .nav-end { display: none; }
  .site-header .wordmark { font-size: 1.125rem; }
  .header-account { margin-left: auto; display: flex; align-items: center; gap: 16px; }
  .header-account a:not(.btn) { color: var(--graphite); text-decoration: none; font-weight: 520; font-size: 0.9375rem; padding-block: 6px; }
}
@media (min-width: 860px) { .header-account { display: none; } }

@media (max-width: 520px) {
  .sheet-parties { grid-template-columns: 1fr; }
  .sheet-dates { grid-template-columns: auto 1fr; }
  .sheet-dates dd { text-align: left; }
  table.lines .col-rate { display: none; }
  .sheet .marker[data-for="client"], .sheet .marker[data-for="pay"] { left: -28px; }
  .sheet .marker[data-for="due"], .sheet .marker[data-for="pdf"] { right: -28px; }
  .anatomy-stage { padding: 0 14px; }
}

/* ---------- App ---------- */

.app-body { background: var(--desk); }

.app-shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 22px 14px 18px;
  background: var(--paper);
  border-right: 1px solid var(--rule);
}
.sidebar .wordmark { padding: 0 10px; margin-bottom: 30px; font-size: 1.125rem; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a, .sidebar-foot a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--graphite);
  text-decoration: none;
  font-weight: 520;
}
.sidebar nav a:hover, .sidebar-foot a:hover { background: var(--desk); }
.sidebar nav a[aria-current="page"] { background: var(--desk); color: var(--ink); font-weight: 650; box-shadow: inset 3px 0 0 var(--ink); }
.sidebar svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.sidebar-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--rule); display: flex; flex-direction: column; gap: 2px; }

/* Account menu: the avatar and name at the bottom of the sidebar open it. */
.account { position: relative; }
.account-btn {
  display: flex; align-items: center; gap: 10px; width: 100%;
  margin-top: 6px; padding: 8px 10px; border: 0; border-radius: 6px;
  background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.account-btn:hover, .account-btn[aria-expanded="true"] { background: var(--desk); }
.avatar {
  display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%;
  background: var(--ink); color: #fff; font-size: 0.8125rem; font-weight: 650; letter-spacing: 0.02em;
}
.account .who { flex: 1; min-width: 0; font-size: var(--t-small); color: var(--muted); line-height: 1.4; }
.account .who strong { display: block; color: var(--graphite); font-weight: 600; }
.account-menu {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); z-index: 20;
  display: flex; flex-direction: column; padding: 6px;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 8px;
  outline: 4px solid rgba(35, 39, 47, 0.06);
}
.account-menu[hidden] { display: none; }
.sidebar .account-menu a, .account-menu a {
  display: block; padding: 8px 10px; border-radius: 5px;
  color: var(--graphite); text-decoration: none; font-weight: 520; font-size: 0.9375rem;
}
.sidebar .account-menu a, .account-menu a { display: flex; align-items: center; gap: 10px; }
.account-menu svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; color: var(--muted); }
.account-menu a:hover svg { color: var(--graphite); }
.account-menu a:hover, .account-menu a:focus-visible { background: var(--desk); }
.account-menu hr { border: 0; border-top: 1px solid var(--rule); margin: 6px 4px; }
.account-compact { display: none; }

.app-main { width: 100%; padding: 34px clamp(20px, 4vw, 56px) 72px; max-width: 1180px; margin: 0 auto; }
.app-main.narrow { max-width: 820px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 30px; }
.page-head h1 { font-size: 2rem; letter-spacing: -0.026em; }
.page-head p { margin-top: 6px; color: var(--muted); }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }

.panel { background: var(--paper); border: 1px solid var(--rule); border-radius: 8px; }
.panel + .panel, .panel + h2, .ledger-block + .ledger-block { margin-top: 40px; }

.ledger-block h2 { font-size: 1.25rem; letter-spacing: -0.014em; display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.ledger-block h2 .num { font-weight: 800; }
.ledger-block h2 small { font-size: var(--t-small); font-weight: 500; color: var(--muted); letter-spacing: 0; }

table.ledger { width: 100%; border-collapse: collapse; }
table.ledger th {
  text-align: left;
  font-size: var(--t-small);
  font-weight: 550;
  color: var(--muted);
  padding: 12px 18px;
  border-bottom: 1px solid var(--rule);
}
table.ledger td { padding: 14px 18px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
table.ledger tbody tr:last-child td { border-bottom: 0; }
table.ledger .r { text-align: right; }
table.ledger td.amount { font-weight: 650; }
table.ledger tbody tr:hover, table.ledger tbody tr:focus-within { background: color-mix(in srgb, var(--carbon) 32%, var(--paper)); }
table.ledger a.row-link { color: var(--graphite); text-decoration: none; font-weight: 600; }
table.ledger a.row-link:hover { text-decoration: underline; }
table.ledger .sub { display: block; color: var(--muted); font-size: var(--t-small); }
table.ledger tfoot td { border-top: 2px solid var(--graphite); border-bottom: 0; font-weight: 700; }
table.ledger .late { color: var(--overdue); font-weight: 600; }
table.ledger .nowrap { white-space: nowrap; }

.owed-summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-bottom: 34px; }
.owed-summary .figure { font-size: clamp(2.25rem, 1.6rem + 2vw, 3rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.owed-summary .figure span { background: var(--carbon); padding: 0 6px; border-radius: 2px; }
.owed-summary p { color: var(--muted); }

.app-mobile-bar { display: none; }

/* Editor */
.editor { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 32px; align-items: start; }
.editor-form { padding: 26px; }
.editor-preview { position: sticky; top: 24px; }
.editor-preview .preview-label { font-size: var(--t-small); color: var(--muted); margin-bottom: 10px; display: flex; justify-content: space-between; }

fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset + fieldset { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--rule); }
legend { float: left; width: 100%; font-weight: 700; font-size: 1.0625rem; letter-spacing: -0.01em; padding: 0; margin-bottom: 14px; }

legend ~ * { clear: both; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field + .field { margin-top: 14px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-row + .field, .field + .field-row, .field-row + .field-row { margin-top: 14px; }
.field-row .field + .field { margin-top: 0; }
.field label, .field .label { font-size: var(--t-small); font-weight: 600; }
.field .hint { font-size: var(--t-small); color: var(--muted); }

input[type="text"], input[type="email"], input[type="password"], input[type="date"], input[type="number"], select, textarea {
  width: 100%;
  min-height: 42px;
  padding: 8px 11px;
  border: 1px solid var(--rule-strong);
  border-radius: 5px;
  background: var(--paper);
  color: var(--graphite);
  font: inherit;
  font-size: 1rem;
  font-variant-numeric: tabular-nums lining-nums;
}
textarea { min-height: 84px; resize: vertical; line-height: 1.45; }
input:focus, input:focus-within, select:focus, textarea:focus { outline: 3px solid var(--ink); outline-offset: 0; border-color: var(--ink); border-radius: 5px; }
input[readonly] { background: var(--desk); color: var(--muted); }

.line-items { display: flex; flex-direction: column; gap: 10px; }
.line-item { display: grid; grid-template-columns: minmax(0, 1fr) 76px 92px 34px; gap: 8px; align-items: end; }
.line-item .field + .field { margin-top: 0; }
.line-item:not(:first-child) .field label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.icon-btn {
  width: 34px; height: 42px;
  display: grid; place-items: center;
  border: 0; border-radius: 5px;
  background: transparent; color: var(--muted);
  cursor: pointer;
}
.icon-btn:hover { background: var(--desk); color: var(--graphite); }
.icon-btn svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; }
.add-line { margin-top: 12px; background: none; border: 0; padding: 6px 0; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
.add-line:hover { text-decoration: underline; }

.form-actions { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--rule); display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.demo-note { font-size: var(--t-small); color: var(--muted); }
.demo-note[data-shown] { color: var(--graphite); }

.editor-preview .sheet { font-size: 0.875rem; }
.editor-preview .sheet-totals dd.total-row { font-size: 1.875rem; }

/* Clients and settings */
.settings-form { padding: 28px; }

@media (max-width: 1080px) {
  .editor { grid-template-columns: 1fr; }
  .editor-preview { position: static; }
}

@media (max-width: 860px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .sidebar { display: none; }
  .app-mobile-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    flex-wrap: wrap;
    row-gap: 10px;
  }
  .app-mobile-bar .wordmark { font-size: 1.0625rem; flex-basis: 100%; }
  .app-mobile-bar a:not(.wordmark) { color: var(--graphite); text-decoration: none; font-size: 0.9375rem; font-weight: 550; white-space: nowrap; }
  .app-mobile-bar a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; }
  .app-mobile-bar .wordmark { order: -2; flex: 1 0 calc(100% - 60px); }
  .app-mobile-bar .account-compact { display: block; order: -1; }
  .account-compact .account-btn { margin: 0; padding: 2px; border-radius: 50%; }
  .account-compact .account-menu { left: auto; right: 0; bottom: auto; top: calc(100% + 8px); width: 220px; }
  .app-mobile-bar .account-menu a { white-space: normal; font-size: 0.9375rem; text-decoration: none; }
  .app-main { padding-top: 26px; }
}

@media (max-width: 640px) {
  table.ledger .hide-sm { display: none; }
  table.ledger th, table.ledger td { padding-left: 12px; padding-right: 12px; }
}
@media (max-width: 400px) {
  table.ledger th, table.ledger td { padding-left: 9px; padding-right: 9px; font-size: 0.9375rem; }
  table.ledger .sub { font-size: 0.8125rem; }
  .field-row { grid-template-columns: 1fr; }
  .line-item { grid-template-columns: minmax(0, 1fr) 64px 34px; }
  .line-item .field-rate { grid-column: 2; grid-row: 2; }
  .line-item .field-desc { grid-column: 1 / -1; }
  .line-item .field-qty { grid-column: 1; grid-row: 2; }
  .line-item .icon-btn { grid-column: 3; grid-row: 2; }
  .line-item { grid-template-columns: 1fr 1fr 34px; }
  .line-item:not(:first-child) .field label { position: static; width: auto; height: auto; clip: auto; }
  .line-item + .line-item { padding-top: 12px; border-top: 1px dashed var(--rule); }
  .editor-form, .settings-form { padding: 20px; }
}

/* ---------- Client-facing invoice page ---------- */

.client-page { min-height: 100vh; display: flex; flex-direction: column; }
.client-bar { padding: 18px var(--margin); display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; max-width: 960px; width: 100%; margin: 0 auto; }
.client-bar .from { font-weight: 700; letter-spacing: -0.01em; }
.client-bar .from small { display: block; font-weight: 400; color: var(--muted); font-size: var(--t-small); letter-spacing: 0; }
.client-main { flex: 1; max-width: 960px; width: 100%; margin: 0 auto; padding: 8px var(--margin) 56px; display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 32px; align-items: start; }
.pay-box { position: sticky; top: 24px; }
.pay-box .amount-due { font-size: var(--t-small); color: var(--muted); }
.pay-box .amount-due strong { display: block; font-size: 2.25rem; letter-spacing: -0.03em; font-weight: 800; color: var(--graphite); line-height: 1.15; }
.pay-box .due-when { margin: 4px 0 20px; }
.pay-box .btn { width: 100%; }
.pay-box .btn + .btn { margin-top: 10px; }
.pay-box .demo-note { margin-top: 14px; }
.client-foot { padding: 24px var(--margin) 32px; text-align: left; max-width: 960px; width: 100%; margin: 0 auto; font-size: var(--t-small); color: var(--muted); }

@media (max-width: 820px) {
  .client-main { grid-template-columns: 1fr; }
  .pay-box { position: static; order: -1; }
}

/* ---------- Print: Download PDF prints only the sheet ---------- */

@media print {
  @page { margin: 14mm; }
  body { background: #fff; }
  body * { visibility: hidden; }
  .print-sheet, .print-sheet * { visibility: visible; }
  .print-sheet { position: absolute; left: 0; top: 0; width: 100%; box-shadow: none; padding: 0; transform: none; }
  .print-sheet .sheet-foot .btn { display: none; }
  .sheet-totals dt.due-row, .sheet-totals dd.due-row { background: none; padding: 3px 0; margin: 0; }
}

/* Without JS the hero shows its final, paid state. */
html:not(.js) .hero .status-sent { display: none; }
.fake-link { color: var(--ink); text-decoration: underline; text-underline-offset: 0.18em; }
table.ledger .show-sm { display: none; }
@media (max-width: 640px) { table.ledger .show-sm { display: block; } }

/* ---------- Sheet details: totals ruling, the Paid stamp, the remittance stub ---------- */

.sheet { --pad: clamp(22px, 3.4vw, 44px); padding: var(--pad); }

/* Bookkeeping convention: one rule above the grand total, a double rule below it. */
.sheet-totals .total-row { border-bottom: 4px double var(--graphite); padding-bottom: 8px; }

.totals-zone { position: relative; }
.stamp-room { position: relative; }

.stamp {
  position: absolute;
  left: 2%;
  top: 50%;
  margin-top: -40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 18px 9px;
  border: 3px solid var(--paid);
  border-radius: 10px;
  box-shadow: inset 0 0 0 3px var(--paper), inset 0 0 0 4.5px var(--paid);
  color: var(--paid);
  transform: rotate(-9deg);
  opacity: 0.9;
  mix-blend-mode: multiply;
  pointer-events: none;
  /* Uneven ink, the way a real rubber stamp prints. */
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.6 0 0 0 2.15'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.6 0 0 0 2.15'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.stamp-word { font-size: 2.25rem; font-weight: 900; letter-spacing: 0.01em; line-height: 1; }
.stamp-date { margin-top: 3px; font-size: 0.8125rem; font-weight: 750; letter-spacing: 0.02em; }

/* The tear-off stub at the foot of a paper invoice. */
.sheet-stub {
  position: relative;
  margin: 30px calc(-1 * var(--pad)) calc(-1 * var(--pad));
  padding: 18px var(--pad) calc(var(--pad) * 0.6);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 20px;
  font-size: var(--t-small);
  color: var(--muted);
  background:
    radial-gradient(circle, #d3d9e2 2.6px, transparent 3.1px) 4px -4.5px / 12px 9px repeat-x;
}
.sheet-stub::before,
.sheet-stub::after {
  content: "";
  position: absolute;
  top: -9px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--desk);
}
.sheet-stub::before { left: -9px; }
.sheet-stub::after { right: -9px; }
.stub-from { color: var(--graphite); font-weight: 600; }
.stub-pay strong { color: var(--graphite); font-weight: 600; }

/* When the totals take most of the sheet's width, the stamp gets its own space above them. */
.totals-zone { container-type: inline-size; }
@container (max-width: 470px) {
  .stamp-room { padding-top: 92px; }
  .stamp { left: 4px; top: 14px; margin-top: 0; padding: 6px 12px 7px; }
  .stamp-word { font-size: 1.75rem; }
}
@media (max-width: 520px) {
}

/* Hero: the paid invoice sits on the one before it. */
.hero-sheet-col { position: relative; }
.sheet-under {
  position: absolute;
  inset: 0;
  padding: 0;
  rotate: -3deg;
  translate: -16px 14px;
  background: #fbfcfd;
}

/* Closing: a blank INV-0001, tucked into the footer. */
body:not(.app-body) #main > .closing { padding-bottom: 0; overflow: hidden; }
.blank-sheet {
  max-width: 560px;
  height: 250px;
  margin: clamp(48px, 6vw, 72px) auto 0;
  text-align: left;
  border-radius: 3px 3px 0 0;
  rotate: -0.8deg;
  translate: 0 14px;
}
.blank-sheet .sheet-from { color: var(--muted); }
.blank-sheet .sheet-from strong { color: var(--muted); }
.blank-fill { display: block; color: var(--muted); font-style: italic; }
.blank-lines { display: flex; flex-direction: column; }
.blank-head { display: grid; grid-template-columns: 1fr 60px 80px 90px; padding-bottom: 8px; border-bottom: 1px solid var(--rule); font-size: var(--t-small); color: var(--muted); }
.blank-head span:not(:first-child) { text-align: right; }
.blank-line { height: 40px; border-bottom: 1px solid var(--rule); }
@media (max-width: 520px) {
  .blank-head { grid-template-columns: 1fr 50px 70px; }
  .blank-head span:nth-child(3) { display: none; }
  .sheet-under { display: none; }
}

/* ---------- Contact: the Suggestions path first, then the private form ---------- */

.contact { max-width: 680px; margin: 0 auto; }
.contact-head { text-align: center; margin-bottom: clamp(32px, 4vw, 48px); }
.contact-head h1 { font-size: var(--t-h2); }
.contact-head p { margin-top: 12px; font-size: var(--t-lead); color: var(--muted); }

.contact-route {
  padding: 26px 28px 28px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-top: 4px solid var(--ink);
  border-radius: 4px;
}
.contact-route h2 { font-size: 1.375rem; letter-spacing: -0.016em; }
.contact-route p { margin-top: 8px; color: var(--muted); max-width: 36em; }
.contact-route-actions { margin-top: 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }

.contact-form-block { margin-top: clamp(44px, 6vw, 64px); }
.contact-form-block h2 { font-size: 1.375rem; letter-spacing: -0.016em; }
.contact-form-intro { margin: 6px 0 18px; color: var(--muted); }
.contact-form { padding: 26px 28px; }
.contact-form .form-actions { margin-top: 22px; padding-top: 0; border-top: 0; }

.nudge {
  margin: 8px 0 0;
  padding: 9px 12px;
  background: color-mix(in srgb, var(--carbon) 45%, var(--paper));
  border-radius: 4px;
  font-size: 0.9375rem;
}

@media (max-width: 520px) {
  .contact-route, .contact-form { padding: 20px; }
}

/* Smallest phones: keep the wordmark, Log in, and Start free on one row. */
@media (max-width: 400px) {
  .site-header .wrap { column-gap: 12px; }
  .header-account { gap: 12px; }
  .header-account .btn { padding: 0 12px; }
}

/* ---------- The desk is a columnar ledger pad ----------
   Like an accountant's analysis pad: ruled entry lines, a wide open description
   area, and a block of money columns at the right edge of the content. Each money
   column has eight narrow digit lanes, with a heavier rule setting off the cents
   and heavier rules between columns. A double margin rule sits just outside the
   content on each side. White sections lie on the pad like sheets of paper.
   Everything is faint Ink so it never competes with text. */

:root {
  --pad-line: rgb(31 61 140 / 0.055);
  --pad-margin: rgb(31 61 140 / 0.15);
  --pad-pitch: 32px;
  --pad-columns: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='337' height='8'><rect x='0' width='1' height='8' fill='%231F3D8C' fill-opacity='.17'/><rect x='14' width='1' height='8' fill='%231F3D8C' fill-opacity='.04'/><rect x='28' width='1' height='8' fill='%231F3D8C' fill-opacity='.04'/><rect x='42' width='1' height='8' fill='%231F3D8C' fill-opacity='.04'/><rect x='56' width='1' height='8' fill='%231F3D8C' fill-opacity='.04'/><rect x='70' width='1' height='8' fill='%231F3D8C' fill-opacity='.04'/><rect x='84' width='1' height='8' fill='%231F3D8C' fill-opacity='.13'/><rect x='98' width='1' height='8' fill='%231F3D8C' fill-opacity='.04'/><rect x='112' width='1' height='8' fill='%231F3D8C' fill-opacity='.17'/><rect x='126' width='1' height='8' fill='%231F3D8C' fill-opacity='.04'/><rect x='140' width='1' height='8' fill='%231F3D8C' fill-opacity='.04'/><rect x='154' width='1' height='8' fill='%231F3D8C' fill-opacity='.04'/><rect x='168' width='1' height='8' fill='%231F3D8C' fill-opacity='.04'/><rect x='182' width='1' height='8' fill='%231F3D8C' fill-opacity='.04'/><rect x='196' width='1' height='8' fill='%231F3D8C' fill-opacity='.13'/><rect x='210' width='1' height='8' fill='%231F3D8C' fill-opacity='.04'/><rect x='224' width='1' height='8' fill='%231F3D8C' fill-opacity='.17'/><rect x='238' width='1' height='8' fill='%231F3D8C' fill-opacity='.04'/><rect x='252' width='1' height='8' fill='%231F3D8C' fill-opacity='.04'/><rect x='266' width='1' height='8' fill='%231F3D8C' fill-opacity='.04'/><rect x='280' width='1' height='8' fill='%231F3D8C' fill-opacity='.04'/><rect x='294' width='1' height='8' fill='%231F3D8C' fill-opacity='.04'/><rect x='308' width='1' height='8' fill='%231F3D8C' fill-opacity='.13'/><rect x='322' width='1' height='8' fill='%231F3D8C' fill-opacity='.04'/><rect x='336' width='1' height='8' fill='%231F3D8C' fill-opacity='.17'/></svg>");
  --pad-double: linear-gradient(90deg, var(--pad-margin) 0 1px, transparent 1px 4px, var(--pad-margin) 4px 5px);
  --pad-rules: repeating-linear-gradient(to bottom, transparent 0 calc(var(--pad-pitch) - 1px), var(--pad-line) calc(var(--pad-pitch) - 1px) var(--pad-pitch));
}

body:not(.app-body) {
  position: relative;
  background-color: var(--desk);
  background-image: var(--pad-rules);
}
/* The column structure lives on a layer the width of the content plus its margin rules. */
body:not(.app-body)::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  /* The margin rules sit well outside the content so the hero can breathe:
     up to 96px out on wide screens, never closer than 6px to the window edge. */
  --pad-out: clamp(24px, 6vw, 96px);
  width: min(calc(100% - 12px), calc(var(--max) + 2 * var(--pad-out)), calc(100% - 2 * var(--margin) + 2 * var(--pad-out)));
  margin-inline: auto;
  pointer-events: none;
  background-image: var(--pad-double), var(--pad-double), var(--pad-columns);
  background-repeat: no-repeat, no-repeat, repeat-y;
  background-size: 5px 100%, 5px 100%, 337px 8px;
  background-position: left top, right top, right 10px top;
}

/* Phones: the entry lines and the left margin rule only. */
@media (max-width: 760px) {
  body:not(.app-body)::before {
    width: calc(100% - 12px);
    background-image: var(--pad-double);
    background-repeat: no-repeat;
    background-size: 5px 100%;
    background-position: left top;
  }
}

/* The app sits on plain Desk, with no ledger lines. */
.app-body { background-color: var(--desk); background-image: none; }

/* The menu sits on plain Desk, ruled off from the pad's entry lines by one line. */
.site-header { position: relative; background: var(--desk); border-bottom: 1px solid var(--pad-margin); }

/* ---------- "What's on the invoice": a printer's proof, not the ledger ----------
   A solid, slightly deeper Desk, crop marks at the sheet's corners, registration
   targets above and below, and a slug line identifying the proof. */

.proof-section { background: #e3e7ee; border-block: 1px solid var(--rule); }
.proof { position: relative; }
.proof::before,
.proof::after {
  content: "";
  position: absolute;
  inset: -30px -30px -30px -30px;
  pointer-events: none;
}
/* Crop marks: an L at each corner, 10px clear of the sheet. */
.proof::before {
  --mark: linear-gradient(var(--graphite), var(--graphite));
  background-image: var(--mark), var(--mark), var(--mark), var(--mark), var(--mark), var(--mark), var(--mark), var(--mark);
  background-repeat: no-repeat;
  background-size: 20px 1px, 1px 20px, 20px 1px, 1px 20px, 20px 1px, 1px 20px, 20px 1px, 1px 20px;
  background-position:
    left 0 top 30px, left 30px top 0,
    right 0 top 30px, right 30px top 0,
    left 0 bottom 30px, left 30px bottom 0,
    right 0 bottom 30px, right 30px bottom 0;
  opacity: 0.55;
}
/* Registration targets, centered above and below the sheet. */
.proof::after {
  --target: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20'%3E%3Cg fill='none' stroke='%2323272F' stroke-width='1'%3E%3Ccircle cx='10' cy='10' r='5.5'/%3E%3Cpath d='M10 0v20M0 10h20'/%3E%3C/g%3E%3C/svg%3E");
  background-image: var(--target), var(--target);
  background-repeat: no-repeat;
  background-size: 20px 20px;
  background-position: center top 2px, center bottom 2px;
  opacity: 0.45;
}
.proof-slug {
  position: absolute;
  left: 0;
  top: calc(100% + 34px);
  margin: 0;
  font-size: 0.8125rem;
  color: var(--muted);
  white-space: nowrap;
}
.proof-section .anatomy { padding-bottom: 40px; }

/* The marks need room outside the sheet; on narrow screens they go. */
@media (max-width: 600px) {
  .proof::before, .proof::after { display: none; }
  .proof-slug { position: static; margin-top: 14px; }
  .proof-section .anatomy { padding-bottom: 0; }
}

/* ---------- FAQ: an invoice for the answers, billed at $0.00 ---------- */

.faq-invoice {
  max-width: 760px;
  margin: 0 auto;
  rotate: -0.5deg;
  /* A crisp paper edge, so the sheet reads clearly against the light grid. */
  outline: 1px solid rgb(35 39 47 / 0.16);
  box-shadow: 0 1px 2px rgb(35 39 47 / 0.10), 0 22px 44px -14px rgb(35 39 47 / 0.30);
}
/* The document's name, set unusually large so it reads from across the room. */
.faq-invoice .sheet-from { flex: 1; min-width: 0; }
.faq-title {
  display: block;
  margin-top: 10px;
  color: var(--graphite);
  font-size: clamp(2.25rem, 1.1rem + 3.6vw, 3.75rem);
  font-weight: 850;
  letter-spacing: -0.034em;
  line-height: 0.98;
  text-wrap: balance;
}
/* No parties block: the line items start right under the header rule. */
.faq-invoice table.lines { margin-top: 22px; }
.faq-invoice table.lines td.desc { padding-right: 24px; }
.faq-q { display: block; font-size: clamp(1.125rem, 1rem + 0.45vw, 1.3125rem); font-weight: 700; letter-spacing: -0.014em; line-height: 1.3; color: var(--graphite); }
.faq-a { display: block; margin-top: 6px; color: var(--muted); font-size: 0.9375rem; line-height: 1.55; max-width: 34em; }
.faq-invoice table.lines td { padding: 16px 0; }
.faq-invoice table.lines td.r { color: var(--muted); }
/* This total is a joke, not a figure: keep it well below the hero's. */
.faq-invoice .sheet-totals dd.total-row { font-size: 1.75rem; }

/* The stamp, in Ink rather than the Paid colour: it is not a payment status. */
.stamp-ink {
  border-color: var(--ink);
  color: var(--ink);
  box-shadow: inset 0 0 0 3px var(--paper), inset 0 0 0 4.5px var(--ink);
  rotate: 4deg;
}
.stamp-ink .stamp-word { font-size: 1.75rem; }
.stamp-ink .stamp-date { letter-spacing: 0.01em; }

.faq-invoice .stub-pay a { font-weight: 600; }

@media (max-width: 760px) {
  .faq-invoice { rotate: none; }
}
@media (max-width: 520px) {
  .faq-invoice .col-qty { display: none; }
  .faq-invoice table.lines td.desc { padding-right: 14px; }
}

/* ---------- FAQ background: off the ledger ----------
   An inverted grid to break up the page: white lines over squares whose Ink
   tint varies irregularly across the top, lighter in some patches and darker in
   others but always visible, then fades out toward the bottom. */
.faq-section {
  position: relative;
  border-block: 1px solid var(--rule);
  background-color: var(--paper);
  background-image:
    /* White grid lines, drawn over the tint */
    linear-gradient(var(--paper) 2px, transparent 2px),
    linear-gradient(90deg, var(--paper) 2px, transparent 2px),
    /* Lighter patches: white haze that lifts some areas without erasing the boxes */
    radial-gradient(ellipse 14% 12% at 22% 3%, rgb(255 255 255 / 0.55), transparent 72%),
    radial-gradient(ellipse 12% 14% at 74% 15%, rgb(255 255 255 / 0.5), transparent 72%),
    radial-gradient(ellipse 16% 10% at 96% 2%, rgb(255 255 255 / 0.45), transparent 72%),
    radial-gradient(ellipse 10% 12% at 52% 9%, rgb(255 255 255 / 0.4), transparent 72%),
    radial-gradient(ellipse 12% 10% at 38% 32%, rgb(255 255 255 / 0.4), transparent 72%),
    /* Darker patches, scattered across the top */
    radial-gradient(ellipse 22% 18% at 8% 6%, rgb(31 61 140 / 0.06), transparent 72%),
    radial-gradient(ellipse 18% 22% at 34% 14%, rgb(31 61 140 / 0.05), transparent 72%),
    radial-gradient(ellipse 26% 16% at 63% 4%, rgb(31 61 140 / 0.065), transparent 72%),
    radial-gradient(ellipse 16% 20% at 86% 18%, rgb(31 61 140 / 0.05), transparent 72%),
    radial-gradient(ellipse 20% 14% at 47% 27%, rgb(31 61 140 / 0.04), transparent 72%),
    radial-gradient(ellipse 14% 16% at 14% 30%, rgb(31 61 140 / 0.035), transparent 72%),
    /* Behind the invoice, so the paper rests on the grid */
    radial-gradient(ellipse 40% 46% at 50% 40%, rgb(31 61 140 / 0.07) 0%, rgb(31 61 140 / 0.05) 60%, transparent 96%),
    /* The base fade: every box at the top stays visible, gone by the lower part */
    linear-gradient(180deg, rgb(31 61 140 / 0.075) 0%, rgb(31 61 140 / 0.055) 25%, rgb(31 61 140 / 0.02) 58%, transparent 82%);
  background-size: 30px 30px, 30px 30px, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%;
  background-position: center top;
}

/* ---------- Closing: a full-bleed Ink band ----------
   The page's one dark moment, to break up the run of light sections. A soft
   spotlight sits behind the blank INV-0001, which reads as paper on a dark desk. */
body:not(.app-body) #main > .closing {
  border-top: 0;
  color: #fff;
  background-color: var(--ink-deep);
  /* Dark at the top, lighter toward the bottom */
  background-image: linear-gradient(180deg, #0f2254 0%, var(--ink-deep) 45%, var(--ink) 100%);
}
.closing h2 { color: #fff; }
.closing p { color: #e3e9f7; }
.closing .btn { background: #fff; border-color: #fff; color: var(--ink); }
.closing .btn:hover { background: #e9eef8; border-color: #e9eef8; }
.closing .btn:focus-visible { outline-color: #fff; }
.closing .blank-sheet { box-shadow: 0 1px 2px rgb(0 0 0 / 0.2), 0 24px 60px -12px rgb(0 0 0 / 0.45); }

/* A damask wall stencil on the closing band: an original mirrored medallion in a
   half-drop repeat, with dotted swags draping between neighbours. White at low
   opacity, tone on tone, so it reads as a pattern painted on the wall. */
body:not(.app-body) #main > .closing {
  position: relative;
  isolation: isolate;
  /* How visible the stencil is: 0 is invisible, 1 is solid white.
     0.05 is barely there, 0.09 is subtle, 0.15 is clearly visible. */
  --damask-strength: 0.05;
}
.closing::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: url("/assets/damask.svg") center top / 220px 299px repeat;
  opacity: var(--damask-strength);
}


/* A dark overlay above the stencil and below the copy, so the pattern recedes
   into the background. --damask-overlay sets how dark it is. */
.closing::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    /* Dark through the middle; a little lighter at the top so the pattern
       shows a slight hint there, and lighter toward the left and right edges
       and the bottom. The pattern shows only the faintest hints in the middle. */
    radial-gradient(ellipse 60% 85% at 50% 38%, rgb(8 18 50 / 0.6) 0%, rgb(8 18 50 / 0.45) 45%, transparent 88%),
    linear-gradient(180deg, rgb(8 18 50 / 0.08) 0%, transparent 30%),
    /* Darker in the lower left and lower right corners */
    radial-gradient(ellipse 48% 75% at 0% 100%, rgb(6 14 40 / 0.78) 0%, rgb(6 14 40 / 0.45) 40%, transparent 80%),
    radial-gradient(ellipse 48% 75% at 100% 100%, rgb(6 14 40 / 0.78) 0%, rgb(6 14 40 / 0.45) 40%, transparent 80%),
    linear-gradient(rgb(10 22 60 / var(--damask-overlay)), rgb(10 22 60 / var(--damask-overlay)));
}
body:not(.app-body) #main > .closing { --damask-overlay: 0.52; }


/* The blank INV-0001 sits on a second blank sheet, like two papers on a desk.
   Hovering the section, or moving keyboard focus into it, lifts the top sheet
   toward the Start free button; the sheet beneath stays put. Reduced motion
   turns the movement off. */
.blank-stack {
  position: relative;
  max-width: 560px;
  /* The visible part of the stack; the sheets run on past it and are cut off by
     the band's bottom edge, so they stay tucked in even when the top one lifts. */
  height: 264px;
  margin: clamp(48px, 6vw, 72px) auto 0;
}
.closing .blank-stack .blank-sheet {
  position: relative;
  max-width: none;
  height: 360px;
  margin: 0;
  translate: none;
  rotate: -0.8deg;
  transition: transform 320ms cubic-bezier(.2, .8, .3, 1);
}
.blank-under {
  position: absolute;
  inset: 0;
  height: 360px;
  padding: 0;
  rotate: 2deg;
  translate: 14px 10px;
  background: #f4f6fa;
}
.closing:hover .blank-sheet,
.closing:focus-within .blank-sheet {
  transform: translateY(-22px);
}
@media (prefers-reduced-motion: reduce) {
  .closing:hover .blank-sheet,
  .closing:focus-within .blank-sheet { transform: none; }
}

/* ---------- A simple invoice example: a dated timeline of cards ----------
   A line runs from the first dot to the last; each dot sits centred above its
   card. Each card opens with a tear-off calendar page and the time of day, and
   the gaps between dots say how long passed. */
.life-section { background: #f4f6f9; border-block: 1px solid var(--rule); }
.life-wrap { position: relative; --life-gap: clamp(24px, 3vw, 40px); }
.life {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: auto auto auto auto;
  column-gap: var(--life-gap);
  row-gap: 0;
}
/* The line: from the centre of the first column to the centre of the last. */
.life::before {
  content: "";
  position: absolute;
  top: 9px;
  left: calc((100% - 2 * var(--life-gap)) / 6);
  right: calc((100% - 2 * var(--life-gap)) / 6);
  border-top: 2px solid var(--graphite);
}
.step { display: grid; grid-row: span 4; grid-template-rows: subgrid; }
.step-dot {
  position: relative;
  justify-self: center;
  width: 20px; height: 20px;
  margin-bottom: 26px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--graphite);
  /* A ring of the section colour, so the line stops short of each dot */
  outline: 5px solid #f4f6f9;
}
.step:last-child .step-dot { background: var(--ink); border-color: var(--ink); }

.step-card {
  position: relative;
  grid-row: 2 / span 3;
  display: grid;
  grid-template-rows: subgrid;
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-radius: 10px;
  padding: 20px;
}
/* A small notch from the card up toward its dot. */
.step-card::before {
  content: "";
  position: absolute;
  top: -7px;
  left: calc(50% - 6px);
  width: 12px; height: 12px;
  background: var(--paper);
  border-left: 1px solid var(--rule-strong);
  border-top: 1px solid var(--rule-strong);
  rotate: 45deg;
}
.step-head { display: flex; align-items: center; gap: 14px; }
.step-title h3 { margin: 2px 0 0; }
.step-time { font-size: var(--t-small); color: var(--ink); font-weight: 650; }
.step-card > p { margin: 14px 0 18px; color: var(--muted); }
.step-card .artifact { align-self: start; }

/* A tear-off calendar page. */
.cal {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 58px;
  border: 1px solid var(--rule-strong);
  border-radius: 7px;
  overflow: hidden;
  background: var(--paper);
  text-align: center;
  line-height: 1;
}
.cal-month {
  align-self: stretch;
  padding: 6px 0 4px;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  /* Ink strip with two binding holes */
  background:
    radial-gradient(circle at 16px 3px, var(--paper) 1.8px, transparent 2.3px),
    radial-gradient(circle at 40px 3px, var(--paper) 1.8px, transparent 2.3px),
    var(--ink);
}
.cal-day { padding-top: 6px; font-size: 1.625rem; font-weight: 800; letter-spacing: -0.02em; color: var(--graphite); }
.cal-weekday { padding: 3px 0 7px; font-size: 0.75rem; color: var(--muted); }

/* How long passed between steps, sitting on the line. */
.life-gaps { position: absolute; inset: 0 0 auto 0; height: 20px; pointer-events: none; z-index: 1; }
.life-gap {
  position: absolute;
  top: 10px;
  translate: -50% -50%;
  padding: 3px 10px;
  background: #f4f6f9;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  font-size: 0.8125rem;
  color: var(--muted);
  white-space: nowrap;
}
.life-gap-1 { left: calc((100% - 2 * var(--life-gap)) / 3 + var(--life-gap) / 2); }
.life-gap-2 { left: calc(2 * (100% - 2 * var(--life-gap)) / 3 + var(--life-gap) * 1.5); }

/* Narrow screens: a vertical timeline, dots on the left, cards to the right. */
@media (max-width: 960px) {
  .life { grid-template-columns: 1fr; grid-template-rows: none; row-gap: 36px; max-width: 560px; margin: 0 auto; padding-left: 34px; }
  .life::before { display: none; }
  .step { display: block; position: relative; grid-row: auto; }
  /* The line runs from each dot down to the next one. */
  .step:not(:last-child)::after {
    content: "";
    position: absolute;
    left: -25px;
    top: 48px;
    bottom: -64px;
    border-left: 2px solid var(--graphite);
  }
  .step-dot { position: absolute; left: -34px; top: 28px; margin: 0; }
  .step-card { display: block; }
  .step-card::before { top: 32px; left: -7px; rotate: -45deg; }
  .life-gaps { display: none; }
}

/* ---------- Pricing: two plan cards and one shared list ----------
   Price first, then the one real difference, then the button. What both plans
   share is listed once underneath. */
.pricing-section { background: var(--paper); border-block: 1px solid var(--rule); }
.plans {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 32px);
  max-width: 760px;
  margin: 0 auto;
}
.plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 30px 30px 28px;
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-radius: 12px;
}
.plan-pick { border-top: 4px solid var(--ink); padding-top: 27px; background: #f7f9fd; }
.plan-name { font-size: 1.5rem; letter-spacing: -0.02em; }
.plan-for { margin-top: 2px; color: var(--muted); font-size: var(--t-small); }
.plan-price { margin-top: 22px; display: flex; align-items: baseline; gap: 8px; }
.plan-price .amount { font-size: clamp(2.25rem, 1.6rem + 1.4vw, 2.375rem); font-weight: 850; letter-spacing: -0.035em; line-height: 1; }
.plan-price .per { color: var(--muted); }
.plan-limit {
  margin: 20px 0 24px;
  padding: 12px 0;
  border-block: 1px solid var(--rule);
  font-size: 1.0625rem;
}
.plan-limit strong { font-weight: 750; }
.plan-card .btn { margin-top: auto; width: 100%; }

/* A small carbon tag, like a sticky label, stating Solo's one difference. */
.plan-tag {
  position: absolute;
  top: -15px;
  right: 22px;
  padding: 4px 11px 5px;
  background: var(--carbon);
  color: var(--graphite);
  border-radius: 4px;
  font-size: 0.8125rem;
  font-weight: 650;
  rotate: 2deg;
}

.plans-shared { max-width: 760px; margin: 28px auto 0; text-align: center; }
.plans-shared-title { font-weight: 650; }
.plans-shared ul {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, auto);
  justify-content: center;
  gap: 8px 40px;
  text-align: left;
  color: var(--muted);
}
.plans-shared li { display: inline-flex; align-items: center; gap: 7px; }
.plans-shared svg { width: 16px; height: 16px; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.plans-shared .sb-link { justify-content: center; margin: 18px 0 0; text-align: left; }

@media (max-width: 640px) {
  .plans { grid-template-columns: 1fr; max-width: 420px; }
  .plans-shared ul { grid-template-columns: auto; }
}

/* ---------- Contact page: a letter in an airmail envelope, not the ledger ----------
   Plain Desk behind, and the page's content set in a white envelope with an
   airmail border of diagonal Ink and pale blue stripes. */
/* Pages that sit on plain Desk, with no ledger lines or columns. */
body.contact-page,
body.plain-page { background-image: none; }
body.contact-page::before,
body.plain-page::before { display: none; }
.contact-page .contact {
  max-width: 760px;
  padding: clamp(28px, 5vw, 56px) clamp(20px, 5vw, 64px) clamp(32px, 5vw, 56px);
  background: var(--paper);
  border: 12px solid transparent;
  border-radius: 4px;
  border-image: repeating-linear-gradient(-45deg,
      var(--ink) 0 14px,
      var(--paper) 14px 22px,
      #9db0d8 22px 36px,
      var(--paper) 36px 44px) 12;
}
/* Inside the envelope the Suggestions box and the form sit on white, so give
   them a faint tint to keep them distinct. */
.contact-page .contact-route { background: #f7f9fd; }
.contact-page .contact-form { background: #fbfcfe; }
@media (max-width: 520px) {
  .contact-page .contact { border-width: 8px; border-image-slice: 8; }
}

/* Clients page: the page action and its demo note sit together. */
.page-head .actions { align-items: center; }

/* ---------- Hero background: a desk blotter ----------
   Plain Desk, off the ledger. The hero sits on a desk pad: a slightly deeper
   panel with a stitched edge and dark leather corner pockets. */
#main > .hero { position: relative; background: var(--desk); }
#main > .hero > .wrap { position: relative; }
#main > .hero:not(.hero-photo) > .wrap::before {
  content: "";
  position: absolute;
  inset: -40px calc(var(--margin) - 28px) -48px;
  z-index: -1;
  border-radius: 6px;
  background:
    /* Leather corner pockets */
    linear-gradient(135deg, #22345f 0 50%, transparent 50%) left top / 96px 96px no-repeat,
    linear-gradient(225deg, #22345f 0 50%, transparent 50%) right top / 96px 96px no-repeat,
    linear-gradient(45deg, #22345f 0 50%, transparent 50%) left bottom / 96px 96px no-repeat,
    linear-gradient(315deg, #22345f 0 50%, transparent 50%) right bottom / 96px 96px no-repeat,
    #e2e7ef;
  outline: 1.5px dashed rgb(35 39 47 / 0.18);
  outline-offset: -10px;
}
#main > .hero { isolation: isolate; }
@media (max-width: 760px) {
  #main > .hero:not(.hero-photo) > .wrap::before {
    inset: -24px 8px -32px;
    background-size: 56px 56px, 56px 56px, 56px 56px, 56px 56px, auto;
  }
}

/* ---------- Hero background option: a blurred studio photo ----------
   On when the hero has the hero-photo class (remove the class to go back to the
   desk blotter). The photo is pre-blurred, shown in greyscale, and washed with
   cool Desk and Ink so the headline stays readable: strongest on the left,
   lighter behind the invoice. */
#main > .hero.hero-photo { overflow: hidden; }
#main > .hero.hero-photo::before,
#main > .hero.hero-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
#main > .hero.hero-photo::before {
  inset: -20px;
  background: url("/assets/hero-studio.jpg") center 40% / cover no-repeat;
  /* Some of the photo's own colour (brick, wood, plants) shows through */
  filter: saturate(0.85) blur(4px);
}
#main > .hero.hero-photo::after {
  background:
    linear-gradient(90deg, rgb(238 241 245 / 0.88) 0%, rgb(238 241 245 / 0.78) 40%, rgb(238 241 245 / 0.32) 75%, rgb(238 241 245 / 0.25) 100%),
    linear-gradient(rgb(31 61 140 / 0.08), rgb(31 61 140 / 0.08));
}
@media (max-width: 960px) {
  #main > .hero.hero-photo::after {
    background:
      linear-gradient(180deg, rgb(238 241 245 / 0.9) 0%, rgb(238 241 245 / 0.82) 45%, rgb(238 241 245 / 0.4) 100%),
      linear-gradient(rgb(31 61 140 / 0.08), rgb(31 61 140 / 0.08));
  }
}

/* ---------- Demo support chat (assets/chat.js) ----------
   A typical SaaS chat widget in the lower right, on only when turned on with
   ?chat=1. It exists to show the SuggestionBox widget sharing the page. */
.chatw { position: fixed; right: 20px; bottom: 20px; z-index: 1000; font-family: var(--font); }
.chatw-launcher {
  position: relative;
  display: grid;
  place-items: center;
  width: 58px; height: 58px;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 18px rgb(31 61 140 / 0.35);
}
.chatw-launcher:hover { background: var(--ink-deep); }
.chatw-launcher svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chatw-icon-close { display: none; }
.chatw[data-open="true"] .chatw-icon-open { display: none; }
.chatw[data-open="true"] .chatw-icon-close { display: block; }
.chatw-dot { position: absolute; top: 3px; right: 3px; width: 14px; height: 14px; border-radius: 50%; background: #e5484d; border: 2px solid #fff; }

.chatw-panel {
  position: absolute;
  right: 0;
  bottom: 74px;
  width: 370px;
  height: min(560px, calc(100vh - 120px));
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgb(35 39 47 / 0.25);
  animation: chatw-in 180ms ease-out;
}
.chatw-panel[hidden] { display: none; }
@keyframes chatw-in { from { opacity: 0; translate: 0 10px; } to { opacity: 1; translate: 0 0; } }

.chatw-head { display: flex; align-items: center; gap: 12px; padding: 16px; background: var(--ink); color: #fff; }
.chatw-team { display: flex; }
.chatw-team span {
  display: grid; place-items: center;
  width: 30px; height: 30px; margin-left: -8px;
  border-radius: 50%; border: 2px solid var(--ink);
  background: #c9d4ef; color: var(--ink); font-size: 0.75rem; font-weight: 700;
}
.chatw-team span:first-child { margin-left: 0; background: #f5e38a; }
.chatw-team span:nth-child(2) { background: #bfe3d0; }
.chatw-title { flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
.chatw-title strong { font-size: 1rem; }
.chatw-title span { font-size: 0.8125rem; opacity: 0.85; }
.chatw-close { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: #fff; cursor: pointer; }
.chatw-close:hover { background: rgb(255 255 255 / 0.12); }
.chatw-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.chatw-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: #f6f8fb; }
.chatw-msg { max-width: 82%; padding: 10px 13px; border-radius: 14px; font-size: 0.9375rem; line-height: 1.45; }
.chatw-them { align-self: flex-start; background: var(--paper); border: 1px solid var(--rule); border-bottom-left-radius: 4px; color: var(--graphite); }
.chatw-me { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 4px; }
.chatw-them a { color: var(--ink); font-weight: 600; }
.chatw-typing { display: flex; gap: 4px; padding: 13px 14px; }
.chatw-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); opacity: 0.5; animation: chatw-blink 1s infinite; }
.chatw-typing span:nth-child(2) { animation-delay: 0.15s; }
.chatw-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes chatw-blink { 50% { opacity: 1; } }

.chatw-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px; background: #f6f8fb; }
.chatw-chips:not(:empty) { padding-bottom: 12px; }
.chatw-chip { padding: 6px 11px; border: 1px solid var(--ink); border-radius: 999px; background: var(--paper); color: var(--ink); font: inherit; font-size: 0.8125rem; font-weight: 600; cursor: pointer; }
.chatw-chip:hover { background: #eef2fb; }

.chatw-form { display: flex; align-items: flex-end; gap: 8px; padding: 12px; border-top: 1px solid var(--rule); }
.chatw-form textarea { flex: 1; min-height: 42px; max-height: 120px; resize: none; padding: 10px 12px; border-radius: 10px; }
.chatw-send { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border: 0; border-radius: 10px; background: var(--ink); color: #fff; cursor: pointer; }
.chatw-send svg { width: 18px; height: 18px; fill: currentColor; }
.chatw-foot { padding: 0 12px 10px; font-size: 0.75rem; color: var(--muted); text-align: center; }

@media (max-width: 520px) {
  .chatw { right: 14px; bottom: 14px; }
  .chatw[data-open="true"] .chatw-panel { position: fixed; inset: 0; width: auto; height: auto; border-radius: 0; }
  .chatw[data-open="true"] .chatw-launcher { display: none; }
}

/* The footer switch for the demo chat */

/* SuggestionBox suggestion link (concept): one suggestion linked from the spot it's about. */
.sb-link { display: flex; align-items: flex-start; gap: 8px; margin: 10px 0 22px; font-size: var(--t-small); color: var(--muted); line-height: 1.45; }
.sb-q { display: inline-grid; place-items: center; flex: none; width: 16px; height: 16px; margin-top: 2px; border: 1.5px solid var(--ink); border-radius: 50%; color: var(--ink); font-size: 0.6875rem; font-weight: 700; line-height: 1; }
.sb-link a { display: inline-block; padding: 2px 0; color: var(--ink); font-weight: 600; }

/* New-feature card in the app sidebar (demo, shown with ?announce=1). */
.sidebar-new {
  position: relative; margin: auto 0 14px; padding: 14px 14px 14px;
  background: var(--paper); border: 1px solid var(--rule); border-left: 3px solid var(--ink); border-radius: 8px;
  font-size: var(--t-small); line-height: 1.45; color: var(--muted);
}
.sidebar-new[hidden] { display: none; }
.sidebar-new:not([hidden]) + .sidebar-foot { margin-top: 0; }
.sidebar-new-tag { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--carbon); color: var(--graphite); font-size: 0.75rem; font-weight: 700; }
.sidebar-new-title { margin-top: 8px; color: var(--graphite); font-weight: 650; font-size: 0.9375rem; }
.sidebar-new p + p { margin-top: 2px; }
.sidebar .sidebar-new a { display: inline-block; margin-top: 8px; padding: 2px 0; color: var(--ink); font-weight: 600; text-decoration: underline; }
.sidebar .sidebar-new a:hover { background: none; }
.sidebar-new-close { position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; }
.sidebar-new-close:hover { background: var(--desk); color: var(--graphite); }
.sidebar .sidebar-new-close svg { width: 14px; height: 14px; stroke-width: 2; }

/* Announcement bar above the marketing header (demo, shown with ?announcement-bar=1). */
.announce-bar { background: var(--ink); color: #fff; font-size: var(--t-small); }
.announce-bar[hidden] { display: none; }
.announce-bar .wrap { display: flex; align-items: center; justify-content: center; gap: 12px; position: relative; padding-top: 9px; padding-bottom: 9px; padding-right: 48px; }
.announce-bar p { text-align: center; line-height: 1.45; }
.announce-bar a { display: inline-block; padding: 2px 0; color: #fff; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.announce-tag { display: inline-block; margin-right: 6px; padding: 0 8px; border-radius: 999px; background: var(--carbon); color: var(--graphite); font-size: 0.75rem; font-weight: 700; }
.announce-close { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 6px; background: none; color: #fff; cursor: pointer; }
.announce-close:hover { background: rgba(255, 255, 255, 0.12); }
.announce-close svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* What's planned inline widget (idea 14, mocked): customer requests in the works. */
body:not(.app-body) #main > section.planned-section { position: relative; z-index: 1; padding: clamp(44px, 5vw, 64px) 0; background: var(--desk); border-top: 1px solid var(--rule); }
.planned-head { text-align: center; max-width: 36rem; margin: 0 auto 18px; }
.planned-head h2 { font-size: 1.625rem; letter-spacing: -0.02em; }
.planned-head p { margin-top: 4px; color: var(--muted); }
/* Mirrors SuggestionBox's What's planned list: same sizes, lines, dots, and layout.
   It inherits the page's font and text color, as the real embed does. */
/* The real list has no background; SoloInvoicer sets white on the element that holds it. */
.planned-card { container: planned / inline-size; max-width: 560px; margin: 0 auto; background: var(--paper); border: 1px solid rgb(128 128 128 / 28%); border-radius: 8px; overflow: hidden; }
.planned-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 14px minmax(0, 1fr) auto auto; column-gap: 12px; }
.planned-list li { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; align-items: center; row-gap: 1px; padding: 0.35em 0.75em; line-height: 1.25; }
.planned-list li + li { border-top: 1px solid rgb(128 128 128 / 28%); }
.planned-list .pl-title { display: contents; }
.planned-list .pl-title a {
  grid-column: 2; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: inherit; font-weight: 600; text-decoration: underline; text-decoration-color: rgb(128 128 128 / 55%); text-underline-offset: 3px;
}
.planned-list .pl-title a:hover { text-decoration-color: currentColor; }
.planned-list .pl-count { grid-column: 3; font-size: 0.8em; opacity: 0.7; white-space: nowrap; }
.planned-list .pl-status { grid-column: 4; padding-left: 16px; font-size: 0.85em; font-weight: 600; opacity: 0.7; white-space: nowrap; }
.planned-list .pl-status.now { font-weight: 700; opacity: 1; }
/* Narrow: each title takes the full width with its count underneath; a long title ends in "…". */
@container planned (max-width: 540px) {
  .planned-list .pl-title a { grid-column: 2 / 4; }
  .planned-list .pl-count { grid-column: 2 / 4; grid-row: 2; }
  .planned-list .pulse, .planned-list .pl-status { grid-row: 1 / span 2; }
}

/* Status dots: In progress in the brand color, Planned in amber. A few rings once the list
   is on screen (site.js adds "go"), then the dots rest. */
.pulse { position: relative; justify-self: center; width: 7px; height: 7px; border-radius: 50%; background: #d9b52c; }
.pulse.now { background: var(--ink); }
.pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: inherit; opacity: 0; }
.go .pulse::after { animation: pulse-ring 1.8s ease-out 3; }
.go .pulse.planned::after { animation-duration: 2.8s; }
.go li:nth-child(2) .pulse::after { animation-delay: 0.6s; }
.go li:nth-child(3) .pulse::after { animation-delay: 1.2s; }
@keyframes pulse-ring {
  0% { transform: scale(1); opacity: 0.55; }
  80%, 100% { transform: scale(2.8); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .go .pulse::after { animation: none; } }

.planned-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 20px; padding: 0.4em 0.75em; border-top: 1px solid rgb(128 128 128 / 28%); font-size: 0.85em; }
.planned-foot a { color: inherit; font-weight: 600; text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-color: var(--ink); }

/* The app's shared error message (demo: ?save-error=1 on the invoice editor, then Save draft). */
.error-toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 40; transform: translateX(-50%);
  display: flex; align-items: flex-start; gap: 12px; width: min(520px, calc(100vw - 32px));
  padding: 12px 10px 12px 16px; border-radius: 8px;
  background: var(--graphite); color: #fff; font-size: 0.9375rem; line-height: 1.45;
}
.error-toast p { flex: 1; padding-top: 3px; }
.error-toast a { display: inline-block; padding: 1px 0; color: #fff; font-weight: 650; text-decoration: underline; text-underline-offset: 2px; }
.error-toast-close { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 6px; background: none; color: #fff; cursor: pointer; }
.error-toast-close:hover { background: rgba(255, 255, 255, 0.12); }
.error-toast-close svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* Settings search: a small field in the page head. */
.settings-search { position: relative; width: min(260px, 100%); }
.settings-search svg { position: absolute; left: 11px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 1.7; stroke-linecap: round; pointer-events: none; }
.settings-search input { width: 100%; min-height: 38px; padding: 0 12px 0 34px; border: 1px solid var(--rule); border-radius: 5px; background: var(--paper); font: inherit; font-size: 0.9375rem; color: var(--graphite); }
.settings-search input::placeholder { color: var(--muted); }
.settings-search input:focus { outline: 2px solid var(--ink); outline-offset: 1px; border-color: var(--ink); border-radius: 5px; }
.settings-empty { padding: 28px; }
.settings-empty-title { font-weight: 650; color: var(--graphite); }
.settings-empty p + p { margin-top: 6px; color: var(--muted); }
.settings-empty a { display: inline-block; padding: 2px 0; color: var(--ink); font-weight: 600; }
.settings-form [hidden], .settings-form[hidden] { display: none; }
/* While searching, only rule between fieldsets that are still showing. */
.settings-form[data-searching] fieldset { margin-top: 0; padding-top: 0; border-top: 0; }
.settings-form[data-searching] fieldset:not([hidden]) ~ fieldset:not([hidden]) { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--rule); }

/* Sign-up page (demo). */
.signup { max-width: 440px; margin: 0 auto; }
.signup-head { text-align: center; margin-bottom: 28px; }
.signup-head h1 { font-size: var(--t-h2); }
.signup-head p { margin-top: 10px; color: var(--muted); }
.signup-form { padding: 28px; }
.signup-submit { width: 100%; margin-top: 22px; }
.signup-note { margin-top: 14px; text-align: center; font-size: var(--t-small); color: var(--muted); }
.signup-note a { display: inline-block; padding: 2px 0; color: var(--ink); font-weight: 600; }


/* Integrations page: one list per group, rows divided by rules. */
.integration-list { list-style: none; margin: 0; padding: 0; }
.integration { display: flex; align-items: center; gap: 16px; padding: 16px 20px; }
.integration + .integration { border-top: 1px solid var(--rule); }
.integration-icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 8px; background: var(--desk); color: var(--ink); }
.integration-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.integration-body { flex: 1; min-width: 0; }
.integration-body h3 { font-size: 1rem; }
.integration-body p { margin-top: 2px; color: var(--muted); font-size: 0.9375rem; }
.integration-connect { flex: none; }
#integrations-note { display: block; margin-top: 10px; }
.integration-list ~ .sb-link { margin-top: 22px; }
@media (max-width: 520px) { .integration { flex-wrap: wrap; } .integration-body { flex-basis: calc(100% - 56px); } .integration-connect { margin-left: 56px; } }
.integration-body .integration-status { display: flex; align-items: center; gap: 5px; margin-top: 6px; color: var(--ink); font-size: 0.875rem; font-weight: 600; }
.integration-status svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- SuggestionBox ideas drawer (assets/ideas.js) ---------- */
/* Ideas are off until switched on; [hidden] must win over each element's own display. */
[data-idea][hidden], [data-idea-off][hidden] { display: none !important; }

.ideas-tab {
  /* Above the middle of the edge, so a side-docked Suggest tab (centered) can share the edge. */
  position: fixed; left: 0; top: max(150px, 34vh); z-index: 1100;
  display: grid; place-items: center;
  width: 40px; height: 40px; padding: 0;
  border: 0; border-radius: 0 6px 6px 0;
  background: var(--ink); color: #fff; cursor: pointer;
}
.ideas-tab:hover { background: var(--ink-deep); }
.ideas-tab:focus-visible { outline: 3px solid var(--carbon); outline-offset: 2px; }
.ideas-tab svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; transition: transform 160ms ease; }
html[data-ideas-open] .ideas-tab { left: min(360px, calc(100vw - 48px)); }
html[data-ideas-open] .ideas-tab svg { transform: rotate(45deg); }

.ideas-drawer {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 1090;
  width: min(360px, calc(100vw - 48px));
  overflow-y: auto; overscroll-behavior: contain;
  padding: 20px 20px 28px;
  background: var(--paper); color: var(--graphite);
  border-right: 1px solid var(--rule);
  font-family: var(--font);
}
.ideas-drawer[hidden] { display: none; }
.ideas-head h2 { font-size: 1.125rem; margin: 0; }
.ideas-head p { margin: 6px 0 12px; color: var(--muted); font-size: 0.875rem; line-height: 1.45; }
.ideas-reset {
  font: inherit; font-size: 0.8125rem; font-weight: 600; color: var(--ink);
  background: var(--paper); border: 1px solid var(--rule-strong); border-radius: 6px;
  padding: 6px 10px; cursor: pointer;
}
.ideas-reset:hover { background: var(--desk); }
.ideas-list { list-style: none; margin: 14px 0 0; padding: 0; }
.ideas-row {
  display: grid; grid-template-columns: 24px 1fr auto; gap: 10px; align-items: start;
  padding: 11px 0; border-top: 1px solid var(--rule);
}
.ideas-row-info { grid-template-columns: 24px 1fr; }
.ideas-row-plain { grid-template-columns: 1fr auto; border-top: 0; padding-top: 4px; }
.ideas-num { color: var(--muted); font-size: 0.8125rem; font-variant-numeric: tabular-nums; padding-top: 2px; }
.ideas-text { display: grid; gap: 2px; min-width: 0; }
.ideas-title { font-size: 0.9375rem; font-weight: 600; line-height: 1.3; }
.ideas-where { color: var(--muted); font-size: 0.8125rem; line-height: 1.4; }
.ideas-show {
  justify-self: start; margin-top: 4px; padding: 2px 0;
  font: inherit; font-size: 0.8125rem; font-weight: 600; color: var(--ink);
  background: none; border: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.ideas-show[hidden] { display: none; }
.ideas-shows { display: flex; flex-wrap: wrap; gap: 0 16px; }
.ideas-shows[hidden] { display: none; }
.ideas-restart {
  grid-column: 3; grid-row: 2; align-self: end; justify-self: end;
  display: grid; place-items: center; width: 32px; height: 32px; margin-right: 4px; padding: 0;
  border: 1px solid var(--rule-strong); border-radius: 50%; background: var(--paper); color: var(--ink); cursor: pointer;
}
.ideas-row:has(.ideas-restart) .ideas-num { grid-column: 1; grid-row: 1; }
.ideas-row:has(.ideas-restart) .ideas-text { grid-column: 2; grid-row: 1 / span 2; }
.ideas-row:has(.ideas-restart) .ideas-switch { grid-column: 3; grid-row: 1; }
.ideas-restart:hover { background: var(--desk); }
.ideas-restart:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.ideas-restart[hidden] { display: none; }
.ideas-restart svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ideas-switch {
  position: relative; flex: none;
  width: 40px; height: 24px; margin-top: 1px; padding: 0;
  border: 0; border-radius: 999px; background: var(--rule-strong); cursor: pointer;
  transition: background 160ms ease;
}
.ideas-switch::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgb(35 39 47 / 0.3);
  transition: transform 160ms ease;
}
.ideas-switch[aria-checked="true"] { background: var(--ink); }
.ideas-switch[aria-checked="true"]::after { transform: translateX(16px); }
.ideas-switch:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.ideas-outside { margin-top: 18px; }
.ideas-outside h3 { font-size: 0.8125rem; font-weight: 700; color: var(--muted); margin: 0; }
.ideas-outside .ideas-list { margin-top: 6px; }
.ideas-foot { margin: 20px 0 0; color: var(--muted); font-size: 0.8125rem; }
.idea-highlight { outline: 3px solid var(--ink) !important; outline-offset: 4px; border-radius: 4px; }
.chatw-chip.idea-highlight { border-radius: 999px; outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  .ideas-tab svg, .ideas-switch, .ideas-switch::after { transition: none; }
}

/* ---------- Suggestion Widget, mocked (idea 6) ---------- */
/* The container never uses transform, so the modal's position: fixed stays relative to the window. */
.sbw { position: fixed; z-index: 1000; font-family: var(--font); pointer-events: none; display: flex; }
.sbw > * { pointer-events: auto; }
.sbw[data-position^="bottom"] { bottom: 20px; }
.sbw[data-position="bottom-left"] { left: 20px; }
.sbw[data-position="bottom-right"] { right: 20px; }
.sbw[data-position="bottom-right"][data-beside-chat] { right: 96px; }
.sbw[data-position="bottom-center"] { left: 0; right: 0; justify-content: center; }
.sbw[data-style="docked"][data-position^="bottom"] { bottom: 0; }
.sbw[data-position="left"], .sbw[data-position="right"] { top: 0; bottom: 0; align-items: center; }
.sbw[data-position="left"] { left: 0; }
.sbw[data-position="right"] { right: 0; }

.sbw-launcher {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px; border: 0; border-radius: 999px;
  background: var(--ink); color: #fff; font: inherit; font-weight: 600; font-size: 0.9375rem; cursor: pointer;
  box-shadow: 0 6px 18px -6px rgb(23 46 107 / 0.55);
}
.sbw-launcher:hover { background: var(--ink-deep); }
.sbw-launcher:focus-visible { outline: 3px solid var(--carbon); outline-offset: 2px; }
.sbw-launcher svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
/* Docked to the bottom edge: a tab with square bottom corners. */
.sbw[data-style="docked"][data-position^="bottom"] .sbw-launcher { border-radius: 10px 10px 0 0; padding: 9px 16px; box-shadow: none; }
/* Side tabs: sideways, docked to the middle of the edge. */
.sbw[data-position="left"] .sbw-launcher, .sbw[data-position="right"] .sbw-launcher {
  writing-mode: vertical-rl; padding: 16px 9px; box-shadow: none;
}
/* The bottom of the text always faces the window edge the tab is docked to:
   left side reads top to bottom, right side bottom to top (rotated 180deg, so its
   rounded corners are given pre-rotation). Rounded corners face the page. The icon
   turns with the text. */
.sbw[data-position="left"] .sbw-launcher { border-radius: 0 10px 10px 0; }
.sbw[data-position="right"] .sbw-launcher { transform: rotate(180deg); border-radius: 0 10px 10px 0; }
.sbw[data-position="left"] .sbw-launcher svg, .sbw[data-position="right"] .sbw-launcher svg { transform: rotate(90deg); }

.sbw-panel {
  position: absolute; width: 320px; z-index: 2;
  padding: 16px; background: var(--paper); color: var(--graphite);
  border: 1px solid var(--rule); border-radius: 12px; box-shadow: var(--sheet-shadow);
}
.sbw-panel[hidden] { display: none; }
/* Popup: opens next to the button. */
.sbw[data-opens="popup"][data-position^="bottom"] .sbw-panel { bottom: calc(100% + 12px); }
.sbw[data-opens="popup"][data-position="bottom-left"] .sbw-panel { left: 0; }
.sbw[data-opens="popup"][data-position="bottom-right"] .sbw-panel { right: 0; }
.sbw[data-opens="popup"][data-position="bottom-center"] .sbw-panel { left: 50%; margin-left: -160px; }
.sbw[data-opens="popup"][data-position="left"] .sbw-panel { left: calc(100% + 12px); top: 50%; margin-top: -170px; }
.sbw[data-opens="popup"][data-position="right"] .sbw-panel { right: calc(100% + 12px); top: 50%; margin-top: -170px; }
/* Modal: centered over a dimmed page. */
.sbw[data-opens="modal"] .sbw-panel { position: fixed; top: 50%; left: 50%; width: min(440px, calc(100vw - 32px)); margin: 0; transform: translate(-50%, -50%); }
.sbw-backdrop { position: fixed; inset: 0; z-index: 1; background: rgb(35 39 47 / 0.45); }
.sbw-backdrop[hidden] { display: none; }

.sbw-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.sbw-close { width: 32px; height: 32px; display: grid; place-items: center; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 6px; }
.sbw-close:hover { background: var(--desk); }
.sbw-close svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; }
.sbw-form { display: grid; gap: 8px; }
.sbw-form label { font-size: 0.875rem; font-weight: 600; }
.sbw-form textarea { font: inherit; font-size: 0.9375rem; padding: 8px 10px; border: 1px solid var(--rule-strong); border-radius: 8px; resize: vertical; }
.sbw-send { justify-self: end; font: inherit; font-weight: 600; font-size: 0.875rem; color: #fff; background: var(--ink); border: 0; border-radius: 8px; padding: 8px 14px; cursor: pointer; }
.sbw-sent { margin: 0; color: var(--muted); font-size: 0.875rem; }
.sbw-foot { margin: 12px 0 0; color: var(--muted); font-size: 0.75rem; text-align: center; }
@media (max-width: 520px) {
  .sbw[data-position^="bottom"][data-style="floating"] { bottom: 14px; }
  .sbw[data-position="bottom-left"] { left: 14px; }
  .sbw[data-position="bottom-right"] { right: 14px; }
  .sbw[data-position="bottom-right"][data-beside-chat] { right: 84px; }
  /* On phones the popup is a full-width sheet above the button (as specific as the desktop rules, and later, so it wins). */
  .sbw[data-opens="popup"][data-position] .sbw-panel { position: fixed; left: 12px; right: 12px; top: auto; bottom: 72px; width: auto; margin: 0; }
}

/* Widget options in the drawer. */
.ideas-options { grid-column: 2 / -1; display: grid; grid-template-columns: auto 1fr; gap: 8px 10px; align-items: center; margin-top: 4px; }
.ideas-options[hidden] { display: none; }
.ideas-options label { font-size: 0.8125rem; font-weight: 600; color: var(--graphite); }
.ideas-options select { font: inherit; font-size: 0.875rem; padding: 6px 8px; border: 1px solid var(--rule-strong); border-radius: 6px; background: var(--paper); color: var(--graphite); min-width: 0; }
.ideas-options select:disabled { color: var(--muted); background: var(--desk); }
.ideas-options-note { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 0.8125rem; }
.ideas-options-note[hidden] { display: none; }

/* ---------- Demo pages for ideas 19-21 (/demos/...) ---------- */
.demo-page { background: var(--desk); color: var(--graphite); font-family: var(--font); min-height: 100vh; }
/* No ledger lines: those are the homepage's alone. */
body.demo-page { background-image: none; }
body.demo-page::before { display: none; }
.demo-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px var(--margin); background: var(--paper); border-bottom: 1px solid var(--rule); }
.demo-back { color: var(--ink); font-weight: 600; font-size: var(--t-small); padding: 6px 0; }
.demo-main { max-width: 1240px; margin: 0 auto; padding: 28px var(--margin) 40px; }
.demo-intro { max-width: 46rem; margin-bottom: 22px; }
.demo-intro h1 { font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -0.02em; }
.demo-intro > p { margin-top: 6px; color: var(--muted); }
.demo-steps { display: grid; gap: 4px; margin: 14px 0 0; padding: 0 0 0 1.25em; font-size: var(--t-small); }
.demo-steps li { padding-left: 2px; }
.demo-stage { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 900px) { .demo-stage { grid-template-columns: minmax(0, 1fr); } }
.demo-foot { margin-top: 20px; color: var(--muted); font-size: var(--t-small); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.demo-restart { font: inherit; font-weight: 600; color: var(--ink); background: var(--paper); border: 1px solid var(--rule-strong); border-radius: 6px; padding: 7px 12px; cursor: pointer; }
.demo-restart:hover { background: var(--desk-deep); }

/* Windows: each app in its own frame with a plain title bar. */
.demo-window { background: #fff; border: 1px solid var(--rule-strong); border-radius: 10px; overflow: hidden; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 15px; color: #1d2939; }
.demo-bar { display: flex; align-items: center; gap: 10px; padding: 9px 14px; background: #f2f4f7; border-bottom: 1px solid #e4e7ec; font-size: 13px; }
.demo-dots { width: 42px; height: 10px; background: radial-gradient(circle, #d0d5dd 4px, transparent 4.5px) 0 0 / 14px 10px repeat-x; flex: none; }
.demo-app { font-weight: 700; }
.demo-where { color: #667085; }
.demo-pane { padding: 18px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.demo-btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 14px; font-weight: 600; padding: 7px 12px; border-radius: 8px; border: 1px solid #d0d5dd; background: #fff; color: #1d2939; cursor: pointer; }
.demo-btn:hover { background: #f9fafb; }
.demo-btn svg, .demo-chip svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
.demo-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.demo-btn:focus-visible, .demo-chip-action:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
.demo-status { font-size: 13px; font-weight: 600; color: #067647; min-height: 1em; }

/* SuggestionBox panes: its own blue, so the two apps are easy to tell apart. */
.demo-sb .demo-app { color: #2458cf; }
.demo-sb .demo-btn-primary { background: #315eea; border-color: #315eea; color: #fff; }
.demo-sb .demo-btn-primary:hover { background: #2458cf; }
.demo-sb-title { font-size: 17px; font-weight: 700; }
.demo-sb-meta { color: #5d6673; font-size: 14px; }
.demo-sb-row { display: grid; gap: 4px; }
.demo-sb-row label { font-size: 13px; font-weight: 700; }
.demo-sb-row select, .demo-sb-row input { font: inherit; font-size: 14px; padding: 7px 10px; border: 1px solid #d0d5dd; border-radius: 8px; background: #fff; }
.demo-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.demo-email-preview { max-height: 460px; overflow: auto; border: 1px solid #e4e7ec; border-radius: 8px; }
.demo-search { position: relative; }
.demo-search svg { position: absolute; left: 10px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); fill: none; stroke: #667085; stroke-width: 1.6; }
.demo-search input { width: 100%; font: inherit; font-size: 14px; padding: 8px 10px 8px 32px; border: 1px solid #d0d5dd; border-radius: 8px; }
.demo-sugg { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 14px; padding: 14px; border: 1px solid #e2e5ea; border-radius: 12px; }
.demo-votes { display: grid; place-items: center; height: 52px; border: 1px solid #e2e5ea; border-radius: 10px; font-weight: 700; font-size: 18px; }
.demo-sugg h2 { font-size: 16px; font-weight: 700; }
.demo-sugg-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 6px; font-size: 13px; color: #5d6673; }
.demo-dot { display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 50%; background: #0f766e; }
.demo-chip { display: inline-flex; align-items: center; gap: 4px; font: inherit; font-size: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: #5d6673; background: none; border: 0; padding: 2px 0; }
.demo-chip-action { color: #2458cf; font-weight: 700; cursor: pointer; }
.demo-chip-action:hover { text-decoration: underline; }
.demo-linkbox { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border: 1px solid #d0d5dd; border-radius: 8px; background: #f9fafb; }
.demo-linkbox code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }

/* Generic email client and social profile: neutral, not modelled on any real product. */
.demo-mail .demo-btn-primary, .demo-social .demo-btn-primary { background: #1d2939; border-color: #1d2939; color: #fff; }
.demo-mail .demo-btn-primary:hover, .demo-social .demo-btn-primary:hover { background: #344054; }
.demo-msg { display: grid; gap: 8px; padding-bottom: 14px; border-bottom: 1px solid #e4e7ec; }
.demo-msg-from { font-size: 14px; color: #475467; }
.demo-msg-subject { font-size: 17px; font-weight: 700; }
.demo-compose { display: grid; gap: 8px; }
.demo-compose[hidden], .demo-sent[hidden] { display: none; }
.demo-field { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px solid #eaecf0; font-size: 14px; }
.demo-field span { width: 58px; color: #667085; flex: none; }
.demo-toolbar { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #667085; }
.demo-body { width: 100%; font: inherit; font-size: 15px; line-height: 1.5; padding: 10px 12px; border: 1px solid #d0d5dd; border-radius: 8px; background: #fff; color: #1d2939; resize: vertical; }
.demo-body:focus { outline: 2px solid #1d2939; outline-offset: 1px; }
.demo-body-rich { min-height: 220px; max-height: 460px; overflow: auto; padding: 0; }
.demo-body-rich:empty::before { content: attr(data-placeholder); display: block; padding: 10px 12px; color: #98a2b3; }
.demo-send-row { display: flex; justify-content: flex-end; }
.demo-sent { display: grid; gap: 8px; padding: 16px; border-radius: 8px; background: #ecfdf3; border: 1px solid #abefc6; color: #054f31; }
.demo-label { font-size: 13px; font-weight: 700; }
.demo-input { padding: 9px 12px; }
.demo-profile-head { display: flex; align-items: center; gap: 12px; }
.demo-profile-head div { display: grid; }
.demo-profile-head span:not(.demo-avatar) { color: #667085; font-size: 14px; }
.demo-avatar { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: #eef1f5; flex: none; }
.demo-avatar svg { width: 20px; height: 24px; }
.demo-social .demo-sent { background: #fff; border-color: #e4e7ec; color: #1d2939; }
.demo-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.demo-tab { font: inherit; font-size: var(--t-small); font-weight: 600; color: var(--muted); background: var(--paper); border: 1px solid var(--rule-strong); border-radius: 999px; padding: 7px 14px; cursor: pointer; }
.demo-tab:hover { color: var(--graphite); }
.demo-tab[aria-selected="true"] { color: #fff; background: var(--ink); border-color: var(--ink); }
.demo-tab:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.demo-example[hidden] { display: none; }
.demo-example-lede { margin: 0 0 14px; color: var(--graphite); max-width: 46rem; }
.demo-address code { font-size: 13px; white-space: normal; overflow-wrap: anywhere; text-overflow: clip; }
.demo-dot.is-done { background: #1d2939; }
.demo-dot.is-open { background: #98a2b3; }
.demo-sugg-note { margin-top: 6px; font-size: 14px; color: #475467; }
.demo-video { display: grid; place-items: center; aspect-ratio: 16 / 9; border-radius: 8px; background: #1d2939; color: #fff; font-size: 28px; }
.demo-video-title { font-weight: 700; }
.demo-video-page { background: #fff; border-color: #e4e7ec; color: #1d2939; }
.demo-video-channel { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.demo-avatar-small { width: 28px; height: 28px; }
.demo-avatar-small svg { width: 12px; height: 14px; }
.demo-desc { padding: 10px 12px; border-radius: 10px; background: #f2f4f7; font-size: 14px; }
.demo-desc-meta { font-weight: 700; margin-bottom: 2px; }
.demo-desc-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; line-clamp: 1; overflow: hidden; }
.demo-desc.is-open .demo-desc-text { display: block; -webkit-line-clamp: unset; line-clamp: none; overflow: visible; }
.demo-desc-toggle { font: inherit; font-weight: 700; color: #1d2939; background: none; border: 0; padding: 2px 0; cursor: pointer; }
.demo-desc-toggle:focus-visible { outline: 2px solid #1d2939; outline-offset: 2px; }
.demo-post { gap: 10px; }
.demo-post-text { white-space: pre-line; line-height: 1.5; }
.demo-post-text a { color: #2563eb; font-weight: 600; word-break: break-all; }
.demo-preview-card { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid #e4e7ec; border-radius: 10px; background: #f9fafb; }
.demo-preview-host { font-size: 12px; color: #667085; }
.demo-preview-card span:last-child { font-size: 14px; color: #475467; }
.demo-post-meta { font-size: 13px; color: #067647; font-weight: 600; }
