body[data-customer-portal] {
  min-height: 100vh;
  overflow-x: hidden;
}

body[data-customer-portal] .app-header-inner,
body[data-customer-portal] .app-shell,
body[data-customer-portal] .app-footer {
  width: min(1040px, calc(100% - 32px));
}

.portal-header-return {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: min(420px, 54vw);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px 8px 14px;
  background: #fff;
  color: #4f4543;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(91, 64, 61, .06);
  transition: border-color .18s ease, color .18s ease, box-shadow .18s ease;
}

.portal-header-return:hover {
  border-color: #d8bab3;
  color: var(--brand-dark);
  box-shadow: 0 10px 28px rgba(91, 64, 61, .1);
}

.portal-header-return:focus-visible,
.portal-link:focus-visible,
body[data-customer-portal] button:focus-visible,
body[data-customer-portal] .button:focus-visible,
body[data-customer-portal] input:focus-visible,
body[data-customer-portal] textarea:focus-visible {
  outline: 3px solid rgba(175, 16, 26, .16);
  outline-offset: 2px;
}

.portal-header-return-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .84rem;
  font-weight: 800;
}

.portal-header-return-arrow {
  flex: 0 0 auto;
  color: var(--brand);
  font-size: 1rem;
  line-height: 1;
}

.portal-shell {
  padding-top: 30px;
}

.portal-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  align-items: end;
  gap: 32px;
  padding: 28px 0 30px;
}

.portal-hero-copy {
  min-width: 0;
}

.portal-hero h1 {
  max-width: 720px;
  margin: 5px 0 12px;
  font-size: clamp(2.25rem, 6vw, 4.4rem);
  letter-spacing: -.06em;
  line-height: .98;
}

.portal-hero .portal-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  color: var(--brand);
  font-size: .76rem;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.portal-hero .portal-kicker::before {
  width: 20px;
  height: 3px;
  border-radius: 999px;
  background: var(--brand-gold);
  content: "";
}

.portal-intro {
  max-width: 660px;
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.65;
}

.portal-tenant-context {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 15px 16px;
  background: rgba(255, 255, 255, .82);
  box-shadow: 0 12px 34px rgba(91, 64, 61, .07);
}

.portal-tenant-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--brand-dark), var(--brand-bright));
  color: #fff;
  font-size: 1.05rem;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(175, 16, 26, .18);
}

.portal-tenant-copy {
  min-width: 0;
}

.portal-tenant-copy span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.portal-tenant-copy strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .96rem;
}

.portal-tenant-context .button {
  flex: 0 0 auto;
}

.portal-card {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 24px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 16px 45px rgba(91, 64, 61, .07);
}

.portal-card h2 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 1.25rem;
  letter-spacing: -.025em;
}

.portal-card > p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.6;
}

.portal-card label {
  display: block;
  margin-bottom: 7px;
  color: #443b39;
  font-size: .86rem;
  font-weight: 800;
}

body[data-customer-portal] input[type="email"],
body[data-customer-portal] input[type="date"],
body[data-customer-portal] textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid #d9ccc6;
  border-radius: 12px;
  padding: 10px 13px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  transition: border-color .16s ease, box-shadow .16s ease;
}

body[data-customer-portal] input[type="email"]:focus,
body[data-customer-portal] input[type="date"]:focus,
body[data-customer-portal] textarea:focus {
  border-color: var(--brand);
  outline: none;
  box-shadow: 0 0 0 4px rgba(175, 16, 26, .1);
}

body[data-customer-portal] textarea {
  min-height: 100px;
  resize: vertical;
}

body[data-customer-portal] button,
body[data-customer-portal] .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 10px 15px;
  background: linear-gradient(135deg, var(--brand), var(--brand-bright));
  color: #fff;
  font: inherit;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(175, 16, 26, .16);
  transition: background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease;
}

body[data-customer-portal] button:hover,
body[data-customer-portal] .button:hover {
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
}

body[data-customer-portal] button:disabled {
  border-color: #cbd5e1;
  background: #e2e8f0;
  color: #64748b;
  box-shadow: none;
  cursor: not-allowed;
}

body[data-customer-portal] button.secondary,
body[data-customer-portal] .button.secondary,
body[data-customer-portal] .button.ghost {
  border-color: var(--line);
  background: #fff;
  color: #4f4543;
  box-shadow: none;
}

body[data-customer-portal] button.secondary:hover,
body[data-customer-portal] .button.secondary:hover,
body[data-customer-portal] .button.ghost:hover {
  border-color: #d8bab3;
  background: #fff8f7;
  color: var(--brand-dark);
}

body[data-customer-portal] button.danger,
body[data-customer-portal] .button.danger {
  border-color: #fecdd3;
  background: #fff1f2;
  color: var(--danger);
  box-shadow: none;
}

body[data-customer-portal] button.danger:hover,
body[data-customer-portal] .button.danger:hover {
  border-color: #fda4af;
  background: #ffe4e6;
}

.portal-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.portal-stack {
  display: grid;
  gap: 13px;
}

.portal-link {
  color: var(--brand-dark);
  font-weight: 800;
  text-decoration: none;
}

.portal-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.portal-status {
  border: 1px solid #d6dee8;
  border-radius: 11px;
  padding: 10px 12px;
  background: #f8fafc;
  color: #526174;
}

.portal-status.error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.portal-onboarding {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.portal-step {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: 18px;
  background: linear-gradient(155deg, #fff, #fff9f6);
}

.portal-step-number {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 13px;
  border-radius: 11px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: .84rem;
  font-weight: 900;
}

.portal-step strong {
  display: block;
  margin-bottom: 6px;
}

.portal-step p {
  margin: 0;
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.55;
}

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

.booking-reschedule {
  display: grid;
  min-width: 0;
  gap: 12px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 14px;
  background: #fffaf8;
}

.booking-reschedule .portal-row > * {
  min-width: 0;
}

.booking-reschedule[hidden] {
  display: none;
}

.booking-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
}

body[data-customer-portal] .slot-button {
  min-height: 38px;
  border-color: #e1c1bd;
  padding: 8px 10px;
  background: #fff;
  color: var(--brand-dark);
  box-shadow: none;
}

body[data-customer-portal] .slot-button.is-selected {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.selected-slot {
  color: var(--brand-dark);
  font-weight: 800;
}

.consent {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding: 15px 0;
}

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

.consent strong,
.consent span {
  display: block;
}

.consent span {
  margin-top: 3px;
  color: var(--muted);
  font-size: .86rem;
  line-height: 1.5;
}

.switch {
  inline-size: 48px;
  block-size: 28px;
  flex: 0 0 auto;
}

.portal-table-wrap {
  overflow-x: auto;
}

.portal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}

.portal-table th,
.portal-table td {
  border-bottom: 1px solid var(--line);
  padding: 12px 9px;
  text-align: left;
  vertical-align: top;
}

.portal-table th {
  color: var(--muted);
  font-size: .76rem;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.portal-footer {
  width: min(1040px, calc(100% - 32px));
}

.portal-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 16px;
}

.portal-footer a {
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
}

.portal-footer a:hover {
  color: var(--brand);
}

body[data-customer-portal] .slotio-push-reminder-card {
  border-color: rgba(175, 16, 26, .16);
  background: linear-gradient(180deg, #fff, #fffaf7);
  box-shadow: 0 8px 24px rgba(91, 64, 61, .06);
}

@media (max-width: 700px) {
  body[data-customer-portal] .app-header-inner,
  body[data-customer-portal] .app-shell,
  body[data-customer-portal] .app-footer {
    width: min(100% - 22px, 1040px);
  }

  .portal-header-return {
    max-width: 48vw;
    padding: 7px 10px;
  }

  .portal-header-return-label {
    font-size: .76rem;
  }

  .portal-shell {
    padding-top: 18px;
  }

  .portal-hero {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 18px 0 20px;
  }

  .portal-hero h1 {
    font-size: clamp(2.25rem, 13vw, 3.6rem);
  }

  .portal-tenant-context {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .portal-tenant-copy {
    flex: 1 1 calc(100% - 60px);
  }

  .portal-tenant-context .button {
    width: 100%;
  }

  .portal-card {
    border-radius: 18px;
    padding: 18px;
  }

  .portal-onboarding {
    grid-template-columns: 1fr;
  }

  .portal-row {
    align-items: stretch;
  }

  .portal-row > button,
  .portal-row > .button {
    flex: 1 1 150px;
  }

  .booking-actions {
    align-items: stretch;
  }

  .booking-actions > * {
    flex: 1 1 150px;
  }

  .portal-table-wrap {
    overflow: visible;
  }

  .portal-table,
  .portal-table tbody,
  .portal-table tr,
  .portal-table td {
    display: block;
    width: 100%;
  }

  .portal-table thead {
    display: none;
  }

  .portal-table tr {
    border-bottom: 1px solid var(--line);
    padding: 10px 0;
  }

  .portal-table td {
    border-bottom: 0;
    padding: 6px 0;
  }

  .portal-footer {
    flex-direction: column;
  }

  .portal-footer nav {
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .portal-header-return,
  body[data-customer-portal] button,
  body[data-customer-portal] .button,
  body[data-customer-portal] input,
  body[data-customer-portal] textarea {
    transition: none;
  }
}
