:root {
  --navy: #0f172a;
  --panel: #172033;
  --ink: #0f172a;
  --muted: #64748b;
  --soft: #f8fafc;
  --line: #e2e8f0;
  --green: #10b981;
  --green-dark: #059669;
  --blue: #2563eb;
  --amber: #f59e0b;
  --white: #ffffff;
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #e2e8f0;
  color: var(--ink);
  font-size: 14px;
}

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

.app-header {
  height: 60px;
  background: var(--navy);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 22px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -0.02em; }
.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: var(--green);
  color: var(--navy);
  display: grid;
  place-items: center;
  font-weight: 900;
}

.header-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.btn {
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 9px 13px;
  font-weight: 700;
  font-size: 13px;
  background: var(--white);
  color: var(--ink);
}
.btn.primary { background: var(--green); color: white; }
.btn.primary:hover { background: var(--green-dark); }
.btn.ghost { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.1); color: rgba(255,255,255,0.82); }
.btn.line { background: white; border-color: var(--line); color: var(--muted); }
.btn.locked::after { content: " Pro"; color: var(--amber); font-size: 11px; margin-left: 5px; }

.trust-strip {
  background: #ecfdf5;
  border-bottom: 1px solid #bbf7d0;
  color: #065f46;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 18px;
  font-weight: 700;
  text-align: center;
}
.trust-strip span { color: #047857; font-weight: 600; }

.seo-intro {
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  padding: 18px 22px;
}
.seo-intro div {
  max-width: 1040px;
  margin: 0 auto;
  display: grid;
  gap: 6px;
}
.seo-intro h1 {
  margin: 0;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: 0;
}
.seo-intro p {
  margin: 0;
  max-width: 820px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.mobile-tabs { display: none; background: #1e293b; }
.mobile-tabs button {
  flex: 1;
  background: none;
  color: #94a3b8;
  border: 0;
  border-bottom: 3px solid transparent;
  padding: 12px;
  font-weight: 800;
}
.mobile-tabs button.active { color: var(--green); border-bottom-color: var(--green); }

.workspace {
  display: grid;
  grid-template-columns: minmax(380px, 480px) minmax(360px, 1fr) 340px;
  min-height: calc(100vh - 184px);
}
.site-footer {
  background: #ffffff;
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 13px 18px;
  font-size: 12px;
}
.site-footer span {
  font-weight: 900;
  color: var(--ink);
}
.site-footer button,
.site-footer a {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0;
  font-weight: 800;
  text-decoration: none;
}

.seo-content {
  background: #f8fafc;
  border-top: 1px solid var(--line);
  padding: 34px 22px;
}
.seo-content-inner {
  max-width: 1040px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 28px;
}
.seo-content section {
  display: grid;
  gap: 8px;
  align-content: start;
}
.seo-content h2,
.seo-content h3,
.seo-content p {
  margin: 0;
}
.seo-content h2 {
  color: var(--ink);
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0;
}
.seo-content h3 {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.3;
  letter-spacing: 0;
  margin-top: 8px;
}
.seo-content p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}
.form-panel, .pro-panel {
  background: white;
  overflow-y: auto;
  max-height: calc(100vh - 184px);
}
.form-panel { border-right: 1px solid var(--line); }
.preview-panel {
  background: #e2e8f0;
  overflow-y: auto;
  max-height: calc(100vh - 101px);
  padding: 26px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}
.pro-panel { border-left: 1px solid var(--line); }

.section {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.section-title {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.field { display: grid; gap: 5px; margin-bottom: 10px; }
.field label { color: var(--muted); font-size: 12px; font-weight: 700; }
.field input, .field textarea, .field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--soft);
  color: var(--ink);
  padding: 10px 11px;
  outline: none;
}
.field-note {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.field-note.ready { color: var(--green-dark); }
.field-note.warning { color: #b45309; }
.field textarea { min-height: 72px; resize: vertical; line-height: 1.45; }
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--blue);
  background: white;
}
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.mini-note {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  color: #075985;
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.45;
}
.privacy-card {
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius);
  padding: 12px;
  color: #065f46;
  line-height: 1.45;
  font-size: 13px;
}
.privacy-card strong { display: block; margin-bottom: 2px; color: #064e3b; }
.early-access-card {
  margin-top: 12px;
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.early-access-card strong {
  display: block;
  color: #065f46;
  margin-bottom: 2px;
}
.early-access-card span {
  display: block;
  color: #047857;
  font-size: 12px;
  line-height: 1.45;
}
.feature-strip {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.feature-strip span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 800;
}
.auth-card {
  margin-top: 12px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.auth-card strong {
  display: block;
  color: #1e3a8a;
  margin-bottom: 2px;
}
.auth-card span {
  display: block;
  color: #475569;
  font-size: 12px;
  line-height: 1.4;
}
.dev-pro-status {
  margin-top: 6px;
  width: fit-content;
  border-radius: 999px;
  padding: 3px 8px;
  background: #f1f5f9;
  color: #64748b !important;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.dev-pro-status.enabled {
  background: #fef3c7;
  color: #92400e !important;
}
.pro-setting-card {
  margin-top: 12px;
  border: 1px solid #fde68a;
  background: #fffbeb;
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.pro-setting-card strong {
  display: block;
  color: #78350f;
  margin-bottom: 2px;
}
.pro-setting-card span {
  display: block;
  color: #64748b;
  font-size: 12px;
  line-height: 1.4;
}
.switch {
  position: relative;
  display: inline-flex;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background 0.16s;
}
.switch span::before {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  top: 3px;
  left: 3px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
  transition: transform 0.16s;
}
.switch input:checked + span {
  background: var(--green);
}
.switch input:checked + span::before {
  transform: translateX(20px);
}

.items-table { width: 100%; border-collapse: collapse; }
.items-table th {
  text-align: left;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  padding: 0 6px 7px 0;
}
.items-table td { padding: 4px 6px 4px 0; }
.items-table input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft);
  padding: 8px;
}
.items-table .qty { width: 58px; }
.items-table .rate, .items-table .amount { width: 84px; }
.amount-pill {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft);
  padding: 8px;
  text-align: right;
  color: var(--muted);
  min-height: 35px;
}
.icon-btn {
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-size: 18px;
}
.totals { display: grid; gap: 8px; margin-top: 12px; }
.total-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.total-row input { width: 74px; border: 1px solid var(--line); border-radius: 6px; padding: 7px; text-align: right; }
.total-row.grand { border-top: 2px solid var(--navy); padding-top: 10px; font-weight: 900; font-size: 16px; }
.total-row.balance { border-top: 2px solid var(--green); padding-top: 10px; font-weight: 900; color: var(--green-dark); }

.invoice {
  width: min(100%, 760px);
  background: white;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 12px 34px rgba(15,23,42,0.18);
}
.invoice-head {
  background: var(--navy);
  color: white;
  padding: 32px 38px;
  display: flex;
  justify-content: space-between;
  gap: 22px;
}
.invoice-head h2 { margin: 0 0 6px; font-size: 22px; }
.invoice-title { font-size: 34px; font-weight: 950; letter-spacing: -0.04em; }
.invoice-meta, .invoice-details, .invoice-body, .invoice-foot { padding: 22px 38px; }
.invoice-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; border-bottom: 1px solid var(--line); }
.invoice-details { display: flex; gap: 26px; flex-wrap: wrap; background: var(--soft); border-bottom: 1px solid var(--line); }
.caption { color: var(--muted); text-transform: uppercase; font-weight: 900; font-size: 11px; letter-spacing: 0.08em; margin-bottom: 5px; }
.invoice table { width: 100%; border-collapse: collapse; }
.invoice th { color: var(--muted); text-transform: uppercase; font-size: 11px; text-align: left; padding-bottom: 9px; border-bottom: 2px solid var(--line); }
.invoice td { padding: 12px 0; border-bottom: 1px solid var(--line); }
.invoice th:nth-child(n+2), .invoice td:nth-child(n+2) { text-align: right; }
.invoice-total { margin-left: auto; width: 280px; padding-top: 12px; }
.invoice-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; background: var(--soft); border-top: 1px solid var(--line); }
.invoice-bottom {
  background: var(--navy);
  color: #94a3b8;
  padding: 12px 38px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}
.invoice-bottom.hidden-brand .brand-footer { display: none; }
.pay-link-preview {
  margin-top: 10px;
}
.pay-link-preview a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 7px;
  background: var(--green);
  color: #ffffff;
  font-weight: 850;
  text-decoration: none;
}
.pay-link-preview small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.invoice.template-minimal .invoice-head,
.invoice.template-minimal .invoice-bottom {
  background: #ffffff;
  color: #111827;
}
.invoice.template-minimal .invoice-head {
  border-bottom: 1px solid var(--line);
  padding: 28px 38px 18px;
}
.invoice.template-minimal .invoice-title {
  font-weight: 700;
  letter-spacing: 0;
  font-size: 26px;
  color: #64748b;
}
.invoice.template-minimal .invoice-details {
  background: #ffffff;
  padding-top: 16px;
  padding-bottom: 16px;
}
.invoice.template-minimal .invoice-body {
  padding-top: 18px;
}
.invoice.template-minimal .invoice th {
  border-bottom-width: 1px;
}
.invoice.template-minimal .invoice-bottom {
  border-top: 1px solid var(--line);
  color: #64748b;
}

.invoice.template-modern .invoice-head,
.invoice.template-modern .invoice-bottom {
  background: #2563eb;
}
.invoice.template-modern {
  border-radius: 14px;
}
.invoice.template-modern .invoice-head {
  padding: 36px 42px;
}
.invoice.template-modern .invoice-details {
  background: #eff6ff;
  border-bottom: 0;
}
.invoice.template-modern .invoice th {
  color: #2563eb;
}
.invoice.template-modern .invoice-total {
  background: #eff6ff;
  border-radius: 10px;
  padding: 14px;
}

.invoice.template-agency .invoice-head,
.invoice.template-agency .invoice-bottom {
  background: #581c87;
}
.invoice.template-agency .invoice-head {
  min-height: 180px;
  align-items: flex-end;
  background: linear-gradient(135deg, #581c87, #be185d);
}
.invoice.template-agency .invoice-title {
  font-size: 42px;
}
.invoice.template-agency .invoice-details {
  background: #fdf2f8;
}
.invoice.template-agency .caption {
  color: #be185d;
}
.invoice.template-agency .invoice-meta {
  grid-template-columns: 1.2fr 0.8fr;
}
.invoice.template-agency .invoice-foot {
  background: #fdf2f8;
}

.invoice.template-contractor .invoice-head,
.invoice.template-contractor .invoice-bottom {
  background: #78350f;
}
.invoice.template-contractor .invoice-head {
  padding: 24px 34px;
}
.invoice.template-contractor .invoice-details {
  background: #fffbeb;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  padding: 0;
}
.invoice.template-contractor .caption {
  color: #b45309;
}
.invoice.template-contractor .invoice-details > div {
  padding: 18px;
  border-right: 1px solid #fde68a;
}
.invoice.template-contractor .invoice-details > div:last-child {
  border-right: 0;
}
.invoice.template-contractor .invoice td {
  padding: 9px 0;
}

.invoice.template-legal .invoice-head,
.invoice.template-legal .invoice-bottom {
  background: #111827;
}
.invoice.template-legal .invoice-head {
  border-bottom: 5px solid #b45309;
}
.invoice.template-legal .caption {
  color: #92400e;
}
.invoice.template-legal .invoice-title {
  font-family: Georgia, serif;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.invoice.template-legal .invoice-meta,
.invoice.template-legal .invoice-foot {
  background: #fffaf0;
}
.invoice.template-legal .invoice th,
.invoice.template-legal .invoice td {
  border-color: #d6d3d1;
}
.invoice.template-legal .invoice-total {
  border: 1px solid #d6d3d1;
  padding: 14px;
}

.invoice.template-consulting .invoice-head,
.invoice.template-consulting .invoice-bottom {
  background: #0c4a6e;
}
.invoice.template-consulting .invoice-head {
  display: grid;
  grid-template-columns: 1fr auto;
}
.invoice.template-consulting .invoice-details {
  background: #ecfeff;
  justify-content: space-between;
}
.invoice.template-consulting .caption {
  color: #0f766e;
}
.invoice.template-consulting .invoice-meta {
  border-bottom: 0;
}
.invoice.template-consulting .invoice-body {
  border-top: 1px solid var(--line);
}
.invoice.template-consulting .invoice-total {
  border-left: 4px solid #14b8a6;
  padding-left: 16px;
}

.pro-header {
  background: var(--panel);
  color: white;
  padding: 18px;
}
.pro-header h2 { margin: 0; font-size: 18px; }
.pro-header p { margin: 5px 0 12px; color: #94a3b8; line-height: 1.4; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px; border-bottom: 1px solid var(--line); background: var(--soft); }
.tab {
  border: 1px solid var(--line);
  background: white;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}
.tab.active { background: var(--navy); color: white; border-color: var(--navy); }
.pro-content { padding: 16px; display: grid; gap: 12px; }
.pro-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px;
  background: white;
}
.pro-card h3 { margin: 0 0 6px; font-size: 14px; display: flex; align-items: center; justify-content: space-between; }
.pro-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: #fef3c7;
  color: #92400e;
}
.status { background: #e0f2fe; color: #075985; }
.status.viewed { background: #ede9fe; color: #5b21b6; }
.status.paid { background: #dcfce7; color: #166534; }
.status.overdue { background: #fee2e2; color: #991b1b; }
.list { display: grid; gap: 8px; }
.list-row {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
  display: grid;
  gap: 6px;
  background: var(--soft);
}
.lead-note {
  border-left: 3px solid var(--green);
  background: white;
  color: var(--muted);
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.45;
}
.row-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 800; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.mini-btn {
  border: 1px solid var(--line);
  background: white;
  color: var(--muted);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 800;
}
.mini-btn.active-filter {
  background: var(--navy);
  border-color: var(--navy);
  color: white;
}
.mini-btn.danger {
  color: #991b1b;
  border-color: #fecaca;
}
.template-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.template {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
  background: var(--soft);
  min-height: 74px;
  font-weight: 900;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}
.template.active { border-color: var(--green); background: #ecfdf5; color: #065f46; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.56);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
}
.modal-backdrop.show { display: flex; }
.modal {
  width: min(100%, 720px);
  background: white;
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.35);
  overflow: hidden;
}
.modal-head { padding: 22px; background: var(--navy); color: white; display: flex; justify-content: space-between; gap: 14px; }
.modal-head h2 { margin: 0; }
.modal-body { padding: 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.plan {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  display: grid;
  gap: 10px;
}
.plan.pro { border-color: var(--green); box-shadow: 0 0 0 2px #bbf7d0 inset; }
.price { font-size: 28px; font-weight: 950; }
.plan ul { margin: 0; padding-left: 18px; color: var(--muted); line-height: 1.7; }
.share-modal {
  width: min(100%, 560px);
}
.share-url {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
  color: var(--ink);
  padding: 11px;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.info-copy {
  color: var(--muted);
  line-height: 1.6;
}
.info-copy h3 {
  margin: 0;
  color: var(--ink);
}
.info-copy p {
  margin: 0;
}
.info-copy ul {
  margin: 0;
  padding-left: 18px;
}

.portal-page {
  background: #e2e8f0;
}

.legal-page {
  background: #f8fafc;
  min-height: 100vh;
  color: var(--ink);
}
.legal-shell {
  max-width: 820px;
  margin: 0 auto;
  padding: 48px 22px;
}
.legal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}
.legal-nav a {
  color: var(--muted);
  font-weight: 800;
  text-decoration: none;
}
.legal-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
}
.legal-card h1 {
  margin: 0 0 10px;
  font-size: 32px;
  letter-spacing: 0;
}
.legal-card h2 {
  margin: 28px 0 8px;
  font-size: 18px;
}
.legal-card p,
.legal-card li {
  color: var(--muted);
  line-height: 1.65;
}
.legal-card p {
  margin: 0 0 14px;
}
.legal-card ul {
  margin: 0 0 14px;
  padding-left: 20px;
}
.contact-form {
  display: grid;
  gap: 14px;
  margin: 20px 0;
}
.contact-form label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-weight: 800;
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 12px;
  color: var(--ink);
  background: #ffffff;
}
.contact-form textarea {
  min-height: 150px;
  resize: vertical;
}
.portal-shell {
  min-height: 100vh;
}
.portal-top {
  background: var(--navy);
  color: white;
  padding: 24px clamp(18px, 4vw, 52px);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
}
.portal-brand {
  margin-bottom: 18px;
}
.portal-top h1 {
  margin: 0;
  font-size: 32px;
  letter-spacing: 0;
}
.portal-top p {
  margin: 6px 0 0;
  color: #94a3b8;
  line-height: 1.5;
}
.portal-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.portal-stage {
  padding: 28px clamp(14px, 4vw, 52px) 42px;
  display: flex;
  justify-content: center;
}
.portal-invoice {
  width: min(100%, 880px);
}
.portal-empty {
  width: min(100%, 720px);
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  color: var(--muted);
}

@media print {
  body {
    background: white;
  }
  .portal-top {
    display: none;
  }
  .pay-link-preview {
    display: none;
  }
  .portal-stage {
    padding: 0;
  }
  .portal-invoice {
    width: 100%;
    box-shadow: none;
    border-radius: 0;
  }
}

@media (max-width: 1180px) {
  .workspace { grid-template-columns: 450px 1fr; }
  .pro-panel { grid-column: 1 / -1; max-height: none; border-left: 0; border-top: 1px solid var(--line); }
}

@media (max-width: 820px) {
  .app-header { height: auto; align-items: flex-start; flex-direction: column; padding: 14px; }
  .trust-strip { flex-direction: column; gap: 3px; }
  .seo-intro { padding: 16px 14px; }
  .seo-intro h1 { font-size: 22px; }
  .seo-content { padding: 24px 14px; }
  .seo-content-inner { grid-template-columns: 1fr; }
  .mobile-tabs { display: flex; }
  .workspace { grid-template-columns: 1fr; min-height: auto; }
  .form-panel, .preview-panel, .pro-panel { max-height: none; }
  .preview-panel { display: none; padding: 14px; }
  .preview-panel.active { display: flex; }
  .form-panel.hidden { display: none; }
  .grid-2, .grid-3, .invoice-meta, .invoice-foot, .modal-body { grid-template-columns: 1fr; }
  .portal-top { align-items: flex-start; flex-direction: column; }
  .portal-actions { justify-content: flex-start; }
  .invoice-head { padding: 22px; }
  .invoice-meta, .invoice-details, .invoice-body, .invoice-foot, .invoice-bottom { padding-left: 22px; padding-right: 22px; }
  .invoice-title { font-size: 26px; }
}
