:root {
  color-scheme: light;
  --ink: #17201b;
  --muted: #617067;
  --line: #d9e2dc;
  --paper: #ffffff;
  --wash: #f4f7f2;
  --mint: #2f8f6b;
  --mint-dark: #176146;
  --gold: #d4a947;
  --sky: #dbeef7;
  --shadow: 0 20px 60px rgba(31, 45, 37, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #f8faf6 0%, #eef5ef 44%, #f8faf6 100%);
}

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

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  align-items: center;
  background: rgba(248, 250, 246, 0.86);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(217, 226, 220, 0.8);
  display: flex;
  height: 72px;
  justify-content: space-between;
  left: 0;
  padding: 0 clamp(18px, 4vw, 56px);
  position: sticky;
  right: 0;
  top: 0;
  z-index: 10;
}

.brand,
.topnav,
.hero-actions,
.form-actions,
.preview-toolbar,
.quote-head,
.pricing-band,
.line-header {
  align-items: center;
  display: flex;
}

.brand {
  font-weight: 800;
  gap: 10px;
}

.brand-mark {
  background: var(--mint);
  border-radius: 8px;
  color: white;
  display: grid;
  height: 36px;
  place-items: center;
  width: 36px;
}

.topnav {
  color: var(--muted);
  font-size: 14px;
  gap: 24px;
}

.topnav a:hover {
  color: var(--mint-dark);
}

.hero {
  display: grid;
  gap: 32px;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  margin: 0 auto;
  max-width: 1180px;
  min-height: 460px;
  padding: 82px clamp(18px, 4vw, 32px) 52px;
}

.hero-copy h1 {
  font-size: clamp(46px, 7vw, 86px);
  letter-spacing: 0;
  line-height: 0.94;
  margin: 10px 0 20px;
  max-width: 820px;
}

.hero-copy p {
  color: var(--muted);
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.55;
  margin: 0;
  max-width: 690px;
}

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

.hero-actions {
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button {
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 46px;
  padding: 12px 18px;
}

.primary {
  background: var(--mint);
  color: white;
}

.primary:hover {
  background: var(--mint-dark);
}

.secondary {
  background: var(--sky);
  color: #1d5870;
}

.ghost {
  background: white;
  border-color: var(--line);
  color: var(--ink);
}

.hero-panel {
  align-self: end;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-height: 250px;
  padding: 28px;
}

.status-dot {
  background: var(--gold);
  border-radius: 99px;
  display: block;
  height: 14px;
  margin-bottom: 60px;
  width: 14px;
}

.mini-label {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 8px;
}

.hero-panel strong {
  display: block;
  font-size: 42px;
  line-height: 1;
}

.hero-panel small {
  color: var(--muted);
  display: block;
  line-height: 1.5;
  margin-top: 12px;
}

.workspace {
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 0.95fr) minmax(380px, 1.05fr);
  margin: 0 auto;
  max-width: 1240px;
  padding: 32px clamp(18px, 4vw, 32px) 70px;
}

.quote-form,
.preview-shell {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.quote-form {
  display: grid;
  gap: 22px;
  padding: 28px;
}

.section-heading h2,
.line-header h2,
.content-band h2,
.pricing-band h2 {
  font-size: 24px;
  letter-spacing: 0;
  margin: 5px 0 0;
}

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

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

label {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  font-weight: 750;
  gap: 8px;
}

input,
select,
textarea {
  background: #fbfdfb;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  min-height: 44px;
  outline: none;
  padding: 10px 12px;
  width: 100%;
}

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

input:focus,
select:focus,
textarea:focus {
  border-color: var(--mint);
  box-shadow: 0 0 0 3px rgba(47, 143, 107, 0.16);
}

.line-header {
  justify-content: space-between;
  margin-bottom: 12px;
}

.icon-button {
  background: var(--ink);
  border: 0;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  font-size: 24px;
  font-weight: 700;
  height: 42px;
  line-height: 1;
  width: 42px;
}

.line-list {
  display: grid;
  gap: 10px;
}

.line-item {
  background: var(--wash);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(130px, 1.4fr) 80px 105px 42px;
  padding: 12px;
}

.remove-line {
  align-self: end;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  height: 44px;
}

.form-actions {
  flex-wrap: wrap;
  gap: 12px;
}

.preview-shell {
  align-self: start;
  overflow: hidden;
  position: sticky;
  top: 92px;
}

.preview-toolbar {
  background: var(--ink);
  color: white;
  font-size: 13px;
  font-weight: 800;
  justify-content: space-between;
  padding: 12px 18px;
}

.quote-preview {
  background: white;
  min-height: 700px;
  overflow: hidden;
  padding: 34px;
  position: relative;
}

.watermark {
  border: 1px solid rgba(47, 143, 107, 0.28);
  border-radius: 8px;
  color: rgba(47, 143, 107, 0.55);
  font-size: 12px;
  font-weight: 800;
  padding: 8px 10px;
  position: absolute;
  right: 28px;
  top: 98px;
}

.quote-head {
  align-items: flex-start;
  border-bottom: 2px solid var(--ink);
  justify-content: space-between;
  padding-bottom: 24px;
}

.quote-kicker,
.quote-for span,
.quote-notes span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.1em;
  margin: 0 0 6px;
  text-transform: uppercase;
}

.quote-head h2 {
  font-size: 28px;
  margin: 0 0 6px;
}

.quote-head p,
.quote-for p,
.quote-notes p {
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.quote-meta {
  display: grid;
  gap: 7px;
  text-align: right;
}

.quote-for {
  background: var(--wash);
  border-radius: 8px;
  margin: 26px 0;
  padding: 18px;
}

.quote-for strong {
  display: block;
  font-size: 20px;
  margin-bottom: 6px;
}

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

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 8px;
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

td:nth-child(n + 2),
th:nth-child(n + 2) {
  text-align: right;
}

.totals {
  display: grid;
  gap: 10px;
  margin: 24px 0 26px auto;
  max-width: 320px;
}

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

.totals span {
  color: var(--muted);
}

.totals .grand {
  border-top: 2px solid var(--ink);
  font-size: 22px;
  padding-top: 14px;
}

.quote-notes {
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

.content-band,
.pricing-band {
  background: white;
  border-top: 1px solid var(--line);
  margin: 0 auto;
  max-width: 1240px;
  padding: 46px clamp(18px, 4vw, 32px);
}

.template-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 24px;
}

.template-card,
.price-box {
  background: var(--wash);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
}

.template-card {
  display: block;
  transition: border-color 160ms ease, transform 160ms ease;
}

.template-card:hover {
  border-color: var(--mint);
  transform: translateY(-2px);
}

.template-grid h3 {
  margin: 0 0 8px;
}

.template-grid p,
.pricing-band p,
.price-box p {
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}

.pricing-band {
  align-items: stretch;
  gap: 24px;
  justify-content: space-between;
  margin-bottom: 54px;
}

.pricing-band > div:first-child {
  max-width: 660px;
}

.price-box {
  min-width: 250px;
}

.price-box span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.price-box strong {
  display: block;
  font-size: 40px;
  margin: 8px 0;
}

.article-hero {
  margin: 0 auto;
  max-width: 960px;
  padding: 74px clamp(18px, 4vw, 32px) 28px;
}

.article-hero h1 {
  font-size: clamp(38px, 6vw, 68px);
  letter-spacing: 0;
  line-height: 0.98;
  margin: 10px 0 18px;
}

.article-hero p {
  color: var(--muted);
  font-size: 19px;
  line-height: 1.6;
  margin: 0;
  max-width: 760px;
}

.article-layout {
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 1fr) 300px;
  margin: 0 auto;
  max-width: 1120px;
  padding: 24px clamp(18px, 4vw, 32px) 70px;
}

.article-main,
.article-side {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.article-main {
  padding: 30px;
}

.article-main h2 {
  font-size: 26px;
  letter-spacing: 0;
  margin: 30px 0 12px;
}

.article-main h2:first-child {
  margin-top: 0;
}

.article-main p,
.article-main li,
.article-side p {
  color: var(--muted);
  line-height: 1.65;
}

.article-main ul,
.article-main ol {
  padding-left: 22px;
}

.article-side {
  align-self: start;
  display: grid;
  gap: 14px;
  padding: 20px;
  position: sticky;
  top: 92px;
}

.article-side h2 {
  font-size: 20px;
  margin: 0;
}

.article-side .button {
  width: 100%;
}

.mini-table {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.mini-table div {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.mini-table span {
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  padding: 12px;
}

.mini-table strong {
  border-bottom: 1px solid var(--line);
  padding: 12px;
}

.mini-table div:last-child span,
.mini-table div:last-child strong {
  border-bottom: 0;
}

@media (max-width: 920px) {
  .hero,
  .workspace,
  .pricing-band,
  .article-layout {
    grid-template-columns: 1fr;
  }

  .preview-shell {
    position: static;
  }

  .article-side {
    position: static;
  }
}

@media (max-width: 680px) {
  .topnav {
    display: none;
  }

  .field-grid,
  .field-grid.compact,
  .template-grid {
    grid-template-columns: 1fr;
  }

  .line-item {
    grid-template-columns: 1fr;
  }

  .quote-form,
  .quote-preview {
    padding: 20px;
  }

  .quote-head {
    gap: 18px;
    flex-direction: column;
  }

  .quote-meta {
    text-align: left;
  }

  .watermark {
    position: static;
    margin-bottom: 16px;
    width: fit-content;
  }
}

@media print {
  body {
    background: white;
  }

  .topbar,
  .hero,
  .quote-form,
  .preview-toolbar,
  .content-band,
  .pricing-band {
    display: none;
  }

  .workspace {
    display: block;
    max-width: none;
    padding: 0;
  }

  .preview-shell {
    border: 0;
    box-shadow: none;
    position: static;
  }

  .quote-preview {
    min-height: auto;
    padding: 34px;
  }
}
