:root {
  color-scheme: light;
  --bg: #f4ecdf;
  --panel: #fffaf1;
  --panel-strong: #ffffff;
  --ink: #211915;
  --muted: #74655b;
  --line: #ded1be;
  --brand: #9f5f35;
  --brand-dark: #6f3c22;
  --soft: #f2e5d4;
  --danger: #b91c1c;
  --shadow: 0 18px 45px rgba(61, 39, 25, 0.13);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top left, rgba(159, 95, 53, 0.12), transparent 34%), linear-gradient(180deg, #fffaf1 0%, var(--bg) 100%);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.portal-shell {
  width: min(1040px, 100%);
  margin: 0 auto;
  padding: 28px 18px 44px;
}

.hero {
  padding: 10px 0 22px;
}

.customer-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.customer-brand img {
  width: 62px;
  height: 62px;
  border-radius: 16px;
  object-fit: cover;
  border: 1px solid rgba(159, 95, 53, 0.18);
  box-shadow: 0 14px 32px rgba(61, 39, 25, 0.16);
}

.customer-brand strong,
.customer-brand span {
  display: block;
}

.customer-brand strong {
  font-size: 1.08rem;
}

.customer-brand span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.9rem;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.18;
}

h1 {
  font-size: 2.35rem;
}

h2 {
  font-size: 1.85rem;
}

h3 {
  font-size: 1.35rem;
}

.hero-copy {
  max-width: 680px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.65;
}

.panel,
.card,
.summary-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 18px;
}

.portal-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.tab-btn {
  background: #fffaf1;
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 11px 12px;
}

.tab-btn.is-active {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  border-color: var(--brand);
  color: #fff;
}

.lookup-form,
.appointment-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 14px;
  align-items: end;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

input,
textarea,
select,
button {
  width: 100%;
  border-radius: 8px;
  font: inherit;
}

input,
textarea,
select {
  border: 1px solid var(--line);
  background: #fffdf8;
  color: var(--ink);
  padding: 13px 14px;
  font-weight: 650;
  outline: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(159, 95, 53, 0.14);
}

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%;
  background-repeat: no-repeat;
  background-size: 6px 6px, 6px 6px;
  padding-right: 34px;
}

button {
  border: 0;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  padding: 14px 18px;
  font-weight: 900;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.message {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: 8px;
  background: #fef2f2;
  color: var(--danger);
  font-weight: 750;
}

.message.ok {
  background: var(--soft);
  color: var(--brand-dark);
}

.result {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.line-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.line-panel p {
  margin: 0;
}

.job-list-section {
  margin-top: 18px;
}

.job-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.portal-result-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.portal-result-summary div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.portal-result-summary span,
.portal-result-summary small {
  color: var(--muted);
  font-size: 0.82rem;
}

.portal-result-summary strong {
  color: var(--brand-dark);
  font-size: 1.15rem;
  word-break: break-word;
}

.job-list-item {
  display: grid;
  gap: 4px;
  width: 100%;
  background: #fffaf1;
  color: var(--ink);
  border: 1px solid var(--line);
  text-align: left;
  padding: 14px;
}

.job-list-item:hover,
.job-list-item:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(159, 95, 53, 0.12);
}

.job-list-item.is-latest {
  border-color: var(--brand);
  background: #fff7e8;
}

.job-list-item strong {
  font-size: 1rem;
}

.job-list-item span,
.job-list-item small {
  color: var(--muted);
  font-weight: 750;
}

.summary-card,
.card {
  padding: 20px;
}

.summary-head,
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.badge {
  display: inline-flex;
  min-width: 90px;
  justify-content: center;
  border-radius: 999px;
  background: var(--soft);
  color: var(--brand-dark);
  padding: 8px 12px;
  font-weight: 900;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 20px 0 0;
}

.detail-grid div {
  min-width: 0;
  padding: 12px;
  border-radius: 8px;
  background: #fffaf1;
  border: 1px solid var(--line);
}

.detail-grid .wide {
  grid-column: span 4;
}

dt {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

dd {
  margin: 5px 0 0;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.map-link {
  display: inline-flex;
  margin-top: 14px;
  color: var(--brand-dark);
  font-weight: 900;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.05fr) minmax(0, 1.1fr);
  gap: 18px;
}

.large-text {
  margin: 12px 0 6px;
  font-size: 1.65rem;
  font-weight: 950;
}

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

.appointment-form {
  grid-template-columns: 1fr 1fr;
}

.appointment-form .wide,
.appointment-form button {
  grid-column: span 2;
}

.claim-card .muted {
  margin: 10px 0 16px;
  line-height: 1.55;
}

.claim-form textarea {
  min-height: 120px;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.image-tile {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fffaf1;
}

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

.image-tile figcaption {
  padding: 9px 10px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.empty {
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-weight: 750;
}

@media (max-width: 780px) {
  .portal-shell {
    padding: 20px 12px 34px;
  }

  h1 {
    font-size: 2rem;
  }

  .lookup-form,
  .appointment-form,
  .line-panel,
  .two-column,
  .detail-grid,
  .image-grid,
  .portal-result-summary,
  .portal-tabs {
    grid-template-columns: 1fr;
  }

  .detail-grid .wide,
  .appointment-form .wide,
  .appointment-form button {
    grid-column: auto;
  }

  .summary-head,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .badge {
    width: fit-content;
  }
}
