/* Kern & Frame: off-white paper, black ink, one vermilion accent.
   Archivo (SIL Open Font License, see fonts/OFL.txt) in two widths:
   expanded for display, normal for text. Figures are tabular everywhere. */

@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo-latin-wdth.woff2") format("woff2-variations"), url("fonts/archivo-latin-wdth.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo-latin-ext-wdth.woff2") format("woff2-variations"), url("fonts/archivo-latin-ext-wdth.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Arial scaled to Archivo's metrics, so text doesn't jump when the font arrives. */
@font-face {
  font-family: "Archivo Fallback";
  src: local("Arial"), local("Helvetica Neue"), local("Helvetica");
  size-adjust: 102%;
  ascent-override: 86%;
  descent-override: 20.6%;
  line-gap-override: 0%;
}

:root {
  --paper: #f4f2ed;
  --paper-deep: #ebe8e1;
  --sheet: #fffefb;
  --ink: #121212;
  --ink-2: #5a5750;
  --hair: #d8d4cb;
  --field: #b9b4a9;
  --accent: #e34234; /* vermilion: rules, marks, focus */
  --accent-strong: #c2331a; /* vermilion for text and filled buttons */
  --ok: #1f5c3a;
  --font: "Archivo", "Archivo Fallback", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1180px;
  color-scheme: light;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

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

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

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

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

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

main:focus {
  outline: none;
}

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

.skip-link {
  position: absolute;
  left: 8px;
  top: -48px;
  z-index: 10;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
}

.skip-link:focus {
  top: 8px;
  color: var(--paper);
}

.wrap {
  width: min(100% - 2 * var(--gutter), var(--max));
  margin-inline: auto;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 9px;
  height: 9px;
  background: var(--accent);
  flex: none;
}

.lead {
  font-size: clamp(17px, 1.6vw, 19px);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 34em;
}

/* ------------------------------------------------------------------ */
/* Demo notice */

.demo-banner {
  background: var(--paper-deep);
  border-bottom: 1px solid var(--hair);
  font-size: 14px;
}

.demo-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  flex-wrap: wrap;
  padding-block: 9px;
}

.demo-banner p {
  color: var(--ink-2);
}

.demo-banner strong {
  display: inline-block;
  margin-right: 8px;
  padding: 1px 7px;
  background: var(--ink);
  color: var(--paper);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  vertical-align: 1px;
}

.demo-banner a,
.demo-banner button {
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  white-space: nowrap;
}

.demo-banner a::after,
.demo-banner button::after {
  content: " →";
}

.demo-inline {
  display: inline;
}

.demo-footer {
  color: var(--ink-2);
}

/* ------------------------------------------------------------------ */
/* Masthead */

.masthead {
  border-bottom: 2px solid var(--ink);
  background: var(--paper);
}

.masthead-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
  flex-wrap: wrap;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}

.mark {
  width: 30px;
  height: 30px;
  flex: none;
}

.mark-frame {
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
}

.mark-dot {
  fill: var(--accent);
}

.wordmark-name {
  font-size: 19px;
  font-weight: 800;
  font-stretch: 118%;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.wordmark-sub {
  padding-left: 12px;
  border-left: 1px solid var(--hair);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.masthead-note {
  color: var(--ink-2);
  font-size: 14px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px 22px;
  flex-wrap: wrap;
  font-size: 15px;
  font-weight: 500;
}

.nav a {
  text-decoration: none;
  padding-block: 6px;
}

.nav a[aria-current="page"] {
  box-shadow: inset 0 -2px var(--accent);
}

.nav .nav-cta {
  padding: 8px 14px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
}

.nav .nav-cta:hover {
  background: var(--accent-strong);
  color: #fff;
}

/* ------------------------------------------------------------------ */
/* Buttons and forms */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1.5px solid var(--ink);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  background: var(--ink);
  color: var(--paper);
}

.button-primary {
  background: var(--ink);
  color: var(--paper);
}

.button-primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #fff;
}

.button-quiet {
  border-color: transparent;
  padding-inline: 4px;
  text-decoration: underline;
  text-decoration-color: var(--hair);
  text-underline-offset: 4px;
}

.button-quiet:hover {
  background: transparent;
  color: var(--accent-strong);
  text-decoration-color: currentColor;
}

.button-small {
  min-height: 36px;
  padding: 0 12px;
  font-size: 14px;
}

.button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

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

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

.stack .button {
  width: 100%;
}

.card {
  background: var(--sheet);
  border: 1px solid var(--hair);
  border-top: 3px solid var(--ink);
  padding: clamp(20px, 3vw, 32px);
}

.card h2 {
  font-size: 22px;
  font-weight: 800;
  font-stretch: 112%;
  letter-spacing: -0.01em;
  margin-bottom: 18px;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 18px;
}

label,
legend {
  font-size: 14px;
  font-weight: 600;
}

.optional {
  color: var(--ink-2);
  font-weight: 400;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--field);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

input[type="date"] {
  height: 44px;
  line-height: 1.2;
}

.nowrap,
.col-no a {
  white-space: nowrap;
}

textarea {
  resize: vertical;
  line-height: 1.45;
}

select {
  appearance: none;
  padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--ink-2);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 0;
  border-color: var(--ink);
}

input[readonly] {
  background: var(--paper);
}

[aria-invalid="true"] {
  border-color: var(--accent-strong);
  box-shadow: inset 3px 0 var(--accent);
}

.hint {
  color: var(--ink-2);
  font-size: 13px;
}

.field-error {
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 600;
}

.error-summary {
  margin-bottom: 20px;
  padding: 12px 16px;
  border-left: 4px solid var(--accent);
  background: #fbeae6;
  font-size: 14px;
}

.error-summary ul {
  margin-top: 4px;
  padding-left: 18px;
  list-style: square;
}

.trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.notice {
  margin: 0 0 20px;
  padding: 12px 16px;
  border-left: 4px solid var(--ink);
  background: var(--sheet);
  font-size: 15px;
}

.notice-error {
  border-left-color: var(--accent);
  background: #fbeae6;
}

/* ------------------------------------------------------------------ */
/* Public page */

.hero {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 32px;
  padding-block: clamp(36px, 7vw, 88px) clamp(48px, 7vw, 88px);
  align-items: start;
}

.hero-copy {
  grid-column: 1 / span 7;
  display: grid;
  gap: 24px;
  padding-top: 8px;
}

.hero h1 {
  font-size: clamp(40px, 5.4vw, 70px);
  line-height: 0.98;
  font-weight: 800;
  font-stretch: 112%;
  letter-spacing: -0.03em;
}

.request-form {
  grid-column: 8 / span 5;
}

.facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 16px;
  border-top: 2px solid var(--ink);
  max-width: 560px;
}

.facts div {
  padding: 14px 16px 0 0;
}

.facts div + div {
  padding-left: 16px;
  border-left: 1px solid var(--hair);
}

.facts dt {
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 800;
  font-stretch: 112%;
  letter-spacing: -0.02em;
  line-height: 1.1;
  white-space: nowrap;
}

.facts dt::after {
  content: "";
  display: block;
  width: 18px;
  height: 3px;
  margin-top: 8px;
  background: var(--accent);
}

.facts dd {
  margin-top: 8px;
  color: var(--ink-2);
  font-size: 14px;
}

.request-form .button {
  width: 100%;
}

.band {
  border-top: 2px solid var(--ink);
  padding-block: clamp(32px, 5vw, 56px);
}

.band > .wrap {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 32px;
}

.section-title {
  grid-column: 1 / span 3;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.services,
.steps {
  grid-column: 4 / span 9;
}

.service {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 16px;
  align-items: baseline;
  padding: 18px 0;
  border-bottom: 1px solid var(--hair);
}

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

.service-index,
.step-index {
  color: var(--accent);
  font-size: 26px;
  font-weight: 800;
  font-stretch: 115%;
  line-height: 1;
}

.service h3 {
  font-size: 21px;
  font-weight: 700;
  font-stretch: 108%;
  letter-spacing: -0.01em;
}

.service p {
  color: var(--ink-2);
}

.service .service-price {
  color: var(--ink);
  font-size: 19px;
  font-weight: 600;
  white-space: nowrap;
}

.service-price span {
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
}

.steps li {
  display: grid;
  gap: 8px;
  align-content: start;
  padding-top: 16px;
  border-top: 1px solid var(--ink);
}

.steps h3 {
  font-size: 20px;
  font-weight: 700;
}

.steps p {
  color: var(--ink-2);
}

.narrow > * {
  max-width: 680px;
}

.confirm {
  display: grid;
  gap: 20px;
  padding-block: clamp(48px, 9vw, 112px);
}

.confirm h1 {
  font-size: clamp(38px, 6vw, 64px);
  line-height: 1;
  font-weight: 800;
  font-stretch: 112%;
  letter-spacing: -0.03em;
}

.demo-next {
  display: grid;
  gap: 12px;
  justify-items: start;
  margin-top: 12px;
}

.demo-next h2 {
  margin: 0;
}

/* ------------------------------------------------------------------ */
/* Footer */

.site-footer {
  margin-top: 72px;
  border-top: 1px solid var(--hair);
  font-size: 14px;
  color: var(--ink-2);
}

.site-footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 32px;
  padding-block: 22px 32px;
}

.site-footer a {
  color: var(--ink);
}

.demo-footer a {
  font-weight: 600;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
}

/* ------------------------------------------------------------------ */
/* Desk */

.desk {
  padding-top: 32px;
}

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

.desk-head h1,
.narrow-wide > h1 {
  margin-top: 6px;
  font-size: clamp(32px, 4vw, 44px);
  line-height: 1.05;
  font-weight: 800;
  font-stretch: 112%;
  letter-spacing: -0.02em;
}

.figures {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--hair);
  margin-bottom: 28px;
}

.figure {
  padding: 16px 20px 18px;
  border-left: 1px solid var(--hair);
}

.figure:first-child {
  border-left: 0;
  padding-left: 0;
}

.figure dt {
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.figure dd {
  display: grid;
  gap: 2px;
  margin-top: 8px;
}

.figure-value {
  font-size: clamp(22px, 2.6vw, 32px);
  font-weight: 700;
  font-stretch: 104%;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.figure-detail {
  color: var(--ink-2);
  font-size: 13px;
}

.figure-alert {
  box-shadow: inset 0 3px var(--accent);
}

.figure-alert .figure-value {
  color: var(--accent-strong);
}

.inbox {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 8px 24px;
  align-items: center;
  margin-bottom: 28px;
  padding: 12px 16px 12px 20px;
  background: var(--sheet);
  border: 1px solid var(--hair);
  border-left: 4px solid var(--accent);
}

.inbox h2 {
  font-size: 15px;
  font-weight: 700;
}

.inbox ul {
  display: grid;
  gap: 8px;
}

.inbox li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.inbox .project {
  display: inline;
  color: var(--ink-2);
  font-size: 15px;
}

.inbox .project::before {
  content: " · ";
}

.tabs {
  display: flex;
  gap: 4px 24px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--ink);
  font-size: 15px;
  font-weight: 500;
}

.tabs a {
  padding: 8px 0 10px;
  text-decoration: none;
  color: var(--ink-2);
}

.tabs a[aria-current="page"] {
  color: var(--ink);
  font-weight: 700;
  box-shadow: inset 0 -3px var(--ink);
}

.count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  margin-left: 4px;
  padding: 0 5px;
  background: var(--accent);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

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

.ledger {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.ledger th {
  padding: 12px 12px 8px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
  border-bottom: 1px solid var(--hair);
  white-space: nowrap;
}

.ledger th.num {
  text-align: right;
}

.ledger td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--hair);
  vertical-align: top;
}

.ledger th:first-child,
.ledger td:first-child {
  padding-left: 0;
}

.ledger th:last-child,
.ledger td:last-child {
  padding-right: 0;
}

.ledger tbody tr:hover {
  background: var(--paper-deep);
}

.col-no a {
  font-weight: 700;
  text-decoration: none;
}

.col-no a::after {
  /* The whole row is clickable through the document number. */
  content: "";
  position: absolute;
  inset: 0;
}

.ledger tbody tr {
  position: relative;
}

.kind-label,
.project {
  display: block;
  color: var(--ink-2);
  font-size: 13px;
}

.client-name {
  display: block;
  font-weight: 600;
}

.col-date {
  white-space: nowrap;
  color: var(--ink-2);
}

.col-total {
  font-weight: 600;
}

.col-email {
  color: var(--ink-2);
  word-break: break-all;
}

.empty {
  padding: 32px 0;
  color: var(--ink-2);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 40px;
  align-items: start;
}

.split .section-title {
  margin-bottom: 8px;
}

/* Status labels: a small shape plus a word, never color alone. */
.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.status-dot {
  width: 9px;
  height: 9px;
  border: 1.5px solid var(--ink);
  flex: none;
}

.status-requested .status-dot {
  border-color: var(--accent);
  border-radius: 50%;
}

.status-draft {
  color: var(--ink-2);
}

.status-draft .status-dot {
  border-style: dashed;
  border-color: var(--ink-2);
}

.status-sent .status-dot {
  border-radius: 50%;
}

.status-accepted .status-dot,
.status-paid .status-dot {
  background: var(--ink);
}

.status-converted,
.status-declined,
.status-void {
  color: var(--ink-2);
}

.status-converted .status-dot {
  background: var(--ink-2);
  border-color: var(--ink-2);
}

.status-declined .status-dot,
.status-void .status-dot {
  height: 0;
  border-width: 1.5px 0 0;
  border-color: var(--ink-2);
}

.status-overdue {
  color: var(--accent-strong);
}

.status-overdue .status-dot {
  background: var(--accent);
  border-color: var(--accent);
}

.status-expired {
  color: var(--ink-2);
}

.status-expired .status-dot {
  border-style: dotted;
  border-color: var(--ink-2);
  border-radius: 50%;
}

/* Links to more pages of a long list */
.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-top: 16px;
  font-size: 15px;
}

.delete-client {
  margin-top: 32px;
}

/* ------------------------------------------------------------------ */
/* Document page */

.doc-wrap {
  padding-top: 16px;
}

.doc-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  min-height: 44px;
}

.back {
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
}

.back::before {
  content: "← ";
}

.doc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 32px;
  align-items: start;
}

.panel {
  position: sticky;
  top: 16px;
  display: grid;
  border-top: 2px solid var(--ink);
}

.panel-block {
  display: grid;
  gap: 10px;
  padding: 16px 0 18px;
  border-bottom: 1px solid var(--hair);
  font-size: 15px;
}

.panel-block h2 {
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.panel-block p {
  color: var(--ink-2);
}

.panel-status .status {
  font-size: 18px;
}

.panel-dates {
  display: grid;
  gap: 2px;
  font-size: 14px;
}

.panel-dates div {
  display: flex;
  justify-content: space-between;
}

.panel-dates dt {
  color: var(--ink-2);
}

.related {
  font-size: 14px;
}

.related a {
  color: var(--ink);
  font-weight: 700;
}

.copy-field {
  display: flex;
}

.copy-field input {
  min-width: 0;
  font-size: 13px;
  border-right: 0;
}

.copy-status {
  min-height: 1.5em;
  font-size: 13px;
}

.request-quote {
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  border-left: 2px solid var(--accent);
  padding-left: 12px;
}

.respond {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
  padding: 18px 20px;
  background: var(--sheet);
  border: 1px solid var(--hair);
  border-left: 4px solid var(--accent);
}

/* The printable sheet */
.sheet {
  position: relative;
  max-width: 860px;
  padding: clamp(20px, 5vw, 56px) clamp(18px, 5vw, 56px) clamp(20px, 4vw, 36px);
  background: var(--sheet);
  border: 1px solid var(--hair);
  box-shadow: 0 1px 0 rgb(18 18 18 / 4%), 0 18px 40px -28px rgb(18 18 18 / 35%);
  font-size: 14.5px;
}

/* The client view centers the document and everything above it. */
.doc-wrap:not(.doc-desk) > * {
  max-width: 860px;
  margin-inline: auto;
}

.doc-wrap:not(.doc-desk) .notice {
  margin-bottom: 20px;
}

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

.sheet-brand {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.sheet-studio {
  font-size: 18px;
  font-weight: 800;
  font-stretch: 118%;
  line-height: 1.2;
}

.sheet-from {
  margin-top: 4px;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.45;
}

.sheet-kind {
  display: grid;
  justify-items: end;
  text-align: right;
}

.sheet-kind h1 {
  font-size: clamp(30px, 4.5vw, 46px);
  font-weight: 800;
  font-stretch: 118%;
  line-height: 0.95;
  letter-spacing: -0.03em;
}

.sheet-number {
  margin-top: 6px;
  color: var(--ink-2);
  font-size: 15px;
  font-weight: 600;
}

.stamp {
  margin-top: 12px;
  padding: 3px 9px;
  border: 2px solid var(--ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stamp-overdue {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.stamp-void,
.stamp-declined {
  border-color: var(--ink-2);
  color: var(--ink-2);
}

.sheet-meta {
  display: grid;
  grid-template-columns: 1fr 1fr 200px;
  gap: 24px;
  padding-block: 22px 26px;
}

.sheet-project {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
}

.sheet-meta h2 {
  margin-bottom: 6px;
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sheet-meta p {
  line-height: 1.5;
}

.sheet-dates {
  display: grid;
  gap: 6px;
  align-content: start;
}

.sheet-dates div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--hair);
}

.sheet-dates dt {
  color: var(--ink-2);
}

.sheet-dates dd {
  font-weight: 600;
}

.lines {
  width: 100%;
  border-collapse: collapse;
}

.lines th {
  padding: 8px 10px;
  border-bottom: 1px solid var(--ink);
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
}

.lines th.num {
  text-align: right;
}

.lines td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--hair);
  vertical-align: top;
}

.lines th:first-child,
.lines td:first-child {
  padding-left: 0;
}

.lines th:last-child,
.lines td:last-child {
  padding-right: 0;
}

.lines .col-qty {
  width: 70px;
}

.lines .col-rate,
.lines .col-amount {
  width: 120px;
}

.line-meta {
  display: none;
}

.lines tfoot th,
.lines tfoot td {
  border-bottom: 0;
  padding-block: 6px;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  text-align: right;
  text-transform: none;
}

.lines tfoot .subtotal th,
.lines tfoot .subtotal td {
  padding-top: 16px;
}

.lines tfoot .total th,
.lines tfoot .total td {
  padding-top: 12px;
  color: var(--ink);
  font-size: 22px;
  font-weight: 800;
  border-top: 3px solid var(--accent);
}

.lines tfoot .total th {
  font-size: 15px;
  font-weight: 700;
  vertical-align: middle;
}

.currency {
  color: var(--ink-2);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.06em;
}

.sheet-empty {
  display: grid;
  gap: 10px;
  padding: 24px 0;
  border-top: 1px solid var(--ink);
}

.sheet-notes {
  margin-top: 28px;
  padding-top: 14px;
  border-top: 1px solid var(--hair);
  max-width: 60ch;
  font-size: 13.5px;
  color: var(--ink-2);
}

.sheet-notes h2 {
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sheet-foot {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-top: 36px;
  padding-top: 12px;
  border-top: 2px solid var(--ink);
  color: var(--ink-2);
  font-size: 12px;
}

/* ------------------------------------------------------------------ */
/* Document form */

.narrow-wide {
  padding-top: 16px;
}

.narrow-wide > * {
  max-width: 920px;
}

.narrow-wide > h1 {
  margin: 0 0 20px;
}

.request-card {
  margin-bottom: 20px;
  border-top-color: var(--accent);
}

.request-card h2 {
  font-size: 15px;
  margin-bottom: 10px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 20px;
}

.span-2 {
  grid-column: span 2;
}

.line-items {
  margin: 8px 0 20px;
  padding: 0;
  border: 0;
  min-width: 0;
}

.line-items legend {
  margin-bottom: 8px;
  padding: 0;
}

.lines-edit td {
  padding: 6px 8px;
  border-bottom: 0;
}

.lines-edit .col-qty {
  width: 90px;
}

.lines-edit .col-rate {
  width: 150px;
}

.lines-edit .col-amount {
  width: 120px;
  vertical-align: middle;
  font-weight: 600;
}

.add-line {
  margin-top: 8px;
}

/* A line with no price yet shows a muted 0.00. */
[data-line-amount][data-empty] {
  color: var(--ink-2);
  font-weight: 400;
}

.notes-field {
  margin-top: 20px;
}

.totals-grid {
  align-items: start;
  padding-top: 16px;
  border-top: 1px solid var(--hair);
}

.live-totals {
  display: grid;
  gap: 4px;
  font-size: 15px;
}

.live-totals div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.live-totals dt {
  color: var(--ink-2);
}

.live-totals .grand {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 3px solid var(--accent);
  font-size: 21px;
  font-weight: 800;
}

.live-totals .grand dt {
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  align-self: center;
}

/* ------------------------------------------------------------------ */
/* Smaller screens */

@media (max-width: 960px) {
  .hero-copy,
  .request-form {
    grid-column: 1 / -1;
  }

  .section-title,
  .services,
  .steps {
    grid-column: 1 / -1;
  }

  .doc-layout,
  .split {
    grid-template-columns: 1fr;
  }

  .doc-desk .panel {
    position: static;
    order: -1;
  }

  .doc-desk .stack {
    display: flex;
    flex-wrap: wrap;
  }

  .doc-desk .stack .button {
    width: auto;
  }

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

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

  .figure:nth-child(3) {
    border-left: 0;
    padding-left: 0;
  }

  .figure:nth-child(n + 3) {
    border-top: 1px solid var(--hair);
  }
}

@media (max-width: 640px) {
  .masthead-inner {
    padding-block: 12px;
    min-height: 0;
  }

  .wordmark-sub {
    display: none;
  }

  .nav {
    gap: 4px 16px;
    font-size: 14px;
  }

  .nav .nav-cta {
    padding: 6px 10px;
  }

  .steps {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .facts div {
    padding-right: 10px;
  }

  .facts div + div {
    padding-left: 10px;
  }

  .facts dt {
    font-size: 20px;
  }

  .service {
    grid-template-columns: 40px 1fr;
  }

  .service .service-price {
    grid-column: 2;
  }

  .figure {
    padding: 12px 12px 14px;
  }

  .figure:nth-child(odd) {
    padding-left: 0;
  }

  /* The ledger becomes a list of compact rows on phones. */
  .ledger thead {
    display: none;
  }

  .ledger,
  .ledger tbody {
    display: block;
  }

  .ledger tr {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2px 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--hair);
  }

  .ledger td {
    display: block;
    padding: 0 !important;
    border: 0;
  }

  .ledger .col-date,
  .ledger .col-email,
  .ledger .col-count {
    display: none;
  }

  .ledger .col-no .kind-label {
    display: inline;
    margin-left: 6px;
  }

  .ledger .col-client {
    grid-column: 1;
  }

  .ledger .col-status {
    grid-column: 2;
    grid-row: 2;
    align-self: end;
    justify-self: end;
  }

  .ledger .col-total {
    grid-column: 2;
    grid-row: 1;
  }

  .sheet-head {
    flex-direction: column-reverse;
  }

  .sheet-kind {
    justify-items: start;
    text-align: left;
  }

  .sheet-meta {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Qty and Rate move under each description (.line-meta). The cells collapse to
     zero width instead of display: none, so the table keeps four columns and the
     totals below (which span three of them) stay lined up with the amounts.
     Screen readers still read the real cells. */
  .lines:not(.lines-edit) .col-qty,
  .lines:not(.lines-edit) .col-rate {
    width: 0;
    max-width: 0;
    padding: 0;
    overflow: hidden;
    font-size: 0;
    letter-spacing: 0;
    white-space: nowrap;
  }

  .lines tfoot th {
    text-align: left;
  }

  .line-meta {
    display: block;
    color: var(--ink-2);
    font-size: 13px;
  }

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

  .span-2 {
    grid-column: auto;
  }

  .lines-edit thead {
    display: none;
  }

  .lines-edit,
  .lines-edit tbody {
    display: block;
  }

  .lines-edit tr {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
    padding: 10px 0;
    border-bottom: 1px solid var(--hair);
  }

  .lines-edit td {
    display: block;
    width: auto !important;
    padding: 0;
  }

  .lines-edit td.col-desc {
    grid-column: 1 / -1;
  }

  .lines-edit td.col-qty::before,
  .lines-edit td.col-rate::before,
  .lines-edit td.col-amount::before {
    display: block;
    color: var(--ink-2);
    font-size: 12px;
    font-weight: 600;
    text-align: left;
  }

  .lines-edit td.col-qty::before {
    content: "Qty";
  }

  .lines-edit td.col-rate::before {
    content: "Price";
  }

  .lines-edit td.col-amount::before {
    content: "Amount";
  }

  /* Label at the top like Qty and Price, amount level with the inputs' text. */
  .lines-edit td.col-amount {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-self: stretch;
    padding-bottom: 12px;
  }
}

/* ------------------------------------------------------------------ */
/* Print: only the document */

@media print {
  @page {
    margin: 14mm;
  }

  body {
    background: #fff;
    font-size: 12pt;
  }

  .demo-banner,
  .masthead,
  .site-footer,
  .no-print,
  .notice,
  .respond,
  .skip-link {
    display: none !important;
  }

  .wrap {
    width: auto;
    padding: 0;
  }

  .doc-layout {
    display: block;
  }

  .sheet {
    max-width: none;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  a {
    text-decoration: none;
  }

  .lines tr {
    break-inside: avoid;
  }
}
