:root {
  --ink: #1a1a1a;
  --muted: #666;
  --rule: #e2e2e2;
  --accent: #1f5f4b;
  --bg: #fdfdfb;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #ececec;
    --muted: #9a9a9a;
    --rule: #333;
    --accent: #6fbfa3;
    --bg: #141414;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
}

main {
  max-width: 44rem;
  margin: 0 auto;
  padding: 4rem 1.5rem 2rem;
}

footer {
  max-width: 44rem;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.875rem;
}

footer a { color: var(--muted); }

h1 { font-size: 2.25rem; line-height: 1.2; margin: 0.25rem 0 1rem; letter-spacing: -0.02em; }
h2 { font-size: 1.125rem; margin: 2.5rem 0 0.75rem; letter-spacing: -0.01em; }
h3 { font-size: 1rem; margin: 1.75rem 0 0.5rem; }

a { color: var(--accent); }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0;
}

.lede { font-size: 1.125rem; color: var(--muted); }
.muted { color: var(--muted); }

ul { padding-left: 1.25rem; }
li { margin-bottom: 0.5rem; }

.placeholder-note {
  margin-top: 3rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
}

.placeholder-note h2 { margin-top: 0; }

/* ---- Public invoice view ---- */

.invoice header { margin-bottom: 2rem; }

.parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.parties h2 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 0.25rem;
}

.parties p { margin: 0; }

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}

th, td {
  text-align: left;
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid var(--rule);
}

th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}

.num { text-align: right; font-variant-numeric: tabular-nums; }
td.num { font-variant-numeric: tabular-nums; }

.totals {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.4rem 1.5rem;
  margin: 0 0 2rem;
  font-variant-numeric: tabular-nums;
}

.totals dt { text-align: right; color: var(--muted); }
.totals dd { margin: 0; text-align: right; font-weight: 600; }

.button {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--accent);
  border-radius: 6px;
  text-decoration: none;
}

/* Tables must scroll inside their own container rather than the page. */
@media (max-width: 34rem) {
  .parties { grid-template-columns: 1fr; }
  h1 { font-size: 1.75rem; }
  main { padding-top: 2.5rem; }
}
