:root {
  --gold: #00685e;
  --gold-dark: #00685e;
  --ink: #1f1f1f;
  --muted: #53575a;
  --line: #d9e1df;
  --surface: #ffffff;
  --paper: #f4f6f6;
  --green: #00685e;
  --blue: #00685e;
  --highlight: #ffa300;
  --radius: 12px;
  --display: "Copperplate Gothic Light", "Copperplate Gothic", Copperplate, "Copperplate Light", Georgia, serif;
  color-scheme: light;
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

a {
  color: inherit;
}

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

.app-shell {
  min-height: 100vh;
  max-width: 520px;
  margin: 0 auto;
  background: linear-gradient(180deg, color-mix(in srgb, var(--gold) 9%, transparent), transparent 260px);
}

.loading,
.error {
  min-height: 100vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
  padding: 32px;
  text-align: center;
}

.loading img {
  width: 108px;
  height: 108px;
  border-radius: 28px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  padding-top: max(16px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  font-weight: 800;
}

.company-tagline {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.badge {
  border: 1px solid color-mix(in srgb, var(--gold) 30%, transparent);
  border-radius: 999px;
  color: var(--gold-dark);
  background: color-mix(in srgb, var(--gold) 10%, transparent);
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero {
  padding: 28px 20px 20px;
  text-align: center;
}

.avatar {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  border: 3px solid var(--gold);
  background: white;
  object-fit: cover;
  box-shadow: 0 10px 28px rgba(35, 35, 35, 0.12);
}

.agent-name {
  margin: 14px 0 2px;
  font-family: var(--display);
  font-size: 30px;
  line-height: 1.05;
  font-weight: 400;
  color: var(--gold);
}

.agency {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.tier {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 9px 18px;
  border: 1px solid rgba(35, 35, 35, 0.15);
  border-radius: 999px;
  background: white;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tier-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--highlight);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--highlight) 22%, transparent);
}

.section {
  padding: 0 20px 24px;
}

.section h2 {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.action {
  min-height: 96px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  box-shadow: 0 2px 10px rgba(35, 35, 35, 0.04);
}

.action strong {
  display: block;
  margin-bottom: 4px;
}

.action span {
  color: var(--muted);
  font-size: 12px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.metric {
  padding: 16px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
}

.metric strong {
  display: block;
  color: var(--gold);
  font-size: 28px;
}

.metric span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.partnership,
.timeline-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 2px 10px rgba(35, 35, 35, 0.04);
}

.partnership {
  padding: 16px;
}

.partnership-row {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
}

.bar {
  height: 8px;
  margin: 12px 0;
  border-radius: 999px;
  background: #ebe7de;
  overflow: hidden;
}

.bar > span {
  display: block;
  height: 100%;
  width: 68%;
  background: linear-gradient(90deg, var(--gold), var(--highlight));
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 12px;
  padding: 14px;
}

.date {
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 10px;
  background: color-mix(in srgb, var(--gold) 9%, transparent);
  color: var(--gold-dark);
  font-weight: 850;
}

.date span {
  display: block;
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}

.inspection-title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 800;
}

.inspection-meta {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.privacy-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.footer {
  padding: 8px 20px calc(36px + env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.footer p {
  margin: 0;
}

.footer a {
  color: var(--gold-dark);
}

.brand-logo {
  display: block;
  height: 44px;
  width: auto;
  max-width: 100%;
}

.install-card {
  position: relative;
  margin: 0 20px 24px;
  padding: 16px 44px 16px 16px;
  border-radius: var(--radius);
  background: var(--gold);
  color: #ffffff;
}

.install-card h2 {
  margin: 0 0 6px;
  font-size: 15px;
}

.install-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
}

.install-button {
  display: none;
  margin-top: 12px;
  padding: 10px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--highlight);
  color: #232323;
  font: inherit;
  font-weight: 700;
}

.install-card.can-install .install-button {
  display: inline-block;
}

.install-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: #ffffff;
  font-size: 22px;
  line-height: 1;
}

.share-glyph {
  display: inline-block;
  width: 12px;
  height: 14px;
  margin: 0 1px -2px;
  border: 1.5px solid currentColor;
  border-top: 0;
  border-radius: 0 0 2px 2px;
  position: relative;
}

.share-glyph::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -6px;
  width: 1.5px;
  height: 11px;
  background: currentColor;
  transform: translateX(-50%);
}

.share-glyph::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -6px;
  width: 5px;
  height: 5px;
  border-left: 1.5px solid currentColor;
  border-top: 1.5px solid currentColor;
  transform: translateX(-50%) rotate(45deg);
}

@media (min-width: 760px) {
  body {
    background:
      radial-gradient(circle at top left, color-mix(in srgb, var(--highlight) 22%, transparent), transparent 360px),
      var(--paper);
  }

  .app-shell {
    min-height: calc(100vh - 48px);
    margin: 24px auto;
    border: 1px solid var(--line);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(35, 35, 35, 0.12);
  }
}

[hidden] {
  display: none !important;
}

.inspection-body {
  min-width: 0;
}

.inspection-sub {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 13px;
}

.inspection-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.doc-link {
  display: inline-block;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--gold-dark);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.doc-link.primary {
  border-color: var(--gold);
  background: var(--gold);
  color: #ffffff;
}

.show-all {
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--gold);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.pin-screen {
  display: grid;
  gap: 14px;
  padding: calc(40px + env(safe-area-inset-top)) 24px 40px;
}

.pin-logo {
  width: 220px;
  max-width: 80%;
  height: auto;
}

.pin-screen h1 {
  margin: 12px 0 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: 26px;
  color: var(--gold);
  text-wrap: balance;
}

.pin-intro {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.pin-form {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.pin-form label {
  font-size: 13px;
  font-weight: 700;
}

.pin-form input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  font-size: 24px;
  letter-spacing: 0.4em;
  text-align: center;
}

.pin-form input:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

.pin-help {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.pin-status {
  min-height: 1.2em;
  margin: 0;
  color: #b3261e;
  font-size: 13px;
  font-weight: 700;
}

.pin-button {
  margin-top: 4px;
  padding: 14px;
  border: 0;
  border-radius: 999px;
  background: var(--gold);
  color: #ffffff;
  font: inherit;
  font-weight: 700;
}

.pin-button:disabled {
  opacity: 0.6;
}

.email-help {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--highlight) 14%, var(--surface));
  font-size: 13px;
  line-height: 1.45;
}

.email-help p {
  margin: 0;
}

.email-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.email-address {
  font-weight: 700;
  overflow-wrap: anywhere;
  user-select: all;
}

.copy-button,
.change-pin,
.pin-cancel {
  padding: 6px 14px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  background: var(--surface);
  color: var(--gold);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.change-pin {
  margin-top: 14px;
  font-size: 12px;
}

.pin-cancel {
  padding: 12px;
  border-color: var(--line);
  color: var(--muted);
}

.saved-note {
  margin: 0;
  padding: 10px 16px;
  background: var(--gold);
  color: #ffffff;
  font-weight: 700;
  text-align: center;
}

.invoice-screen {
  display: grid;
  gap: 16px;
  padding: 20px 16px 40px;
}

.invoice-actions {
  display: grid;
  gap: 8px;
}

.invoice-sheet {
  padding: 24px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: #1f1f1f;
  font-size: 14px;
}

.invoice-head {
  display: grid;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--gold);
}

.invoice-logo {
  width: 220px;
  max-width: 100%;
  height: auto;
}

.invoice-company p {
  margin: 0;
  color: #53575a;
  font-size: 12px;
  line-height: 1.5;
}

.invoice-company p:first-child {
  color: #1f1f1f;
  font-weight: 700;
}

.invoice-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 12px;
}

.invoice-title-row h1 {
  margin: 0;
  font-family: var(--display);
  font-size: 30px;
  font-weight: 400;
  color: var(--gold);
  letter-spacing: 0.04em;
}

.invoice-stamp {
  padding: 6px 12px;
  border: 2px solid currentColor;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.invoice-stamp.paid {
  color: #00685e;
}

.invoice-stamp.due {
  color: #9a5b00;
}

.invoice-meta {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 14px;
  margin: 0 0 18px;
}

.invoice-meta dt {
  color: #53575a;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.invoice-meta dd {
  margin: 0;
}

.invoice-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.invoice-table th,
.invoice-table td {
  padding: 10px 0;
  border-bottom: 1px solid #d9e1df;
  text-align: left;
  vertical-align: top;
}

.invoice-table thead th {
  color: #53575a;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.invoice-table .num {
  text-align: right;
  white-space: nowrap;
}

.invoice-table ul {
  margin: 0;
  padding-left: 18px;
}

.invoice-table tfoot th,
.invoice-table tfoot td {
  font-weight: 700;
}

.invoice-table tfoot tr:last-child th,
.invoice-table tfoot tr:last-child td {
  border-bottom: 0;
  color: var(--gold);
  font-size: 16px;
}

.invoice-note {
  margin: 18px 0 0;
  color: #53575a;
  font-size: 12px;
}

@media print {
  @page { margin: 0.6in; }
  body, .app-shell { background: #ffffff !important; }
  .app-shell { max-width: none; margin: 0; border: 0; box-shadow: none; }
  .no-print, .preview-bar { display: none !important; }
  .invoice-screen { padding: 0; }
  .invoice-sheet { border: 0; padding: 0; }
}

.search-box {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.search-box input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}

.search-box input:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

.search-result {
  margin: 0;
  min-height: 0;
  color: var(--muted);
  font-size: 12px;
}

.search-result:empty {
  display: none;
}

.search-empty {
  margin: 4px 0 0;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.brand-logo {
  height: 38px;
}

.schedule-pill {
  flex: none;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--gold);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.agent-bar {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 4px 14px;
  padding: 18px 20px 16px;
}

.agent-photo,
.inspector-photo {
  display: inline-grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  background: var(--surface);
  object-fit: cover;
}

.agent-photo {
  grid-row: span 2;
}

.agent-photo.initials,
.inspector-photo.initials {
  background: var(--gold);
  color: #ffffff;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.04em;
}

.agent-bar .agent-name {
  margin: 0;
  font-size: 24px;
  text-align: left;
}

.agent-bar .agency {
  margin: 2px 0 0;
  font-size: 13px;
}

.tier-chip {
  grid-column: 2;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tier-chip .tier-dot {
  width: 8px;
  height: 8px;
  box-shadow: none;
}

.inspector-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.inspector-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.inspector-name {
  margin: 0;
  font-family: var(--display);
  font-size: 20px;
  color: var(--gold);
}

.inspector-title {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.inspector-card .action {
  min-height: 0;
  box-shadow: none;
  background: var(--paper);
}

.partnership {
  margin-top: 10px;
}

.search-slot {
  padding: 14px 20px 0;
}

.search-slot .search-box {
  margin-bottom: 8px;
}

.hero .avatar.initials {
  display: inline-grid;
  place-items: center;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  border: 3px solid var(--gold);
  background: var(--gold);
  color: #ffffff;
  font-size: 30px;
  font-weight: 700;
}

.section .inspector-head {
  margin-bottom: 12px;
}

.stats-note {
  margin: 10px 2px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.share-note {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--highlight) 16%, var(--surface));
  font-size: 13px;
  line-height: 1.45;
}
