:root {
  color-scheme: light;
  --paper: #f7f4ef;
  --surface: #ffffff;
  --surface-soft: #fbfaf7;
  --ink: #202124;
  --muted: #646a73;
  --line: #dfd8cc;
  --accent: #246bfe;
  --accent-strong: #134fc0;
  --mint: #dff7ea;
  --mint-ink: #11613a;
  --amber: #fff0c7;
  --amber-ink: #7a4d00;
  --rose: #ffe8e2;
  --shadow: 0 18px 55px rgba(31, 35, 42, 0.12);
  --radius: 8px;
  --page-max: 1180px;
  --receipt-width: 430px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
}

.maintenance-banner {
  position: relative;
  z-index: 30;
  background: var(--amber);
  color: var(--amber-ink);
  border-bottom: 1px solid #ead28c;
  padding: 0.65rem 1rem;
  text-align: center;
  font-weight: 900;
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
}

code {
  background: #ece7de;
  border-radius: 5px;
  padding: 0.1rem 0.28rem;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: 0;
  z-index: 20;
  transform: translateY(-130%);
  background: var(--ink);
  color: #fff;
  padding: 0.65rem 0.9rem;
  border-radius: 0 0 var(--radius) var(--radius);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(247, 244, 239, 0.93);
  border-bottom: 1px solid rgba(223, 216, 204, 0.86);
  backdrop-filter: blur(14px);
}

.header-inner,
.template-hero,
.quick-process,
.category-showroom,
.search-intent-band,
.tool-shell,
.content-band,
.site-footer,
.content-ad {
  width: min(100% - 32px, var(--page-max));
  margin-inline: auto;
}

.header-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  min-width: max-content;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 0.74rem;
}

.top-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  color: var(--muted);
}

.top-nav a,
.header-cta {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  padding: 0.55rem 0.8rem;
  text-decoration: none;
  white-space: nowrap;
}

.top-nav a:hover,
.top-nav a:focus-visible {
  background: #ede8df;
  color: var(--ink);
}

.auth-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
}

.auth-nav a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  padding: 0.55rem 0.85rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.auth-nav button {
  border: 0;
  min-height: 40px;
}

.login-link {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
}

.signup-link {
  background: var(--ink);
  color: #fff;
}

.header-cta {
  background: var(--ink);
  color: #fff;
  font-weight: 700;
}

.template-hero {
  min-height: calc(100svh - 88px);
  display: grid;
  grid-template-columns: minmax(280px, 0.5fr) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  padding: 34px 0 18px;
}

.hero-copy {
  max-width: 850px;
}

.hero-copy h1 {
  font-size: clamp(2.35rem, 5vw, 4.15rem);
}

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

.free-note {
  margin: 0.9rem 0 0;
  color: var(--mint-ink);
  font-weight: 900;
}

.primary-link,
.secondary-link {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  padding: 0.72rem 1rem;
  font-weight: 900;
  text-decoration: none;
}

.primary-link {
  background: var(--accent);
  color: #fff;
}

.secondary-link {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
}

.hero-proof {
  display: grid;
  gap: 0.8rem;
}

.hero-proof div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 14px 38px rgba(31, 35, 42, 0.08);
  padding: 1rem;
}

.hero-proof strong,
.hero-proof span {
  display: block;
}

.hero-proof strong {
  margin-bottom: 0.2rem;
  font-size: 1.05rem;
}

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

.template-showroom {
  padding: 22px 0 18px;
}

.hero-format-area {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 18px 50px rgba(31, 35, 42, 0.09);
  padding: 14px;
}

.format-heading {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 12px;
}

.format-heading h2 {
  margin-bottom: 0;
  font-size: clamp(1.15rem, 1.8vw, 1.7rem);
}

.format-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.format-chips span {
  border: 1px solid #cfc7ba;
  border-radius: 999px;
  background: #fff;
  color: #555d66;
  padding: 0.32rem 0.58rem;
  font-size: 0.78rem;
  font-weight: 900;
}

.quick-process {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 0 0 20px;
}

.quick-process div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.8);
  padding: 0.9rem 1rem;
}

.quick-process strong,
.quick-process span {
  display: block;
}

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

.category-showroom {
  padding: 22px 0 34px;
}

.search-intent-band {
  width: min(100% - 32px, var(--page-max));
  margin: 0 auto;
  padding: 28px 0 38px;
}

.intent-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.intent-grid article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.76);
  padding: 1rem;
}

.intent-grid strong {
  display: block;
  margin-bottom: 0.3rem;
}

.intent-grid p {
  margin-bottom: 0;
  color: var(--muted);
}

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

.category-card {
  display: grid;
  gap: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 14px 36px rgba(31, 35, 42, 0.08);
  padding: 1rem;
}

.category-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(36, 107, 254, 0.16), 0 18px 48px rgba(31, 35, 42, 0.12);
}

.category-card p {
  margin-bottom: 0;
  color: var(--muted);
}

.category-preview {
  min-height: 210px;
  display: grid;
  align-content: start;
  gap: 0.45rem;
  border: 1px solid #ded8ce;
  border-radius: var(--radius);
  background: #fff;
  padding: 0.85rem;
}

.category-preview strong,
.category-preview span,
.category-preview p,
.category-preview i,
.category-preview b {
  display: block;
}

.category-preview strong {
  font-size: 0.92rem;
  text-transform: uppercase;
}

.category-preview span {
  color: #6a7078;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.category-preview p {
  color: #202124;
  font-weight: 800;
}

.category-preview i {
  border-bottom: 1px solid #e4dfd6;
  color: #50565e;
  font-style: normal;
  padding-bottom: 0.3rem;
}

.category-preview b {
  justify-self: end;
  margin-top: 0.25rem;
  border-top: 2px solid #202124;
  padding-top: 0.35rem;
}

.preview-a4 {
  border-top: 7px solid var(--accent);
}

.preview-green {
  border-top-color: #16824f;
}

.preview-amber {
  border-top-color: #b87400;
}

.preview-formal {
  border: 2px solid #202124;
}

.preview-slate {
  border-top-color: #4b5a6a;
}

.preview-thermal {
  width: min(100%, 230px);
  justify-self: center;
  min-height: 250px;
  border-color: #ececec;
  color: #767b84;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
}

.preview-thermal strong,
.preview-thermal span,
.preview-thermal p,
.preview-thermal i,
.preview-thermal b {
  color: #767b84;
}

.preview-thermal strong,
.preview-thermal span {
  text-align: center;
}

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

.two-format-grid {
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.8fr);
  align-items: stretch;
}

.template-card {
  display: grid;
  gap: 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 16px 42px rgba(31, 35, 42, 0.09);
  padding: 1rem;
}

.template-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(36, 107, 254, 0.16), 0 18px 48px rgba(31, 35, 42, 0.12);
}

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

.template-button {
  width: 100%;
}

.format-card {
  align-content: start;
}

.sample-receipt {
  display: grid;
  gap: 0.8rem;
  border: 1px solid #d7d1c7;
  border-radius: var(--radius);
  background: #fff;
  color: #202124;
  padding: 1rem;
}

.sample-receipt header {
  border-bottom: 2px solid #202124;
  padding-bottom: 0.75rem;
}

.sample-receipt span,
.sample-receipt em {
  display: block;
  color: #6a7078;
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.sample-receipt strong {
  display: block;
  margin: 0.15rem 0;
  font-size: 1.2rem;
}

.sample-receipt dl {
  display: grid;
  gap: 0.35rem;
  margin: 0;
}

.sample-receipt dl div {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
}

.sample-receipt dt,
.sample-receipt dd {
  font-size: 0.78rem;
}

.sample-receipt table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.sample-receipt th,
.sample-receipt td {
  border-bottom: 1px solid #e4dfd6;
  padding: 0.45rem 0.2rem;
  text-align: right;
}

.sample-receipt th:first-child,
.sample-receipt td:first-child {
  text-align: left;
}

.sample-receipt b {
  justify-self: end;
  border-top: 2px solid #202124;
  padding-top: 0.45rem;
  font-size: 1.12rem;
}

.sample-a4 {
  min-height: 360px;
  border-top: 8px solid var(--accent);
}

.sample-small {
  width: min(100%, 245px);
  min-height: 430px;
  justify-self: center;
  align-content: start;
  gap: 0.45rem;
  border-color: #ececec;
  border-style: solid;
  box-shadow: 0 10px 28px rgba(31, 35, 42, 0.08);
  color: #767b84;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.68rem;
  line-height: 1.23;
  padding: 1.25rem 1rem 1.6rem;
}

.sample-small .thermal-head {
  border: 0;
  padding: 0 0 0.9rem;
  text-align: center;
}

.sample-small .thermal-head strong,
.sample-small .thermal-head span {
  margin: 0;
  color: #7b8088;
  font-size: 0.68rem;
  font-weight: 500;
  text-transform: none;
}

.sample-small .thermal-head strong {
  font-size: 0.72rem;
}

.thermal-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
}

.thermal-server {
  margin-bottom: 0.2rem;
}

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

.thermal-table td {
  border: 0;
  padding: 0.05rem 0;
  color: #767b84;
  font-size: 0.68rem;
  font-weight: 500;
  text-align: right;
}

.thermal-table td:first-child {
  text-align: left;
}

.thermal-totals {
  margin-top: 1rem;
}

.thermal-thanks {
  margin-top: 4rem;
  text-align: center;
  color: #767b84;
  font-size: 0.78rem;
  font-weight: 500;
}

.mini-receipt {
  min-height: 190px;
  display: grid;
  align-content: start;
  gap: 0.55rem;
  border: 1px solid #d7d1c7;
  border-radius: var(--radius);
  background: #fff;
  padding: 1rem;
  color: #202124;
}

.mini-receipt span {
  color: #6a7078;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.mini-receipt strong {
  font-size: 1.12rem;
}

.mini-receipt i {
  display: block;
  height: 10px;
  border-radius: 99px;
  background: #e7e2d8;
}

.mini-receipt i:nth-of-type(1) {
  width: 92%;
}

.mini-receipt i:nth-of-type(2) {
  width: 74%;
}

.mini-receipt i:nth-of-type(3) {
  width: 84%;
}

.mini-receipt b {
  justify-self: end;
  margin-top: 0.4rem;
  border-top: 2px solid #202124;
  padding-top: 0.45rem;
  font-size: 1.15rem;
}

.mini-blue {
  border-top: 7px solid var(--accent);
}

.mini-green {
  border-top: 7px solid #16824f;
}

.mini-amber {
  border-top: 7px solid #b87400;
}

.mini-formal {
  border: 2px solid #1f2937;
}

.mini-thermal {
  width: min(100%, 230px);
  margin-inline: auto;
  border-style: dashed;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.mini-slate {
  border-top: 7px solid #4b5a6a;
}

.tool-shell {
  padding: 30px 0 44px;
}

.tool-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.5rem;
  align-items: end;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 820px;
  margin-bottom: 0.7rem;
  font-size: clamp(2rem, 6vw, 4.8rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0.45rem;
  font-size: clamp(1.45rem, 2.4vw, 2.25rem);
  line-height: 1.08;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 0.35rem;
  font-size: 1rem;
  line-height: 1.2;
}

.intro-copy {
  max-width: 760px;
  color: var(--muted);
  font-size: 1.04rem;
}

.intro-actions {
  display: grid;
  gap: 0.5rem;
  min-width: 210px;
}

.intro-actions span {
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
  padding: 0.55rem 0.75rem;
  font-weight: 700;
}

.ad-slot {
  border: 1px dashed #b9afa0;
  border-radius: var(--radius);
  background: #fffaf0;
  color: #665b4d;
}

.ad-slot-wide {
  min-height: 96px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  padding: 1rem;
}

.personal-ad-inline {
  width: min(100% - 32px, var(--page-max));
  margin: 18px auto 0;
  min-height: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
}

.ad-label {
  align-self: start;
  justify-self: start;
  color: #776a5b;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.ad-fallback {
  color: #7c705f;
  font-weight: 700;
  text-align: center;
}

.generator-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) minmax(330px, 0.78fr);
  gap: 18px;
  align-items: start;
}

.control-panel,
.receipt-preview-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.control-panel {
  padding: 18px;
}

.panel-heading,
.items-header,
.action-row,
.preview-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.panel-heading {
  margin-bottom: 16px;
}

.field-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

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

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

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

label,
.full-field {
  display: grid;
  gap: 0.35rem;
}

label span,
.full-field span {
  color: #363a40;
  font-size: 0.84rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cfc7ba;
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  min-height: 44px;
  padding: 0.72rem 0.76rem;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(36, 107, 254, 0.2);
  outline-offset: 2px;
  border-color: var(--accent);
}

.items-header {
  margin: 18px 0 10px;
}

.line-items {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.line-item {
  display: grid;
  grid-template-columns: minmax(150px, 1.2fr) 76px 102px 44px;
  gap: 8px;
  align-items: end;
  border: 1px solid #e5ded3;
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 10px;
}

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

.remove-line {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid #e0b4aa;
  border-radius: var(--radius);
  background: var(--rose);
  color: #92331f;
  font-weight: 900;
}

.primary-button,
.secondary-button,
.ghost-button {
  min-height: 44px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  padding: 0.72rem 0.95rem;
  font-weight: 800;
}

.primary-button {
  background: var(--accent);
  color: #fff;
}

.primary-button:hover {
  background: var(--accent-strong);
}

.secondary-button {
  background: var(--mint);
  color: var(--mint-ink);
  border-color: #b6e5c9;
}

.ghost-button {
  background: #f1ece4;
  color: #3d4249;
  border-color: #ded5c7;
}

.compliance-check {
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  margin: 14px 0;
  border: 1px solid #ead28c;
  border-radius: var(--radius);
  background: var(--amber);
  padding: 12px;
}

.compliance-check input {
  width: 18px;
  min-height: 18px;
  margin-top: 0.2rem;
  accent-color: var(--accent);
}

.compliance-check span {
  color: var(--amber-ink);
  font-weight: 800;
}

.action-row {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-top: 12px;
}

.form-status {
  min-height: 1.4rem;
  margin: 0.75rem 0 0;
  color: var(--accent-strong);
  font-weight: 800;
}

.preview-column {
  min-width: 0;
}

.sticky-stack {
  position: sticky;
  top: 90px;
  display: grid;
  gap: 14px;
}

.receipt-preview-wrap {
  overflow: hidden;
}

.preview-topbar {
  border-bottom: 1px solid var(--line);
  background: #f4efe6;
  padding: 0.8rem 1rem;
  color: #3f434a;
  font-weight: 900;
}

.preview-topbar span:last-child {
  color: var(--accent-strong);
}

.receipt-paper {
  position: relative;
  width: min(100%, var(--receipt-width));
  margin: 0 auto;
  background: #fff;
  color: #222;
  padding: 24px;
  overflow: hidden;
}

.receipt-paper[data-size="letter"] {
  --receipt-width: 560px;
  min-height: 680px;
}

.receipt-paper[data-size="a4"] {
  --receipt-width: 600px;
  min-height: 760px;
}

.receipt-paper[data-size="compact"] {
  --receipt-width: 360px;
}

.receipt-paper[data-size="thermal"] {
  --receipt-width: 300px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
}

.receipt-paper[data-size="thermal"] .receipt-head,
.receipt-paper[data-theme="thermal"] .receipt-head {
  display: grid;
  border-bottom-style: dashed;
  text-align: center;
}

.receipt-paper[data-size="thermal"] .receipt-logo,
.receipt-paper[data-theme="thermal"] .receipt-logo {
  justify-self: center;
}

.receipt-paper[data-size="thermal"] .receipt-status,
.receipt-paper[data-theme="thermal"] .receipt-status {
  justify-self: center;
}

.receipt-paper[data-theme="blue"] .receipt-head,
.receipt-paper[data-theme="blue"] .receipt-totals {
  border-color: var(--accent);
}

.receipt-paper[data-theme="blue"] .receipt-status {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.receipt-paper[data-theme="green"] .receipt-head,
.receipt-paper[data-theme="green"] .receipt-totals {
  border-color: #16824f;
}

.receipt-paper[data-theme="green"] .receipt-status {
  border-color: #16824f;
  color: #11613a;
}

.receipt-paper[data-theme="formal"] {
  border: 2px solid #202124;
}

.receipt-paper[data-theme="formal"] .receipt-watermark {
  display: none;
}

.receipt-paper[data-theme="formal"] .receipt-head {
  text-align: center;
}

.receipt-paper[data-theme="formal"] .receipt-head,
.receipt-paper[data-theme="formal"] .receipt-totals {
  border-color: #202124;
}

.receipt-watermark {
  position: absolute;
  inset: 42% auto auto 50%;
  transform: translate(-50%, -50%) rotate(-22deg);
  color: rgba(32, 33, 36, 0.055);
  font-size: 3.25rem;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
}

.receipt-head {
  position: relative;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 2px solid #252525;
  padding-bottom: 16px;
}

.receipt-head p {
  margin-bottom: 0.2rem;
  color: #565656;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.receipt-head h2 {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
  overflow-wrap: anywhere;
}

.receipt-head span {
  color: #666;
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.receipt-brand-block {
  display: grid;
  gap: 0.45rem;
}

.receipt-logo {
  width: 64px;
  min-height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid #d8d2c8;
  border-radius: var(--radius);
  background: #f7f4ee;
  color: #222;
  overflow: hidden;
  font-weight: 900;
  letter-spacing: 0;
}

.receipt-logo img {
  max-width: 100%;
  max-height: 58px;
  object-fit: contain;
}

.receipt-logo span {
  padding: 0.35rem;
  color: inherit;
  font-size: 0.9rem;
}

.receipt-logo[hidden],
.receipt-logo img[hidden],
.receipt-logo span[hidden] {
  display: none;
}

.receipt-status {
  flex: 0 0 auto;
  border: 2px solid #167047;
  border-radius: var(--radius);
  color: #167047;
  padding: 0.35rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.receipt-meta,
.receipt-totals {
  display: grid;
  gap: 0.35rem;
}

.receipt-meta {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 16px 0;
}

.receipt-meta div,
.receipt-totals div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
}

dt {
  color: #666;
  font-size: 0.78rem;
  font-weight: 800;
}

dd {
  margin: 0;
  font-weight: 800;
  text-align: right;
  overflow-wrap: anywhere;
}

.receipt-table {
  position: relative;
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.receipt-table th,
.receipt-table td {
  border-bottom: 1px solid #e3e3e3;
  padding: 0.58rem 0.25rem;
  vertical-align: top;
}

.receipt-table th {
  color: #5e5e5e;
  font-size: 0.72rem;
  text-align: right;
  text-transform: uppercase;
}

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

.receipt-table td {
  text-align: right;
  font-weight: 700;
}

.receipt-table td:first-child {
  max-width: 160px;
  overflow-wrap: anywhere;
}

.receipt-totals {
  margin: 16px 0;
  border-top: 2px solid #252525;
  padding-top: 12px;
}

.receipt-totals .grand-total {
  margin-top: 0.35rem;
  color: #111;
  font-size: 1.15rem;
}

.receipt-notes {
  border: 1px solid #e2e2e2;
  border-radius: var(--radius);
  background: #fafafa;
  padding: 0.8rem;
}

.receipt-notes strong {
  display: block;
  margin-bottom: 0.25rem;
}

.receipt-notes p {
  margin-bottom: 0;
  color: #555;
  overflow-wrap: anywhere;
}

.receipt-footer {
  margin-top: 14px;
  color: #666;
  font-size: 0.68rem;
  line-height: 1.35;
}

.receipt-footer p {
  margin-bottom: 0;
}

.personal-ad {
  padding: 1rem;
}

.personal-ad h3 {
  margin-top: 0.65rem;
  font-size: 1.15rem;
}

.personal-ad p {
  color: #665b4d;
}

.personal-ad a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  padding: 0.45rem 0.7rem;
  font-weight: 800;
  text-decoration: none;
}

.content-band {
  padding: 46px 0;
}

.section-heading {
  max-width: 740px;
  margin-bottom: 18px;
}

.section-heading p,
.split-band p {
  color: var(--muted);
}

.use-case-grid,
.faq-grid,
.rules-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.use-case-grid article,
.rules-grid article,
.growth-list div,
.faq-grid details {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  padding: 1rem;
}

.use-case-grid p,
.rules-grid p,
.growth-list span,
.faq-grid p {
  color: var(--muted);
}

.use-case-grid p,
.rules-grid p,
.faq-grid p {
  margin-bottom: 0;
}

.rules-grid strong {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 1.02rem;
}

.split-band {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(300px, 0.75fr);
  gap: 24px;
  align-items: start;
}

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

.growth-list strong,
.growth-list span {
  display: block;
}

.growth-list strong {
  margin-bottom: 0.25rem;
}

.faq-grid details {
  min-height: 100%;
}

.faq-grid summary {
  cursor: pointer;
  font-weight: 900;
}

.faq-grid p {
  margin-top: 0.65rem;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--line);
  padding: 26px 0 36px;
  color: var(--muted);
}

.site-footer p {
  margin: 0.2rem 0 0;
}

.site-footer nav {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.site-footer a {
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.legal-page {
  width: min(100% - 32px, 860px);
  margin: 0 auto;
  padding: 46px 0 70px;
}

.legal-page article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: clamp(1rem, 4vw, 2rem);
}

.legal-page h1 {
  font-size: clamp(2rem, 5vw, 3.6rem);
}

.legal-page h2 {
  margin-top: 1.6rem;
  font-size: 1.18rem;
}

.legal-page p,
.legal-page li {
  color: var(--muted);
}

.legal-page ul {
  padding-left: 1.2rem;
}

.auth-page {
  width: min(100% - 32px, 940px);
  margin: 0 auto;
  padding: 46px 0 72px;
}

.auth-card {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(280px, 0.7fr);
  gap: 24px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: clamp(1rem, 4vw, 2rem);
}

.auth-copy p {
  color: var(--muted);
}

.auth-benefits {
  display: grid;
  gap: 0.55rem;
  margin-top: 1rem;
}

.auth-benefits span {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 0.65rem 0.75rem;
  font-weight: 800;
}

.auth-form {
  display: grid;
  gap: 0.8rem;
}

.auth-form .primary-button,
.auth-form .secondary-button {
  width: 100%;
}

.auth-switch {
  color: var(--muted);
  text-align: center;
}

.auth-switch a {
  color: var(--accent-strong);
  font-weight: 900;
}

.setup-notice {
  display: grid;
  gap: 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 1rem;
}

.setup-notice.success {
  border-color: #9edfbf;
  background: #f0fff7;
}

.success-status {
  border: 1px solid #9edfbf;
  background: #f0fff7;
  color: #11613a;
  padding: 0.75rem;
}

.error-status {
  border: 1px solid #f1b7ad;
  background: #fff4f1;
  color: #8a2e1f;
  padding: 0.75rem;
}

.config-output {
  width: 100%;
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.8rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  resize: vertical;
}

.admin-page {
  width: min(100% - 32px, var(--page-max));
  margin: 0 auto;
  padding: 42px 0 72px;
}

.admin-hero,
.admin-panel,
.admin-stats article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.admin-hero {
  padding: clamp(1rem, 4vw, 2rem);
}

.admin-hero h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.8rem);
  line-height: 1;
}

.admin-hero p {
  color: var(--muted);
}

.admin-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1rem;
}

.admin-shortcuts a {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 0.65rem 0.85rem;
  text-decoration: none;
  font-weight: 900;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.admin-stats article {
  display: grid;
  gap: 0.4rem;
  padding: 1rem;
}

.admin-stats span {
  color: var(--muted);
  font-weight: 800;
}

.admin-stats strong {
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  line-height: 1;
}

.admin-panel {
  margin-top: 18px;
  padding: clamp(1rem, 3vw, 1.5rem);
}

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

.admin-split .admin-panel {
  min-width: 0;
}

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

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.compact-admin-table {
  min-width: 420px;
}

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

.admin-table th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.admin-table td {
  font-weight: 700;
}

.muted-table-text {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.booking-form {
  display: grid;
  gap: 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: clamp(1rem, 3vw, 1.5rem);
}

.admin-filter,
.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  align-items: end;
}

.admin-form-grid .wide-field,
.admin-form-grid .check-row {
  grid-column: 1 / -1;
}

.admin-form-grid textarea {
  min-height: 110px;
  resize: vertical;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 0.75rem;
  font-weight: 900;
}

.check-row input {
  width: 18px;
  height: 18px;
}

.inline-admin-form,
.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.inline-admin-form select {
  min-height: 38px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #fff;
  padding: 0.35rem 0.45rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--mint);
  color: var(--mint-ink);
  padding: 0.25rem 0.55rem;
  text-transform: capitalize;
}

.danger-button {
  border-color: #f1b7ad;
  color: #8a2e1f;
}

@media (max-width: 1020px) {
  .template-hero,
  .tool-intro,
  .generator-layout,
  .split-band {
    grid-template-columns: 1fr;
  }

  .template-hero {
    min-height: auto;
    align-items: start;
  }

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

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

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

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

  .sticky-stack {
    position: static;
  }

  .receipt-paper {
    --receipt-width: 560px;
  }
}

@media (max-width: 760px) {
  .header-inner,
  .template-hero,
  .quick-process,
  .category-showroom,
  .search-intent-band,
  .tool-shell,
  .content-band,
  .site-footer,
  .content-ad,
  .legal-page,
  .admin-page,
  .auth-page {
    width: min(100% - 22px, var(--page-max));
  }

  .header-inner {
    min-height: auto;
    padding: 10px 0;
    flex-wrap: wrap;
  }

  .brand {
    flex: 1 1 auto;
  }

  .top-nav {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .header-cta {
    padding-inline: 0.7rem;
  }

  .intro-actions,
  .hero-proof,
  .quick-process,
  .admin-stats,
  .admin-filter,
  .admin-form-grid,
  .admin-split,
  .category-grid,
  .intent-grid,
  .field-grid.two,
  .field-grid.three,
  .field-grid.four,
  .template-grid,
  .use-case-grid,
  .rules-grid,
  .faq-grid,
  .auth-card {
    grid-template-columns: 1fr;
  }

  .personal-ad-inline {
    width: min(100% - 22px, var(--page-max));
    grid-template-columns: 1fr;
  }

  .control-panel {
    padding: 14px;
  }

  .line-item {
    grid-template-columns: minmax(0, 1fr) minmax(72px, 0.35fr);
  }

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

  .remove-line {
    align-self: stretch;
  }

  .receipt-paper {
    padding: 18px;
  }

  .receipt-head {
    display: grid;
  }

  .receipt-status {
    width: max-content;
  }

  .receipt-meta {
    grid-template-columns: 1fr;
  }

  .receipt-table {
    font-size: 0.76rem;
  }

  .receipt-table th:nth-child(2),
  .receipt-table td:nth-child(2) {
    display: none;
  }

  .site-footer {
    display: grid;
  }
}

@media (max-width: 430px) {
  h1 {
    font-size: 2.55rem;
  }

  .brand small {
    display: none;
  }

  .auth-nav {
    width: 100%;
  }

  .auth-nav a {
    flex: 1;
  }

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

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

  .action-row > * {
    width: 100%;
  }

  .receipt-paper {
    padding: 14px;
  }
}

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

  body {
    background: #fff;
  }

  .site-header,
  .template-hero,
  .quick-process,
  .category-showroom,
  .search-intent-band,
  .tool-intro,
  .ad-slot,
  .control-panel,
  .preview-topbar,
  .content-band,
  .site-footer {
    display: none !important;
  }

  .tool-shell,
  .generator-layout,
  .preview-column,
  .sticky-stack,
  .receipt-preview-wrap {
    width: 100%;
    margin: 0;
    padding: 0;
    display: block;
    border: 0;
    box-shadow: none;
  }

  .receipt-paper {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding: 0;
  }

  .receipt-paper[data-size="thermal"] {
    width: 300px;
    max-width: 300px;
    padding: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  }
}
