body:has(.portal-page) {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.portal-page {
  flex: 1;
  margin-block: clamp(30px, 4vw, 54px) 70px;
  line-height: 1.6;
}
.portal-page h1, .portal-page h2, .portal-page h3, .portal-page h4, .portal-page h5 {
  font-family: var(--body);
  font-weight: 400;
  line-height: 1.2;
}
.portal-page h1 {
  font-size: clamp(32px, 4vw, 45px);
  letter-spacing: -.035em;
  margin: 0 0 20px;
}
.portal-page h2 { font-size: 23px; letter-spacing: -.025em; margin: 0 0 22px; }
.portal-description { color: var(--muted); font-size: 13px; line-height: 1.75; }
.portal-page section, .portal-page > form {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: clamp(19px, 3vw, 28px);
  margin: 24px 0;
  min-width: 0;
}
.portal-page form { display: grid; gap: 20px; }
.portal-field { display: block; font-size: 12px; font-weight: 500; line-height: 1.65; min-width: 0; }
.portal-page input:not([type="hidden"]) {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 46px;
  border: 1px solid #d6d1ca;
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  font: 400 13px/1.55 var(--body);
  padding: 12px 13px;
  margin-top: 8px;
}
.portal-page input:focus {
  border-color: var(--brand);
  outline: 2px solid #a74d4a20;
  outline-offset: 1px;
}
.portal-page fieldset {
  min-width: 0;
  margin: 0;
  border: 1px solid var(--stone-line);
  border-radius: 8px;
  background: #f8f7f5;
  padding: 10px 15px 15px;
}
.portal-page fieldset label + label { margin-top: 14px; }
.portal-page legend { padding: 0 6px; font-size: 13px; font-weight: 600; }
.portal-field-grid, .contact-fieldsets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.portal-page button {
  justify-self: start;
  border: 1px solid var(--brand);
  border-radius: 8px;
  padding: 13px 20px;
  min-height: 46px;
  color: var(--white);
  background: var(--brand);
  font: 500 13px/1.25 var(--body);
}
.portal-page button:hover { background: var(--brand-hover); }
.portal-page button:disabled { opacity: .65; }
.portal-page a { color: #7e403d; text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.portal-page ul { list-style: none; padding: 0; margin: 0; }
.portal-page .actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .9fr);
  width: min(100%, 965px);
  margin: clamp(14px, 3vw, 38px) auto 0;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.auth-panel {
  min-width: 0;
  min-height: 380px;
  padding: clamp(30px, 4.5vw, 56px);
  align-content: center;
}
.auth-panel .portal-description { margin: 0 0 25px; }
.auth-panel form button { width: 100%; }
.auth-panel > p:last-of-type:has(a) { font-size: 12px; margin-top: 20px; }
.auth-panel .prefill-note { margin-bottom: 18px; }
.auth-confirmation > p { font-size: 13px; line-height: 1.75; }
.auth-confirmation .actions { margin-top: 24px; font-size: 12px; }
.auth-visual { position: relative; min-width: 0; background: var(--stone); }
.auth-visual img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.portal-dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  align-items: start;
  gap: 22px;
}
.portal-dashboard-layout section { margin: 0; }
.portal-dashboard > .prefill-note { font-size: 12px; }
.property-views { display: flex; gap: 6px; margin: -6px 0 18px; }
.property-views a { padding: 6px 12px; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; text-decoration: none; }
.property-views a:hover { border-color: var(--brand); }
.property-views a[aria-current] { background: var(--stone); color: var(--ink); }
.property-list li { padding: 16px 0; border-bottom: 1px solid var(--line); }
.property-list li:first-child { padding-top: 0; }
.property-list li:last-child { border: 0; padding-bottom: 0; }
.portal-page .property-name { color: var(--ink); font-size: 16px; font-weight: 600; }
.property-status { display: flex; flex-wrap: wrap; gap: 6px; margin: 9px 0 11px; }
.property-status span { border: 1px solid var(--line); border-radius: 100px; padding: 3px 8px; color: var(--muted); font-size: 10px; }
.property-status .status-complete { background: #eef1ea; border-color: #d5dfd0; color: #50624c; }
.property-actions { font-size: 12px; }
.property-actions form { display: inline-flex; }
.property-actions button { font-size: 11px; min-height: 36px; padding: 8px 11px; }
.archive-confirmation { max-width: 530px; }
.archive-confirmation .actions { margin-top: 20px; }

@media (max-width: 900px) {
  .portal-dashboard-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .portal-field-grid, .contact-fieldsets, .auth-layout { grid-template-columns: minmax(0, 1fr); }
  .auth-layout { max-width: 460px; margin-top: 0; }
  .auth-panel { min-height: 0; padding: 24px 20px; }
  .auth-visual { display: none; }
}
