* {
  box-sizing: border-box;
}

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

body {
  background: var(--bg-elev);
}

.page-frame {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.site-header {
  display: flex;
  align-items: center;
  min-height: 88px;
  padding: var(--space-3) clamp(var(--space-4), 5vw, var(--space-8));
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.brand-link,
.brand-link:hover {
  display: inline-flex;
  border: 0;
}

.brand-logo {
  display: block;
  width: min(220px, 55vw);
  height: auto;
}

.site-main {
  display: grid;
  place-items: center;
  width: 100%;
  padding: var(--space-7) var(--space-4);
  background: var(--bg-blue);
}

.portal-card {
  width: min(720px, 100%);
  padding: clamp(var(--space-5), 6vw, var(--space-8));
  background: var(--bg);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-3);
}

.portal-card h1 {
  margin-bottom: var(--space-3);
  font-size: clamp(30px, 6vw, 48px);
  overflow-wrap: anywhere;
}

.portal-card-wide {
  width: min(820px, 100%);
}

.portal-copy {
  margin: 0 0 var(--space-5);
  color: var(--fg-muted);
  font: var(--t-body-lg);
}

.portal-form {
  display: grid;
  gap: var(--space-3);
}

.portal-form label {
  font: var(--t-body);
}

.portal-form input {
  width: 100%;
  min-height: 52px;
  padding: var(--space-3);
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  font: var(--t-body-lg);
}

.portal-form input:focus {
  outline: 3px solid var(--c425-sky);
  outline-offset: 2px;
}

.portal-form button,
.button-link,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  color: var(--fg-on-orange);
  background: var(--bg-orange);
  border: 0;
  border-radius: var(--radius-pill);
  font: var(--t-button);
  text-transform: uppercase;
}

.portal-form button:hover,
.button-link:hover {
  color: var(--fg-on-orange);
  background: var(--accent-hover);
}

.text-link {
  font: var(--t-body);
}

.property-list {
  display: grid;
  gap: var(--space-3);
  margin: 0 0 var(--space-5);
  padding: 0;
  list-style: none;
}

.property-list li {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-4);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.property-list span {
  color: var(--fg-muted);
}

.sign-out-form {
  margin: 0;
}

.secondary-button {
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border-strong);
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-5);
  padding: var(--space-3) clamp(var(--space-4), 5vw, var(--space-8));
  color: var(--fg-muted);
  background: var(--bg);
  border-top: 1px solid var(--border);
  font: var(--t-caption);
}

.footer-contact {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.site-footer a,
.site-footer a:hover {
  color: var(--fg-muted);
  border: 0;
}

/* Signed-in portal shell */
.portal-app {
  min-height: 100vh;
  padding: var(--space-4);
  background: color-mix(in srgb, var(--c425-mist) 42%, var(--bg-elev));
}

.portal-app-body {
  min-height: calc(100vh - 32px);
  display: flex;
  overflow: clip;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 24px 24px 0 0;
  box-shadow: var(--shadow-2);
}

.portal-aside {
  flex: 0 0 252px;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  padding: 20px 14px 16px;
  border-right: 1px solid var(--border);
}

.shell-logo,
.shell-logo:hover {
  display: inline-flex;
  padding: 0 var(--space-2);
  border: 0;
}

.shell-logo img {
  display: block;
  width: min(196px, 100%);
  height: auto;
}

.desktop-nav {
  display: grid;
  gap: 2px;
}

.desktop-nav a {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0 var(--space-3);
  color: var(--fg-muted);
  border: 0;
  border-radius: 10px;
  font-weight: 500;
}

.desktop-nav a:hover {
  color: var(--fg);
  background: var(--border);
}

.desktop-nav a[aria-current="page"] {
  color: var(--fg);
  background: var(--bg);
  box-shadow: 0 0 0 1px var(--border), var(--shadow-1);
  font-weight: 600;
}

.desktop-nav a > span:first-child {
  width: 20px;
  color: var(--c425-blue);
  font-size: 20px;
  text-align: center;
}

.desktop-nav .text-us-nav {
  min-height: 48px;
  margin-top: var(--space-4);
  justify-content: center;
  color: var(--fg-on-blue);
  background: var(--bg-blue);
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.desktop-nav .text-us-nav:hover {
  color: var(--fg-on-blue);
  background: var(--primary-hover);
}

.desktop-nav .text-us-nav > span:first-child {
  color: inherit;
}

.nav-badge {
  margin-left: auto;
  color: var(--c425-blue);
  font-size: 12px;
  font-weight: 600;
}

.aside-spacer {
  flex: 1 1 auto;
}

.office-card {
  display: grid;
  gap: var(--space-2);
  padding: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.office-card > span {
  color: var(--fg-muted);
  font-size: 13px;
  line-height: 1.35;
}

.contact-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.contact-pair a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--space-4);
  color: var(--fg-on-navy);
  background: var(--bg-navy);
  border: 0;
  border-radius: 10px;
  font-weight: 600;
}

.contact-pair a:last-child {
  color: var(--fg);
  background: color-mix(in srgb, var(--c425-blue) 10%, var(--bg));
}

.account-menu {
  position: relative;
}

.account-menu summary {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: var(--space-2);
  cursor: pointer;
  border-radius: 10px;
  list-style: none;
}

.account-menu summary::-webkit-details-marker,
.property-menu summary::-webkit-details-marker {
  display: none;
}

.account-initials {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-on-navy);
  background: var(--bg-navy);
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 700;
}

.account-identity {
  min-width: 0;
  display: grid;
  line-height: 1.3;
}

.account-identity strong,
.account-identity span {
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.account-menu form {
  padding: var(--space-2);
}

.account-menu button {
  width: 100%;
  min-height: 44px;
  cursor: pointer;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  font: var(--t-body-sm);
  font-weight: 700;
}

.portal-column {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.mobile-header,
.mobile-nav {
  display: none;
}

.portal-main {
  width: 100%;
  max-width: 1120px;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin: 0 auto;
  padding: 24px 28px 28px;
}

.property-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin: -24px -28px 0;
  padding: 14px 28px 12px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
}

.property-copy {
  min-width: 0;
  flex: 1 1 auto;
  display: grid;
  line-height: 1.25;
}

.property-copy small {
  color: var(--fg-muted);
  font-size: 12px;
  font-weight: 600;
}

.property-copy strong {
  overflow-wrap: anywhere;
}

.property-menu {
  position: relative;
  flex: 0 0 auto;
}

.property-menu summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0 12px 0 14px;
  cursor: pointer;
  color: var(--fg);
  background: color-mix(in srgb, var(--c425-blue) 10%, var(--bg));
  border-radius: 10px;
  font-weight: 600;
  list-style: none;
}

.property-menu summary span {
  min-width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  color: var(--fg-on-navy);
  background: var(--bg-navy);
  border-radius: 6px;
  font-size: 12px;
}

.property-menu [role="menu"] {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 360px;
  max-width: calc(100vw - 48px);
  display: grid;
  gap: 2px;
  padding: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-3);
}

.property-menu [role="menuitem"] {
  min-height: 52px;
  display: grid;
  align-content: center;
  padding: 8px 10px;
  color: var(--fg);
  border: 0;
  border-radius: 10px;
  line-height: 1.3;
}

.property-menu [role="menuitem"][aria-current="true"] {
  background: color-mix(in srgb, var(--c425-blue) 10%, var(--bg));
}

.property-menu [role="menuitem"] span {
  color: var(--fg-muted);
  font-size: 13px;
}

.page-intro {
  display: grid;
  gap: 2px;
}

.page-intro h1 {
  margin: 0;
  font-size: 34px;
}

.page-intro p {
  margin: 0;
  color: var(--fg-muted);
}

.panel {
  padding: 22px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.panel h2,
.after-that h3 {
  margin: 0;
  font: var(--t-body-lg);
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}

.next-visit-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: 22px;
  color: var(--fg-on-navy);
  background: var(--bg-navy);
  border-radius: var(--radius-lg);
}

.next-visit-card h2 {
  margin: var(--space-1) 0 0;
  color: var(--fg-on-navy);
  font: 600 34px/1.08 var(--font-display-alt);
  text-transform: none;
  letter-spacing: 0;
}

.next-visit-card p {
  color: inherit;
}

.visit-chip {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border: 1px solid var(--border-on-dark);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
}

.visit-chip > span {
  width: 7px;
  height: 7px;
  background: var(--c425-sky);
  border-radius: var(--radius-pill);
}

.visit-service,
.window-note {
  margin: 0;
  color: color-mix(in srgb, var(--c425-white) 82%, var(--c425-navy)) !important;
  font-size: 14px;
}

.arrival-window {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.arrival-window span {
  color: color-mix(in srgb, var(--c425-white) 82%, var(--c425-navy));
  font-size: 13px;
  font-weight: 600;
}

.arrival-window strong {
  font: 700 22px/1.2 var(--font-display-alt);
}

.arrival-bar {
  display: grid;
  gap: 6px;
}

.arrival-bar > div {
  position: relative;
  height: 10px;
  overflow: hidden;
  background: var(--border-on-dark);
  border-radius: var(--radius-pill);
}

.arrival-bar > div span {
  position: absolute;
  top: 0;
  bottom: 0;
  background: var(--c425-sky);
  border-radius: var(--radius-pill);
}

.arrival-bar small {
  display: flex;
  justify-content: space-between;
  color: color-mix(in srgb, var(--c425-white) 82%, var(--c425-navy));
}

.crew-status {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  background: var(--border-on-dark);
  border-radius: 14px;
}

.crew-status span {
  color: color-mix(in srgb, var(--c425-white) 82%, var(--c425-navy));
  font-size: 13px;
}

.after-that {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-2);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-on-dark);
}

.after-that h3 {
  color: color-mix(in srgb, var(--c425-white) 82%, var(--c425-navy));
  font-size: 13px;
}

.compact-visit {
  display: grid;
  grid-template-columns: minmax(130px, auto) minmax(140px, 1fr) auto;
  gap: var(--space-3);
  align-items: center;
}

.compact-visit small {
  color: color-mix(in srgb, var(--c425-white) 82%, var(--c425-navy));
}

.empty-visit .contact-pair {
  width: min(320px, 100%);
}

.home-grid,
.visits-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
  align-items: start;
}

.request-panel,
.history-panel,
.home-owe-panel,
.home-agreements-panel,
.before-panel,
.upcoming-panel,
.how-panel,
.change-panel {
  display: grid;
  gap: var(--space-3);
}

.home-panel-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
}

.home-panel-heading a,
.agreements-link {
  border: 0;
  font-size: 13px;
  font-weight: 600;
}

.home-owe-panel > p,
.home-agreements-panel > p {
  margin: 0;
  color: var(--fg-muted);
  font-size: 14px;
}

.home-owe-total {
  font: 700 42px/1 var(--font-display-alt);
}

.home-bill-list,
.home-agreement-list {
  display: grid;
}

.home-bill-list > div {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.home-bill-list > div:last-child {
  border-bottom: 0;
}

.home-bill-list span,
.home-agreement-list > div {
  display: grid;
  gap: 2px;
}

.home-bill-list small,
.home-agreement-list span:not(.agreement-chip),
.home-agreement-list small {
  color: var(--fg-muted);
  font-size: 13px;
}

.home-agreement-list > div {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.home-agreement-list > div:last-child {
  border-bottom: 0;
}

/* Billing */
.billing-owe,
.payments-panel {
  display: grid;
  gap: var(--space-4);
}

.billing-owe > h2,
.payments-panel > h2,
.owe-heading h2,
.agreement-section > h2,
.past-agreements > h2 {
  margin: 0;
  font: var(--t-body-lg);
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}

.owe-heading > div {
  display: grid;
  gap: 2px;
}

.owe-heading h2 {
  color: var(--fg-muted);
  font-size: 15px;
}

.owe-heading strong {
  font: 700 48px/1 var(--font-display-alt);
}

.bill-list {
  padding: 4px 14px;
  background: var(--bg-elev);
  border-radius: 12px;
}

.bill-list > div {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.bill-list > div:last-child {
  border-bottom: 0;
}

.bill-list span {
  display: grid;
  gap: 2px;
}

.bill-list small {
  color: var(--fg-muted);
  font-size: 13px;
}

.office-action,
.billing-question,
.empty-state {
  margin: 0;
  color: var(--fg-muted);
}

.compact-contact {
  width: min(320px, 100%);
}

.other-property-bills {
  display: grid;
  gap: var(--space-2);
}

.other-property-bills p {
  margin: 0;
  padding: 12px 14px;
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  font-size: 14px;
}

.agreements-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-self: start;
}

.table-scroll {
  overflow-x: auto;
}

.payments-table {
  min-width: 660px;
}

.payments-header,
.payments-row {
  display: grid;
  grid-template-columns: 120px minmax(220px, 1fr) 150px 110px;
  gap: var(--space-3);
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.payments-header {
  min-height: 36px;
  color: var(--fg-muted);
  font-size: 12px;
  font-weight: 600;
}

.payments-row {
  min-height: 54px;
}

.payments-header > :last-child,
.payments-row > :last-child {
  text-align: right;
}

.payments-row > :nth-child(3) {
  color: var(--fg-muted);
}

/* Agreements */
.agreement-section,
.agreement-grid,
.agreement-card,
.past-agreements {
  display: grid;
  gap: var(--space-4);
}

.agreement-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.agreement-card > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}

.agreement-card > header > div {
  display: grid;
  gap: var(--space-2);
}

.agreement-card h3 {
  margin: 0;
  font: 700 20px/1.2 var(--font-display-alt);
}

.agreement-chip {
  width: max-content;
  display: inline-flex;
  padding: 3px 10px;
  color: var(--c425-blue);
  background: color-mix(in srgb, var(--c425-blue) 10%, var(--bg));
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
}

.agreement-chip.hold {
  color: #8a4206;
  background: #ffe9d6;
}

.agreement-price {
  max-width: 220px;
  color: var(--fg-muted);
  text-align: right;
  font-size: 14px;
}

.agreement-office-note {
  margin: 0;
  padding: 12px 14px;
  color: #5c2c04;
  background: #fff6ee;
  border: 1px solid #f5c9a0;
  border-radius: 12px;
}

.agreement-dates {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: var(--space-2);
  margin: 0;
}

.agreement-dates > div {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  background: var(--bg-elev);
  border-radius: 12px;
}

.agreement-dates dt {
  color: var(--fg-muted);
  font-size: 12px;
}

.agreement-dates dd {
  margin: 0;
  font-weight: 700;
}

.included-services {
  display: grid;
  gap: var(--space-2);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}

.included-services h4 {
  margin: 0;
  font-size: 14px;
}

.included-services > div {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.included-services > div:last-child {
  border-bottom: 0;
}

.included-services span,
.included-services p {
  color: var(--fg-muted);
  font-size: 13px;
}

.included-services p {
  margin: 0;
}

.past-agreement-list {
  display: grid;
}

.past-agreement-list > div {
  min-height: 56px;
  display: grid;
  grid-template-columns: minmax(200px, 1fr) 170px 100px;
  gap: var(--space-3);
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.past-agreement-list > div:last-child {
  border-bottom: 0;
}

.past-agreement-list span {
  color: var(--fg-muted);
}

.agreements-empty p {
  margin: 0;
}

.request-panel header {
  display: grid;
  gap: 2px;
}

.request-panel p,
.history-panel p,
.before-panel p,
.upcoming-panel p,
.change-panel p {
  margin: 0;
  color: var(--fg-muted);
  font-size: 14px;
}

.service-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
}

.service-tiles a {
  min-height: 88px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: var(--space-2);
  color: var(--fg);
  background: var(--bg-elev);
  border: 0;
  border-radius: 12px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
}

.service-tiles a:hover {
  background: var(--border);
}

.service-tiles a span {
  color: var(--c425-blue);
  font-size: 24px;
}

.history-list,
.upcoming-list {
  display: grid;
}

.history-list > div,
.upcoming-list > div {
  min-height: 58px;
  display: grid;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.history-list > div {
  grid-template-columns: minmax(120px, auto) 1fr;
}

.history-list > div:last-child,
.upcoming-list > div:last-child {
  border-bottom: 0;
}

.history-list time,
.upcoming-list time,
.upcoming-list span {
  color: var(--fg-muted);
  font-size: 13px;
}

/* History */
.history-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  padding: 14px 18px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.history-filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.history-filter-group a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 600;
}

.history-filter-group a[aria-current="true"] {
  color: var(--fg-on-navy);
  background: var(--bg-navy);
  border-color: var(--bg-navy);
}

.service-filters {
  padding-left: 20px;
  border-left: 1px solid var(--border);
}

.history-summary {
  margin: 0 0 0 auto;
  color: var(--fg-muted);
  font-size: 14px;
}

.history-cards {
  display: grid;
  gap: var(--space-3);
}

.history-card {
  display: flex;
  gap: 16px 24px;
  padding: 20px 22px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.history-card > time {
  flex: 0 0 120px;
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.history-card > time strong {
  font: 700 24px/1.25 var(--font-display-alt);
}

.history-card > time span,
.history-invoice,
.history-help {
  color: var(--fg-muted);
  font-size: 14px;
}

.history-card-body {
  min-width: 0;
  flex: 1 1 auto;
  display: grid;
  gap: var(--space-2);
}

.history-card-body > header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 16px;
}

.history-card h2 {
  margin: 0;
  font: 700 18px/1.3 var(--font-display-alt);
  text-transform: none;
  letter-spacing: 0;
}

.history-status {
  display: inline-flex;
  padding: 3px 10px;
  color: #1d6b44;
  background: #e3f4ea;
  border: 0;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.history-status.balance-due {
  color: #8a4206;
  background: #ffe9d6;
}

.history-status.included {
  color: var(--c425-blue);
  background: color-mix(in srgb, var(--c425-blue) 10%, var(--bg));
}

.history-invoice,
.history-help {
  margin: 0;
}

.history-help {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.history-help a {
  border: 0;
  font-weight: 600;
}

.history-empty {
  padding: 28px;
  color: var(--fg-muted);
  background: var(--bg);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  text-align: center;
}

.before-panel .contact-pair,
.change-panel .contact-pair {
  width: min(320px, 100%);
}

.upcoming-list > div {
  grid-template-columns: minmax(140px, auto) 1fr auto;
}

.how-panel {
  grid-column: span 1;
}

.how-panel ol {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.how-panel li {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 14px;
  background: var(--bg-elev);
  border-radius: 14px;
}

.how-panel li > span {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-on-navy);
  background: var(--bg-navy);
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 700;
}

.how-panel li p {
  margin: 0;
  color: var(--fg-muted);
  font-size: 13px;
}

/* Request service */
.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;
}

.request-alert {
  padding: 13px 16px;
  color: #7a2618;
  background: color-mix(in srgb, var(--c425-orange) 16%, var(--bg));
  border: 1px solid color-mix(in srgb, var(--c425-orange) 45%, var(--border));
  border-radius: 12px;
  font-weight: 650;
}

.request-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 320px);
  gap: var(--space-4);
  align-items: start;
}

.service-request-form {
  display: grid;
  gap: 0;
  padding: 0 24px;
}

.service-request-form fieldset {
  min-width: 0;
  margin: 0;
  padding: 22px 0;
  border: 0;
  border-bottom: 1px solid var(--border);
}

.service-request-form legend {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 0;
  color: var(--fg);
  font: 700 17px/1.3 var(--font-display-alt);
}

.service-request-form legend > span,
.request-next li > span {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-on-navy);
  background: var(--bg-navy);
  border-radius: var(--radius-pill);
  font: 700 12px/1 var(--font-body);
}

.request-options {
  display: grid;
  gap: 9px;
}

.property-options,
.service-options,
.timing-options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.request-options > label,
.contact-options > label:not(.mobile-number) {
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.request-options input,
.contact-options input[type="radio"] {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin: 0;
  accent-color: var(--c425-blue);
}

.request-options label:has(input:checked),
.contact-options label:has(input:checked) {
  background: color-mix(in srgb, var(--c425-blue) 8%, var(--bg));
  border-color: color-mix(in srgb, var(--c425-blue) 55%, var(--border));
}

.request-options .invalid-option,
.contact-options .invalid-option {
  border-color: color-mix(in srgb, var(--c425-orange) 55%, var(--border));
}

.property-options label > span {
  min-width: 0;
  display: grid;
  line-height: 1.25;
}

.property-options small,
.field-note {
  color: var(--fg-muted);
  font-size: 12px;
}

.request-textarea textarea {
  width: 100%;
  min-height: 132px;
  padding: 13px 14px;
  resize: vertical;
  color: var(--fg);
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  font: var(--t-body);
}

.request-textarea textarea:focus,
.mobile-number input:focus {
  outline: 3px solid var(--c425-sky);
  outline-offset: 2px;
}

.field-note {
  display: block;
  margin-top: 6px;
}

.contact-options {
  display: grid;
  grid-template-columns: 120px 120px minmax(180px, 1fr);
  gap: 9px;
  align-items: end;
}

.mobile-number {
  display: grid;
  gap: 5px;
  color: var(--fg-muted);
  font-size: 12px;
  font-weight: 600;
}

.mobile-number input {
  width: 100%;
  min-height: 50px;
  padding: 10px 12px;
  color: var(--fg);
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  font: var(--t-body);
}

.request-submit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  padding: 22px 0;
}

.request-submit button {
  min-height: 48px;
  padding: 0 24px;
  cursor: pointer;
  color: var(--fg-on-orange);
  background: var(--bg-orange);
  border: 0;
  border-radius: var(--radius-pill);
  font: var(--t-button);
  text-transform: uppercase;
}

.request-submit > span {
  color: var(--fg-muted);
  font-size: 13px;
}

.request-next {
  position: sticky;
  top: 76px;
  display: grid;
  gap: 18px;
}

.request-next h2 {
  margin: 0;
  font: 700 20px/1.2 var(--font-display-alt);
}

.request-next ol {
  display: grid;
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.request-next li {
  display: flex;
  gap: 11px;
}

.request-next li div {
  display: grid;
  gap: 3px;
}

.request-next p {
  margin: 0;
  color: var(--fg-muted);
  font-size: 13px;
  line-height: 1.4;
}

.request-sent {
  width: min(680px, 100%);
  display: grid;
  justify-items: center;
  gap: 12px;
  margin: 28px auto;
  padding: 44px 28px;
  text-align: center;
}

.sent-check {
  width: 54px;
  height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-on-navy);
  background: var(--bg-navy);
  border-radius: var(--radius-pill);
  font-size: 28px;
}

.request-sent h1,
.request-sent p {
  margin: 0;
}

.request-sent p {
  color: var(--fg-muted);
  font: var(--t-body-lg);
}

.sent-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
}

.empty-property {
  width: min(680px, 100%);
  margin: var(--space-8) auto;
}

.empty-property .contact-pair {
  width: min(320px, 100%);
  margin-top: var(--space-5);
}

.portal-app > .site-footer {
  border: 1px solid var(--border);
  border-top: 1px solid var(--border);
  border-radius: 0 0 24px 24px;
  box-shadow: var(--shadow-2);
}

@media (max-width: 800px) {
  .portal-app {
    padding: 0;
  }

  .portal-app-body {
    min-height: auto;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .portal-aside {
    display: none;
  }

  .mobile-header {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: 10px var(--space-4);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
  }

  .mobile-header .shell-logo {
    padding: 0;
  }

  .mobile-header .shell-logo img {
    width: 154px;
  }

  .mobile-account summary {
    padding: var(--space-1);
  }

  .mobile-account[open] {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 20;
    width: min(300px, calc(100vw - 16px));
    padding: var(--space-2);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-3);
  }

  .mobile-account > div {
    display: grid;
    padding: var(--space-2);
    line-height: 1.3;
  }

  .mobile-account > div span {
    color: var(--fg-muted);
    overflow-wrap: anywhere;
    font-size: 12px;
  }

  .portal-main {
    padding: var(--space-4) var(--space-3) var(--space-5);
  }

  .property-bar {
    top: 0;
    margin: calc(-1 * var(--space-4)) calc(-1 * var(--space-3)) 0;
    padding: 10px var(--space-3);
  }

  .property-menu [role="menu"] {
    position: fixed;
    top: 126px;
    right: var(--space-3);
    left: var(--space-3);
    width: auto;
    max-width: none;
  }

  .page-intro h1 {
    font-size: 30px;
  }

  .next-visit-card h2 {
    font-size: 28px;
  }

  .home-grid,
  .visits-info-grid {
    grid-template-columns: 1fr;
  }

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

  .request-next {
    position: static;
  }

  .how-panel ol {
    grid-template-columns: 1fr;
  }

  .mobile-nav {
    position: sticky;
    bottom: 0;
    z-index: 10;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    padding: 6px 6px max(8px, env(safe-area-inset-bottom));
    background: var(--bg);
    border-top: 1px solid var(--border);
  }

  .mobile-nav a {
    position: relative;
    min-height: 52px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--fg-muted);
    border: 0;
    font-size: 11px;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
  }

  .mobile-nav a[aria-current="page"] {
    color: var(--c425-blue);
    font-weight: 700;
  }

  .mobile-nav a > span {
    font-size: 20px;
    line-height: 1;
  }

  .mobile-nav small {
    position: absolute;
    top: 0;
    left: calc(50% + 8px);
    padding: 1px 4px;
    color: var(--fg);
    background: var(--bg-orange);
    border-radius: 5px;
    font-size: 9px;
  }

  .portal-app > .site-footer {
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
    border-radius: 0;
    box-shadow: none;
  }
}

@media (max-width: 640px) {
  .site-header,
  .site-footer {
    justify-content: center;
    text-align: center;
  }

  .site-main {
    padding: var(--space-5) var(--space-3);
  }

  .portal-card {
    border-radius: var(--radius-lg);
  }

  .portal-form button,
  .button-link,
  .secondary-button {
    width: 100%;
  }

  .footer-contact {
    justify-content: center;
  }

  .property-menu summary {
    padding: 0 10px;
    font-size: 13px;
  }

  .compact-visit,
  .upcoming-list > div,
  .history-list > div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

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

  .property-options,
  .service-options,
  .timing-options,
  .contact-options {
    grid-template-columns: 1fr;
  }

  .service-request-form {
    padding: 0 18px;
  }

  .request-submit {
    align-items: stretch;
    flex-direction: column;
  }

  .agreement-card > header,
  .included-services > div {
    align-items: flex-start;
    flex-direction: column;
  }

  .agreement-price {
    text-align: left;
  }

  .past-agreement-list > div {
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 10px 0;
  }

  .panel,
  .next-visit-card {
    padding: 18px;
  }

  .history-filters {
    align-items: flex-start;
    padding: 14px;
  }

  .service-filters {
    padding: 12px 0 0;
    border-top: 1px solid var(--border);
    border-left: 0;
  }

  .history-summary {
    width: 100%;
    margin-left: 0;
  }

  .history-card {
    flex-direction: column;
    padding: 18px;
  }

  .history-card > time {
    flex-basis: auto;
  }
}

@media (max-width: 400px) {
  .mobile-nav a {
    font-size: 10px;
  }
}
