:root {
  --bg: #f4efe6;
  --panel: rgba(255, 252, 247, 0.92);
  --panel-strong: #fffaf2;
  --ink: #2a221d;
  --muted: #78685d;
  --line: rgba(68, 47, 32, 0.12);
  --brand: #8a4d2c;
  --brand-soft: #d9b08c;
  --accent: #35554a;
  --accent-soft: #dce9e4;
  --shadow: 0 20px 60px rgba(46, 31, 21, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(217, 176, 140, 0.55), transparent 26rem),
    radial-gradient(circle at top right, rgba(53, 85, 74, 0.2), transparent 24rem),
    linear-gradient(180deg, #efe7da 0%, var(--bg) 45%, #f8f4ed 100%);
  font-family: Georgia, "Times New Roman", serif;
}

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

input,
textarea,
select,
button {
  font: inherit;
}

.page-shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1.5rem;
}

.hero h1,
.section-head h2,
.paper h2,
.record-card h3 {
  margin: 0;
  font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
}

.hero h1 {
  font-size: clamp(2rem, 3vw, 3.4rem);
}

.hero-nav {
  display: flex;
  gap: 1rem;
}

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

.grid {
  display: grid;
  gap: 1.25rem;
}

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

.single-column {
  max-width: 880px;
  margin: 0 auto;
}

.panel,
.paper {
  background: var(--panel);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 1.4rem;
  box-shadow: var(--shadow);
}

.accent {
  background: linear-gradient(180deg, rgba(255, 250, 242, 0.98), rgba(255, 244, 234, 0.96));
}

.accent-soft {
  background: linear-gradient(180deg, rgba(250, 255, 252, 0.98), rgba(240, 248, 244, 0.96));
}

.section-head,
.paper-head,
.summary-row,
.record-card,
.actions {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}

.stamp {
  color: var(--muted);
  font-size: 0.9rem;
}

.stack {
  display: grid;
  gap: 1rem;
}

.field-grid {
  display: grid;
  gap: 0.95rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wide {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 0.45rem;
  font-size: 0.95rem;
  color: var(--muted);
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(76, 54, 40, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  padding: 0.85rem 0.95rem;
}

textarea {
  resize: vertical;
}

button {
  border: none;
  border-radius: 999px;
  padding: 0.9rem 1.25rem;
  color: #fff9f1;
  background: linear-gradient(135deg, var(--brand), #a46438);
  cursor: pointer;
  justify-self: start;
}

.share-button {
  padding: 0.55rem 0.95rem;
  color: var(--brand);
  background: rgba(217, 176, 140, 0.18);
  border: 1px solid rgba(138, 77, 44, 0.18);
}

.record-list {
  display: grid;
  gap: 0.9rem;
}

.record-card {
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}

.record-card:first-child {
  border-top: none;
  padding-top: 0;
}

.actions {
  align-items: center;
}

.actions a {
  text-decoration: none;
  white-space: nowrap;
}

.empty,
.attachment-line {
  color: var(--muted);
}

.paper {
  background: var(--panel-strong);
}

.paper-meta {
  display: grid;
  gap: 0.4rem;
  text-align: right;
  color: var(--muted);
}

.paper-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.summary-row {
  padding: 1rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.summary-row span {
  display: block;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.note-block {
  margin-top: 1.35rem;
}

.prewrap {
  white-space: pre-wrap;
}

.invoice-sheet {
  display: grid;
  gap: 1.35rem;
}

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

.invoice-table {
  width: 100%;
  border-collapse: collapse;
}

.invoice-table th,
.invoice-table td {
  padding: 0.8rem 0.9rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.invoice-table th {
  background: rgba(68, 47, 32, 0.06);
  font-weight: 600;
}

.amount-table th:last-child,
.amount-table td:last-child {
  text-align: right;
}

.invoice-totals {
  text-align: right;
  color: var(--ink);
}

.invoice-totals p {
  margin: 0 0 0.3rem;
}

@media (max-width: 900px) {
  .two-up,
  .field-grid,
  .paper-grid {
    grid-template-columns: 1fr;
  }

  .hero,
  .section-head,
  .paper-head,
  .summary-row,
  .record-card {
    flex-direction: column;
    align-items: start;
  }

  .actions {
    justify-content: flex-start;
  }
}
