:root {
  --bg: #eef4f1;
  --bg-deep: #d7e6df;
  --surface: #ffffff;
  --ink: #1a2e28;
  --muted: #5a7268;
  --line: #c5d6cd;
  --accent: #1f7a5c;
  --accent-dark: #145c44;
  --accent-soft: #d8efe5;
  --warn: #9a5b1a;
  --danger: #a33b3b;
  --paid: #1f7a5c;
  --open: #2a6f97;
  --draft: #6b7280;
  --cancelled: #8a4b4b;
  --refunded: #6b4c9a;
  --shadow: 0 12px 40px rgba(26, 46, 40, 0.08);
  --radius: 14px;
  --font: "DM Sans", sans-serif;
  --display: "Fraunces", Georgia, serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, #cfe8dc 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #dce9f2 0%, transparent 50%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  background-attachment: fixed;
}

a {
  color: var(--accent-dark);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 0.4rem;
}

p {
  margin: 0 0 1rem;
  color: var(--muted);
}

/* Layout — admin */
.admin-body {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 100vh;
  align-content: start;
}

.sidebar {
  background: #12352c;
  color: #e8f3ee;
  padding: 1.5rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.sidebar-collapse {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  flex: 1;
  min-height: 0;
}

.nav-toggle {
  display: none;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #e8f3ee;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}

.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.nav-toggle-bars {
  position: relative;
}

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

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

.sidebar.is-open .nav-toggle-bars {
  background: transparent;
}

.sidebar.is-open .nav-toggle-bars::before {
  top: 0;
  transform: rotate(45deg);
}

.sidebar.is-open .nav-toggle-bars::after {
  top: 0;
  transform: rotate(-45deg);
}

.sidebar-brand {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 0.35rem 0.5rem;
  min-width: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #3cb88a, #1f7a5c);
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.2rem;
  color: #fff;
}

.sidebar-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  object-fit: cover;
  background: #fff;
  flex-shrink: 0;
}

.sidebar-brand strong {
  display: block;
  font-size: 0.92rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.sidebar-brand small {
  color: #9db8ad;
  font-size: 0.75rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  color: #cfe0d8;
  text-decoration: none;
  padding: 0.7rem 0.85rem;
  min-height: 44px;
  border-radius: 10px;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  text-decoration: none;
}

.nav-count {
  display: inline-grid;
  place-items: center;
  min-width: 1.3rem;
  height: 1.3rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #e2b340;
  color: #12352c;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
}

.sidebar-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0.5rem 0.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.85rem;
  color: #9db8ad;
}

.sidebar-foot a {
  color: #b8e0cf;
}

.admin-main,
.public-main {
  padding: 2rem;
  max-width: 1100px;
  width: 100%;
  min-width: 0;
}

.public-body .public-main {
  margin: 0 auto;
  max-width: 820px;
  padding: 2.5rem 1.25rem 4rem;
}

/* Landing page */
.landing-body {
  background: #f3f7f5;
}

.landing-main {
  max-width: none;
  width: 100%;
  padding: 0;
  margin: 0;
}

.landing-hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  align-items: end;
  overflow: hidden;
  color: #fff;
}

.landing-hero-media,
.landing-hero-shade {
  position: absolute;
  inset: 0;
}

.landing-hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.04);
  animation: landing-zoom 12s ease-out forwards;
}

.landing-hero-shade {
  background:
    linear-gradient(180deg, rgba(14, 36, 30, 0.28) 0%, rgba(14, 36, 30, 0.55) 48%, rgba(14, 36, 30, 0.82) 100%);
}

.landing-hero-content {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  padding: clamp(2rem, 6vw, 4.5rem);
  padding-bottom: clamp(2.5rem, 8vw, 5rem);
  animation: landing-rise 0.8s ease both;
}

.landing-logo {
  display: block;
  width: min(168px, 58vw);
  height: auto;
  margin: 0 0 1.15rem;
  border-radius: 18px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.28);
  animation: landing-rise 0.9s ease both;
}

.invoice-hero h1 {
  white-space: pre-line;
  line-height: 1.05;
}

.invoice-parties strong {
  white-space: pre-line;
}

.landing-hero h1 {
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.96);
  margin: 0 0 0.65rem;
  max-width: 18ch;
  animation: landing-rise 1s ease 0.08s both;
}

.landing-lead {
  color: rgba(255, 255, 255, 0.86);
  font-size: 1.05rem;
  margin: 0 0 1.5rem;
  max-width: 46ch;
  animation: landing-rise 1s ease 0.16s both;
}

.landing-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  animation: landing-rise 1s ease 0.24s both;
}

.landing-cta .btn {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.landing-cta-light {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(6px);
}

.landing-cta-light:hover {
  background: rgba(255, 255, 255, 0.26);
  color: #fff;
}

.landing-scroll {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.35rem;
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
  animation: landing-rise 1s ease 0.4s both;
}

.landing-scroll:hover {
  color: #fff;
  text-decoration: none;
}

.landing-scroll-icon {
  display: block;
  width: 8px;
  height: 8px;
  margin-top: -0.2rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  animation: landing-scroll-bounce 1.7s ease-in-out 1.1s infinite;
}

@keyframes landing-scroll-bounce {
  0%, 100% { transform: rotate(45deg) translate(0, 0); }
  50% { transform: rotate(45deg) translate(3px, 3px); }
}

.landing-section {
  padding: clamp(3rem, 8vw, 5rem) clamp(1.25rem, 5vw, 3rem);
}

.landing-section-alt {
  background: linear-gradient(180deg, #e7f1ec 0%, #dfece6 100%);
}

.landing-section-inner {
  width: min(900px, 100%);
  margin: 0 auto;
}

.landing-split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2rem;
  align-items: start;
}

.landing-section h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  margin-bottom: 0.75rem;
}

.landing-section p {
  font-size: 1.05rem;
  max-width: 42rem;
}

.landing-section h3 {
  font-size: 1.2rem;
  margin: 0 0 0.4rem;
}

.landing-services {
  margin: 1.5rem 0 1.75rem;
}

.landing-services p {
  margin-bottom: 0;
}

.landing-photos {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  list-style: none;
  margin: 1.75rem 0 0;
  padding: 0;
}

.landing-photos figure {
  margin: 0;
  overflow: hidden;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(23, 60, 49, 0.1);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.landing-photos img {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
  transform: scale(1);
  transition: transform 0.5s ease;
}

.landing-photos figure:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 36px rgba(23, 60, 49, 0.18);
}

.landing-photos figure:hover img {
  transform: scale(1.06);
}

.landing-photos figcaption {
  padding: 0.7rem 0.85rem 0.9rem;
  font-size: 0.92rem;
  color: var(--muted);
}

.landing-photo-feature {
  align-items: stretch;
  margin-top: 0.25rem;
}

.landing-feature-photo {
  margin: 0;
  overflow: hidden;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(23, 60, 49, 0.1);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.landing-feature-photo img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 280px;
  object-fit: cover;
  transform: scale(1);
  transition: transform 0.5s ease;
}

.landing-feature-photo:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 36px rgba(23, 60, 49, 0.18);
}

.landing-feature-photo:hover img {
  transform: scale(1.06);
}

.landing-photo-feature .landing-services {
  grid-template-columns: 1fr;
  gap: 1.1rem;
  margin: 1.15rem 0 1.35rem;
}

.landing-photo-feature .landing-cta {
  margin-top: 0.25rem;
}

.local-page h2 {
  margin-top: 2rem;
}

.local-page-cta {
  margin: 1.25rem 0 0.5rem;
}

.area-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0.75rem 0 1rem;
  padding: 0;
}

.area-list li {
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
}

.local-faq {
  margin: 0.75rem 0 1.5rem;
}

.local-faq dt {
  font-weight: 700;
  color: var(--ink);
  margin: 1rem 0 0.35rem;
}

.local-faq dd {
  margin: 0;
  color: var(--muted);
  max-width: 42rem;
}

.local-reviews {
  margin-top: 1rem;
}

.local-quote-banner {
  margin-top: 2.5rem;
  padding: 1.5rem 1.5rem 1.6rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.local-quote-banner h2 {
  margin-top: 0;
}

.local-quote-banner .btn {
  margin-top: 0.35rem;
}

.landing-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}

.landing-list li {
  padding-left: 1.15rem;
  position: relative;
  color: var(--ink);
  font-weight: 500;
}

.landing-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--accent);
}

.review-toast {
  position: absolute;
  z-index: 2;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  width: min(360px, calc(100% - 2rem));
  animation: review-toast-in 0.55s ease 0.7s both;
}

.review-toast-card {
  display: block;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 16px;
  box-shadow: 0 18px 44px rgba(14, 36, 30, 0.28);
  padding: 0.9rem 1rem 0.95rem;
  text-decoration: none;
  color: inherit;
  backdrop-filter: blur(12px);
}

.review-toast-card:hover {
  text-decoration: none;
  background: #fff;
}

.review-roller-track {
  display: grid;
}

.review-roller-item {
  grid-area: 1 / 1;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.45s ease, transform 0.45s ease, visibility 0.45s;
}

.review-roller-item.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.review-roller-item .review-rating {
  margin: 0 0 0.4rem;
}

.review-roller-item .star {
  font-size: 0.95rem;
}

.review-roller-item p {
  margin: 0 0 0.55rem;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.review-roller-item footer {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.8rem;
}

.review-roller-item cite {
  font-style: normal;
  font-weight: 700;
  color: var(--ink);
}

@keyframes review-toast-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

.landing-contact {
  text-align: center;
}

.landing-contact p {
  margin-left: auto;
  margin-right: auto;
}

.landing-contact .landing-cta {
  justify-content: center;
}

.landing-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.25rem clamp(1.25rem, 5vw, 3rem) max(2rem, env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--line);
}

.landing-footer a {
  color: var(--muted);
}

.landing-footer-links {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

@keyframes landing-zoom {
  from { transform: scale(1.08); }
  to { transform: scale(1); }
}

@keyframes landing-rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .landing-hero-media img,
  .landing-hero-content,
  .landing-logo,
  .landing-hero h1,
  .landing-lead,
  .landing-cta {
    animation: none;
  }

  .landing-scroll,
  .landing-scroll-icon {
    animation: none;
  }

  .review-roller-item,
  .review-toast {
    transition: none;
    animation: none;
  }

  .landing-photos figure,
  .landing-photos img,
  .landing-feature-photo,
  .landing-feature-photo img {
    transition: none;
  }

  .landing-photos figure:hover,
  .landing-feature-photo:hover {
    transform: none;
    box-shadow: 0 10px 24px rgba(23, 60, 49, 0.1);
  }

  .landing-photos figure:hover img,
  .landing-feature-photo:hover img {
    transform: none;
  }

  .landing-hero-media img {
    transform: none;
  }
}

/* Page chrome */
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.page-head p {
  margin: 0;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow);
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
}

.stat strong {
  font-family: var(--display);
  font-size: 1.8rem;
}

.stats-analytics {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.analytics-days {
  display: grid;
  gap: 0.35rem;
}

.analytics-day {
  display: grid;
  grid-template-columns: 4.2rem 1fr 2.4rem;
  gap: 0.6rem;
  align-items: center;
  font-size: 0.9rem;
  color: var(--muted);
}

.analytics-day strong {
  text-align: right;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.analytics-day-bar {
  height: 10px;
  background: var(--accent-soft);
  border-radius: 99px;
  overflow: hidden;
}

.analytics-day-bar > span {
  display: block;
  height: 100%;
  min-width: 0;
  background: var(--accent);
  border-radius: 99px;
}

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

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
}

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

.smtp-test {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.smtp-test p {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.settings-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.1rem;
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.settings-tabs .nav-item {
  flex: 0 0 auto;
}

.settings-tabs .nav-link {
  display: block;
  margin: 0 0 -1px;
  padding: 0.7rem 1rem;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
}

.settings-tabs .nav-link:hover,
.settings-tabs .nav-link:focus-visible {
  color: var(--accent-dark);
  text-decoration: none;
  background: transparent;
}

.settings-tabs .nav-link.active {
  color: var(--accent-dark);
  background: transparent;
  border-bottom-color: var(--accent);
}

.settings-save {
  margin: 0.25rem 0 1.25rem;
}

.panel-title h2 {
  margin: 0;
}

/* Forms */
label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="date"],
select,
textarea {
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--line);
  background: #fbfdfc;
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  margin-bottom: 1rem;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}

.invoice-edit-fields {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.invoice-edit .panel {
  padding: 1.85rem 2rem 1.9rem;
}

.invoice-edit .panel-title {
  margin-bottom: 1.25rem;
}

.invoice-edit-fields > .btn-row {
  margin: 0.35rem 0 1.85rem;
}

input:disabled,
select:disabled,
textarea:disabled {
  background: #f3f6f4;
  color: var(--ink);
  cursor: not-allowed;
  opacity: 0.85;
}

textarea {
  min-height: 100px;
  resize: vertical;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1rem;
}

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

.new-customer-fields {
  margin: 0 0 1rem;
  padding: 1rem 1rem 0.25rem;
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.new-customer-fields[hidden] {
  display: none !important;
}

.new-customer-fields-title {
  margin: 0 0 0.75rem;
  font-weight: 600;
  color: var(--ink);
}

.new-customer-fields-hint {
  margin: -0.5rem 0 1rem;
  font-size: 0.85rem;
}

.check-label {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-weight: 500;
  margin: 0.15rem 0 1rem;
  cursor: pointer;
}

.check-label input[type="checkbox"] {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0.15rem 0 0;
  flex-shrink: 0;
  accent-color: var(--accent);
}

.check-label small {
  display: block;
  font-weight: 400;
  color: var(--muted);
  margin-top: 0.15rem;
}

.table-note {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.btn-row {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  align-items: center;
}

form > .btn-row {
  margin: 0.15rem 0 1.35rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: none;
  border-radius: 999px;
  padding: 0.7rem 1.15rem;
  min-height: 44px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  touch-action: manipulation;
  transition: transform 0.12s ease, background 0.12s ease;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

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

.btn-primary:hover {
  background: var(--accent-dark);
  color: #fff;
}

.btn-secondary {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.btn-danger {
  background: #f6e4e4;
  color: var(--danger);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

.btn.btn-ghost:hover,
.btn.btn-ghost:focus-visible {
  background: #eef4f1;
  color: var(--ink);
  border: 1px solid #b3c6bc;
  text-decoration: none;
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  min-height: 36px;
  font-size: 0.85rem;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

.panel .table-wrap {
  /* Allow Bootstrap fixed-strategy dropdowns to escape the panel */
  overflow: visible;
}

@media (max-width: 900px) {
  .panel .table-wrap {
    overflow-x: auto;
  }
}

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

th, td {
  text-align: left;
  padding: 0.75rem 0.6rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

th.num,
td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

td.num.is-refund {
  color: var(--danger);
}

.payment-stripe-note {
  font-size: 0.9rem;
  color: var(--muted);
}

th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

td .actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

td .actions .dropdown-menu {
  min-width: 10rem;
}

td .actions .dropdown-item {
  font-size: 0.9rem;
}

td .actions form {
  margin: 0;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-draft { background: #eceff3; color: var(--draft); }
.badge-open { background: #e3f1f8; color: var(--open); }
.badge-paid { background: var(--accent-soft); color: var(--paid); }
.badge-cancelled { background: #f6e4e4; color: var(--cancelled); }
.badge-refunded { background: #f3e8ff; color: var(--refunded); }
.badge-emailed { background: var(--accent-soft); color: var(--accent-dark); }
.badge-not-emailed { background: #eceff3; color: var(--draft); }
.badge-sent { background: #e3f1f8; color: var(--open); }
.badge-pending { background: #f7edd8; color: #8a5a12; }
.badge-new { background: #e3f1f8; color: var(--open); }
.badge-active { background: var(--accent-soft); color: var(--paid); }
.badge-terminated { background: #f6e4e4; color: var(--cancelled); }
.badge-expired { background: #eceff3; color: var(--draft); }

.quote-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0.85rem 1.25rem;
  margin: 0;
}

.quote-details div {
  margin: 0;
}

.quote-details dt {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  margin: 0 0 0.2rem;
}

.quote-details dd {
  margin: 0;
}

.quote-message-title {
  font-size: 0.95rem;
  margin: 1.25rem 0 0.4rem;
}

.quote-message {
  margin: 0;
  white-space: pre-wrap;
}

.flash {
  padding: 0.85rem 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  font-weight: 500;
}

.flash-success {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.flash-error {
  background: #f6e4e4;
  color: var(--danger);
}

.empty {
  color: var(--muted);
  padding: 1rem 0;
}

.modal-content {
  overflow: hidden;
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.modal-header {
  border-bottom-color: var(--line);
}

.modal-header.text-bg-success,
.modal-header.text-bg-danger {
  border-bottom: 0;
}

.modal-title {
  font-family: var(--display);
  font-weight: 600;
}

.modal-footer .btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

/* Login */
.login-body {
  min-height: 100vh;
}

.login-main {
  max-width: none;
  width: 100%;
  padding: 0;
  margin: 0;
  min-height: 100vh;
}

.login-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.login-card {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: var(--shadow);
}

.login-card .brand {
  text-align: center;
  margin-bottom: 1.5rem;
}

.login-card .brand .login-logo {
  display: block;
  width: 112px;
  height: 112px;
  margin: 0 auto 0.85rem;
  border-radius: 16px;
  object-fit: contain;
  background: #fff;
}

.login-card .brand h1 {
  font-size: 1.45rem;
  white-space: pre-line;
  line-height: 1.15;
}

/* Invoice builder */
.items-table input {
  margin-bottom: 0;
}

.totals-box {
  margin-top: 1rem;
  margin-left: auto;
  width: min(320px, 100%);
}

.invoice-totals-row {
  display: grid;
  grid-template-columns: 1fr min(320px, 100%);
  align-items: center;
  margin-top: 1rem;
}

.invoice-totals-row .totals-box {
  margin-top: 0;
  width: 100%;
}

.invoice-next-service {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  text-align: center;
}

.invoice-next-service span {
  display: block;
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--muted);
}

.invoice-next-service strong {
  display: block;
  margin-top: 0.15rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}

.totals-box .totals-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.25rem;
  padding: 0.35rem 0;
  color: var(--muted);
}

.totals-box .totals-row strong {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  margin-left: auto;
}

.totals-box .grand {
  border-top: 1px solid var(--line);
  margin-top: 0.4rem;
  padding-top: 0.6rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
}

.totals-box .totals-paid-row {
  align-items: center;
}

.totals-box .totals-paid-row label {
  margin: 0;
  font-weight: 500;
  color: var(--muted);
}

.totals-box .totals-paid-input {
  width: 7.25rem;
  flex: 0 0 auto;
  margin: 0;
  padding: 0.35rem 0.5rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.totals-hint {
  margin: 0.65rem 0 0 auto;
  width: min(320px, 100%);
  font-size: 0.85rem;
  color: var(--muted);
}

.invoice-payments {
  margin-top: 1.35rem;
}

.invoice-payments h3 {
  font-family: var(--font);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  margin: 0 0 0.75rem;
}

.panel-payments {
  padding: 2rem 2rem 1.85rem;
}

.panel-payments .panel-title {
  margin-bottom: 1.35rem;
}

.panel-payments .empty {
  padding: 0.25rem 0 0;
  margin: 0;
}

.panel-payments th,
.panel-payments td {
  padding: 1.05rem 0.85rem;
}

.panel-payments th:first-child,
.panel-payments td:first-child {
  padding-left: 0;
}

.panel-payments th:last-child,
.panel-payments td:last-child {
  padding-right: 0;
}

.panel-payments tbody tr:last-child td {
  border-bottom: none;
}

.badge-partial { background: #f7edd8; color: #8a5a12; }

.invoice-info-paid {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
}

.copy-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.copy-row input {
  margin-bottom: 0;
  flex: 1 1 14rem;
  min-width: 0;
}

.product-picker {
  margin: 0;
  min-width: min(220px, 100%);
}

/* Public invoice */
.invoice-sheet {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: rise 0.45s ease both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.invoice-hero {
  background: #fff;
  color: var(--ink);
  padding: 1.75rem 2rem 1.5rem;
}

.invoice-letterhead {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  padding-bottom: 1rem;
  margin-bottom: 1.1rem;
  border-bottom: 2px solid #2f2f2f;
}

.invoice-brand {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  min-width: 0;
}

.invoice-logo {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  border-radius: 10px;
  object-fit: contain;
  background: #fff;
}

.invoice-brand-text {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.4;
}

.invoice-brand-text strong {
  display: block;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.12rem;
  white-space: pre-line;
}

.invoice-letterhead-meta {
  text-align: right;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.45;
  flex-shrink: 0;
}

.invoice-hero h1 {
  font-family: var(--font);
  font-size: clamp(1.55rem, 3.4vw, 2.05rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 0.3rem;
}

.invoice-hero p,
.invoice-message {
  color: var(--muted);
  margin: 0 0 1.15rem;
}

.invoice-message {
  text-align: center;
}

.invoice-info-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.invoice-info-cols > div {
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.invoice-info-cols h3 {
  font-family: var(--font);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 0.4rem;
}

.invoice-info-cols strong {
  display: block;
  margin-bottom: 0.12rem;
}

.invoice-info-amount {
  font-size: 1.15rem;
  margin-top: 0.15rem;
}

.invoice-info-payment {
  text-align: right;
}

.invoice-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 1.25rem;
  font-size: 0.95rem;
}

.invoice-meta div span {
  display: block;
  opacity: 0.75;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.15rem;
}

.invoice-body {
  padding: 1.75rem 2rem 2rem;
}

.invoice-parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
}

.invoice-parties h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-family: var(--font);
  font-weight: 600;
}

.invoice-parties strong {
  display: block;
  font-size: 1.05rem;
  margin-bottom: 0.2rem;
}

.pay-box {
  margin-top: 1.75rem;
  padding: 1.25rem;
  border-radius: 14px;
  background: linear-gradient(180deg, #f3faf7, #e8f4ef);
  border: 1px solid var(--line);
  text-align: center;
  scroll-margin-top: 1.25rem;
}

.invoice-history-link {
  margin-top: 1.25rem;
  text-align: center;
}

.invoice-sheet tr.is-current-invoice td {
  background: #f3faf7;
}

.pay-box h3 {
  margin-bottom: 0.35rem;
}

.pay-box .amount {
  font-family: var(--display);
  font-size: 2rem;
  margin: 0.4rem 0 1rem;
}

.invoice-review {
  margin-top: 1.75rem;
  padding: 1.25rem 1.35rem 1.4rem;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
  text-align: left;
  scroll-margin-top: 1.25rem;
}

.invoice-review h3 {
  margin-bottom: 0.35rem;
}

.invoice-review > p {
  color: var(--muted);
  margin: 0 0 1rem;
}

.invoice-review-form .form-grid {
  margin-bottom: 0.25rem;
}

.invoice-review-posted {
  margin-top: 0.35rem;
}

.invoice-review-posted p {
  margin: 0.35rem 0 0.45rem;
  color: var(--ink);
}

.invoice-review-posted small {
  color: var(--muted);
}

.field-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.rating-picker {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 0.1rem;
  margin: 0.15rem 0 1rem;
}

.rating-picker input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.rating-picker label {
  display: inline-block;
  margin: 0;
  cursor: pointer;
  font-size: 1.85rem;
  font-weight: 400;
  line-height: 1;
  color: #d8c3a0;
  transition: color 0.12s ease, transform 0.12s ease;
}

.rating-picker input:focus {
  outline: none;
  border-color: transparent;
}

.rating-picker label:hover {
  transform: scale(1.08);
}

.rating-picker input:checked ~ label,
.rating-picker input:checked + label,
.rating-picker label:hover,
.rating-picker label:hover ~ label {
  color: #e2b340;
}

.rating-picker input:focus-visible + label {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

tr.is-pending-review td {
  background: #fff8ee;
}

.notes {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  white-space: pre-wrap;
}

.invoice-flag {
  margin-top: 1.25rem;
  padding: 0.7rem 0.9rem;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: #f7fbf9;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 600;
}

.invoice-policy {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.invoice-policy h3 {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
  color: var(--ink);
}

.invoice-policy p {
  margin: 0 0 0.45rem;
}

.invoice-policy p:last-child {
  margin-bottom: 0;
}

.reviews-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
  padding: 1rem clamp(1.25rem, 5vw, 3rem);
  padding-top: max(1rem, env(safe-area-inset-top));
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.reviews-top-brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 1;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
}

.reviews-top-brand img {
  display: block;
  height: 48px;
  width: auto;
  max-width: min(200px, 62vw);
  object-fit: contain;
}

.reviews-top-brand:hover {
  text-decoration: none;
  color: var(--accent-dark);
}

.reviews-top-toggle {
  display: none;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}

.reviews-top-toggle:hover {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.reviews-top-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.reviews-top-toggle-bars,
.reviews-top-toggle-bars::before,
.reviews-top-toggle-bars::after {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.reviews-top-toggle-bars {
  position: relative;
}

.reviews-top-toggle-bars::before,
.reviews-top-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.reviews-top-toggle-bars::before { top: -6px; }
.reviews-top-toggle-bars::after { top: 6px; }

.reviews-top.is-open .reviews-top-toggle-bars {
  background: transparent;
}

.reviews-top.is-open .reviews-top-toggle-bars::before {
  top: 0;
  transform: rotate(45deg);
}

.reviews-top.is-open .reviews-top-toggle-bars::after {
  top: 0;
  transform: rotate(-45deg);
}

.reviews-top-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem 1rem;
}

.reviews-top-nav a {
  white-space: nowrap;
}

.reviews-top-nav a[aria-current="page"] {
  font-weight: 700;
  color: var(--accent-dark);
}

.reviews-wrap {
  width: min(760px, 100%);
}

.legal-doc {
  width: min(760px, 100%);
  margin: 0 auto;
}

.legal-doc h1 {
  margin-bottom: 0.35rem;
}

.legal-doc h2 {
  font-size: 1.25rem;
  margin: 1.75rem 0 0.55rem;
}

.legal-doc p {
  color: var(--ink);
  line-height: 1.6;
  margin: 0 0 0.85rem;
}

.legal-doc .reviews-summary p {
  color: var(--muted);
}

.contact-phone {
  color: var(--muted);
  margin: 0 0 1.25rem;
}

.quote-thanks .reviews-summary {
  margin-bottom: 1.25rem;
}

.quote-thanks .landing-cta {
  animation: none;
}

.contact-form {
  margin-top: 0.5rem;
}

.field-optional {
  font-weight: 400;
  color: var(--muted);
}

.captcha-block .field-label {
  margin-bottom: 0.5rem;
}

.captcha-block .g-recaptcha {
  margin: 0.15rem 0 0.35rem;
  overflow-x: auto;
  max-width: 100%;
}

.recaptcha-note {
  font-size: 0.8rem;
  margin: 0 0 1.25rem;
}

.captcha-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
}

.captcha-image-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
}

.captcha-code {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  width: 220px;
  height: 64px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    repeating-linear-gradient(-18deg, transparent 0 7px, rgba(197, 214, 205, 0.55) 7px 8px),
    #e7f1ec;
  user-select: none;
}

.captcha-code span {
  display: inline-block;
  font-family: var(--display);
  font-size: 1.7rem;
  font-weight: 700;
  color: #145c44;
  line-height: 1;
}

.captcha-field {
  flex: 1 1 10rem;
  min-width: 0;
}

.captcha-field input {
  margin-bottom: 0;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.reviews-summary h1 {
  font-size: clamp(2rem, 4vw, 2.6rem);
  margin-bottom: 0.5rem;
}

.reviews-score {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.75rem;
  color: var(--muted);
  margin: 0 0 2rem;
}

.reviews-score strong {
  font-family: var(--display);
  font-size: 2rem;
  color: var(--ink);
  font-weight: 700;
}

.reviews-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.review-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.9rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem;
  box-shadow: var(--shadow);
}

.review-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #d7e6df;
  color: var(--accent-dark);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.review-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
  flex-wrap: wrap;
}

.review-meta strong {
  color: var(--ink);
}

.review-meta span {
  color: var(--muted);
  font-size: 0.85rem;
}

.review-rating {
  margin: 0.2rem 0 0.45rem;
}

.review-body p {
  margin: 0;
  color: var(--ink);
  line-height: 1.55;
}

.stars {
  display: inline-flex;
  gap: 0.08rem;
  letter-spacing: 0;
  color: #d8c3a0;
}

.star {
  font-size: 1.05rem;
  line-height: 1;
}

.star-full {
  color: #e2b340;
}

.star-half {
  background: linear-gradient(90deg, #e2b340 50%, #d8c3a0 50%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.star-empty {
  color: #d8c3a0;
}

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

@media (max-width: 860px) {
  body {
    background-attachment: scroll;
  }

  .admin-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 50;
    height: auto;
    max-height: none;
    overflow: visible;
    padding: 0.45rem 0.85rem;
    padding-top: max(0.45rem, env(safe-area-inset-top));
    gap: 0;
  }

  .sidebar-brand {
    padding: 0;
    gap: 0.55rem;
  }

  .sidebar-brand-name {
    display: none;
  }

  .sidebar-brand small {
    color: #e8f3ee;
    font-size: 0.95rem;
    font-weight: 600;
  }

  .brand-mark,
  .sidebar-logo {
    width: 34px;
    height: 34px;
    font-size: 1rem;
    border-radius: 9px;
  }

  .nav-toggle {
    display: inline-flex;
    width: 40px;
    height: 40px;
  }

  .sidebar-collapse {
    display: none;
    flex: none;
    padding: 0.5rem 0 0.35rem;
  }

  .sidebar.is-open {
    max-height: 100dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .sidebar.is-open .sidebar-collapse {
    display: flex;
  }

  .sidebar-nav {
    flex-direction: column;
    flex-wrap: nowrap;
  }

  .admin-main,
  .public-main {
    padding: 1.15rem 1rem max(2rem, env(safe-area-inset-bottom));
  }

  .public-body .public-main {
    padding: 1.25rem 1rem max(3rem, env(safe-area-inset-bottom));
  }

  .login-wrap {
    padding: 1rem;
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
  }

  .login-card {
    padding: 1.5rem 1.15rem;
  }

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

  .form-grid,
  .invoice-parties,
  .invoice-info-cols,
  .landing-split {
    grid-template-columns: 1fr;
  }

  .panel-title {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .panel-title .btn-row,
  .panel-title .product-picker {
    width: 100%;
  }

  .product-picker {
    min-width: 0;
  }

  .invoice-letterhead {
    flex-direction: column;
  }

  .invoice-letterhead-meta,
  .invoice-info-payment {
    text-align: left;
  }

  .invoice-hero,
  .invoice-body {
    padding: 1.15rem 1rem 1.25rem;
  }

  .landing-hero {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: stretch;
    min-height: 100vh;
    min-height: 100dvh;
    min-height: 100svh;
  }

  .landing-hero-content {
    width: 100%;
    padding-left: max(1.15rem, env(safe-area-inset-left));
    padding-right: max(1.15rem, env(safe-area-inset-right));
  }

  .review-toast {
    position: relative;
    inset: auto;
    width: auto;
    margin: 0 1rem max(1.15rem, env(safe-area-inset-bottom));
    z-index: 2;
  }

  .copy-row .btn {
    flex: 1 1 auto;
  }

  .panel .table-wrap table:not(.items-table):not(.stack-on-mobile) {
    min-width: 40rem;
  }

  .pay-methods .pay-method-action {
    grid-template-columns: 1fr;
  }

  .pay-methods .pay-method-action .btn {
    justify-self: stretch;
    width: 100%;
  }
}

@media (max-width: 720px) {
  .reviews-top-brand {
    flex: 1 1 auto;
    min-width: 0;
  }

  .reviews-top-brand img {
    height: 40px;
    max-width: calc(100vw - 6.5rem);
  }

  .reviews-top-toggle {
    display: inline-flex;
  }

  .reviews-top-nav {
    display: none;
    flex: 1 0 100%;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
  }

  .reviews-top.is-open .reviews-top-nav {
    display: flex;
  }

  .reviews-top-nav a {
    padding: 0.75rem 0;
    border-top: 1px solid var(--line);
  }
}

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

  .page-head {
    align-items: stretch;
  }

  .page-head .btn {
    width: 100%;
  }

  .landing-cta .btn,
  .invoice-toolbar .btn,
  .landing-contact .landing-cta .btn {
    width: 100%;
  }

  .landing-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .landing-footer-links a {
    overflow-wrap: anywhere;
  }

  .review-card {
    grid-template-columns: 1fr;
  }

  .review-avatar {
    width: 40px;
    height: 40px;
  }

  .captcha-code {
    width: 100%;
    max-width: 220px;
  }

  .captcha-field,
  .captcha-row .btn {
    width: 100%;
  }

  .landing-photos {
    grid-template-columns: 1fr;
  }

  .landing-photos img {
    height: 210px;
  }

  .totals-box {
    width: 100%;
  }

  .invoice-totals-row {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .invoice-totals-row .totals-box {
    width: 100%;
  }

  .invoice-next-service {
    padding: 0.35rem 0;
  }

  .items-table thead {
    display: none;
  }

  .items-table tbody tr {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.45rem 0.75rem;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--line);
  }

  .items-table tbody td {
    border: none;
    padding: 0;
    width: auto !important;
  }

  .items-table tbody td:first-child,
  .items-table tbody td:last-child {
    grid-column: 1 / -1;
  }

  .items-table tbody td:first-child::before {
    content: "Description";
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    font-weight: 600;
    margin-bottom: 0.25rem;
  }

  .items-table tbody td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    font-weight: 600;
    margin-bottom: 0.25rem;
  }

  .items-table .item-desc,
  .items-table .item-qty,
  .items-table .item-price {
    margin-bottom: 0;
  }

  .items-table .remove-item {
    width: 100%;
  }

  .stack-on-mobile thead {
    display: none;
  }

  .stack-on-mobile tbody,
  .stack-on-mobile tr,
  .stack-on-mobile td {
    display: block;
    width: 100%;
  }

  .stack-on-mobile tbody tr {
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--line);
  }

  .stack-on-mobile td {
    border: none;
    padding: 0.2rem 0;
  }

  .stack-on-mobile td:first-child {
    font-weight: 600;
  }

  .stack-on-mobile td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    font-weight: 600;
    margin-bottom: 0.1rem;
  }

  .stack-on-mobile td.num {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
  }

  .stack-on-mobile td.num[data-label]::before {
    display: inline;
    margin-bottom: 0;
    text-align: left;
  }

  .stack-on-mobile .btn {
    width: 100%;
    margin-top: 0.35rem;
  }

  .modal-footer {
    flex-wrap: wrap;
  }

  .modal-footer .btn {
    flex: 1 1 auto;
  }
}

@media (max-width: 860px) {
  .panel .table-wrap:has(.items-table),
  .panel .table-wrap:has(.stack-on-mobile) {
    overflow: visible;
  }
}

.invoice-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}

.pay-methods {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  text-align: left;
  display: grid;
  gap: 0.85rem;
}

.pay-methods li {
  display: grid;
  gap: 0.25rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.pay-methods .pay-method-action {
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 1rem;
}

.pay-methods .pay-method-action > div {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
}

.pay-methods strong {
  font-size: 0.95rem;
  color: var(--ink);
}

.pay-methods span {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.pay-methods .pay-method-action .btn {
  margin: 0;
  flex-shrink: 0;
  justify-self: end;
  align-self: center;
}

.pay-methods .pay-method-venmo {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr auto;
  align-items: stretch;
  align-content: stretch;
  padding: 1.2rem 1.35rem;
}

.venmo-pay {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem 1.75rem;
  align-items: start;
}

.venmo-pay-copy {
  display: grid;
  justify-items: start;
  align-content: start;
  gap: 0.2rem;
  min-width: 0;
  padding-top: 0.15rem;
}

.venmo-pay-copy strong {
  font-size: 1.05rem;
  font-weight: 700;
}

.pay-methods .venmo-handle {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 400;
  line-height: 1.35;
  white-space: nowrap;
}

.venmo-pay-copy .btn {
  margin-top: 0.7rem;
  justify-self: start;
  align-self: start;
  width: auto;
}

.pay-methods .pay-method-stripe {
  grid-template-columns: 1fr;
}

.stripe-pay {
  display: grid;
  justify-items: start;
  gap: 0.25rem;
  min-width: 0;
}

.stripe-pay strong {
  font-size: 1.05rem;
  font-weight: 700;
}

.admin-stripe-preview {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  color: #8a5a12;
  background: #fff6e5;
  border: 1px solid #f0d7a3;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  margin: 0.15rem 0 0.1rem;
}

.stripe-fee-note,
.stripe-fee-total {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.stripe-fee-total {
  font-weight: 600;
  color: var(--ink);
}

.stripe-pay-form {
  margin-top: 0.55rem;
}

.stripe-pay-form .btn {
  margin: 0;
}

.card-brand-logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  margin: 0.55rem 0 0;
  width: 100%;
}

.pay-method-card {
  align-content: stretch;
  grid-template-rows: 1fr auto;
}

.pay-method-venmo .card-brand-logos,
.pay-method-card .card-brand-logos {
  margin-top: auto;
  padding-top: 0.55rem;
  justify-self: stretch;
}

.card-brand-logo {
  display: block;
  width: 2.35rem;
  height: 1.4rem;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(26, 46, 40, 0.08);
}

.venmo-brand-logo {
  display: block;
  height: 1.4rem;
  width: auto;
  max-width: 100%;
}

.venmo-qr {
  margin: 0;
  display: grid;
  justify-items: center;
  gap: 0.45rem;
}

.venmo-qr-frame {
  display: block;
  padding: 0.65rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(26, 46, 40, 0.08);
  text-decoration: none;
  line-height: 0;
}

.venmo-qr-frame:hover {
  text-decoration: none;
  border-color: var(--accent);
}

.venmo-qr svg {
  display: block;
  width: 8.25rem;
  height: 8.25rem;
  shape-rendering: crispEdges;
}

.venmo-qr figcaption {
  margin: 0;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.3;
}

@media (max-width: 860px) {
  .pay-box {
    padding: 1rem 0.85rem;
  }

  .pay-methods .pay-method-venmo {
    padding: 1rem 0.95rem;
    overflow: hidden;
  }

  .pay-methods .venmo-pay {
    grid-template-columns: 1fr;
    gap: 0.85rem;
    justify-items: stretch;
  }

  .pay-methods .venmo-pay-copy {
    min-width: 0;
    max-width: 100%;
  }

  .pay-methods .venmo-handle {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .pay-methods .venmo-pay-copy .btn {
    width: 100%;
    max-width: 100%;
    justify-self: stretch;
    justify-content: center;
    margin-top: 0.55rem;
  }

  .pay-methods .pay-method-stripe {
    padding: 1rem 0.95rem;
  }

  .stripe-pay-form,
  .stripe-pay-form .btn {
    width: 100%;
    max-width: 100%;
  }

  .pay-methods .venmo-qr {
    justify-self: center;
    max-width: 100%;
  }

  .pay-methods .venmo-qr-frame {
    max-width: 100%;
  }

  .pay-methods .venmo-qr svg {
    width: 6.75rem;
    height: 6.75rem;
    max-width: 100%;
  }
}

.print-only {
  display: none;
}

@media print {
  @page {
    size: auto;
    margin: 0.4in;
  }

  html, body, main, .public-main, .admin-main, .invoice-sheet, .invoice-body, .table-wrap {
    background: #fff !important;
    min-height: 0 !important;
    height: auto !important;
    overflow: visible !important;
  }

  html, body {
    color: #111;
    width: auto;
    margin: 0 !important;
    padding: 0 !important;
  }

  body {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .no-print,
  .pay-box .btn,
  .sidebar,
  .nav-toggle,
  .reviews-top-toggle,
  .flash,
  .landing-footer,
  .invoice-toolbar,
  .invoice-review,
  .modal,
  #appConfirmModal,
  #appAlertModal,
  #appPaymentModal {
    display: none !important;
  }

  .print-only {
    display: inline;
    word-break: break-all;
  }

  .public-main,
  .admin-main {
    max-width: none !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .public-main,
  .admin-main {
    display: block !important;
  }

  .invoice-sheet {
    display: block !important;
    box-shadow: none !important;
    border: none;
    border-radius: 0;
    overflow: visible;
    animation: none !important;
    transform: none !important;
    width: 100%;
    max-width: none;
    margin: 0;
    page-break-inside: auto;
    break-inside: auto;
  }

  .table-wrap {
    overflow: visible !important;
    max-width: none;
  }

  .invoice-hero,
  .invoice-letterhead,
  .invoice-info-cols,
  .invoice-brand,
  .invoice-totals-row,
  .totals-box,
  .invoice-flag,
  .invoice-policy,
  .pay-box,
  .pay-methods,
  .pay-methods li,
  .venmo-pay,
  .venmo-qr,
  .stripe-pay {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .invoice-sheet h3,
  .invoice-payments h3,
  .invoice-policy h3,
  .pay-box h3 {
    break-after: avoid;
    page-break-after: avoid;
  }

  .invoice-hero {
    padding: 0 0 10px;
    margin: 0;
    background: none !important;
    color: #111 !important;
  }

  .invoice-letterhead {
    flex-direction: row;
    align-items: flex-start;
    padding-bottom: 8px;
    margin-bottom: 10px;
    border-bottom: 2px solid #333;
    gap: 12px;
  }

  .invoice-letterhead-meta {
    font-size: 10pt;
    color: #555;
    text-align: right;
  }

  .invoice-logo {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    background: #fff !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .invoice-brand-text {
    font-size: 9pt;
    color: #444;
  }

  .invoice-brand-text strong {
    font-size: 10pt;
    color: #111;
  }

  .invoice-hero h1 {
    font-family: var(--font);
    font-size: 18pt;
    line-height: 1.15;
    margin: 0 0 4px;
    color: #111;
  }

  .invoice-hero p,
  .invoice-message {
    font-size: 10pt;
    margin: 0 0 10px;
    color: #555;
    text-align: center;
  }

  .invoice-info-cols {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 2px;
  }

  .invoice-info-cols > div {
    padding-top: 0;
    border-top: none;
    font-size: 10pt;
    color: #111;
  }

  .invoice-info-cols h3 {
    font-size: 8pt;
    margin-bottom: 4px;
    color: #111;
  }

  .invoice-info-amount {
    font-size: 12pt;
  }

  .invoice-info-payment {
    text-align: right;
  }

  .invoice-meta {
    gap: 18px;
    margin-top: 8px;
    font-size: 11px;
    color: #111;
  }

  .invoice-meta div span {
    opacity: 1;
    color: #666;
  }

  .invoice-body {
    padding: 10px 0 0;
  }

  .invoice-parties {
    gap: 16px;
    margin-bottom: 12px;
  }

  .invoice-parties h3 {
    font-size: 8pt;
    margin-bottom: 0.06in;
  }

  .invoice-parties strong {
    font-size: 11pt;
  }

  .invoice-sheet table {
    font-size: 10pt;
    border-collapse: separate;
    border-spacing: 0;
    page-break-inside: auto;
    break-inside: auto;
  }

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

  .invoice-sheet tr,
  .invoice-sheet th,
  .invoice-sheet td {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .stack-on-mobile thead {
    display: table-header-group !important;
  }

  .stack-on-mobile tbody {
    display: table-row-group !important;
  }

  .stack-on-mobile tr {
    display: table-row !important;
    padding: 0;
    border: none;
  }

  .stack-on-mobile td,
  .stack-on-mobile th {
    display: table-cell !important;
    width: auto !important;
    padding: 0.08in 0.06in;
    border-bottom: 1px solid #ddd;
  }

  .stack-on-mobile td:first-child {
    font-weight: inherit;
  }

  .stack-on-mobile td[data-label]::before {
    display: none !important;
  }

  .stack-on-mobile td.num {
    text-align: right;
    white-space: nowrap;
  }

  .items-table thead {
    display: table-header-group !important;
  }

  .items-table tbody tr {
    display: table-row !important;
  }

  .items-table tbody td {
    display: table-cell !important;
  }

  .items-table tbody td:first-child::before,
  .items-table tbody td[data-label]::before {
    display: none !important;
  }

  .invoice-sheet th,
  .invoice-sheet td {
    padding: 0.08in 0.06in;
  }

  .invoice-sheet th.num,
  .invoice-sheet td.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
  }

  .totals-box {
    width: 2.6in;
    margin-top: 0.18in;
    margin-left: auto;
    font-size: 10pt;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .invoice-totals-row {
    display: grid;
    grid-template-columns: 1fr 2.6in;
    align-items: center;
    margin-top: 0.18in;
  }

  .invoice-totals-row .totals-box {
    margin-top: 0;
    width: 2.6in;
  }

  .invoice-next-service {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    text-align: center;
  }

  .invoice-next-service span {
    font-size: 10pt;
  }

  .invoice-next-service strong {
    font-size: 11pt;
  }

  .totals-box .totals-row {
    display: flex;
    justify-content: space-between;
    gap: 0.2in;
  }

  .totals-box .totals-row strong {
    text-align: right;
    font-variant-numeric: tabular-nums;
  }

  .totals-box .grand {
    font-size: 12pt;
  }

  .notes {
    margin-top: 0.18in;
    padding-top: 0.12in;
    font-size: 9pt;
    orphans: 3;
    widows: 3;
  }

  .invoice-flag {
    margin-top: 0.18in;
    padding: 0.08in 0.1in;
    border-radius: 0;
    font-size: 9pt;
  }

  .invoice-policy {
    margin-top: 0.18in;
    padding-top: 0.12in;
    font-size: 9pt;
  }

  .invoice-policy h3 {
    font-size: 10pt;
  }

  .pay-box {
    margin-top: 10px;
    padding: 8px 10px;
    text-align: left;
    border-radius: 0;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .pay-box h3 {
    font-size: 12pt;
    margin: 0 0 0.06in;
  }

  .pay-box p {
    margin: 0;
    font-size: 9pt;
  }

  .pay-box .amount {
    font-size: 16pt;
    margin: 0.08in 0 0.12in;
  }

  .pay-methods {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.12in;
    margin-top: 0.08in;
    align-items: stretch;
  }

  .pay-methods-with-card {
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
  }

  .pay-methods li {
    padding: 0.1in 0.12in;
    border-radius: 0;
    break-inside: avoid;
    page-break-inside: avoid;
    align-content: start;
    height: 100%;
  }

  .pay-methods strong {
    font-size: 10pt;
  }

  .pay-methods span {
    font-size: 8.5pt;
    line-height: 1.3;
  }

  .pay-methods .pay-method-venmo,
  .pay-methods .pay-method-card {
    padding: 0.1in 0.12in;
  }

  .venmo-pay {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.06in 0.08in;
    align-items: start;
    height: 100%;
  }

  .pay-methods-with-card .venmo-qr {
    align-self: start;
  }

  .pay-methods-with-card .venmo-qr svg {
    width: 0.58in;
    height: 0.58in;
  }

  .venmo-pay-copy {
    padding-top: 0;
  }

  .pay-methods .venmo-handle {
    font-size: 8pt;
    color: #5a7268;
    font-weight: 400;
    white-space: nowrap;
  }

  .venmo-qr {
    justify-items: center;
    gap: 0.03in;
  }

  .venmo-qr-frame {
    padding: 0.04in;
    border: 1px solid #c5d6cd;
    border-radius: 0;
    box-shadow: none;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .venmo-qr svg {
    width: 0.58in;
    height: 0.58in;
  }

  .venmo-qr figcaption {
    font-size: 7.5pt;
    font-weight: 700;
    color: #111;
  }

  .pay-methods .pay-method-stripe {
    grid-template-columns: 1fr;
  }

  .stripe-pay {
    gap: 0.04in;
  }

  .stripe-fee-note,
  .stripe-fee-total {
    font-size: 8pt;
  }

  .pay-methods .pay-method-venmo,
  .pay-methods .pay-method-card {
    grid-template-rows: 1fr auto;
    align-content: stretch;
  }

  .card-brand-logos {
    gap: 0.04in;
    margin: 0.06in 0 0;
    padding-top: 0.05in;
    justify-content: center;
    width: 100%;
  }

  .card-brand-logo {
    width: 0.42in;
    height: 0.25in;
    border-radius: 1px;
    box-shadow: none;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .venmo-brand-logo {
    height: 0.25in;
    width: auto;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}
