/* Main Street Playbooks — site + tool + print styles. No build step. */

:root {
  --navy: #1f355e;
  --navy-dark: #162641;
  --navy-mid: #2a4573;
  --mustard: #e8a33d;
  --mustard-dark: #c48522;
  --mustard-soft: #f8e4bf;
  --cream: #fbf6ec;
  --cream-dark: #f3ead8;
  --ink: #22252a;
  --muted: #5c6570;
  --line: #d9d3c7;
  --white: #ffffff;
  --error: #9b2c2c;
  --error-bg: #fdeeee;
  --success: #215c3a;
  --shadow: 0 10px 30px rgba(31, 53, 94, 0.08);
  --shadow-sm: 0 2px 8px rgba(31, 53, 94, 0.06);
  --font-sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --radius: 12px;
  --max: 1120px;
  --header-h: 72px;
  --focus: 0 0 0 3px rgba(232, 163, 61, 0.55);
}

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

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--navy);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--navy-mid);
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--navy);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 100;
  border-radius: 6px;
}

.skip-link:focus {
  top: 0.6rem;
}

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

.print-only {
  display: none;
}

[hidden] {
  display: none !important;
}

/* ---------- Header ---------- */

.site-header {
  background: var(--navy);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 3px solid var(--mustard);
}

.header-inner,
.footer-inner,
.wrap {
  width: min(var(--max), calc(100% - 2rem));
  margin: 0 auto;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: #fff;
  text-decoration: none;
  flex-shrink: 0;
}

.logo:hover {
  color: #fff;
}

.logo-mark {
  width: 36px;
  height: 36px;
  display: block;
  flex-shrink: 0;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  width: 18px;
  height: 2px;
  background: #fff;
  margin: 0 auto;
  position: relative;
}

.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.2rem 1.25rem;
}

.site-nav a,
.nav-drop-btn {
  color: #f3ead8;
  text-decoration: none;
  background: none;
  border: 0;
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 0.45rem 0;
}

.site-nav a:hover,
.nav-drop-btn:hover,
.site-nav a[aria-current="page"] {
  color: #fff;
}

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

.nav-drop {
  position: relative;
}

.nav-drop-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-drop-btn::after {
  content: "";
  border: 4px solid transparent;
  border-top-color: currentColor;
  margin-top: 4px;
}

.nav-drop-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: #fff;
  color: var(--ink);
  min-width: 240px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 0.4rem 0;
  border: 1px solid var(--line);
}

.nav-drop.is-open .nav-drop-menu,
.nav-drop:hover .nav-drop-menu,
.nav-drop:focus-within .nav-drop-menu {
  display: block;
}

.nav-drop-menu a {
  display: block;
  color: var(--navy);
  padding: 0.55rem 1rem;
  text-decoration: none;
}

.nav-drop-menu a:hover {
  background: var(--cream);
  color: var(--navy-dark);
}

.nav-shop {
  background: var(--mustard) !important;
  color: var(--navy-dark) !important;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.45rem 0.95rem !important;
  box-shadow: none !important;
}

.nav-shop:hover {
  filter: brightness(1.05);
}

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

.site-footer {
  background: var(--navy-dark);
  color: #d6dfea;
  margin-top: auto;
  padding: 2.5rem 0 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
}

.site-footer h2 {
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mustard);
  margin: 0 0 0.8rem;
}

.site-footer a {
  color: #e8eef6;
  text-decoration: none;
}

.site-footer a:hover {
  color: #fff;
  text-decoration: underline;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer li {
  margin: 0.35rem 0;
}

.footer-brand p {
  margin: 0.4rem 0 0;
  max-width: 32ch;
  color: #b7c2d3;
}

.footer-bottom {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.85rem;
  color: #9aa7bb;
}

/* ---------- Buttons & forms ---------- */

.btn,
button.btn,
a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  background: var(--navy);
  color: #fff;
}

.btn:hover {
  background: var(--navy-mid);
  color: #fff;
}

.btn-mustard,
a.btn.btn-mustard,
button.btn.btn-mustard {
  background: var(--mustard);
  color: var(--navy-dark);
}

.btn-mustard:hover,
a.btn.btn-mustard:hover,
button.btn.btn-mustard:hover {
  background: var(--mustard-dark);
  color: #fff;
}

.btn-ghost,
a.btn.btn-ghost,
button.btn.btn-ghost {
  background: transparent;
  color: var(--navy);
  border-color: var(--line);
}

.btn-ghost:hover,
a.btn.btn-ghost:hover,
button.btn.btn-ghost:hover {
  background: var(--cream-dark);
  color: var(--navy-dark);
}

.btn-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--navy);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.btn-icon:hover {
  background: var(--error-bg);
  border-color: #e2b4b4;
  color: var(--error);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.2rem;
}

label,
.lbl {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
  color: var(--navy-dark);
}

.hint {
  display: block;
  font-weight: 400;
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 0.2rem;
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="file"],
select,
textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  min-height: 44px;
}

textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--navy);
}

.field {
  margin-bottom: 0.9rem;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.field-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.8rem;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1rem 0.2rem;
  margin: 0 0 1.1rem;
  background: #fff;
}

legend {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--navy);
  padding: 0 0.4rem;
}

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

.radio-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  min-height: 44px;
  cursor: pointer;
  background: #fff;
  font-weight: 600;
  color: var(--navy);
}

.radio-pill:has(input:checked) {
  border-color: var(--navy);
  background: var(--cream);
  box-shadow: inset 0 0 0 1px var(--navy);
}

.radio-pill input {
  width: auto;
  min-height: 0;
  accent-color: var(--navy);
}

/* ---------- Homepage ---------- */

.hero {
  padding: 3.2rem 0 2.5rem;
  background:
    linear-gradient(180deg, #eef2f8 0%, var(--cream) 100%);
  border-bottom: 1px solid var(--line);
}

.hero-inner {
  width: min(var(--max), calc(100% - 2rem));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2.5rem;
  align-items: center;
}

.eyebrow {
  display: inline-block;
  color: var(--navy);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.75rem;
  margin-bottom: 0.7rem;
}

.eyebrow::after {
  content: "";
  display: block;
  width: 48px;
  height: 3px;
  background: var(--mustard);
  margin-top: 0.55rem;
}

h1, h2, h3, .sheet h2 {
  font-family: var(--font-display);
  color: var(--navy);
  line-height: 1.15;
}

.hero h1 {
  font-size: clamp(2rem, 4.4vw, 3.15rem);
  margin: 0 0 0.8rem;
}

.lede,
.hero .lede {
  font-size: 1.15rem;
  color: #3a4450;
  max-width: 46ch;
  margin: 0 0 1.4rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.hero-panel {
  background: var(--navy);
  color: #e8eef6;
  border-radius: 16px;
  padding: 1.5rem 1.6rem 1.3rem;
  box-shadow: var(--shadow);
  border-top: 6px solid var(--mustard);
}

.hero-panel h2 {
  color: #fff;
  font-size: 1.15rem;
  margin: 0 0 0.8rem;
}

.hero-panel ol {
  margin: 0;
  padding-left: 1.2rem;
}

.hero-panel li {
  margin: 0.4rem 0;
}

.section {
  padding: 3rem 0;
}

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

.section-head h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2rem);
}

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

.tool-grid,
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
}

.tool-card,
.product-card,
.page-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.tool-card {
  padding: 1.2rem 1.2rem 1.15rem;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tool-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  color: inherit;
}

.tool-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--navy);
  color: var(--mustard);
  display: grid;
  place-items: center;
  margin-bottom: 0.85rem;
}

.tool-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tool-card h3 {
  margin: 0 0 0.4rem;
  font-size: 1.15rem;
}

.tool-card p {
  margin: 0;
  color: var(--muted);
  flex: 1;
}

.tool-card .card-link {
  margin-top: 0.9rem;
  font-weight: 700;
  color: var(--navy);
}

.note-box {
  background: var(--mustard-soft);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  margin-top: 1.5rem;
  color: var(--navy-dark);
}

/* Products */

.products-section {
  background: #fff;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.product-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  color: inherit;
}

.product-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--navy);
  display: block;
}

.product-body {
  padding: 1rem 1.05rem 1.1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-body h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.product-body p {
  margin: 0 0 0.8rem;
  color: var(--muted);
  font-size: 0.95rem;
  flex: 1;
}

.price {
  font-weight: 800;
  color: var(--navy);
  font-size: 1.15rem;
}

.price s {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
  margin-left: 0.35rem;
}

.badge {
  display: inline-block;
  background: var(--mustard);
  color: var(--navy-dark);
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  margin-bottom: 0.4rem;
}

.callout {
  margin-top: 2rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.25rem;
  border-left: 6px solid var(--mustard);
}

.callout h2 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
}

.callout p {
  margin: 0 0 0.9rem;
  color: var(--muted);
}

.callout-products {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.callout-products a {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.4rem 0.7rem 0.4rem 0.4rem;
  background: var(--cream);
  min-height: 44px;
  flex: 1 1 240px;
}

.callout-products a:hover {
  border-color: var(--navy);
}

.callout-products img {
  width: 88px;
  height: 50px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.callout-products strong {
  display: block;
  color: var(--navy);
}

.callout-products span {
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- Inner pages ---------- */

.page-hero {
  padding: 2.2rem 0 1.5rem;
}

.page-hero h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
}

.prose {
  max-width: 68ch;
}

.prose h2 {
  margin-top: 1.8rem;
}

.prose p,
.prose li {
  color: #2c3340;
}

.crumb {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.7rem;
}

.crumb a {
  color: var(--navy);
}

/* ---------- Tool layout ---------- */

.tool-page .page-hero {
  padding-bottom: 0.5rem;
}

.tool-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
  padding-bottom: 3rem;
}

.tool-form,
.preview-col {
  min-width: 0;
}

.sticky-preview {
  position: sticky;
  top: calc(var(--header-h) + 1rem);
}

.live-total-bar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  background: var(--navy);
  color: #fff;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.9rem;
}

.live-total-bar span {
  color: #d6dfea;
  font-size: 0.9rem;
}

.live-total-bar strong {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: #fff;
}

.logo-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

#logo-thumb {
  width: 72px;
  height: 72px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

/* Line items table */

.lines-wrap {
  overflow-x: auto;
}

.lines-table,
.sheet-lines,
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.lines-table th,
.data-table th {
  text-align: left;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.35rem 0.35rem 0.5rem;
}

.lines-table td {
  padding: 0.25rem;
  vertical-align: middle;
}

.lines-table .line-qty,
.lines-table .line-rate {
  min-width: 5rem;
}

.lines-table .line-amount {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  padding-left: 0.5rem;
  color: var(--navy);
  font-weight: 600;
}

.lines-table th:nth-child(2),
.lines-table th:nth-child(3),
.lines-table td:nth-child(2),
.lines-table td:nth-child(3) {
  width: 6.2rem;
}

.lines-table th:nth-child(4),
.lines-table td:nth-child(4) {
  width: 6.5rem;
}

.lines-table th:nth-child(5),
.lines-table td:nth-child(5) {
  width: 3rem;
  text-align: right;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--line);
  padding: 0.5rem 0.4rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.data-table th:first-child,
.data-table td:first-child {
  text-align: left;
}

/* Document preview sheet */

.sheet {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1.6rem 1.5rem 1.8rem;
  box-shadow: var(--shadow);
  color: #1a1d21;
  min-height: 480px;
}

.sheet-head {
  display: flex;
  justify-content: space-between;
  gap: 1.2rem;
  border-bottom: 3px solid var(--navy);
  padding-bottom: 1rem;
  margin-bottom: 1.1rem;
}

.sheet-brand {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
}

.sheet-logo {
  max-width: 96px;
  max-height: 96px;
  object-fit: contain;
}

.sheet-biz {
  font-size: 0.92rem;
  line-height: 1.45;
}

.sheet-biz {
  font-weight: 600;
}

.sheet-kicker {
  margin: 0 0 0.2rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.65rem;
  color: var(--mustard-dark);
  font-weight: 700;
}

.sheet-meta h2 {
  margin: 0 0 0.6rem;
  font-size: 2rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sheet-meta {
  text-align: right;
  flex: 0 0 auto;
  min-width: 13.5rem;
}

.sheet-meta-row strong {
  white-space: nowrap;
}

.sheet-brand {
  flex: 1;
  min-width: 0;
}

.sheet-meta-row {
  display: flex;
  justify-content: flex-end;
  gap: 0.8rem;
  font-size: 0.9rem;
}

.sheet-meta-row span {
  color: var(--muted);
}

.sheet-client h3,
.sheet-block h3 {
  margin: 0 0 0.3rem;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--navy);
}

.sheet-client {
  margin-bottom: 1.1rem;
}

.sheet-client p,
.sheet-block p {
  margin: 0;
  line-height: 1.45;
}

.sheet-lines {
  margin: 0.4rem 0 1rem;
  font-size: 0.95rem;
}

.sheet-lines th {
  background: var(--navy);
  color: #fff;
  text-align: left;
  padding: 0.5rem 0.55rem;
  font-weight: 600;
}

.sheet-lines th:nth-child(2),
.sheet-lines td:nth-child(2),
.sheet-lines th:nth-child(3),
.sheet-lines td:nth-child(3),
.sheet-lines th:nth-child(4),
.sheet-lines td:nth-child(4) {
  text-align: right;
  white-space: nowrap;
}

.sheet-lines td {
  padding: 0.5rem 0.55rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.sheet-sums {
  margin-left: auto;
  width: min(260px, 100%);
}

.sheet-sum-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.28rem 0;
}

.sheet-sum-row.total {
  border-top: 2px solid var(--navy);
  margin-top: 0.3rem;
  padding-top: 0.5rem;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--navy);
}

.sheet-block {
  margin-top: 1.1rem;
}

.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  margin-bottom: 1rem;
}

.result-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.85rem 0.95rem;
}

.result-card.featured {
  grid-column: 1 / -1;
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

.result-card.featured h3,
.result-card.featured .hint {
  color: #d6dfea;
}

.result-card h3 {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.result-card .figure {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--navy);
  margin-top: 0.2rem;
}

.result-card.featured .figure {
  color: #fff;
  font-size: 2.2rem;
}

.breakdown {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem 1.1rem;
}

.breakdown h3 {
  margin: 0 0 0.6rem;
  font-size: 1.05rem;
}

.breakdown dl {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 1rem;
  margin: 0;
}

.breakdown dt {
  color: var(--muted);
}

.breakdown dd {
  margin: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.errors {
  background: var(--error-bg);
  color: var(--error);
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  margin-bottom: 0.8rem;
}

.errors p {
  margin: 0.2rem 0;
}

.is-dim {
  opacity: 0.55;
}

.email-preview {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.email-label {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  padding: 0.7rem 1rem 0;
}

.email-subject {
  padding: 0.25rem 1rem 0.7rem;
  font-weight: 700;
  color: var(--navy);
  border-bottom: 1px solid var(--line);
  white-space: pre-wrap;
}

.email-body {
  padding: 1rem;
  white-space: pre-wrap;
  font-family: var(--font-sans);
  line-height: 1.55;
  min-height: 16rem;
}

.status-line {
  color: var(--muted);
  margin: 0 0 0.8rem;
  font-size: 0.95rem;
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  background: var(--navy);
  color: #fff;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 80;
  max-width: min(90vw, 24rem);
}

.toast.is-on {
  opacity: 1;
  transform: none;
}

.toast-error {
  background: var(--error);
}

.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  margin: 1rem 0;
}

.compare div {
  background: var(--cream);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
}

.compare h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .hero-inner,
  .tool-layout,
  .footer-grid,
  .tool-grid,
  .product-grid,
  .field-row-3,
  .compare,
  .results-grid {
    grid-template-columns: 1fr;
  }

  .sticky-preview {
    position: static;
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .site-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--navy-dark);
    flex-direction: column;
    align-items: stretch;
    padding: 0.5rem 0 1rem;
    border-bottom: 3px solid var(--mustard);
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a,
  .nav-drop-btn {
    padding: 0.8rem 1.2rem;
    text-align: left;
  }

  .nav-shop {
    margin: 0.4rem 1.2rem 0;
    text-align: center;
  }

  .nav-drop-menu {
    position: static;
    display: none;
    min-width: 0;
    box-shadow: none;
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 0;
  }

  .site-nav.is-open .nav-drop-menu,
  .nav-drop.is-open .nav-drop-menu,
  .nav-drop:hover .nav-drop-menu,
  .nav-drop:focus-within .nav-drop-menu {
    display: block;
  }

  .nav-drop-menu a {
    color: #f3ead8;
    padding-left: 1.8rem;
  }
}

@media (max-width: 640px) {
  .field-row {
    grid-template-columns: 1fr;
  }

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

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

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

  .sheet-meta-row {
    justify-content: space-between;
  }

  /* Stack line-item table on very small screens */
  .lines-table thead {
    display: none;
  }

  .lines-table tr {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 0.3rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--line);
  }

  .lines-table td {
    width: auto !important;
    padding: 0;
  }

  .lines-table td:first-child {
    grid-column: 1 / -1;
  }

  .lines-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    margin-bottom: 0.15rem;
  }

  .lines-table .line-actions {
    align-self: end;
  }
}

/* ---------- Print ---------- */

@media print {
  @page {
    margin: 0.6in;
  }

  html,
  body {
    background: #fff;
    color: #000;
  }

  .skip-link,
  .site-header,
  .site-footer,
  .page-hero,
  .crumb,
  .tool-form,
  .callout,
  .actions,
  .btn,
  .toast,
  .no-print,
  .nav-toggle {
    display: none !important;
  }

  .tool-layout,
  .preview-col,
  .sticky-preview,
  .wrap,
  .hero-inner,
  .header-inner {
    display: block;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    position: static;
  }

  .sheet,
  .email-preview,
  .print-report {
    box-shadow: none;
    border: 0;
    border-radius: 0;
    padding: 0;
    min-height: 0;
  }

  .print-report {
    display: block !important;
  }

  a {
    color: #000;
    text-decoration: none;
  }

  .sheet-lines th,
  .result-card.featured {
    background: #1f355e !important;
    color: #fff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .print-only,
  .print-only[hidden] {
    display: block !important;
  }

  .result-card,
  .breakdown,
  .email-preview {
    break-inside: avoid;
  }
}
