:root {
  --green: #188600;
  --green-dark: #0b4d08;
  --green-soft: #eff9ed;
  --gold: #f3bd13;
  --gold-soft: #fff6cf;
  --ink: #171717;
  --muted: #686868;
  --line: #2a2a2a;
  --paper: #fffdf7;
  --panel: #ffffff;
  --shadow: 0 20px 70px rgba(0, 0, 0, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(243, 189, 19, 0.22), transparent 32rem),
    linear-gradient(135deg, #f4f0e6, #e5e8df);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

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

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 22px;
  align-items: start;
  width: min(1360px, calc(100% - 32px));
  margin: 24px auto;
}

.paper-form,
.preview-panel {
  border: 1px solid rgba(0, 0, 0, 0.16);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.paper-form {
  padding: 26px;
}

.form-header {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 5px solid var(--green);
  box-shadow: inset 0 -2px 0 var(--gold);
}

.brand-logo {
  display: block;
  width: 100%;
  max-height: 124px;
  object-fit: contain;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--green-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 0.95;
  letter-spacing: 0;
  text-transform: uppercase;
}

.header-copy p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.paper-top-grid {
  display: grid;
  grid-template-columns: 0.47fr 0.53fr;
  gap: 28px;
  margin-top: 22px;
}

.paper-left-grid,
.paper-right-grid {
  display: grid;
  gap: 0;
  align-content: start;
}

.paper-left-grid {
  grid-template-columns: 1fr 1fr 0.45fr 0.35fr;
}

.paper-right-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.paper-cell {
  position: relative;
  display: grid;
  min-height: 56px;
  align-items: end;
  border-top: 2px solid rgba(42, 42, 42, 0.78);
  border-right: 1px solid rgba(42, 42, 42, 0.62);
  background: rgba(255, 255, 255, 0.36);
}

.paper-cell:nth-child(3n),
.paper-left-grid .paper-cell:nth-child(2),
.paper-left-grid .paper-cell.zip {
  border-right: 0;
}

.paper-cell span,
.what-to-do-box span,
.service-box span,
.suggestion-box span,
.invoice-grid span {
  display: block;
  padding: 0 8px 4px;
  color: #333;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
}

.paper-cell input,
.paper-cell select {
  width: 100%;
  min-height: 30px;
  border: 0;
  border-radius: 0;
  background: transparent;
  outline: none;
  padding: 2px 8px 7px;
  text-align: center;
}

.paper-cell input:focus,
.paper-cell select:focus,
.paper-cell textarea:focus,
.paper-work-area textarea:focus,
.invoice-grid input:focus,
.invoice-grid select:focus {
  background: rgba(239, 249, 237, 0.86);
  box-shadow: inset 0 -3px 0 var(--gold);
}

.paper-cell.full {
  grid-column: 1 / -1;
}

.paper-cell.half {
  grid-column: span 2;
}

.paper-cell.city {
  grid-column: span 2;
}

.paper-cell.state,
.paper-cell.zip {
  grid-column: span 1;
}

.access-cell {
  min-height: 66px;
}

.paper-checkbox {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding-bottom: 6px;
}

.paper-checkbox input,
.agreement-check input {
  width: 20px;
  height: 20px;
  accent-color: var(--green);
}

.paper-checkbox em {
  color: var(--muted);
  font-size: 0.82rem;
  font-style: normal;
  font-weight: 700;
}

.problem-cell {
  grid-column: 1 / -1;
  min-height: 112px;
  border-right: 0;
}

.problem-cell span {
  text-align: left;
}

.problem-cell textarea {
  width: 100%;
  height: 72px;
  min-height: 72px;
  resize: vertical;
  border: 0;
  background: transparent;
  outline: none;
  padding: 6px 8px;
}

.paper-work-area {
  position: relative;
  display: grid;
  grid-template-rows: 132px minmax(340px, auto) 104px;
  margin-top: 48px;
  border: 2px solid var(--line);
  background: rgba(255, 255, 255, 0.56);
}

.paper-title-tab {
  position: absolute;
  top: -39px;
  left: 16px;
  padding: 0 12px 0 0;
  color: rgba(11, 77, 8, 0.92);
  background: var(--paper);
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  -webkit-text-stroke: 1px rgba(17, 17, 17, 0.42);
  text-shadow: 2px 2px 0 rgba(243, 189, 19, 0.65);
}

.what-to-do-box,
.service-box,
.suggestion-box {
  display: grid;
  grid-template-columns: 180px 1fr;
  border-bottom: 2px solid var(--line);
}

.suggestion-box {
  border-bottom: 0;
}

.what-to-do-box span,
.service-box span,
.suggestion-box span {
  display: grid;
  align-items: center;
  justify-content: center;
  border-right: 2px solid var(--line);
  padding: 12px;
  text-align: center;
}

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

.service-box span {
  display: block;
  border-right: 0;
  border-bottom: 2px solid var(--line);
  padding: 8px;
}

.paper-work-area textarea {
  width: 100%;
  min-height: 100%;
  resize: vertical;
  border: 0;
  background:
    linear-gradient(to bottom, transparent 34px, rgba(0, 0, 0, 0.08) 35px),
    rgba(255, 255, 255, 0.72);
  background-size: 100% 36px;
  outline: none;
  padding: 10px;
  line-height: 36px;
}

.paper-bottom-grid {
  display: grid;
  grid-template-columns: 0.38fr 0.62fr;
  gap: 0;
  margin-top: 0;
  border: 2px solid var(--line);
  border-top: 0;
}

.agreement-card,
.invoice-card,
.tips-box,
.summary-card,
.status-box {
  border: 1px solid rgba(0, 0, 0, 0.18);
  background: #fff;
}

.agreement-card,
.invoice-card {
  padding: 14px;
}

.agreement-card {
  border-top: 0;
  border-left: 0;
  border-bottom: 0;
  border-right: 2px solid var(--line);
}

.tips-box {
  border: 0;
  border-left: 0;
  border-radius: 0;
  padding: 14px 18px;
}

.invoice-card {
  grid-column: 1 / -1;
  border: 0;
  border-top: 2px solid var(--line);
}

.agreement-card h2,
.tips-box h2,
.invoice-card h2 {
  margin-bottom: 10px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.agreement-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-weight: 700;
}

.agreement-card p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.invoice-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.invoice-grid input,
.invoice-grid select {
  min-height: 40px;
  width: 100%;
  border: 1px solid rgba(0, 0, 0, 0.24);
  border-radius: 6px;
  background: #fff;
  padding: 8px 10px;
  outline: none;
}

.total-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: 18px;
  padding: 14px 16px;
  border-left: 5px solid var(--gold);
  background: var(--green-soft);
}

.total-row span {
  color: var(--green-dark);
  font-weight: 800;
}

.total-row strong {
  font-size: 1.55rem;
}

.tips-box ol {
  margin: 0;
  padding-left: 22px;
  color: #333;
  font-size: 0.92rem;
}

.actions-bar {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin: 24px -26px -26px;
  padding: 14px 26px;
  border-top: 1px solid rgba(0, 0, 0, 0.14);
  background: rgba(255, 253, 247, 0.94);
  backdrop-filter: blur(12px);
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 7px;
  padding: 0 18px;
  font-weight: 800;
  cursor: pointer;
}

button.primary {
  color: #fff;
  background: linear-gradient(180deg, #179500, var(--green-dark));
  box-shadow: inset 0 -3px 0 var(--gold);
}

button.secondary {
  color: var(--green-dark);
  border: 1px solid rgba(11, 77, 8, 0.34);
  background: #fff;
}

.preview-panel {
  position: sticky;
  top: 24px;
  padding: 18px;
  border-radius: 10px;
}

.preview-panel h2 {
  margin-bottom: 14px;
  font-size: 1.25rem;
}

.summary-card {
  display: grid;
  gap: 5px;
  margin-top: 12px;
  padding: 14px;
  border-radius: 8px;
}

.summary-card span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.summary-card strong {
  word-break: break-word;
}

.status-box {
  margin-top: 14px;
  padding: 14px;
  border-left: 5px solid var(--gold);
  border-radius: 8px;
  color: #4a3b00;
  background: var(--gold-soft);
  font-size: 0.92rem;
  line-height: 1.45;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100% - 36px));
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  border-radius: 8px;
  padding: 12px 14px;
  color: #fff;
  background: var(--green-dark);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.visible {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 1060px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .preview-panel {
    position: static;
    order: -1;
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 18px, 620px);
    margin: 9px auto;
  }

  .paper-form {
    padding: 14px;
  }

  .form-header,
  .paper-top-grid,
  .paper-left-grid,
  .paper-right-grid,
  .paper-bottom-grid,
  .invoice-grid {
    grid-template-columns: 1fr;
  }

  .brand-logo {
    max-width: 180px;
  }

  .paper-cell.full,
  .paper-cell.half,
  .paper-cell.city,
  .paper-cell.state,
  .paper-cell.zip,
  .problem-cell {
    grid-column: auto;
  }

  .paper-top-grid {
    gap: 18px;
  }

  .paper-cell {
    border-right: 0;
  }

  .paper-work-area {
    grid-template-rows: 150px minmax(300px, auto) 140px;
  }

  .what-to-do-box,
  .suggestion-box {
    grid-template-columns: 1fr;
  }

  .what-to-do-box span,
  .suggestion-box span {
    border-right: 0;
    border-bottom: 2px solid var(--line);
    padding: 8px;
  }

  .agreement-card {
    border-right: 0;
    border-bottom: 2px solid var(--line);
  }

  .actions-bar {
    display: grid;
    margin: 18px -14px -14px;
    padding: 12px 14px;
  }
}
