:root {
  color-scheme: light;
  --bg: #f4f6f6;
  --panel: #ffffff;
  --ink: #17211f;
  --muted: #68736f;
  --line: #d9e1df;
  --accent: #2c6f73;
  --accent-dark: #1d5558;
  --accent-soft: #e0efee;
  --steel: #445b7c;
  --steel-soft: #e7edf3;
  --warning: #c26f4b;
  --warning-soft: #f4e4da;
  --shadow: 0 18px 45px rgba(24, 35, 33, 0.1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background:
    linear-gradient(180deg, #ffffff 0, var(--bg) 34rem),
    var(--bg);
  color: var(--ink);
}

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

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

button {
  cursor: pointer;
}

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  min-height: 4.6rem;
  padding: 0.75rem clamp(1rem, 4vw, 3rem);
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(23, 33, 31, 0.09);
  backdrop-filter: blur(16px);
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  width: fit-content;
  font-weight: 900;
}

.site-logo .brand-mark {
  width: 2.35rem;
  height: 2.35rem;
}

.site-nav {
  display: inline-flex;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}

.site-nav a {
  border-radius: 999px;
  color: var(--muted);
  padding: 0.55rem 0.85rem;
  font-weight: 750;
}

.site-nav a:hover {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.nav-cta {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.55rem;
  border-radius: 0.45rem;
  background: var(--accent-dark);
  color: #ffffff;
  padding: 0.65rem 0.95rem;
  font-weight: 850;
}

.hero-section {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: center;
  min-height: min(48rem, 78svh);
  overflow: hidden;
  padding: clamp(4.5rem, 8vw, 7rem) clamp(1rem, 5vw, 4rem) clamp(3rem, 7vw, 5rem);
  color: #ffffff;
}

.hero-image,
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-overlay {
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(17, 26, 24, 0.94) 0%, rgba(25, 58, 60, 0.76) 44%, rgba(25, 58, 60, 0.18) 100%),
    linear-gradient(0deg, rgba(17, 26, 24, 0.46), transparent 42%);
}

.hero-content {
  width: min(43rem, 100%);
}

.hero-kicker {
  margin: 0 0 0.9rem;
  color: #f2b36d;
  font-size: 0.84rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-content h1 {
  margin: 0;
  font-size: clamp(3.2rem, 10vw, 7.4rem);
  line-height: 0.92;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 39rem;
  margin: 1.1rem 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(1.05rem, 2vw, 1.32rem);
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.hero-primary,
.hero-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  border-radius: 0.45rem;
  padding: 0.8rem 1.05rem;
  font-weight: 900;
}

.hero-primary {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 14px 32px rgba(24, 85, 88, 0.28);
}

.hero-secondary {
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 8.8rem));
  gap: 0.75rem;
  margin: 2rem 0 0;
}

.hero-stats div {
  border-top: 1px solid rgba(255, 255, 255, 0.28);
  padding-top: 0.65rem;
}

.hero-stats dt {
  font-size: 1.3rem;
  font-weight: 950;
}

.hero-stats dd {
  margin: 0.2rem 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.9rem;
}

.proof-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  padding: 1rem;
  background: #fbfcfc;
  border-bottom: 1px solid var(--line);
}

.proof-strip span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: #344340;
  padding: 0.45rem 0.75rem;
  font-size: 0.86rem;
  font-weight: 800;
}

.feature-section,
.template-showcase,
.app-section {
  scroll-margin-top: 5rem;
  padding: clamp(3rem, 7vw, 5.5rem) clamp(1rem, 5vw, 4rem);
}

.feature-section {
  background: #f7f9f9;
}

.template-showcase {
  background: #ffffff;
}

.section-copy {
  display: grid;
  gap: 0.75rem;
  width: min(48rem, 100%);
  margin: 0 auto 1.6rem;
  text-align: center;
}

.section-copy h2,
.app-section-header h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  line-height: 1.05;
}

.section-copy p,
.app-section-header p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.feature-grid,
.showcase-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  max-width: 72rem;
  margin: 0 auto;
}

.feature-grid article,
.showcase-grid article {
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: #ffffff;
  padding: 1rem;
  box-shadow: 0 10px 26px rgba(24, 35, 33, 0.045);
}

.feature-grid span {
  color: var(--accent);
  font-weight: 950;
}

.feature-grid h3,
.showcase-grid strong {
  display: block;
  margin: 0.45rem 0 0.35rem;
  font-size: 1.05rem;
}

.feature-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.showcase-grid article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: #fbfcfc;
}

.showcase-grid span {
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--steel-soft);
  color: var(--steel);
  padding: 0.3rem 0.55rem;
  font-size: 0.76rem;
  font-weight: 850;
}

.app-section {
  background:
    linear-gradient(135deg, rgba(44, 111, 115, 0.12), transparent 29rem),
    linear-gradient(315deg, rgba(194, 111, 75, 0.08), transparent 24rem),
    #edf3f2;
}

.app-section-header {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(16rem, 0.45fr);
  gap: 1.5rem;
  align-items: end;
  max-width: 90rem;
  margin: 0 auto 1.25rem;
}

.app-shell {
  display: grid;
  grid-template-columns: 18.5rem minmax(0, 1fr);
  min-height: 0;
  max-width: 90rem;
  margin: 0 auto;
  overflow: clip;
  border: 1px solid rgba(23, 33, 31, 0.12);
  border-radius: 0.75rem;
  background: var(--bg);
  box-shadow: 0 24px 70px rgba(24, 35, 33, 0.14);
}

.sidebar {
  position: sticky;
  top: 5.6rem;
  height: calc(100svh - 5.6rem);
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  padding: 1.25rem;
  background:
    linear-gradient(180deg, rgba(44, 111, 115, 0.24), transparent 38%),
    #17211f;
  color: #f7fbf7;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-mark {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  border-radius: 0.5rem;
  background: #ffffff;
  border: 1px solid rgba(23, 33, 31, 0.1);
  box-shadow: 0 10px 24px rgba(24, 35, 33, 0.12);
}

.brand-mark img {
  width: 82%;
  height: 82%;
  display: block;
}

.brand h1,
.topbar h2,
.section-heading h3,
.preview-toolbar h3 {
  margin: 0;
  line-height: 1.08;
}

.brand h1 {
  font-size: 1.35rem;
}

.sidebar-status {
  display: grid;
  grid-template-columns: 0.75rem 1fr;
  gap: 0.65rem;
  align-items: start;
  padding: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.55rem;
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-status strong {
  display: block;
  font-size: 0.92rem;
}

.sidebar-status small {
  display: block;
  margin-top: 0.2rem;
  color: #b5c9c6;
  line-height: 1.35;
}

.status-dot {
  width: 0.62rem;
  height: 0.62rem;
  margin-top: 0.26rem;
  border-radius: 999px;
  background: #7fd1b7;
  box-shadow: 0 0 0 4px rgba(127, 209, 183, 0.14);
}

.eyebrow {
  margin: 0 0 0.25rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0;
}

.sidebar .eyebrow {
  color: #b5c9c6;
}

.step-nav {
  display: grid;
  gap: 0.42rem;
}

.step-link {
  display: grid;
  grid-template-columns: 2rem 1fr;
  align-items: center;
  min-height: 2.85rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  color: #f7fbf7;
  text-align: left;
  padding: 0.55rem 0.7rem;
  font-weight: 780;
}

.step-link span {
  display: grid;
  width: 1.55rem;
  height: 1.55rem;
  place-items: center;
  border-radius: 0.38rem;
  background: rgba(255, 255, 255, 0.08);
  color: #b5c9c6;
  font-size: 0.72rem;
  font-weight: 900;
}

.step-link.active,
.step-link:hover {
  background: #f7fbf7;
  color: #17211f;
}

.step-link.active span,
.step-link:hover span {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.metric-panel {
  margin-top: auto;
  display: grid;
  gap: 0.45rem;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.65rem;
  background: rgba(255, 255, 255, 0.09);
}

.metric-panel span,
.metric-panel small {
  color: #b5c9c6;
}

.metric-panel strong {
  font-size: clamp(1.55rem, 5vw, 2.15rem);
  line-height: 1;
}

.metric-divider {
  height: 1px;
  margin: 0.35rem 0;
  background: rgba(255, 255, 255, 0.12);
}

.metric-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: #dce8e2;
  font-size: 0.86rem;
}

.metric-row b {
  color: #ffffff;
  text-align: right;
}

.workspace {
  min-width: 0;
  padding: 1.1rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.35)),
    #edf3f2;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
  padding: 1rem;
  border: 1px solid rgba(24, 33, 29, 0.08);
  border-radius: 0.65rem;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 10px 28px rgba(24, 35, 33, 0.06);
}

.topbar h2 {
  font-size: clamp(1.35rem, 2.6vw, 2rem);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.topbar-copy {
  min-width: 0;
}

.tool-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.tool-badges span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  padding: 0.28rem 0.55rem;
  font-size: 0.74rem;
  font-weight: 850;
}

.tool-badges span:first-child {
  background: var(--accent-soft);
  color: var(--accent-dark);
  border-color: rgba(44, 111, 115, 0.18);
}

.workspace-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.9rem;
}

.workspace-summary article {
  min-width: 0;
  border: 1px solid rgba(24, 33, 29, 0.08);
  border-radius: 0.6rem;
  background: rgba(255, 255, 255, 0.76);
  padding: 0.85rem;
}

.workspace-summary span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 820;
  text-transform: uppercase;
}

.workspace-summary strong {
  display: block;
  margin-top: 0.28rem;
  overflow: hidden;
  color: var(--ink);
  font-size: 1.02rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
  margin-bottom: 0.85rem;
  padding: 0.35rem;
  border: 1px solid rgba(24, 33, 29, 0.08);
  border-radius: 0.65rem;
  background: rgba(255, 255, 255, 0.72);
}

.tool-tab {
  min-height: 2.75rem;
  border: 1px solid transparent;
  border-radius: 0.48rem;
  background: transparent;
  color: var(--muted);
  font-weight: 850;
}

.tool-tab.active,
.tool-tab:hover {
  border-color: rgba(44, 111, 115, 0.18);
  background: #ffffff;
  color: var(--accent-dark);
  box-shadow: 0 8px 20px rgba(24, 35, 33, 0.06);
}

.tool-view {
  min-width: 0;
}

.template-picker-panel {
  padding: 1rem;
  border: 1px solid rgba(24, 33, 29, 0.08);
  border-radius: 0.65rem;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 26px rgba(24, 35, 33, 0.055);
}

.template-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.template-picker-head h3 {
  margin: 0;
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  line-height: 1.08;
}

.template-picker-head .secondary-button {
  flex: 0 0 auto;
  margin-top: 0;
}

.template-picker-panel .template-grid {
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}

.template-picker-panel .template-card {
  min-height: 11.5rem;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(26rem, 1fr) minmax(24rem, 0.9fr);
  gap: 0.95rem;
  align-items: start;
}

.editor,
.preview-panel {
  min-width: 0;
}

.form-section {
  margin-bottom: 0.85rem;
  padding: 1rem;
  border: 1px solid rgba(24, 33, 29, 0.08);
  border-radius: 0.65rem;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 26px rgba(24, 35, 33, 0.055);
}

.section-heading {
  display: flex;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.section-heading p {
  margin: 0.25rem 0 0;
  color: var(--muted);
}

.section-number {
  display: grid;
  flex: 0 0 auto;
  width: 2.35rem;
  height: 2.35rem;
  place-items: center;
  border-radius: 0.55rem;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 800;
}

.field-grid {
  display: grid;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

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

.full-span {
  grid-column: 1 / -1;
}

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

.field-grid.compact {
  margin-top: 0.85rem;
}

label,
.checks legend {
  display: grid;
  gap: 0.4rem;
  color: #344139;
  font-size: 0.9rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 2.65rem;
  border: 1px solid #d8dfd5;
  border-radius: 0.48rem;
  background: #fbfcfa;
  color: var(--ink);
  padding: 0.7rem 0.75rem;
  outline: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

textarea {
  resize: vertical;
  min-height: 7rem;
}

input:focus,
select:focus,
textarea:focus {
  background: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(44, 111, 115, 0.14);
}

.tone-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 2.35rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  padding: 0.35rem 0.7rem;
  font-weight: 750;
}

.chip input {
  width: auto;
  min-height: auto;
  accent-color: var(--accent);
}

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

.template-card {
  display: grid;
  gap: 0.75rem;
  align-content: space-between;
  min-height: 12.5rem;
  padding: 0.9rem;
  border: 1px solid rgba(24, 33, 29, 0.08);
  border-radius: 0.65rem;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(24, 35, 33, 0.045);
  transition:
    border-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.template-card:hover {
  transform: translateY(-1px);
  border-color: rgba(44, 111, 115, 0.35);
  box-shadow: 0 12px 26px rgba(24, 35, 33, 0.08);
}

.template-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(44, 111, 115, 0.12);
}

.template-card h4 {
  margin: 0.35rem 0 0.35rem;
  font-size: 1rem;
  line-height: 1.2;
}

.template-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.template-trade {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  padding: 0.25rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 800;
}

.template-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.template-meta span {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 750;
}

.template-apply {
  width: 100%;
  margin-top: 0;
}

.empty-state {
  grid-column: 1 / -1;
  margin: 0;
  border: 1px dashed var(--line);
  border-radius: 0.5rem;
  color: var(--muted);
  padding: 1rem;
  text-align: center;
}

.line-items {
  display: grid;
  gap: 0.65rem;
}

.line-item {
  display: grid;
  grid-template-columns: minmax(8rem, 1.35fr) 5.5rem 5.8rem 6.5rem 2.4rem;
  gap: 0.55rem;
  align-items: end;
  padding: 0.7rem;
  border: 1px solid rgba(24, 33, 29, 0.08);
  border-radius: 0.6rem;
  background: #fbfcfa;
}

.line-item label {
  font-size: 0.78rem;
}

.line-item input,
.line-item select {
  min-height: 2.35rem;
  padding: 0.55rem;
}

.remove-line {
  width: 2.35rem;
  height: 2.35rem;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  background: var(--warning-soft);
  color: #8d452d;
  font-size: 1.15rem;
}

.primary-button,
.ai-button,
.secondary-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border-radius: 0.5rem;
  font-weight: 800;
  white-space: nowrap;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    border-color 140ms ease;
}

.primary-button:hover,
.ai-button:hover,
.secondary-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.primary-button {
  min-height: 2.8rem;
  border: 1px solid var(--accent-dark);
  background: var(--accent);
  color: #ffffff;
  padding: 0.7rem 1rem;
  box-shadow: 0 8px 18px rgba(44, 111, 115, 0.2);
}

.ai-button {
  min-height: 2.8rem;
  border: 1px solid #9b5538;
  background: var(--warning);
  color: #ffffff;
  padding: 0.7rem 0.9rem;
  box-shadow: 0 8px 18px rgba(194, 111, 75, 0.2);
}

.ai-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.ai-button span {
  display: inline-grid;
  min-width: 1.55rem;
  height: 1.55rem;
  place-items: center;
  border-radius: 0.35rem;
  background: rgba(255, 255, 255, 0.18);
  font-size: 0.74rem;
}

.secondary-button {
  min-height: 2.6rem;
  margin-top: 0.75rem;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
  padding: 0.65rem 0.85rem;
}

.icon-button {
  width: 2.8rem;
  height: 2.8rem;
  border: 1px solid #d8dfd5;
  background: #ffffff;
  color: var(--ink);
  font-size: 1.1rem;
}

.checks {
  display: grid;
  gap: 0.65rem;
  margin: 0 0 0.85rem;
  padding: 0.85rem;
  border: 1px solid rgba(24, 33, 29, 0.08);
  border-radius: 0.6rem;
  background: #fbfcfa;
}

.checks label {
  grid-template-columns: 1.1rem 1fr;
  align-items: start;
  color: var(--muted);
  font-weight: 650;
}

.checks input {
  min-height: auto;
  accent-color: var(--accent);
}

.preview-panel {
  position: sticky;
  top: 5.9rem;
}

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.65rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(24, 33, 29, 0.08);
  border-radius: 0.6rem;
  background: rgba(255, 255, 255, 0.84);
}

.quote-document {
  padding: clamp(1rem, 3vw, 1.5rem);
  border: 1px solid rgba(24, 33, 29, 0.1);
  border-radius: 0.7rem;
  background: var(--panel);
  box-shadow: 0 18px 48px rgba(24, 35, 33, 0.12);
}

.quote-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #243229;
}

.quote-header > div:first-child {
  min-width: 0;
}

.quote-brand {
  margin: 0 0 0.35rem;
  color: var(--accent);
  font-weight: 850;
  text-transform: uppercase;
}

.quote-header h2 {
  margin: 0;
  font-size: clamp(1.3rem, 3vw, 2rem);
  line-height: 1.1;
}

.quote-meta {
  flex: 0 0 auto;
  display: grid;
  align-content: start;
  gap: 0.25rem;
  color: var(--muted);
  text-align: right;
}

.quote-meta span {
  white-space: nowrap;
}

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

.quote-parties > div {
  padding: 0.85rem;
  border: 1px solid rgba(24, 33, 29, 0.06);
  border-radius: 0.55rem;
  background: #f7f8f4;
}

.quote-parties span {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.quote-parties p {
  margin: 0.18rem 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.quote-block {
  margin-top: 1rem;
}

.quote-block h3 {
  margin: 0 0 0.55rem;
  font-size: 1rem;
}

.quote-block p {
  color: #344139;
  line-height: 1.55;
}

.price-table {
  display: grid;
  border: 1px solid #dce3d9;
  border-radius: 0.55rem;
  overflow: hidden;
}

.price-row {
  display: grid;
  grid-template-columns: minmax(8rem, 1fr) 4.5rem 5rem 6rem;
  gap: 0.6rem;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--line);
}

.price-row:last-child {
  border-bottom: 0;
}

.price-head {
  background: #eef4ef;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.price-row span:not(:first-child) {
  text-align: right;
}

.totals {
  display: grid;
  gap: 0.4rem;
  margin-top: 0.8rem;
}

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

.grand-total {
  margin-top: 0.35rem;
  padding-top: 0.65rem;
  border-top: 2px solid var(--ink);
  font-size: 1.2rem;
}

#docTerms {
  margin: 0;
  padding-left: 1.15rem;
  color: #344139;
  line-height: 1.55;
}

.quote-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  max-width: min(22rem, calc(100vw - 2rem));
  transform: translateY(1rem);
  opacity: 0;
  pointer-events: none;
  border-radius: 0.45rem;
  background: var(--ink);
  color: #ffffff;
  padding: 0.8rem 1rem;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

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

@media (max-width: 1060px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .site-nav {
    display: none;
  }

  .hero-section {
    min-height: 72svh;
  }

  .feature-grid,
  .showcase-grid {
    grid-template-columns: 1fr;
  }

  .app-section-header {
    grid-template-columns: 1fr;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    gap: 1rem;
  }

  .step-nav {
    grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
  }

  .metric-panel {
    display: none;
  }

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

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

  .template-picker-head {
    align-items: stretch;
    flex-direction: column;
  }

  .preview-panel {
    position: static;
  }
}

@media (max-width: 680px) {
  .site-header {
    min-height: 4.1rem;
    padding-inline: 0.9rem;
  }

  .site-logo span:last-child {
    font-size: 0.95rem;
  }

  .nav-cta {
    min-height: 2.35rem;
    padding-inline: 0.75rem;
  }

  .hero-section {
    min-height: 70svh;
    padding-inline: 1rem;
  }

  .hero-overlay {
    background:
      linear-gradient(90deg, rgba(17, 26, 24, 0.95), rgba(25, 58, 60, 0.68)),
      linear-gradient(0deg, rgba(17, 26, 24, 0.46), transparent 44%);
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

  .feature-section,
  .template-showcase,
  .app-section {
    padding-inline: 0.9rem;
  }

  .section-copy {
    text-align: left;
  }

  .workspace,
  .sidebar {
    padding: 0.9rem;
  }

  .topbar,
  .quote-header,
  .quote-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: 2.8rem minmax(0, 1fr);
    justify-content: stretch;
  }

  .topbar-actions .primary-button {
    grid-column: 1 / -1;
  }

  .primary-button {
    flex: 1;
  }

  .ai-button {
    flex: 1;
  }

  .workspace-summary {
    grid-template-columns: 1fr 1fr;
  }

  .workspace-summary article {
    padding: 0.72rem;
  }

  .workspace-summary strong {
    font-size: 0.92rem;
  }

  .tool-tabs {
    grid-template-columns: 1fr;
  }

  .template-picker-panel {
    padding: 0.9rem;
  }

  .template-picker-head h3 {
    font-size: 1.35rem;
  }

  .step-nav,
  .field-grid.two,
  .field-grid.three,
  .template-grid,
  .full-span,
  .quote-parties {
    grid-template-columns: 1fr;
    grid-column: auto;
  }

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

  .line-item label:first-child {
    grid-column: 1 / -1;
  }

  .price-row {
    grid-template-columns: 1fr;
    gap: 0.42rem;
    padding: 0.72rem;
    font-size: 0.82rem;
  }

  .price-head {
    display: none;
  }

  .price-row span:first-child {
    font-weight: 850;
  }

  .price-row span:not(:first-child) {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    text-align: left;
  }

  .price-row span:not(:first-child)::before {
    content: attr(data-label);
    color: var(--muted);
    font-weight: 800;
  }

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

@media print {
  body {
    background: #ffffff;
  }

  .site-header,
  .hero-section,
  .proof-strip,
  .feature-section,
  .template-showcase,
  .app-section-header,
  .sidebar,
  .topbar,
  .tool-tabs,
  .template-picker-panel,
  .editor,
  .preview-toolbar,
  .toast {
    display: none;
  }

  .app-shell,
  .workspace,
  .content-grid {
    display: block;
    padding: 0;
  }

  .preview-panel {
    position: static;
  }

  .quote-document {
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
}
