:root {
  color-scheme: light;
  --ink: #18231f;
  --muted: #5f6f68;
  --line: #ccd8d3;
  --surface: #ffffff;
  --surface-soft: #f8fbfa;
  --band: #eef4f1;
  --band-strong: #dfeae6;
  --rail: #22342d;
  --accent: #0d6f61;
  --accent-strong: #09584d;
  --accent-soft: #dcefeb;
  --contrast: #8b1d4f;
  --contrast-soft: #f7e7ef;
  --info-soft: #e5f0f7;
  --warning-soft: #fff3d8;
  --shadow: 0 10px 28px rgba(19, 43, 35, 0.08);
  --shadow-strong: 0 18px 44px rgba(19, 43, 35, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(180deg, rgba(248, 251, 250, 0.98) 0, rgba(238, 244, 241, 0.98) 320px),
    linear-gradient(90deg, rgba(13, 111, 97, 0.06), rgba(139, 29, 79, 0.04));
  color: var(--ink);
  line-height: 1.5;
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

.site-header {
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 28px rgba(19, 43, 35, 0.08);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 12px 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0;
  font-weight: 800;
  color: var(--ink);
  text-decoration: none;
}

.site-logo {
  height: 40px;
  width: auto;
  max-width: min(220px, calc(100vw - 40px));
  aspect-ratio: auto;
  object-fit: contain;
  display: block;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--rail);
  color: #ffffff;
  font-size: 0.82rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 7px 10px;
  border-radius: 8px;
  color: #34453f;
  font-weight: 700;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a:focus,
.site-nav a.active {
  background: var(--band);
  color: var(--accent-strong);
}

.site-nav form {
  margin: 0;
}

.page {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 32px 18px 64px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 700;
}

.breadcrumb a,
.breadcrumb span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
}

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

.breadcrumb a:hover,
.breadcrumb a:focus {
  text-decoration: underline;
}

.breadcrumb a::after {
  content: "/";
  margin-left: 8px;
  color: #98a8a2;
  text-decoration: none;
}

.toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.page-hero {
  align-items: center;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(220, 239, 235, 0.82), rgba(255, 255, 255, 0.98) 54%),
    var(--surface);
  box-shadow: var(--shadow);
}

.dashboard-hero {
  border-left: 6px solid var(--accent);
}

.detail-hero {
  border-left: 6px solid var(--contrast);
}

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

h1 {
  font-size: 2.1rem;
  line-height: 1.1;
  margin-bottom: 8px;
}

h2 {
  font-size: 1.2rem;
  margin-bottom: 10px;
}

h3 {
  margin-bottom: 8px;
}

.kicker {
  margin-bottom: 6px;
  color: var(--contrast);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.page-description {
  max-width: 62ch;
  color: var(--muted);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 12px;
}

.section-title::before {
  content: "";
  width: 8px;
  height: 22px;
  border-radius: 8px;
  background: var(--accent);
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-heading .section-title {
  margin-bottom: 0;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

button.small,
.button.small {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 0.94rem;
}

button:hover,
.button:hover,
button:focus,
.button:focus {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  box-shadow: 0 6px 14px rgba(13, 111, 97, 0.18);
  transform: translateY(-1px);
}

button.secondary,
.button.secondary {
  background: var(--surface);
  color: var(--accent);
}

button.secondary:hover,
button.secondary:focus,
.button.secondary:hover,
.button.secondary:focus {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

button.danger,
.button.danger {
  border-color: #b42318;
  background: #b42318;
  color: #ffffff;
}

button.danger:hover,
button.danger:focus,
.button.danger:hover,
.button.danger:focus {
  border-color: #8f1b13;
  background: #8f1b13;
  color: #ffffff;
}

nav button {
  min-height: 38px;
  padding: 7px 10px;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.record-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.action-panel {
  justify-content: flex-end;
  max-width: 520px;
}

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 4px;
}

.search-form,
.form-panel,
.content-block,
.record-card,
.followup-strip {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.search-form {
  display: flex;
  gap: 10px;
  padding: 10px;
  margin-bottom: 22px;
  align-items: center;
}

.search-form input {
  min-height: 46px;
  border-color: transparent;
  background: var(--surface-soft);
}

input,
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #b8c3bf;
  border-radius: 8px;
  font: inherit;
  background: #ffffff;
  color: var(--ink);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(13, 111, 97, 0.16);
  outline: none;
}

textarea {
  min-height: 120px;
}

.search-form input {
  flex: 1;
}

.filter-panel {
  display: grid;
  gap: 14px;
}

.filter-panel-heading {
  margin-bottom: 0;
}

.search-form-jobs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  align-items: end;
  margin-bottom: 0;
}

.filter-field {
  display: grid;
  gap: 6px;
}

.filter-field span {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
}

.filter-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.filter-actions > * {
  flex: 0 0 auto;
}

.active-filter-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.active-filter-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: #33443e;
  font-size: 0.92rem;
  font-weight: 800;
}

.records {
  display: grid;
  gap: 12px;
}

.onboarding-panel {
  margin-bottom: 14px;
}

.onboarding-intro {
  margin-bottom: 14px;
}

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

.onboarding-step {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.onboarding-step-complete {
  background: linear-gradient(180deg, #ffffff, var(--accent-soft));
}

.onboarding-step-title {
  margin-bottom: 6px;
  font-weight: 800;
}

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

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

.metric-card {
  min-height: 92px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric-card:nth-child(2) {
  border-color: #d9bdd0;
  background: linear-gradient(180deg, #ffffff, var(--contrast-soft));
}

.metric-card:nth-child(3) {
  border-color: #bdd4de;
  background: linear-gradient(180deg, #ffffff, var(--info-soft));
}

.metric-value,
.metric-label {
  display: block;
}

.metric-value {
  margin-bottom: 2px;
  color: var(--accent-strong);
  font-size: 2rem;
  line-height: 1;
  font-weight: 800;
}

.metric-label {
  color: var(--muted);
  font-weight: 700;
}

.record-card,
.content-block,
.followup-strip {
  padding: 16px;
}

.record-card {
  border-left: 4px solid var(--accent);
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.record-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-strong);
  transform: translateY(-1px);
}

.record-card h2,
.record-card h3 {
  margin-bottom: 6px;
}

.record-card-header,
.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.panel-heading {
  align-items: center;
  margin-bottom: 12px;
}

.panel-heading h2 {
  margin-bottom: 0;
}

.client-card {
  display: grid;
  gap: 10px;
}

.property-line {
  margin-bottom: 0;
  color: #33443e;
  font-weight: 700;
}

.property-card {
  border-left-color: var(--contrast);
}

.timeline-card {
  border-left-color: #3e7486;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 3px 8px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.9rem;
  font-weight: 800;
}

.status-chip-scheduled {
  background: var(--warning-soft);
  color: #7b5210;
}

.status-chip-in_progress {
  background: var(--info-soft);
  color: #2e6170;
}

.status-chip-completed {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.status-chip-cancelled {
  background: #f9e3e1;
  color: #8f1b13;
}

.status-chip-draft {
  background: #ece8ff;
  color: #4b3388;
}

.status-chip-issued {
  background: var(--warning-soft);
  color: #7b5210;
}

.status-chip-paid {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.status-chip-external {
  background: #e8f1fb;
  color: #1f5686;
}

.status-chip-internal-type {
  background: #edf3ea;
  color: #285d39;
}

.status-chip-external-type {
  background: #e6f0fb;
  color: #1f5686;
}

.status-chip-current {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.status-chip-on_schedule {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.status-chip-due_soon {
  background: var(--warning-soft);
  color: #7b5210;
}

.status-chip-overdue {
  background: #f9e3e1;
  color: #8f1b13;
}

.status-chip-not_configured {
  background: #eceff3;
  color: #55616d;
}

.status-chip-no_schedule {
  background: #eceff3;
  color: #55616d;
}

.invoice-card {
  border-left-color: #4b3388;
}

.reminder-card-overdue {
  border-left-color: #8f1b13;
}

.reminder-card-due_soon {
  border-left-color: #c98f24;
}

.accent-panel {
  border-left: 4px solid var(--contrast);
}

.record-card a {
  font-weight: 800;
  text-decoration: none;
}

.record-card a:hover,
.record-card a:focus {
  text-decoration: underline;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.75fr);
  gap: 20px;
  align-items: start;
}

.billing-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.58fr);
  gap: 20px;
  align-items: start;
  margin-bottom: 20px;
}

.billing-layout > div:first-child {
  display: grid;
  gap: 16px;
}

.billing-sidebar {
  display: grid;
  gap: 16px;
}

.billing-summary {
  border-left: 4px solid var(--accent);
}

.payment-status {
  border-left: 4px solid #3e7486;
}

.billing-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.billing-details div {
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.billing-details dt {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.billing-details dd {
  margin: 0;
  font-weight: 800;
}

.billing-contact-form p {
  margin-bottom: 14px;
}

.billing-contact-form label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
}

.billing-reference {
  color: var(--muted);
  font-size: 0.9rem;
}

.plan-picker {
  display: grid;
  gap: 18px;
}

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

.plan-tile {
  display: grid;
  gap: 12px;
  min-height: 190px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  box-shadow: var(--shadow);
}

.plan-tile:hover,
.plan-tile:focus {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--accent);
}

.plan-tile.selected {
  border-color: var(--accent);
  background: linear-gradient(180deg, #ffffff, var(--accent-soft));
  box-shadow: var(--shadow-strong);
}

.plan-tile-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.plan-name {
  display: block;
  font-size: 1.1rem;
  font-weight: 900;
}

.plan-badge,
.plan-check {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 900;
}

.plan-badge {
  margin-top: 6px;
  background: var(--contrast-soft);
  color: var(--contrast);
}

.plan-check {
  visibility: hidden;
  background: var(--accent);
  color: #ffffff;
  white-space: nowrap;
}

.plan-tile.selected .plan-check {
  visibility: visible;
}

.plan-price {
  color: var(--accent-strong);
  font-size: 2rem;
  line-height: 1;
  font-weight: 900;
}

.plan-price small {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 800;
}

.plan-note {
  color: var(--muted);
  font-weight: 700;
}

.checkout-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(260px, 0.7fr);
  gap: 18px;
  align-items: start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(229, 240, 247, 0.82), rgba(255, 255, 255, 0.98)),
    var(--surface);
}

.paypal-checkout-box {
  min-height: 150px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.paypal-plan-panel {
  display: none;
}

.paypal-plan-panel.active {
  display: block;
}

.plan-manager {
  border-left: 4px solid var(--accent);
}

.active-plan-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, var(--accent-soft));
}

.active-plan-card > div {
  display: grid;
  gap: 10px;
}

.management-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.cancel-subscription-panel {
  padding: 14px;
  border: 1px solid #f3b8b2;
  border-radius: 8px;
  background: #fff7f6;
}

.cancel-subscription-panel summary {
  color: #8f1b13;
  font-weight: 900;
  cursor: pointer;
}

.cancel-subscription-panel p {
  margin: 10px 0 12px;
}

button:disabled,
.button.disabled {
  border-color: #b8c3bf;
  background: var(--surface-soft);
  color: var(--muted);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

button:disabled:hover,
button:disabled:focus {
  border-color: #b8c3bf;
  background: var(--surface-soft);
  color: var(--muted);
  box-shadow: none;
  transform: none;
}

.detail-grid {
  gap: 22px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 18px;
  align-items: start;
}

.guide-grid {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.guide-toc {
  position: sticky;
  top: 88px;
  display: grid;
  gap: 8px;
}

.guide-toc a {
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface-soft);
  font-weight: 700;
  text-decoration: none;
}

.guide-toc a:hover,
.guide-toc a:focus {
  background: var(--accent-soft);
}

.guide-content {
  display: grid;
  gap: 22px;
}

.guide-content section {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.guide-content section:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.guide-content ul {
  margin: 0;
  padding-left: 22px;
}

.guide-content li + li {
  margin-top: 6px;
}

.compact-list {
  display: grid;
  gap: 6px;
}

.compact-list a {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface-soft);
  font-weight: 700;
  text-decoration: none;
}

.compact-list a:hover,
.compact-list a:focus {
  background: var(--accent-soft);
}

.compact-list-jobs {
  gap: 10px;
}

.dashboard-subsection {
  display: grid;
  gap: 10px;
}

.dashboard-subsection + .dashboard-subsection {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.panel-heading-inline {
  margin-bottom: 0;
}

.panel-heading-inline h3 {
  margin: 0;
}

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

.compact-status-item {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.compact-status-item-pending {
  border-left: 4px solid var(--accent);
}

.compact-status-item-recent {
  border-left: 4px solid #3d8a63;
}

.compact-status-item-due-soon {
  border-left: 4px solid #d59b1d;
}

.compact-status-item-overdue {
  border-left: 4px solid #b53f3f;
  background: #fff5f5;
}

.compact-status-item h3 {
  margin: 0;
}

.compact-status-item-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.compact-status-item p {
  margin: 0;
}

.compact-status-item a {
  text-decoration: none;
}

.compact-status-item a:hover,
.compact-status-item a:focus {
  text-decoration: underline;
}

.compact-status-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.compact-status-actions form {
  margin: 0;
}

.compact-status-actions .button,
.compact-status-actions button {
  min-height: 38px;
}

.field-help {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.compact-job-item {
  display: grid !important;
  gap: 3px;
}

.compact-job-time {
  color: var(--contrast);
  font-size: 0.84rem;
  font-weight: 900;
  text-transform: uppercase;
}

.compact-job-title {
  color: var(--ink);
  font-weight: 800;
}

.compact-job-meta {
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 700;
}

.job-day-list {
  display: grid;
  gap: 18px;
}

.job-date-nav,
.job-status-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.job-date-nav {
  margin: -6px 0 18px;
}

.job-status-form {
  margin-top: 12px;
}

.job-status-actions .job-status-form {
  margin-top: 0;
}

.job-status-actions .job-status-form button {
  width: 100%;
}

.job-card {
  display: grid;
  gap: 14px;
}

.job-card-scheduled {
  border-left-color: #c88714;
}

.job-card-in_progress {
  border-left-color: #3e7486;
}

.job-card-completed {
  border-left-color: var(--accent);
}

.job-card-cancelled {
  border-left-color: #b42318;
}

.job-card-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.job-card-time {
  display: grid;
  gap: 4px;
  min-width: 92px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.job-card-time .kicker {
  margin-bottom: 0;
}

.job-card-time strong {
  font-size: 1.05rem;
  line-height: 1.1;
}

.job-card-title {
  display: grid;
  gap: 4px;
}

.job-service-type {
  margin-bottom: 0;
  color: var(--contrast);
  font-size: 0.86rem;
  font-weight: 900;
  text-transform: uppercase;
}

.job-card-title h3 {
  margin-bottom: 0;
}

.job-card-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.job-card-details div {
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.job-card-details dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.job-card-details dd {
  margin: 0;
  font-weight: 800;
}

.property-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.property-info-grid div {
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.property-info-grid dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.property-info-grid dd {
  margin: 0;
  font-weight: 800;
}

.narrow {
  width: min(720px, 100%);
  margin: 0 auto;
}

.job-form-hero {
  margin-bottom: 16px;
}

.form-panel {
  padding: 20px;
}

.form-panel p {
  margin-bottom: 14px;
}

.form-field {
  display: grid;
  gap: 6px;
}

.field-errors ul {
  margin: 0;
  padding-left: 18px;
  color: #8f1b13;
  font-weight: 700;
}

.form-sections {
  display: grid;
  gap: 18px;
}

fieldset {
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

legend {
  padding: 0 6px;
  font-weight: 800;
}

.form-panel label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
}

.field-grid,
.test-grid,
.paper-grid,
.signature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.test-grid {
  grid-template-columns: 1fr 1.2fr 1.2fr;
}

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

.form-hint {
  margin-bottom: 12px;
  color: var(--muted);
}

.status-panel {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
}

.status-panel p:last-child {
  margin-bottom: 0;
}

.status-panel-signed {
  border-color: #abd7cf;
  background: var(--accent-soft);
}

.invoice-panel-external {
  border-left: 4px solid #1f5686;
}

.checkbox-field {
  align-content: start;
}

.checkbox-field input[type="checkbox"] {
  margin-right: 8px;
}

.meta-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
}

.meta-list span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
}

.preserve {
  white-space: pre-wrap;
}

.signature-pad-panel {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.signature-pad {
  display: block;
  width: 100%;
  min-height: 280px;
  border: 2px dashed #9ab3aa;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(248, 251, 250, 0.9), rgba(255, 255, 255, 1));
  touch-action: none;
}

.signature-actions {
  justify-content: flex-start;
}

.signature-image {
  display: block;
  width: min(100%, 520px);
  max-width: 100%;
  height: auto;
  max-height: none;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  aspect-ratio: auto;
  object-fit: contain;
}

.inline-form {
  display: inline;
}

.invoice-sheet {
  display: grid;
  gap: 16px;
}

.invoice-sheet-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.invoice-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.invoice-brand-logo {
  display: block;
  width: 92px;
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
}

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

.invoice-panel {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.invoice-panel h3 {
  margin-bottom: 6px;
}

.invoice-totals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  min-width: 280px;
}

.invoice-totals div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.invoice-totals dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.invoice-totals dd {
  margin: 0;
  font-weight: 800;
}

.invoice-line-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
}

.callout {
  padding: 12px;
  border-left: 4px solid var(--contrast);
  background: var(--contrast-soft);
  border-radius: 8px;
  font-weight: 700;
}

.follow-up-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.follow-up-callout p {
  margin: 4px 0 0;
  font-weight: 600;
}

.messages {
  margin-bottom: 16px;
}

.message {
  padding: 10px 12px;
  background: var(--accent-soft);
  border: 1px solid #abd7cf;
  border-radius: 8px;
}

.notice-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid #ead29c;
  border-radius: 8px;
  background: var(--warning-soft);
}

.notice-banner p {
  margin: 0;
  font-weight: 700;
}

.notice-banner-warning {
  border-color: #ead29c;
  background: var(--warning-soft);
}

.danger-panel {
  border-color: #f3b8b2;
  background: #fff7f6;
}

.empty-state {
  padding: 14px;
  border: 1px dashed #aebdb7;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
  font-weight: 700;
}

.empty-state-with-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.empty-state-with-action p {
  margin: 0;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.photo-panel {
  box-shadow: var(--shadow);
}

.service-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 180px);
  align-items: flex-start;
  gap: 12px;
}

figure {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.service-photo-card {
  width: 180px !important;
  max-width: 180px !important;
}

.service-photo-link {
  display: block;
}

img {
  display: block;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.service-photo-thumb {
  width: 180px !important;
  max-width: 180px !important;
  height: 120px !important;
  max-height: 120px !important;
  aspect-ratio: auto !important;
  object-fit: cover !important;
}

.photo-detail {
  display: grid;
  gap: 14px;
}

.photo-detail-image {
  width: auto;
  max-width: 100%;
  max-height: 72vh;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: contain;
}

figcaption {
  padding: 8px 10px;
  color: var(--muted);
}

.paper-form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  box-shadow: var(--shadow-strong);
}

.paper-header {
  border-bottom: 2px solid var(--ink);
  margin-bottom: 18px;
  padding-bottom: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 18px;
}

th,
td {
  padding: 8px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--info-soft);
  font-weight: 800;
}

.invite-row {
  display: grid;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.invite-row:first-of-type {
  border-top: 0;
}

@media (max-width: 980px) {
  .toolbar {
    align-items: stretch;
  }

  .actions,
  .record-actions,
  .form-actions,
  .management-actions {
    align-items: stretch;
    justify-content: flex-start;
  }

  .actions .button,
  .form-actions .button,
  .form-actions button,
  .management-actions .button,
  .record-actions .button {
    flex: 1 1 180px;
    white-space: nowrap;
  }

  .search-form-jobs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .compact-status-actions .button,
  .compact-status-actions button {
    flex: 1 1 180px;
    white-space: nowrap;
  }

  .filter-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .filter-actions > * {
    flex: 1 1 180px;
  }

  .job-status-actions {
    align-items: stretch;
  }

  .job-status-actions .job-status-form {
    flex: 1 1 220px;
  }

  .onboarding-step {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .onboarding-step .button {
    white-space: nowrap;
  }

  .record-card-header,
  .panel-heading {
    gap: 14px;
  }

  .section-heading {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .content-grid,
  .dashboard-grid {
    gap: 16px;
  }

  .invoice-sheet-header {
    align-items: stretch;
    flex-direction: column;
  }

  .invoice-totals {
    min-width: 0;
  }
}

@media (max-width: 760px) {
  .site-header-inner,
  .toolbar,
  .search-form {
    align-items: stretch;
    flex-direction: column;
  }

  .site-nav {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .brand {
    justify-content: flex-start;
  }

  .site-nav a,
  .site-nav button {
    width: auto;
    white-space: nowrap;
  }

  .actions .button {
    width: 100%;
  }

  .record-card-header,
  .panel-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .section-heading,
  .empty-state-with-action,
  .notice-banner {
    align-items: stretch;
    flex-direction: column;
  }

  .onboarding-step {
    align-items: flex-start;
    flex-direction: column;
  }

  .action-panel {
    max-width: none;
  }

  .page {
    padding-top: 20px;
  }

  .page-hero {
    padding: 18px;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .billing-layout {
    grid-template-columns: 1fr;
  }

  .billing-details,
  .pricing-grid,
  .checkout-panel {
    grid-template-columns: 1fr;
  }

  .search-form-jobs,
  .job-card-summary,
  .job-card-details,
  .property-info-grid {
    grid-template-columns: 1fr;
  }

  .filter-actions {
    justify-content: stretch;
  }

  .filter-actions .button,
  .filter-actions button {
    width: 100%;
  }

  .active-plan-card {
    flex-direction: column;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .guide-grid {
    grid-template-columns: 1fr;
  }

  .guide-toc {
    position: static;
  }

  .service-photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  .service-photo-card {
    width: 100% !important;
    max-width: 100% !important;
  }

  .service-photo-thumb {
    width: 100% !important;
    max-width: 100% !important;
  }

  .field-grid,
  .test-grid,
  .paper-grid,
  .signature-grid {
    grid-template-columns: 1fr;
  }

  .invoice-grid,
  .invoice-totals {
    grid-template-columns: 1fr;
  }

  .invoice-line-item {
    flex-direction: column;
  }
}

@media (max-width: 420px) {
  .service-photo-card {
    width: 100% !important;
    max-width: 100% !important;
  }
}

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 40px;
  padding: 20px 24px 28px;
}

.site-footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.95rem;
}

.site-footer-nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.site-footer-nav a {
  color: #34453f;
  font-weight: 700;
}

.site-footer-nav a:hover,
.site-footer-nav a:focus {
  color: var(--accent-strong);
}

.legal-page .page-hero {
  margin-bottom: 20px;
}

.legal-content {
  display: grid;
  gap: 20px;
}

.legal-content section {
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}

.legal-content section:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

@media print {
  body {
    background: #ffffff;
  }

  .site-header,
  .site-footer,
  .no-print,
  .messages {
    display: none;
  }

  .page {
    width: 100%;
    padding: 0;
  }

  .paper-form {
    border: 0;
    border-radius: 0;
    padding: 0;
  }

  .signature-image {
    width: min(100%, 420px);
    max-height: none;
    page-break-inside: avoid;
  }

  .invoice-sheet,
  .invoice-grid,
  .invoice-totals {
    gap: 12px;
  }

  .invoice-sheet-header,
  .invoice-grid {
    display: block;
  }

  .invoice-panel,
  .invoice-totals div {
    margin-bottom: 12px;
    break-inside: avoid;
  }

  a {
    color: inherit;
    text-decoration: none;
  }
}
