﻿* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
:root {
  --font-body: "Manrope", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Sora", "Manrope", ui-sans-serif, system-ui, sans-serif;
  --font-serif: "Georgia", "Times New Roman", serif;
  --bg: #e7edf3;
  --panel: rgba(255, 255, 255, 0.68);
  --section: rgba(255, 255, 255, 0.52);
  --section-strong: #f0f4f8;
  --text: #283241;
  --muted: #566172;
  --line: rgba(145, 160, 180, 0.82);
  --soft-line: rgba(255, 255, 255, 0.35);
  --accent: #8b9bb4;
  --accent-dark: #6c6e7b;
  --blue: #8b9bb4;
  --danger: #d94b4b;
  --warning: #8b9bb4;
  --dark-btn: #343e49;
  --deep-dark: #131316;
  --shadow: 0 24px 56px rgba(31, 44, 59, 0.12), 0 8px 18px rgba(31, 44, 59, 0.06);
  --glass-border: 1px solid rgba(169, 182, 198, 0.38);
  --glass-bg: rgba(255, 255, 255, 0.32);
  --glass-blur: blur(18px) saturate(140%);
}
body {
  min-height: 100vh;
  padding: 28px 18px;
  font-family: var(--font-body);
  background:
    radial-gradient(circle at 16% 8%, rgba(139, 155, 180, 0.22), transparent 30%),
    radial-gradient(circle at 92% 18%, rgba(184, 194, 206, 0.28), transparent 32%),
    radial-gradient(circle at 50% 90%, rgba(221, 228, 236, 0.45), transparent 45%),
    linear-gradient(135deg, #f0f4f8 0%, #e7edf3 50%, #dde4ec 100%);
  background-attachment: fixed;
  color: var(--text);
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.app {
  width: min(1440px, 100%);
  margin: 0 auto;
}
.hero-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
  color: var(--text);
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  /* border-radius: 14px; */
  overflow: hidden;
  /* background: linear-gradient(135deg, var(--accent), var(--accent-dark)); */
  font-weight: 900;
  /* box-shadow: 0 8px 24px rgba(52, 62, 73, 0.18), inset 0 1px 0 rgba(255,255,255,0.25); */
  /* border: var(--glass-border); */
}
.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
a.brand-mark {
  text-decoration: none;
  color: inherit;
}
.brand h1 {
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.02;
  letter-spacing: -0.04em;
  font-weight: 800;
}
.brand p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  font-weight: 500;
}
.top-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}
.top-nav {
  display: flex;
  align-items: center;
  gap: 18px;
}
.top-nav a {
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  transition: color 0.15s ease;
}
.top-nav a:hover {
  color: var(--text);
}
.site-hero,
.seo-content,
.app-footer {
  border-radius: 22px;
  background: var(--panel);
  backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  box-shadow: var(--shadow);
}
.site-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  gap: 18px;
  margin-top: 22px;
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background:
    radial-gradient(circle at top left, rgba(139, 155, 180, 0.12), transparent 32%),
    linear-gradient(180deg, rgba(255,255,255,0.78), rgba(240,244,248,0.58));
}
.site-hero-bottom {
  margin-bottom: 22px;
}
.site-hero-copy h2 {
  font-family: var(--font-display);
  margin-top: 6px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.01;
  letter-spacing: -0.05em;
  font-weight: 800;
}
.site-hero-copy > p {
  margin-top: 10px;
  max-width: 60ch;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
  font-weight: 500;
}
.eyebrow {
  font-family: var(--font-display);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.site-hero-note {
  align-self: stretch;
  padding: 20px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: linear-gradient(180deg, rgba(255,255,255,0.88), rgba(240,244,248,0.62));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.78), 0 10px 24px rgba(35, 47, 63, 0.06);
}
.site-hero-note strong {
  font-family: var(--font-display);
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  letter-spacing: -0.01em;
}
.site-hero-note p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  font-weight: 500;
}
.ad-slot.is-disabled {
  display: none;
}
.ghost-btn, .primary-btn, .danger-btn, .dark-btn {
  font-family: var(--font-display);
  min-height: 42px;
  padding: 0 16px;
  border-radius: 10px;
  border: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.ghost-btn {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  color: var(--text);
  border: var(--glass-border);
  box-shadow: 0 4px 12px rgba(52, 62, 73, 0.06);
}
.ghost-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(52, 62, 73, 0.1); }
.primary-btn {
  background: linear-gradient(135deg, rgba(139,155,180,0.92), rgba(108,110,123,0.92));
  color: #fff;
  border: 1px solid rgba(255,255,255,0.25);
  box-shadow: 0 8px 24px rgba(52, 62, 73, 0.18), inset 0 1px 0 rgba(255,255,255,0.2);
}
.primary-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(52, 62, 73, 0.22), inset 0 1px 0 rgba(255,255,255,0.25); }
.dark-btn {
  background: linear-gradient(135deg, rgba(52,62,73,0.92), rgba(19,19,22,0.92));
  color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: 0 8px 24px rgba(52, 62, 73, 0.18), inset 0 1px 0 rgba(255,255,255,0.1);
}
.dark-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(19, 19, 22, 0.25); }
.danger-btn {
  background: rgba(217, 75, 75, 0.1);
  backdrop-filter: var(--glass-blur);
  color: var(--danger);
  border: 1px solid rgba(217, 75, 75, 0.2);
}
.layout {
  display: grid;
  grid-template-columns: minmax(0, 0.98fr) minmax(560px, 1.02fr);
  gap: 24px;
  align-items: start;
}
.editor, .preview-wrap {
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,0.82), rgba(241,245,250,0.64));
  backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  box-shadow: var(--shadow);
}
.editor { padding: 28px; }
.preview-wrap {
  position: sticky;
  top: 24px;
  align-self: start;
  padding: 16px 16px 22px;
}
.toolbar {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
  padding: 4px;
  border: 0;
  background: transparent;
}
.choice-field {
  position: relative;
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 88px;
  padding: 14px;
  border: 1px solid rgba(176, 189, 206, 0.46);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.88), rgba(243,247,251,0.66));
  backdrop-filter: blur(12px) saturate(130%);
  box-shadow: 0 10px 22px rgba(20, 27, 45, 0.05), inset 0 1px 0 rgba(255,255,255,0.76);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.choice-field:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(20, 27, 45, 0.08), inset 0 1px 0 rgba(255,255,255,0.6); }
.choice-field:focus-within {
  border-color: rgba(139, 155, 180, 0.7);
  box-shadow: 0 0 0 4px rgba(139, 155, 180, 0.12), 0 10px 28px rgba(52, 62, 73, 0.08);
}
.choice-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 4px 12px rgba(52, 62, 73, 0.12), inset 0 1px 0 rgba(255,255,255,0.25);
  border: 1px solid rgba(255,255,255,0.2);
}
.choice-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2.2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.choice-field:nth-child(2) .choice-icon { background: linear-gradient(135deg, #8b9bb4, #b8c2ce); }
.choice-field:nth-child(3) .choice-icon { background: linear-gradient(135deg, #6c6e7b, #343e49); }
.choice-field label {
  font-family: var(--font-display);
  margin-bottom: 5px;
  color: #4d5567;
  font-size: 12px;
  letter-spacing: 0.12em;
  font-weight: 700;
  text-transform: uppercase;
}
.choice-field select {
  height: auto;
  padding: 0 26px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236c6e7b' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
  background-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  min-width: 0;
}
.choice-field select:focus {
  border: 0;
  box-shadow: none;
  outline: none;
}
.section {
  margin-top: 20px;
  padding: 22px;
  border: 1px solid rgba(160, 176, 195, 0.5);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.8), rgba(243,247,251,0.6));
  backdrop-filter: blur(14px) saturate(125%);
  box-shadow: 0 12px 26px rgba(35, 47, 63, 0.05), inset 0 1px 0 rgba(255,255,255,0.72);
}
.section.accent-section {
  border: 1px dashed rgba(139, 155, 180, 0.72);
  background: linear-gradient(180deg, rgba(241,245,250,0.82), rgba(233,240,247,0.54));
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}
.section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}
.section-head-meta {
  display: none;
  align-items: center;
  gap: 8px;
}
.section-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.42);
  color: transparent;
  border: 1px solid rgba(255,255,255,0.4);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}
.collapsible-section.is-complete .section-status {
  color: var(--accent-dark);
}
.collapsible-section.is-complete .section-status::before {
  content: "OK";
}
.section-chevron {
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--accent-dark);
  border-bottom: 2px solid var(--accent-dark);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}
.collapsible-section.is-collapsed .section-chevron {
  transform: rotate(-45deg);
}
.section-body {
  overflow: hidden;
}
.section-title {
  font-family: var(--font-display);
  color: #1f2834;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.section-icon {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-right: 8px;
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(240,244,248,0.8), rgba(221,228,236,0.6));
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
  vertical-align: middle;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
  border: 1px solid rgba(255,255,255,0.4);
}
label {
  display: block;
  margin-bottom: 7px;
  color: #1f2834;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.field-error {
  min-height: 16px;
  margin-top: 6px;
  color: #bd3939;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}
input, textarea, select {
  width: 100%;
  min-width: 0;
  border: 1.5px solid rgba(148, 165, 186, 0.7);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  font-weight: 500;
  backdrop-filter: blur(6px);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
input, select { height: 46px; padding: 0 12px; }
select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236c6e7b' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  cursor: pointer;
  font-weight: 700;
}
select:hover {
  border-color: rgba(139, 155, 180, 0.65);
  background: rgba(255, 255, 255, 0.75);
}
select:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238b9bb4' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}
textarea {
  min-height: 98px;
  padding: 12px;
  resize: vertical;
}
input:focus, textarea:focus, select:focus {
  border-color: rgba(139, 155, 180, 0.7);
  outline: none;
  box-shadow: 0 0 0 4px rgba(139, 155, 180, 0.12);
  background: rgba(255, 255, 255, 0.85);
}
.field-invalid,
.field-invalid:focus {
  border-color: rgba(217, 75, 75, 0.65) !important;
  box-shadow: 0 0 0 4px rgba(217, 75, 75, 0.12) !important;
}
input[readonly] { background: rgba(251, 251, 252, 0.7); color: #535b6a; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.full { grid-column: 1 / -1; }
.conditional-field[hidden] {
  display: none !important;
}
.upload-control {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
}
.upload-label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,0.55), rgba(221,228,236,0.45));
  backdrop-filter: blur(8px);
  color: #475365;
  font-weight: 900;
  cursor: pointer;
  border: 1px solid rgba(173, 187, 204, 0.44);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.upload-label:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(52, 62, 73, 0.08), inset 0 1px 0 rgba(255,255,255,0.5); }
.upload-label input { display: none; }
.logo-preview {
  display: none;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(184, 194, 206, 0.4);
  border-radius: 10px;
  object-fit: contain;
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(6px);
}
.logo-preview.show { display: block; }
.item-grid, .upsell-grid {
  display: grid;
  gap: 10px;
}
.item-row-group, .upsell-row-group {
  display: grid;
  gap: 6px;
}
.item-row {
  display: grid;
  grid-template-columns: minmax(160px, 2.3fr) minmax(62px, 0.65fr) minmax(100px, 1fr) minmax(100px, 1fr) 38px;
  gap: 9px;
  align-items: center;
}
.upsell-row {
  display: grid;
  grid-template-columns: minmax(170px, 2fr) minmax(100px, 1fr) 38px;
  gap: 9px;
  align-items: center;
}
.row-error {
  min-height: 16px;
  color: #bd3939;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}
.icon-btn {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(235,236,239,0.8), rgba(221,228,236,0.6));
  backdrop-filter: blur(6px);
  color: #4b4f5a;
  font-weight: 900;
  border: 1px solid rgba(255,255,255,0.4);
  box-shadow: 0 2px 8px rgba(52, 62, 73, 0.06);
  transition: transform 0.1s ease, box-shadow 0.15s ease;
}
.icon-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(52, 62, 73, 0.1); }
.mini-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 12px;
}
.mini-btn {
  font-family: var(--font-display);
  min-height: 38px;
  padding: 0 13px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(52,62,73,0.88), rgba(19,19,22,0.88));
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: 0 4px 14px rgba(52, 62, 73, 0.14), inset 0 1px 0 rgba(255,255,255,0.1);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.mini-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(52, 62, 73, 0.18); }
.form-actions {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}
.secondary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}
.privacy-note {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(171, 186, 204, 0.38);
  background: linear-gradient(180deg, rgba(255,255,255,0.58), rgba(240,244,248,0.42));
  color: #5a6677;
  font-size: 13px;
  line-height: 1.5;
}
.generate-btn {
  font-family: var(--font-display);
  min-height: 54px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(139,155,180,0.92), rgba(108,110,123,0.92));
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  border: 1px solid rgba(255,255,255,0.25);
  box-shadow: 0 10px 30px rgba(52, 62, 73, 0.2), inset 0 1px 0 rgba(255,255,255,0.2);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.generate-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(52, 62, 73, 0.24), inset 0 1px 0 rgba(255,255,255,0.25); }
.toast {
  display: none;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(240,244,248,0.8), rgba(221,228,236,0.6));
  backdrop-filter: blur(12px);
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  border: 1px solid rgba(255,255,255,0.45);
  box-shadow: 0 4px 14px rgba(52, 62, 73, 0.08);
}
.toast.show { display: block; }
.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.preview-header h2 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.preview-actions { display: flex; gap: 8px; }
.invoice-paper {
  --invoice-bg: rgba(255, 255, 255, 0.72);
  --invoice-surface: rgba(240, 244, 248, 0.75);
  --invoice-soft: rgba(231, 237, 243, 0.65);
  --invoice-border: rgba(184, 194, 206, 0.5);
  --invoice-accent: #8b9bb4;
  --invoice-secondary: #6c6e7b;
  --invoice-text: #343e49;
  --invoice-dark: #131316;
  position: relative;
  overflow: hidden;
  min-height: 780px;
  max-width: 100%;
  margin: 0 auto;
  padding: 30px 32px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(240, 244, 248, 0.55), rgba(255, 255, 255, 0.25) 40%),
    var(--invoice-bg);
  backdrop-filter: blur(10px) saturate(130%);
  color: var(--invoice-text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6), 0 12px 40px rgba(52, 62, 73, 0.1);
  overflow-wrap: anywhere;
  word-break: break-word;
  font-family: var(--font-body);
  font-size: 14px;
}
.invoice-paper:before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 9px;
  background: linear-gradient(90deg, var(--invoice-dark), var(--invoice-accent), var(--invoice-soft));
  opacity: 0.9;
}
.template-modern {
  --invoice-bg: rgba(255, 255, 255, 0.84);
  --invoice-surface: rgba(233, 240, 248, 0.78);
  --invoice-soft: rgba(223, 232, 243, 0.66);
  --invoice-border: rgba(165, 183, 204, 0.52);
  --invoice-accent: #6f88a6;
  --invoice-secondary: #5d6d80;
  --invoice-text: #243241;
  --invoice-dark: #16202a;
}
.template-minimal {
  --invoice-bg: rgba(255, 255, 255, 0.78);
  --invoice-surface: rgba(244, 246, 248, 0.7);
  --invoice-soft: rgba(231, 237, 243, 0.6);
  --invoice-border: rgba(198, 206, 216, 0.55);
  --invoice-accent: #6c6e7b;
  --invoice-secondary: #8b9bb4;
  --invoice-text: #343e49;
  --invoice-dark: #131316;
}
.template-corporate {
  --invoice-bg: rgba(248, 250, 252, 0.78);
  --invoice-surface: rgba(221, 228, 236, 0.7);
  --invoice-soft: rgba(231, 237, 243, 0.6);
  --invoice-border: rgba(184, 194, 206, 0.5);
  --invoice-accent: #8b9bb4;
  --invoice-secondary: #6c6e7b;
  --invoice-text: #273341;
  --invoice-dark: #343e49;
}
.template-gold,
.template-creative {
  --invoice-bg: rgba(255, 255, 255, 0.78);
  --invoice-surface: rgba(244, 241, 236, 0.7);
  --invoice-soft: rgba(239, 232, 220, 0.6);
  --invoice-border: rgba(200, 189, 168, 0.55);
  --invoice-accent: #a68f68;
  --invoice-secondary: #6c6e7b;
  --invoice-text: #34312d;
  --invoice-dark: #131316;
}
.template-agency {
  --invoice-bg: rgba(245, 250, 255, 0.78);
  --invoice-surface: rgba(216, 229, 241, 0.72);
  --invoice-soft: rgba(230, 238, 246, 0.65);
  --invoice-border: rgba(170, 190, 212, 0.55);
  --invoice-accent: #4f7aa4;
  --invoice-secondary: #5a6f84;
  --invoice-text: #213447;
  --invoice-dark: #162534;
}
.template-dark {
  --invoice-bg: rgba(24, 28, 36, 0.96);
  --invoice-surface: rgba(39, 47, 60, 0.86);
  --invoice-soft: rgba(57, 69, 88, 0.75);
  --invoice-border: rgba(114, 126, 148, 0.42);
  --invoice-accent: #8ec5ff;
  --invoice-secondary: #bcc6d8;
  --invoice-text: #f3f6fb;
  --invoice-dark: #ffffff;
}
.template-modern:before {
  background: linear-gradient(90deg, #1e2834, #6f88a6, #d5e3f3);
}
.template-minimal:before { background: var(--invoice-dark); }
.template-corporate:before { background: linear-gradient(90deg, var(--invoice-dark), var(--invoice-accent)); }
.template-gold:before, .template-creative:before { background: linear-gradient(90deg, var(--invoice-dark), var(--invoice-accent), var(--invoice-soft)); }
.template-agency:before { background: linear-gradient(90deg, var(--invoice-dark), var(--invoice-accent), #d7ebff); }
.template-dark:before { background: linear-gradient(90deg, #ffffff, #8ec5ff, #2f3b4d); }
.template-modern .paper-meta h2,
.template-agency .paper-meta h2,
.template-corporate .paper-meta h2,
.template-creative .paper-meta h2,
.template-dark .paper-meta h2 {
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.template-modern .paper-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(234,241,248,0.78));
}
.template-modern .invoice-table th {
  background: linear-gradient(180deg, #243241, #4f6781);
}
.template-minimal {
  font-family: var(--font-serif);
}
.template-minimal .paper-top {
  align-items: flex-end;
  border-bottom-width: 2px;
}
.template-minimal .paper-brand h3,
.template-minimal .paper-meta h2 {
  font-weight: 700;
  letter-spacing: 0;
}
.template-minimal .paper-card,
.template-minimal .payment-box,
.template-minimal .paper-note {
  padding-left: 0;
  padding-right: 0;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  background: transparent;
  box-shadow: none;
}
.template-minimal .invoice-table th {
  padding-left: 0;
  padding-right: 0;
  background: transparent;
  color: var(--invoice-dark);
  border-bottom: 2px solid var(--invoice-dark);
}
.template-minimal .invoice-table td {
  padding-left: 0;
  padding-right: 0;
}
.template-minimal .status-badge {
  background: transparent;
  border-color: var(--invoice-dark);
}
.template-agency .paper-top {
  padding: 16px 18px 24px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(220,233,247,0.9), rgba(245,250,255,0.75));
}
.template-agency .paper-brand h3 {
  font-size: 30px;
}
.template-agency .paper-meta {
  padding: 16px 18px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(33,52,71,0.96), rgba(79,122,164,0.92));
  color: #fff;
}
.template-agency .paper-meta h2,
.template-agency .paper-meta div,
.template-agency .paper-meta strong {
  color: inherit;
}
.template-agency .status-badge {
  background: rgba(255,255,255,0.14);
  color: #fff;
}
.template-agency .paper-card {
  border-top: 4px solid var(--invoice-accent);
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(228,239,248,0.78));
}
.template-agency .invoice-table th {
  background: linear-gradient(180deg, #1e3953, #4f7aa4);
}
.template-corporate .paper-top {
  align-items: stretch;
}
.template-corporate .paper-brand,
.template-corporate .paper-meta {
  padding: 14px 16px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(232,239,246,0.8), rgba(248,250,252,0.65));
}
.template-corporate .paper-card,
.template-corporate .payment-box,
.template-corporate .paper-note {
  border-radius: 8px;
}
.template-corporate .invoice-table th {
  background: linear-gradient(180deg, #343e49, #607284);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.template-corporate .totals {
  border-top-width: 3px;
}
.template-creative .paper-top {
  position: relative;
  padding-top: 22px;
}
.template-creative .paper-top::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(166,143,104,0.2), transparent 68%);
  pointer-events: none;
}
.template-creative .paper-brand h3 {
  font-size: 32px;
}
.template-creative .paper-card {
  background: linear-gradient(180deg, rgba(255,250,244,0.95), rgba(244,241,236,0.74));
  border-left: 4px solid var(--invoice-accent);
}
.template-creative .invoice-table th {
  background: linear-gradient(180deg, #4f4030, #a68f68);
}
.template-creative .grand-total .total-value {
  color: var(--invoice-accent);
}
.template-dark .invoice-table th {
  background: linear-gradient(180deg, rgba(255,255,255,0.14), rgba(255,255,255,0.08));
  color: #fff;
}
.template-dark .paper-card,
.template-dark .payment-box,
.template-dark .paper-note {
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
}
.template-dark .paper-top {
  border-bottom-color: rgba(142,197,255,0.34);
}
.template-dark .paper-card,
.template-dark .paper-meta,
.template-dark .payment-box,
.template-dark .paper-note {
  border-color: rgba(142,197,255,0.22);
}
.template-dark .paper-meta {
  padding: 14px 16px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.04));
}
.template-dark .status-badge {
  background: rgba(255,255,255,0.09);
  color: #fff;
}
.template-dark .total-value,
.template-dark .paper-footer .powered-by a {
  color: #8ec5ff;
}
.paper-top {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding-top: 8px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--invoice-border);
}
.paper-brand {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
}
.paper-logo {
  max-width: 82px;
  max-height: 66px;
  object-fit: contain;
  border-radius: 10px;
}
.fallback-logo {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--invoice-soft), rgba(221,228,236,0.5));
  color: var(--invoice-dark);
  font-weight: 900;
  border: 1px solid rgba(255,255,255,0.4);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
}
.paper-brand h3 {
  font-family: var(--font-display);
  color: var(--invoice-dark);
  font-size: 28px;
  line-height: 1.03;
  letter-spacing: -0.04em;
  font-weight: 700;
  word-break: break-word;
}
.paper-muted {
  margin-top: 6px;
  color: var(--invoice-secondary);
  font-size: 13px;
  line-height: 1.65;
  font-weight: 500;
}
.paper-meta { text-align: right; line-height: 1.55; }
.paper-meta h2 {
  font-family: var(--font-display);
  margin-bottom: 6px;
  font-size: 40px;
  letter-spacing: -0.04em;
  font-weight: 800;
  white-space: nowrap;
}
.paper-brand,
.paper-meta,
.paper-card,
.payment-box,
.paper-note,
.paper-footer,
.total-row span,
.invoice-table th,
.invoice-table td {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-top: 8px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--invoice-soft);
  color: var(--invoice-dark);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid rgba(255,255,255,0.4);
  backdrop-filter: blur(4px);
}
.status-paid { background: var(--invoice-soft); color: var(--invoice-dark); }
.status-overdue { background: rgba(255, 241, 241, 0.7); color: #bd3939; backdrop-filter: blur(4px); }
.status-sent { background: var(--invoice-surface); color: var(--invoice-text); }
.paper-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 22px 0;
}
.paper-card {
  min-height: 116px;
  padding: 17px;
  border-radius: 12px;
  border: 1px solid rgba(184, 194, 206, 0.4);
  background: linear-gradient(180deg, rgba(255,255,255,0.6), rgba(240,244,248,0.5));
  backdrop-filter: blur(8px);
  line-height: 1.55;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
}
.paper-card h4 {
  font-family: var(--font-display);
  margin-bottom: 7px;
  color: var(--invoice-secondary);
  font-size: 12px;
  letter-spacing: 0.12em;
  font-weight: 700;
  text-transform: uppercase;
}
.invoice-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  table-layout: fixed;
}
.invoice-table th {
  font-family: var(--font-display);
  background: linear-gradient(180deg, rgba(19,19,22,0.92), rgba(52,62,73,0.92));
  color: #fff;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.invoice-table th, .invoice-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--invoice-border);
  vertical-align: top;
}
.text-right { text-align: right; }
.totals {
  width: min(390px, 100%);
  margin-top: 18px;
  margin-left: auto;
  border-top: 2px solid var(--invoice-dark);
}
.invoice-summary,
.payment-box,
.paper-note,
.paper-footer {
  break-inside: avoid;
  page-break-inside: avoid;
}
.total-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 9px 0;
  border-bottom: 1px solid var(--invoice-border);
  font-size: 14px;
  font-weight: 700;
}
.grand-total {
  align-items: center;
  border-bottom: 0;
  font-size: 18px;
}
.total-value {
  color: var(--invoice-dark);
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.paper-note, .payment-box {
  margin-top: 18px;
  padding: 15px;
  border-radius: 12px;
  border: 1px solid rgba(184, 194, 206, 0.4);
  background: linear-gradient(180deg, rgba(255,255,255,0.55), rgba(231,237,243,0.45));
  backdrop-filter: blur(8px);
  line-height: 1.55;
  font-size: 13px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
}
.payment-box h4, .paper-note h4 {
  margin-bottom: 5px;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.paper-footer {
  margin-top: 22px;
  padding-top: 12px;
  border-top: 1px solid var(--invoice-border);
  color: var(--invoice-secondary);
  text-align: center;
  font-size: 13px;
  line-height: 1.5;
  font-weight: 500;
}
.paper-footer .powered-by {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--invoice-border);
}
.paper-footer .powered-by a {
  color: var(--invoice-accent);
  text-decoration: none;
  font-weight: 700;
  transition: color 0.15s ease;
}
.paper-footer .powered-by a:hover {
  color: var(--invoice-dark);
  text-decoration: underline;
}
.seo-content {
  margin-top: 22px;
  padding: 24px;
  background:
    radial-gradient(circle at top right, rgba(139, 155, 180, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(255,255,255,0.76), rgba(241,245,250,0.62));
}
.seo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.trust-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid rgba(160, 176, 195, 0.36);
  background: linear-gradient(180deg, rgba(255,255,255,0.74), rgba(240,244,248,0.5));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
}
.trust-strip strong {
  color: #1f2834;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}
.trust-strip p {
  color: var(--muted);
  line-height: 1.55;
  font-size: 14px;
  font-weight: 600;
}
.seo-card {
  margin-top: 0;
  position: relative;
  overflow: hidden;
  padding-top: 20px;
}
.seo-card,
.faq-section,
.xinrlabs-cta {
  border-color: rgba(170, 184, 201, 0.4);
  box-shadow: 0 14px 30px rgba(35, 47, 63, 0.045), inset 0 1px 0 rgba(255,255,255,0.72);
}
.seo-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, rgba(108,110,123,0.95), rgba(139,155,180,0.9));
}
.seo-card-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  min-height: 26px;
  margin-bottom: 12px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(139, 155, 180, 0.14);
  border: 1px solid rgba(139, 155, 180, 0.22);
  color: var(--accent-dark);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
}
.seo-card h2,
.faq-section h2,
.xinrlabs-cta h2 {
  font-family: var(--font-display);
  margin-bottom: 10px;
  font-size: 24px;
  line-height: 1.06;
  letter-spacing: -0.04em;
  font-weight: 800;
}
.seo-card p,
.faq-head p,
.faq-item p,
.xinrlabs-cta p {
  color: var(--muted);
  line-height: 1.62;
  font-weight: 500;
}
.seo-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(35, 47, 63, 0.06), inset 0 1px 0 rgba(255,255,255,0.76);
}
.faq-section,
.xinrlabs-cta {
  margin-top: 18px;
}
.faq-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
  margin-top: 16px;
  align-items: start;
}
.faq-item {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(170, 184, 201, 0.38);
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(243,247,251,0.72));
  box-shadow: 0 10px 22px rgba(35, 47, 63, 0.04), inset 0 1px 0 rgba(255,255,255,0.8);
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
.faq-item summary {
  font-family: var(--font-display);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.02em;
  list-style: none;
}
.faq-item summary::after {
  content: "";
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--accent-dark);
  border-bottom: 2px solid var(--accent-dark);
  transform: rotate(45deg);
  transition: transform 0.18s ease;
}
.faq-item summary::-webkit-details-marker {
  display: none;
}
.faq-item[open] {
  border-color: rgba(125, 143, 164, 0.58);
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(234,241,248,0.82));
  box-shadow: 0 12px 26px rgba(35, 47, 63, 0.05), inset 0 1px 0 rgba(255,255,255,0.84);
}
.faq-item[open] summary::after {
  transform: rotate(225deg);
}
.faq-item p {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.65;
}
.xinrlabs-cta {
  background: linear-gradient(135deg, rgba(255,255,255,0.86), rgba(228,237,247,0.72));
}
.xinrlabs-cta .primary-btn {
  background: linear-gradient(135deg, rgba(31,40,52,0.96), rgba(67,78,92,0.94));
  box-shadow: 0 12px 30px rgba(24, 31, 41, 0.2), inset 0 1px 0 rgba(255,255,255,0.14);
}
.mobile-action-bar {
  display: none;
}
@media (max-width: 1180px) {
  .layout { grid-template-columns: 1fr; }
  .preview-wrap { position: static; }
  .invoice-paper { min-height: auto; }
  .site-hero,
  .seo-grid,
  .faq-list {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 760px) {
  body { padding: 16px 10px calc(92px + env(safe-area-inset-bottom, 0px)); }
  .topbar, .paper-top { align-items: flex-start; flex-direction: column; }
  .editor, .preview-wrap, .site-hero, .seo-content { padding: 18px; border-radius: 16px; }
  .top-nav { display: none; }
  .toolbar, .grid-2, .grid-3, .paper-cards, .form-actions { grid-template-columns: 1fr; }
  .secondary-actions { flex-direction: column; }
  .secondary-actions button { width: 100%; }
  .site-hero-copy h2,
  .seo-card h2,
  .faq-section h2,
  .xinrlabs-cta h2 { font-size: 22px; }
  .hero-actions { flex-direction: column; }
  .hero-actions .hero-link { width: 100%; }
  .trust-strip {
    flex-direction: column;
    align-items: flex-start;
  }
  .section-head-meta { display: inline-flex; }
  .collapsible-section .section-head { margin-bottom: 0; }
  .collapsible-section.is-collapsed .section-body { display: none; }
  .section-toggle { padding: 2px 0; }
  .mobile-action-bar {
    position: fixed;
    right: 10px;
    bottom: 10px;
    left: 10px;
    z-index: 25;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    padding: 12px;
    border-radius: 18px;
    background: rgba(255,255,255,0.78);
    backdrop-filter: blur(16px) saturate(150%);
    border: 1px solid rgba(255,255,255,0.52);
    box-shadow: 0 14px 36px rgba(20, 27, 45, 0.16);
  }
  .mobile-action-bar button {
    min-width: 0;
  }
  .item-row { grid-template-columns: minmax(0, 1fr) minmax(66px, 0.38fr); }
  .item-row .item-rate, .item-row .item-amount, .item-row .icon-btn { grid-column: span 1; }
  .upsell-row { grid-template-columns: minmax(0, 1fr) minmax(110px, 0.55fr); }
  .upsell-row .icon-btn { grid-column: 1 / -1; width: 100%; }
  .paper-meta { text-align: left; }
  .invoice-table { min-width: 560px; }
  .invoice-paper { overflow-x: auto; }
}
@media (max-width: 540px) {
  .item-row, .upsell-row, .upload-control { grid-template-columns: 1fr; }
  .icon-btn { width: 100%; }
  .invoice-paper { padding: 22px 16px; }
  .preview-header { align-items: flex-start; flex-direction: column; }
  .preview-actions { width: 100%; }
  .preview-actions button { flex: 1; }
  .brand { align-items: flex-start; }
  .brand-mark { width: 42px; height: 42px; }
}
.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
  padding: 18px 22px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.45), rgba(240,244,248,0.38));
  backdrop-filter: blur(14px) saturate(125%);
  border: var(--glass-border);
  box-shadow: var(--shadow);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.app-footer p { margin: 0; }
.app-footer strong { color: var(--text); }
.app-footer a {
  color: var(--accent-dark);
  text-decoration: none;
  font-weight: 700;
  transition: color 0.15s ease;
}
.app-footer a:hover { color: var(--text); text-decoration: underline; }
@media (max-width: 540px) {
  .app-footer { flex-direction: column; align-items: flex-start; gap: 4px; }
}
@media print {
  @page {
    size: A4;
    margin: 10mm;
  }

  html, body {
    width: auto;
    min-height: auto;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    color: #000 !important;
  }

  body * {
    box-shadow: none !important;
    text-shadow: none !important;
  }

  .topbar,
  .app-header,
  .editor,
  .editor-panel,
  .preview-header,
  .preview-actions,
  .app-footer,
  .site-hero,
  .seo-content,
  .site-footer,
  .form-actions,
  .secondary-actions,
  .mini-actions,
  .section,
  .custom-options,
  .ghost-btn,
  .primary-btn,
  .dark-btn,
  .danger-btn,
  .generate-btn,
  button,
  input,
  textarea,
  select {
    display: none !important;
  }

  .app,
  .layout,
  .preview-wrap,
  #invoiceContent {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: #fff !important;
    backdrop-filter: none !important;
  }

  .preview-wrap {
    position: static !important;
  }

  .invoice-paper {
    width: 210mm !important;
    min-height: 297mm !important;
    margin: 0 auto !important;
    padding: 14mm !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #fff !important;
    color: #111 !important;
    backdrop-filter: none !important;
    box-shadow: none !important;
    overflow: visible !important;
    page-break-after: auto;
    break-after: auto;
  }

  .invoice-paper::before,
  .paper-card,
  .payment-box,
  .paper-note,
  .status-badge {
    background: #fff !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
  }

  .paper-top,
  .paper-card,
  .paper-note,
  .payment-box,
  .paper-footer,
  .invoice-table th,
  .invoice-table td,
  .totals,
  .total-row {
    border-color: #d8d8d8 !important;
  }

  .invoice-table {
    page-break-inside: auto;
    break-inside: auto;
  }

  .invoice-table thead {
    display: table-header-group;
  }

  .invoice-table tbody {
    display: table-row-group;
  }

  .invoice-table tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .invoice-summary,
  .payment-box,
  .paper-note,
  .paper-footer,
  .paper-cards,
  .paper-card {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .invoice-summary {
    width: 100% !important;
    max-width: 390px !important;
    margin-left: auto !important;
  }

  .paper-footer {
    margin-top: 18px !important;
    padding-bottom: 0 !important;
  }
}
.custom-select {
  position: relative;
  display: block;
  width: 100%;
}
.choice-field .custom-select {
  display: inline-block;
}
.custom-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  height: 46px;
  padding: 0 12px;
  border: 1.5px solid rgba(184, 194, 206, 0.45);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(6px);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.custom-trigger:hover {
  border-color: rgba(139, 155, 180, 0.65);
  background: rgba(255, 255, 255, 0.75);
}
.custom-trigger:focus-visible {
  outline: none;
  border-color: rgba(139, 155, 180, 0.7);
  box-shadow: 0 0 0 4px rgba(139, 155, 180, 0.12);
}
.custom-select.field-invalid .custom-trigger {
  border-color: rgba(217, 75, 75, 0.65) !important;
  box-shadow: 0 0 0 4px rgba(217, 75, 75, 0.12) !important;
}
.choice-field .custom-trigger {
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  font-size: 15px;
  font-weight: 800;
}
.choice-field .custom-trigger:hover {
  background: transparent;
  border-color: transparent;
}
.choice-field .custom-trigger:focus-visible {
  box-shadow: none;
}
.custom-trigger > span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.custom-trigger svg {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  stroke: #6c6e7b;
  stroke-width: 2.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s ease;
}
.custom-select.open .custom-trigger svg {
  transform: rotate(180deg);
}
.custom-options {
  position: fixed;
  z-index: 9999;
  padding: 6px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(240,244,248,0.88));
  backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid rgba(255,255,255,0.55);
  box-shadow: 0 16px 48px rgba(52, 62, 73, 0.14), 0 4px 12px rgba(52, 62, 73, 0.06);
  display: none;
  max-height: 260px;
  overflow-y: auto;
  width: max-content;
}
.custom-options::-webkit-scrollbar { width: 6px; }
.custom-options::-webkit-scrollbar-track { background: transparent; }
.custom-options::-webkit-scrollbar-thumb { background: rgba(184,194,206,0.5); border-radius: 10px; }
.custom-options.open { display: block; }
.custom-option {
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  transition: background 0.12s ease;
  margin: 2px 0;
}
.custom-option:hover, .custom-option.focused {
  background: rgba(139, 155, 180, 0.18);
}
.custom-option.selected {
  background: rgba(139, 155, 180, 0.3);
  font-weight: 800;
  color: var(--deep-dark);
}
select.native-select {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
  border: 0;
  padding: 0;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
}
