.portal-shell {
  --portal-ink: #172033;
  --portal-muted: #5b6472;
  --portal-line: #d9e0e8;
  --portal-soft-line: #e8edf2;
  --portal-panel: #ffffff;
  --portal-surface: #f6f8fb;
  --portal-surface-strong: #eef4f8;
  --portal-accent: #0f766e;
  --portal-accent-soft: #e8f7f4;
  --portal-accent-line: #8bd1c8;
  --portal-danger: #991b1b;
  --portal-focus: #2563eb;
  color: var(--portal-ink);
  display: grid;
  gap: 1rem;
}

.portal-shell * {
  box-sizing: border-box;
}

.portal-hero {
  display: grid;
  gap: .85rem;
  padding: 1rem;
  border: 1px solid var(--portal-line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .94), rgba(255, 255, 255, .86)),
    var(--portal-surface-strong);
  border-radius: 8px;
}

.portal-hero h1 {
  margin: 0;
  color: var(--portal-ink);
  font-size: 1.65rem;
  line-height: 1.1;
}

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

.portal-home {
  gap: 1.5rem;
}

.portal-home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, .75fr);
  gap: 1rem;
  padding: clamp(1.25rem, 4vw, 2.75rem);
  border: 1px solid var(--portal-line);
  border-radius: 16px;
  background:
    radial-gradient(circle at 92% 8%, rgba(15, 118, 110, .16), transparent 34%),
    linear-gradient(135deg, #fff 0%, var(--portal-surface) 100%);
}

.portal-home-hero__copy {
  display: grid;
  align-content: center;
  gap: .8rem;
}

.portal-home-hero__copy .title {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1;
  letter-spacing: -.04em;
}

.portal-home-hero__lede {
  max-width: 680px;
  margin: 0;
  color: var(--portal-muted);
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  line-height: 1.55;
}

.portal-home-hero__aside {
  display: grid;
  align-content: center;
  gap: .65rem;
  min-height: 200px;
  padding: 1.25rem;
  border: 1px solid var(--portal-accent-line);
  border-radius: 12px;
  background: rgba(232, 247, 244, .78);
}

.portal-home-hero__aside strong {
  font-size: 1.15rem;
  line-height: 1.35;
}

.portal-home--signed-in .portal-home-hero {
  grid-template-columns: 1fr;
  padding: 1.25rem;
}

.portal-home--signed-in .portal-home-hero__copy .title {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
}

.portal-home--signed-in .portal-home-hero__aside {
  display: none;
}

.portal-home--signed-in .portal-home-card {
  min-height: 165px;
  padding: 1rem;
}

.portal-home-kicker,
.portal-home-card__eyebrow {
  color: var(--portal-accent);
  font-size: .75rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.portal-home-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .85rem;
}

.portal-home-section-heading .title,
.portal-home-section-heading p {
  margin: 0;
}

.portal-home-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .85rem;
}

.portal-home-card {
  display: grid;
  align-content: start;
  gap: .6rem;
  min-height: 210px;
  padding: 1.25rem;
  border: 1px solid var(--portal-line);
  border-radius: 12px;
  background: var(--portal-panel);
  color: var(--portal-ink);
  text-decoration: none;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.portal-home-card:hover,
.portal-home-card:focus {
  border-color: var(--portal-accent-line);
  box-shadow: 0 14px 32px rgba(23, 32, 51, .09);
  outline: 0;
  transform: translateY(-2px);
}

.portal-home-card--featured {
  background: linear-gradient(145deg, var(--portal-accent-soft), #fff 72%);
}

.portal-home-card h3,
.portal-home-card p {
  margin: 0;
}

.portal-home-card h3 {
  font-size: 1.25rem;
}

.portal-home-card p {
  color: var(--portal-muted);
  line-height: 1.55;
}

.portal-home-card__action {
  align-self: end;
  margin-top: auto;
  color: var(--portal-accent);
  font-weight: 900;
}

.portal-home-card__status {
  color: var(--portal-muted);
  font-size: .82rem;
  font-weight: 800;
}

.portal-home-utility {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  border-top: 1px solid var(--portal-line);
  padding: 1rem .25rem 0;
}

.portal-home-utility h2,
.portal-home-utility p {
  margin: 0;
}

.portal-home-utility h2 {
  font-size: 1rem;
}

.portal-home-utility__eyebrow {
  margin-bottom: .2rem !important;
  color: var(--portal-muted);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.portal-home-utility__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .4rem 1rem;
}

.portal-home-utility__links a {
  color: var(--portal-accent);
  font-size: .9rem;
  font-weight: 800;
  text-underline-offset: .2em;
}

.portal-site-utility-wrap {
  padding-block: 0;
}

.portal-site-utility {
  align-items: center;
  flex-direction: row;
  justify-content: space-between;
  gap: 1.25rem;
  width: 100%;
  margin: 1.5rem 0 0;
  padding: 1rem 0 0;
}

.portal-site-utility > div {
  display: grid;
  gap: .2rem;
}

.portal-site-utility .portal-home-utility__links {
  align-items: center;
  flex-direction: row;
  justify-content: flex-end;
  gap: .4rem 1rem;
}

.portal-action-list {
  display: grid;
  gap: .65rem;
}

.portal-action-card {
  display: grid;
  gap: .2rem;
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  padding: .8rem;
  background: var(--portal-surface);
  color: var(--portal-ink);
  text-decoration: none;
}

.portal-action-card:hover,
.portal-action-card:focus {
  border-color: var(--portal-accent);
  outline: 0;
}

.portal-action-card span {
  color: var(--portal-muted);
}

.portal-dashboard-guidance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: linear-gradient(145deg, var(--portal-accent-soft), var(--portal-panel));
}

.portal-dashboard-guidance h2,
.portal-dashboard-guidance p {
  margin: 0;
}

.portal-dashboard-guidance__restore {
  justify-self: start;
}

.portal-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .85rem;
}

.portal-dashboard-card {
  display: grid;
  align-content: start;
  gap: .85rem;
}

.portal-dashboard-card .portal-button {
  justify-self: start;
}

.portal-dashboard-card h2,
.portal-dashboard-card p {
  margin: 0;
}

.portal-next-actions--primary {
  border-color: var(--portal-accent-line);
  background: linear-gradient(135deg, var(--portal-accent-soft), var(--portal-panel) 68%);
}

.portal-dashboard-card--author {
  grid-column: 1 / -1;
  border-color: var(--portal-accent-line);
}

.portal-author-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .55rem;
  margin-bottom: .85rem;
}

.portal-author-stats span {
  display: grid;
  gap: .1rem;
  padding: .65rem;
  border-radius: 8px;
  background: var(--portal-surface);
  color: var(--portal-muted);
  font-size: .78rem;
}

.portal-author-stats strong {
  color: var(--portal-ink);
  font-size: 1.25rem;
}

.portal-readiness-list,
.portal-dashboard-list {
  display: grid;
  gap: .55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.portal-readiness-list li {
  display: flex;
  align-items: center;
  gap: .55rem;
}

.portal-readiness-list li::before {
  content: "○";
  color: var(--portal-muted);
  font-weight: 900;
}

.portal-readiness-list li.is-complete::before {
  content: "✓";
  color: var(--portal-accent);
}

.portal-dashboard-item {
  display: grid;
  gap: .25rem;
}

.portal-dashboard-item a {
  color: var(--portal-accent);
  font-weight: 900;
  text-decoration: none;
}

.portal-dashboard-item .muted {
  font-size: .9rem;
}

.portal-home-empty {
  display: grid;
  gap: .45rem;
  padding: 1.25rem;
  border: 1px dashed var(--portal-line);
  border-radius: 12px;
  background: var(--portal-surface);
}

.portal-home-empty p {
  margin: 0;
}

.portal-progress {
  counter-reset: portal-step;
  display: grid;
  gap: .5rem;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.portal-progress li {
  counter-increment: portal-step;
  display: flex;
  align-items: center;
  gap: .5rem;
  min-height: 44px;
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  padding: .55rem .65rem;
  background: #fff;
  color: var(--portal-muted);
  font-weight: 700;
  cursor: pointer;
}

.portal-progress li::before {
  content: counter(portal-step);
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: var(--portal-surface);
  color: var(--portal-muted);
  font-size: .78rem;
}

.portal-progress .is-active {
  border-color: var(--portal-accent-line);
  color: var(--portal-accent);
  background: var(--portal-accent-soft);
}

.portal-progress .is-active::before {
  background: var(--portal-accent);
  color: #fff;
}

.portal-panel {
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  padding: 1rem;
  background: var(--portal-panel);
}

.portal-panel--muted {
  background: var(--portal-surface);
}

.portal-account-nav {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  align-items: center;
  padding: .35rem;
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  background: var(--portal-surface);
}

.portal-navigation {
  display: grid;
  gap: .45rem;
}

.portal-navigation__toggle {
  display: none;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  padding: .55rem .75rem;
  background: var(--portal-surface);
  color: var(--portal-ink);
  font: inherit;
  font-weight: 800;
}

.portal-account-nav__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border-radius: 6px;
  padding: .45rem .7rem;
  color: var(--portal-muted);
  font-weight: 800;
  text-decoration: none;
}

.portal-account-overview {
  display: grid;
  gap: .75rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.portal-stat {
  display: grid;
  gap: .2rem;
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  padding: .85rem;
  background: var(--portal-surface);
}

.portal-stat strong {
  color: var(--portal-accent);
  font-size: 1.65rem;
}

.portal-stat span,
.portal-context-note {
  color: var(--portal-muted);
}

.portal-context-note {
  margin: .75rem 0 0;
  font-size: .9rem;
  line-height: 1.5;
}

.portal-view-switcher {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
}

.portal-calendar-view-tabs {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(88px, 1fr));
  overflow: hidden;
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  background: var(--portal-surface);
}

.portal-calendar-view-tabs .portal-view-switcher__button {
  min-height: 40px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.portal-calendar-view-tabs .portal-view-switcher__button + .portal-view-switcher__button {
  border-left: 1px solid var(--portal-line);
}

.portal-calendar-view-tabs .portal-view-switcher__button.is-active {
  background: var(--portal-accent);
  color: #fff;
}

.portal-view-switcher__button,
.portal-action-chip {
  min-height: 38px;
  border: 1px solid var(--portal-line);
  border-radius: 999px;
  padding: .4rem .75rem;
  background: var(--portal-surface);
  color: var(--portal-ink);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.portal-view-switcher__button.is-active,
.portal-view-switcher__button:hover,
.portal-action-chip:hover {
  border-color: var(--portal-accent);
  color: var(--portal-accent);
}

.portal-calendar-workspace {
  display: grid;
  gap: 1rem;
}

.portal-calendar-toolbar {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

.portal-month-controls {
  display: flex;
  gap: .45rem;
  align-items: center;
}

.portal-month-controls strong {
  min-width: 150px;
  text-align: center;
}

.portal-agenda {
  display: grid;
  gap: 1rem;
}

.portal-agenda-day {
  display: grid;
  gap: .55rem;
}

.portal-agenda-day h3 {
  margin: 0;
  color: var(--portal-muted);
  font-size: .86rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.portal-agenda-day__events {
  display: grid;
  gap: .55rem;
}

.portal-calendar-event {
  display: grid;
  gap: .3rem;
  grid-template-columns: minmax(90px, .45fr) minmax(160px, 1.25fr) minmax(130px, 1fr) auto;
  align-items: center;
  width: 100%;
  border: 1px solid var(--portal-line);
  border-left: 4px solid var(--portal-accent);
  border-radius: 8px;
  padding: .75rem;
  background: var(--portal-panel);
  color: var(--portal-ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.portal-calendar-event:hover,
.portal-calendar-event:focus {
  border-color: var(--portal-accent);
  outline: 2px solid transparent;
  box-shadow: 0 8px 22px rgba(23, 32, 51, .08);
}

.portal-calendar-event--past {
  border-left-color: var(--portal-muted);
}

.portal-calendar-event--cancelled {
  border-left-color: #b42318;
  opacity: .78;
}

.portal-calendar-event__time {
  color: var(--portal-accent);
  font-weight: 900;
}

.portal-calendar-event__action {
  grid-column: 2 / -1;
  color: var(--portal-accent);
  font-size: .78rem;
  font-weight: 800;
}

.portal-month-calendar {
  display: grid;
  gap: .5rem;
  overflow-x: auto;
}

.portal-month-calendar__weekdays,
.portal-month-calendar__grid {
  display: grid;
  min-width: 760px;
  grid-template-columns: repeat(7, minmax(100px, 1fr));
}

.portal-month-calendar__weekdays span {
  padding: .45rem;
  color: var(--portal-muted);
  font-size: .78rem;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.portal-month-day {
  min-height: 135px;
  border: 1px solid var(--portal-line);
  padding: .4rem;
  background: var(--portal-panel);
}

.portal-month-day.is-today {
  box-shadow: inset 0 0 0 2px var(--portal-accent);
}

.portal-month-day--outside {
  background: var(--portal-surface);
}

.portal-month-day__number {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  margin-left: auto;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--portal-ink);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.portal-month-day__number:hover,
.portal-month-day__number:focus {
  background: var(--portal-accent-soft);
  color: var(--portal-accent);
}

.portal-month-day__events {
  display: grid;
  gap: .3rem;
  margin-top: .35rem;
}

.portal-month-day .portal-calendar-event {
  display: grid;
  gap: .1rem;
  min-height: 0;
  grid-template-columns: 1fr;
  padding: .4rem;
  font-size: .76rem;
}

.portal-month-day .portal-calendar-event > span:not(.portal-calendar-event__time),
.portal-month-day .portal-calendar-event .portal-pill {
  display: none;
}

.portal-calendar-empty {
  display: grid;
  justify-items: start;
  gap: .5rem;
  border: 1px dashed var(--portal-line);
  border-radius: 8px;
  padding: 1.25rem;
  background: var(--portal-surface);
}

.portal-calendar-empty p {
  margin: 0;
  color: var(--portal-muted);
}

.portal-appointment-drawer {
  position: fixed;
  z-index: 60;
  top: 1rem;
  right: 1rem;
  bottom: 1rem;
  display: grid;
  width: min(520px, calc(100vw - 2rem));
  overflow: auto;
  gap: 1rem;
  border: 1px solid var(--portal-accent-line);
  border-radius: 10px;
  padding: 1.1rem;
  background: var(--portal-panel);
  box-shadow: 0 24px 70px rgba(23, 32, 51, .28);
}

.portal-drawer-backdrop {
  position: fixed;
  z-index: 55;
  inset: 0;
  width: 100%;
  border: 0;
  background: rgba(17, 24, 39, .48);
  cursor: default;
}

body.portal-drawer-open {
  overflow: hidden;
}

.portal-appointment-drawer__header {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  justify-content: space-between;
}

.portal-calendar-export {
  display: grid;
  gap: .55rem;
  border-top: 1px solid var(--portal-line);
  padding-top: 1rem;
}

.portal-completion {
  display: grid;
  gap: .75rem;
  border: 1px solid var(--portal-accent-line);
  border-radius: 8px;
  padding: 1rem;
  background: linear-gradient(145deg, var(--portal-accent-soft), var(--portal-panel));
}

.portal-completion__percent {
  color: var(--portal-accent);
  font-size: 1.5rem;
}

.portal-completion__controls {
  display: flex;
  gap: .5rem;
  align-items: center;
}

.portal-completion__restore {
  width: 100%;
  margin-bottom: 1rem;
}

.portal-completion__track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--portal-line);
}

.portal-completion__track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--portal-accent);
  transition: width .2s ease;
}

.portal-completion .portal-action-list {
  display: flex;
  flex-wrap: wrap;
}

.portal-profile-disabled-banner {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  border: 2px solid #b42318;
  border-radius: 10px;
  padding: 1rem;
  background: #fef3f2;
  color: #7a271a;
  box-shadow: 0 8px 22px rgba(180, 35, 24, .1);
}

.portal-profile-disabled-banner p {
  margin: .2rem 0 0;
}

.portal-shell.is-profile-disabled .portal-profile-summary {
  opacity: .78;
}

.portal-shell.is-profile-disabled #profilePhotoPreview {
  filter: grayscale(1);
}

.portal-pill--danger {
  border-color: #fda29b;
  background: #fee4e2;
  color: #b42318;
}

.portal-notice--warning {
  background: #fffaeb;
  color: #7a2e0e;
}

.portal-subpanel.is-disabled {
  opacity: .62;
}

.portal-filter-bar--analytics {
  grid-template-columns: repeat(4, minmax(130px, 1fr)) auto;
  align-items: end;
}

.portal-analytics-breakdown {
  display: grid;
  gap: .55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.portal-analytics-breakdown li {
  display: flex;
  min-width: 0;
  gap: .75rem;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--portal-line);
  padding-bottom: .45rem;
}

.portal-analytics-breakdown span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.portal-table-scroll {
  width: 100%;
  overflow-x: auto;
}

.portal-analytics-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
}

.portal-analytics-table th,
.portal-analytics-table td {
  border-bottom: 1px solid var(--portal-line);
  padding: .7rem;
  text-align: left;
}

.portal-analytics-table th:not(:first-child),
.portal-analytics-table td:not(:first-child) {
  text-align: right;
}

.portal-booking-summary {
  position: sticky;
  bottom: .75rem;
  z-index: 5;
  display: grid;
  gap: .75rem;
  grid-template-columns: minmax(150px, .8fr) minmax(280px, 2fr) auto;
  align-items: center;
  border: 1px solid var(--portal-accent-line);
  border-radius: 10px;
  padding: .9rem 1rem;
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 14px 34px rgba(23, 32, 51, .14);
  backdrop-filter: blur(10px);
}

.portal-booking-summary p,
.portal-booking-summary h2,
.portal-booking-summary dl,
.portal-booking-summary dd {
  margin: 0;
}

.portal-reschedule-comparison {
  display: grid;
  gap: .75rem;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  margin-bottom: 1rem;
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  padding: .85rem;
  background: var(--portal-surface);
}

.portal-reschedule-comparison > div {
  display: grid;
  gap: .25rem;
}

.portal-reschedule-comparison__label {
  color: var(--portal-muted);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.portal-reschedule-comparison__arrow {
  color: var(--portal-accent);
  font-size: 1.35rem;
}

#proposedBookingTime.is-changed,
#drawerProposedBookingTime.is-changed {
  color: var(--portal-accent);
}

.portal-booking-summary__continue {
  display: grid;
  gap: .2rem;
}

.portal-booking-summary__continue .muted {
  max-width: 180px;
  font-size: .72rem;
  text-align: center;
}

.portal-panel--attention {
  outline: 3px solid var(--portal-accent-line);
  outline-offset: 3px;
  animation: portal-panel-attention .8s ease-out;
}

@keyframes portal-panel-attention {
  from { box-shadow: 0 0 0 8px var(--portal-accent-soft); }
  to { box-shadow: none; }
}

.portal-booking-upcoming__list {
  display: grid;
  gap: .55rem;
  margin-top: .8rem;
}

.portal-booking-upcoming__item {
  display: grid;
  gap: .2rem;
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  padding: .75rem;
  color: var(--portal-ink);
  text-decoration: none;
}

.portal-booking-upcoming__item:hover,
.portal-booking-upcoming__item:focus {
  border-color: var(--portal-accent);
}

.portal-booking-upcoming__item span {
  color: var(--portal-muted);
  font-size: .86rem;
}

.portal-booking-summary dl {
  display: grid;
  gap: .6rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.portal-booking-summary dl div {
  min-width: 0;
}

.portal-booking-summary dt {
  color: var(--portal-muted);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.portal-booking-summary dd {
  overflow: hidden;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-account-nav__link:hover,
.portal-account-nav__link:focus {
  color: var(--portal-accent);
  outline: 0;
}

.portal-account-nav__link.is-active {
  background: var(--portal-panel);
  color: var(--portal-accent);
  box-shadow: inset 0 0 0 1px var(--portal-line);
}

.portal-subpanel {
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  padding: .85rem;
  background: var(--portal-surface);
}

.portal-link-status {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  margin-top: .75rem;
}

.portal-grid {
  display: grid;
  gap: .85rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.portal-date-presets {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 1rem;
}

.portal-date-preset {
  min-height: 40px;
  border: 1px solid var(--portal-line);
  border-radius: 999px;
  padding: .45rem .8rem;
  background: var(--portal-surface);
  color: var(--portal-ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.portal-date-preset:hover,
.portal-date-preset[aria-pressed="true"] {
  border-color: var(--portal-accent);
  color: var(--portal-accent);
}

.portal-date-preset:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.portal-calendar-navigation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  margin-top: 1rem;
}

.portal-provider-picker {
  display: grid;
  gap: .65rem;
  max-width: 640px;
}

.portal-provider-picker > label {
  color: var(--portal-ink);
  font-weight: 800;
}

.portal-provider-picker > select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  padding: .6rem .75rem;
  background: #fff;
  color: var(--portal-ink);
  font: inherit;
}

.portal-provider-picker__selection {
  display: grid;
  gap: .2rem;
  border: 1px solid var(--portal-accent-line);
  border-radius: 8px;
  padding: .75rem;
  background: var(--portal-accent-soft);
}

.portal-provider-picker__eyebrow {
  color: var(--portal-accent);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.portal-advanced-search {
  margin-top: .85rem;
  border: 1px solid var(--portal-soft-line);
  border-radius: 8px;
  padding: .75rem;
  background: var(--portal-surface);
}

.portal-advanced-search summary {
  color: var(--portal-accent);
  font-weight: 800;
  cursor: pointer;
}

.portal-advanced-search > p {
  margin: .6rem 0 0;
}

.portal-grid--full {
  grid-column: 1 / -1;
  width: 100%;
}

.portal-review-widgets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: .75rem;
}

.portal-review-mode {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem 1.25rem;
  padding: .65rem .8rem;
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  background: var(--portal-surface);
}

.portal-review-widget {
  display: grid;
  align-content: start;
  gap: .35rem;
  min-height: 112px;
  padding: 1rem;
  border: 1px solid var(--portal-line);
  border-left: 4px solid var(--portal-accent);
  border-radius: 8px;
  background: linear-gradient(145deg, var(--portal-panel), var(--portal-accent-soft));
}

.portal-review-widget__label {
  color: var(--portal-muted);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.portal-review-widget strong {
  font-size: 1.15rem;
  overflow-wrap: anywhere;
}

.portal-review-note {
  margin: 1rem 0 0;
  line-height: 1.65;
}

.portal-review-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: .75rem;
  margin: 1rem 0 0;
}

.portal-review-meta div {
  padding: .75rem;
  border-radius: 7px;
  background: var(--portal-surface);
}

.portal-review-meta dt {
  color: var(--portal-muted);
  font-size: .75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.portal-review-meta dd {
  margin: .3rem 0 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.portal-review-evaluation {
  display: grid;
  gap: .75rem;
  margin-top: .85rem;
}

.portal-review-evaluation__group {
  padding: .85rem;
  border: 1px solid var(--portal-soft-line);
  border-radius: 8px;
  background: var(--portal-surface);
}

.portal-review-evaluation__group h3 {
  margin: 0 0 .5rem;
  font-size: .95rem;
}

.portal-review-evaluation__group ul {
  margin: 0;
  padding-left: 1.25rem;
}

.portal-review-raw {
  padding: .75rem .85rem;
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  background: var(--portal-surface);
}

.portal-review-raw summary {
  cursor: pointer;
  color: var(--portal-ink);
  font-weight: 800;
}

.portal-content-body {
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.portal-content-body img {
  max-width: 100%;
  height: auto;
}

.portal-author-photo {
  width: 88px;
  height: 88px;
  border-radius: 999px;
  object-fit: cover;
}

.portal-shell [hidden] {
  display: none !important;
}

.portal-cards {
  display: grid;
  gap: .75rem;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  margin-top: .75rem;
}

.portal-cards--nested {
  margin-top: .55rem;
}

.portal-type-group {
  display: grid;
  gap: .25rem;
}

.portal-type-group + .portal-type-group {
  margin-top: .9rem;
}

.portal-type-group h3 {
  margin: 0;
  color: var(--portal-ink);
  font-size: .95rem;
}

.portal-grid--spaced,
.portal-field--spaced,
.portal-actions--spaced {
  margin-top: .85rem;
}

.portal-calendar--spaced {
  margin-top: 1rem;
}

.portal-calendar--compact {
  margin-top: .75rem;
}

.portal-card-button {
  display: grid;
  gap: .45rem;
  width: 100%;
  min-height: 112px;
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  padding: .85rem;
  background: var(--portal-panel);
  color: var(--portal-ink);
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.portal-card-button:hover,
.portal-card-button:focus {
  border-color: var(--portal-accent);
  box-shadow: 0 8px 20px rgba(15, 118, 110, .1);
  outline: 0;
  transform: translateY(-1px);
}

.portal-card-button.is-active {
  border-color: var(--portal-accent);
  background: var(--portal-accent-soft);
}

.portal-card-title {
  font-weight: 800;
}

.portal-card-meta {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
  color: var(--portal-muted);
  font-size: .9rem;
}

.portal-pill {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  min-height: 24px;
  border-radius: 999px;
  padding: .2rem .55rem;
  background: #edf2ff;
  color: #27428f;
  font-size: .82rem;
  font-weight: 700;
}

.portal-pill--quiet {
  background: var(--portal-surface);
  color: var(--portal-muted);
}

.portal-pill--draft {
  border: 1px solid #d6a22f;
  background: #fff5d6;
  color: #744c00;
}

.portal-content-item--draft {
  position: relative;
  overflow: hidden;
  border-color: #dfbd69;
  background: linear-gradient(105deg, #fffaf0, var(--portal-panel) 58%);
}

.portal-content-item--draft::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: #d6a22f;
}

.portal-card-meta .portal-pill {
  min-height: 20px;
  padding: .12rem .45rem;
  font-size: .76rem;
  line-height: 1.2;
}

.portal-card-meta time {
  margin-left: .15rem;
  color: var(--portal-muted);
  font-size: .8rem;
  white-space: nowrap;
}

.portal-field {
  display: grid;
  gap: .35rem;
}

.portal-field label {
  color: var(--portal-ink);
  font-weight: 700;
}

.portal-field input,
.portal-field select,
.portal-field textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--portal-line);
  border-radius: 6px;
  padding: .55rem .65rem;
  background: #fff;
  color: var(--portal-ink);
}

.portal-field textarea {
  resize: vertical;
}

.portal-check {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 44px;
  color: var(--portal-ink);
  font-weight: 700;
}

.portal-check input {
  width: 18px;
  height: 18px;
}

.portal-checkbox {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  min-height: 44px;
  color: var(--portal-ink);
  font-weight: 700;
}

.portal-checkbox input[type='checkbox'] {
  flex: 0 0 auto;
  width: 18px;
  min-height: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
}

.portal-field input:focus,
.portal-field select:focus,
.portal-field textarea:focus,
.portal-slot:focus-visible,
.portal-date-preset:focus-visible,
.portal-button:focus-visible,
.portal-link:focus-visible,
.portal-item-button:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .2);
  outline-offset: 2px;
  border-color: var(--portal-focus);
}

/* Engagement contact and subscription forms */
.engagement-shell {
  max-width: 880px;
  margin: 0 auto;
}

.engagement-form {
  display: grid;
  gap: 1.25rem;
  padding: clamp(1rem, 3vw, 1.5rem);
  border-color: #c7d1dc;
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(23, 32, 51, .07);
}

.engagement-form__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.engagement-form__wide {
  grid-column: 1 / -1;
}

.engagement-form .portal-field {
  gap: .45rem;
}

.engagement-form .portal-field label,
.engagement-fieldset legend {
  color: var(--portal-ink);
  font-size: .92rem;
  font-weight: 750;
}

.engagement-form .portal-field input:not([type='checkbox']),
.engagement-form .portal-field select,
.engagement-form .portal-field textarea {
  width: 100%;
  border: 1.5px solid #aebbc9;
  border-radius: 9px;
  padding: .7rem .8rem;
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(23, 32, 51, .04);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.engagement-form .portal-field input:not([type='checkbox']):hover,
.engagement-form .portal-field select:hover,
.engagement-form .portal-field textarea:hover {
  border-color: #8293a6;
}

.engagement-form .portal-field input:not([type='checkbox']):focus,
.engagement-form .portal-field select:focus,
.engagement-form .portal-field textarea:focus {
  border-color: var(--portal-focus);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .16);
}

.engagement-form .portal-field input::placeholder,
.engagement-form .portal-field textarea::placeholder {
  color: #7a8796;
}

.engagement-optional,
.engagement-required-note,
.engagement-fieldset__hint {
  color: var(--portal-muted);
  font-size: .82rem;
  font-weight: 500;
}

.engagement-preferences {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(220px, .65fr);
  gap: 1rem;
}

.engagement-fieldset {
  min-width: 0;
  margin: 0;
  border: 1px solid var(--portal-line);
  border-radius: 12px;
  padding: 1rem;
  background: var(--portal-surface);
}

.engagement-fieldset legend {
  padding: 0 .3rem;
}

.engagement-fieldset__hint {
  margin: -.1rem 0 .75rem;
}

.engagement-choice-grid {
  display: grid;
  gap: .55rem;
}

.engagement-choice-grid--channels {
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
}

.engagement-choice {
  display: flex;
  gap: .65rem;
  align-items: flex-start;
  min-height: 44px;
  margin: 0;
  border: 1px solid var(--portal-line);
  border-radius: 9px;
  padding: .65rem .7rem;
  background: #fff;
  color: var(--portal-ink);
  cursor: pointer;
  font-size: .92rem;
  font-weight: 650;
  line-height: 1.4;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.engagement-choice:hover {
  border-color: var(--portal-accent-line);
  background: var(--portal-accent-soft);
}

.engagement-choice:has(input:checked) {
  border-color: var(--portal-accent-line);
  background: var(--portal-accent-soft);
  box-shadow: 0 0 0 1px var(--portal-accent-line);
}

.engagement-choice input[type='checkbox'] {
  flex: 0 0 19px;
  width: 19px;
  min-width: 19px;
  height: 19px;
  min-height: 19px;
  margin: .05rem 0 0;
  padding: 0;
  accent-color: var(--portal-accent);
  cursor: pointer;
}

.engagement-choice span {
  min-width: 0;
}

.engagement-choice--consent {
  border-color: #c7d1dc;
  background: var(--portal-surface);
  font-weight: 550;
}

.engagement-form__actions {
  justify-content: space-between;
  padding-top: .1rem;
}

.engagement-form__actions .portal-button {
  min-width: 150px;
  justify-content: center;
}

.engagement-form .portal-notice {
  margin: 0;
  border: 1px solid #bfdbfe;
}

.portal-shell--embed.engagement-shell {
  padding: 0;
}

.portal-shell--embed .engagement-form {
  box-shadow: none;
}

@media (max-width: 700px) {
  .engagement-form__grid,
  .engagement-preferences {
    grid-template-columns: 1fr;
  }

  .engagement-form__wide {
    grid-column: auto;
  }

  .engagement-form__actions {
    align-items: stretch;
    flex-direction: column;
  }

  .engagement-form__actions .portal-button {
    width: 100%;
  }
}

/* Tenant engagement directory */
.engagement-directory {
  gap: 1.1rem;
}

.engagement-tabs {
  display: flex;
  gap: .4rem;
  overflow-x: auto;
  border-bottom: 1px solid var(--portal-line);
}

.engagement-tab {
  flex: 0 0 auto;
  border-bottom: 3px solid transparent;
  padding: .75rem .9rem;
  color: var(--portal-muted);
  font-weight: 750;
  text-decoration: none;
}

.engagement-tab:hover,
.engagement-tab.is-active {
  border-color: var(--portal-accent);
  color: var(--portal-accent);
}

.engagement-directory__search {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto 110px auto;
  gap: .75rem;
  align-items: end;
}

.engagement-directory__search .portal-link {
  align-self: end;
}

.engagement-directory__summary {
  display: flex;
  gap: .55rem;
  align-items: baseline;
  color: var(--portal-muted);
}

.engagement-directory__summary strong {
  color: var(--portal-ink);
  font-size: 1.35rem;
}

.engagement-people {
  display: grid;
  gap: 1rem;
}

.engagement-person {
  border: 1px solid #c7d1dc;
  border-radius: 14px;
  background: var(--portal-panel);
  box-shadow: 0 8px 24px rgba(23, 32, 51, .05);
  overflow: clip;
}

.engagement-person__summary {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, auto);
  gap: .75rem;
  align-items: center;
  padding: .85rem 2.6rem .85rem 1rem;
  cursor: pointer;
  list-style: none;
  position: relative;
}

.engagement-person__summary::-webkit-details-marker {
  display: none;
}

.engagement-person__summary::after {
  position: absolute;
  right: 1rem;
  color: var(--portal-accent);
  content: "⌄";
  font-size: 1.2rem;
  font-weight: 800;
  transition: transform .15s ease;
}

.engagement-person[open] > .engagement-person__summary::after {
  transform: rotate(180deg);
}

.engagement-person__summary:hover {
  background: var(--portal-surface);
}

.engagement-person__summary:focus-visible {
  outline: 3px solid var(--portal-accent-line);
  outline-offset: -3px;
}

.engagement-person__body {
  display: grid;
  gap: .9rem;
  border-top: 1px solid var(--portal-soft-line);
  padding: 1rem;
}

.engagement-person__header,
.engagement-person__section-head,
.engagement-person__meta,
.engagement-pagination {
  display: flex;
  gap: .75rem;
  justify-content: space-between;
  align-items: flex-start;
}

.engagement-person h2,
.engagement-person h3,
.engagement-person p {
  margin: 0;
}

.engagement-person h2 {
  font-size: 1.15rem;
}

.engagement-person h3 {
  font-size: .9rem;
}

.engagement-person__identity,
.engagement-person__badges,
.engagement-subscriptions {
  display: flex;
  gap: .45rem;
  flex-wrap: wrap;
}

.engagement-person__badges {
  align-items: center;
  justify-content: flex-end;
}

.engagement-person__last-seen {
  color: var(--portal-muted);
  font-size: .76rem;
  white-space: nowrap;
}

.engagement-person__identity {
  margin-top: .3rem;
}

.engagement-person__identity a {
  color: var(--portal-accent);
  overflow-wrap: anywhere;
}

.engagement-badge,
.engagement-subscription {
  border: 1px solid var(--portal-line);
  border-radius: 999px;
  padding: .25rem .55rem;
  background: var(--portal-surface);
  color: var(--portal-muted);
  font-size: .76rem;
  font-weight: 700;
}

.engagement-badge.is-active,
.engagement-subscription.is-active {
  border-color: var(--portal-accent-line);
  background: var(--portal-accent-soft);
  color: var(--portal-accent);
}

.engagement-badge.is-linked {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.engagement-person__meta {
  justify-content: flex-start;
  color: var(--portal-muted);
  font-size: .78rem;
}

.engagement-location,
.engagement-activity-location {
  display: flex;
  gap: .35rem .65rem;
  align-items: baseline;
  flex-wrap: wrap;
  color: var(--portal-muted);
  font-size: .78rem;
}

.engagement-location {
  border: 1px solid var(--portal-accent-line);
  border-radius: 9px;
  padding: .6rem .7rem;
  background: var(--portal-accent-soft);
}

.engagement-location strong,
.engagement-activity-location strong {
  color: var(--portal-ink);
}

.engagement-location span + span::before,
.engagement-activity-location span + span::before {
  margin-right: .65rem;
  color: var(--portal-line);
  content: "·";
}

.engagement-location small,
.engagement-activity-location small {
  color: var(--portal-muted);
}

.engagement-activity-location {
  border-top: 1px dashed var(--portal-soft-line);
  padding-top: .45rem;
}

.engagement-person__section {
  display: grid;
  gap: .55rem;
  border: 1px solid var(--portal-soft-line);
  border-radius: 10px;
  padding: .8rem;
  background: var(--portal-surface);
}

.engagement-person__section-head time,
.engagement-source {
  color: var(--portal-muted);
  font-size: .78rem;
}

.engagement-message,
.engagement-history__item p {
  line-height: 1.55;
  white-space: pre-wrap;
}

.engagement-history {
  border-top: 1px solid var(--portal-soft-line);
  padding-top: .75rem;
}

.engagement-history summary {
  color: var(--portal-accent);
  cursor: pointer;
  font-weight: 700;
}

.engagement-history__items {
  display: grid;
  gap: .65rem;
  margin-top: .75rem;
}

.engagement-history__item {
  display: grid;
  gap: .35rem;
  border-left: 3px solid var(--portal-accent-line);
  padding: .5rem .7rem;
  background: var(--portal-surface);
}

.engagement-history__item small {
  color: var(--portal-muted);
}

.engagement-pagination {
  align-items: center;
}

.engagement-pagination__pages {
  display: flex;
  gap: .3rem;
  justify-content: center;
}

.engagement-pagination__page {
  display: inline-grid;
  min-width: 2rem;
  min-height: 2rem;
  place-items: center;
  border: 1px solid var(--portal-line);
  border-radius: 7px;
  color: var(--portal-accent);
  font-size: .82rem;
  font-weight: 750;
  text-decoration: none;
}

.engagement-pagination__page.is-current {
  border-color: var(--portal-accent);
  background: var(--portal-accent);
  color: #fff;
}

.engagement-pagination__status {
  color: var(--portal-muted);
  font-size: .8rem;
}

@media (max-width: 700px) {
  .engagement-directory__search {
    grid-template-columns: 1fr;
  }

  .engagement-person__header,
  .engagement-person__section-head,
  .engagement-person__meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .engagement-person__badges {
    justify-content: flex-start;
  }

  .engagement-person__summary {
    grid-template-columns: 1fr;
  }

  .engagement-pagination {
    flex-wrap: wrap;
  }

  .engagement-pagination__pages {
    order: -1;
    width: 100%;
  }

  .engagement-pagination__status {
    display: none;
  }
}

.portal-actions {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  align-items: center;
}

.portal-section-actions {
  justify-content: flex-end;
}

.portal-filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 240px) auto;
  gap: .65rem;
  align-items: center;
  margin: .85rem 0 1rem;
  padding: .7rem;
  border: 1px solid var(--portal-soft-line);
  border-radius: 8px;
  background: var(--portal-surface);
}

.portal-filter-bar .portal-search {
  width: 100%;
}

.portal-filter-actions {
  display: flex;
  gap: .45rem;
  align-items: center;
}

.portal-search-status {
  min-height: 1.25rem;
  margin: -.35rem 0 .75rem;
}

.portal-button.portal-button--accent {
  border-color: var(--portal-accent);
  background: var(--portal-accent);
  color: #fff;
}

.portal-button.portal-button--accent:hover {
  border-color: #0b5f59;
  background: #0b5f59;
}

.portal-draft-highlight,
.portal-draft-workspace {
  position: relative;
  overflow: hidden;
  border-color: var(--portal-accent-line);
  background: linear-gradient(135deg, var(--portal-accent-soft), #fff 68%);
}

.portal-draft-highlight::before,
.portal-draft-workspace::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--portal-accent);
}

.portal-draft-highlight .portal-list-item--card,
.portal-draft-workspace .portal-list-item--card {
  border-color: var(--portal-accent-line);
  background: rgba(255, 255, 255, .9);
}

.portal-editor-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .65rem;
  margin-bottom: .5rem;
}

.portal-image-toolbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(8rem, auto);
  align-items: end;
  margin-top: .65rem;
  padding: .75rem;
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  background: var(--portal-surface);
}

.portal-image-toolbar > .portal-button {
  min-height: 44px;
}

.portal-image-toolbar__options {
  display: grid;
  grid-template-columns: minmax(8rem, .45fr) minmax(14rem, 1fr);
  gap: .65rem;
  align-items: end;
}

.portal-inline-field {
  display: grid;
  gap: .3rem;
  margin: 0;
}

.portal-inline-field > span {
  color: var(--portal-muted);
  font-size: .78rem;
  font-weight: 700;
}

.portal-image-toolbar select,
.portal-image-toolbar input,
.portal-review-link-actions select {
  min-height: 44px;
}

.portal-editor-secondary {
  margin-top: 1.25rem;
  padding: 1rem;
  border: 1px solid var(--portal-line);
  border-radius: 10px;
  background: var(--portal-surface);
}

.portal-editor-secondary__header {
  max-width: 54rem;
}

.portal-editor-secondary__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .85rem;
}

.portal-workflow-card {
  position: relative;
  border-left: 4px solid var(--portal-accent-line);
  box-shadow: 0 6px 18px rgba(29, 44, 68, .06);
}

.portal-workflow-card--share {
  border-left-color: #7c6bc4;
}

.portal-workflow-card--feedback {
  grid-column: 1 / -1;
  border-left-color: #c18b37;
}

.portal-workflow-card__label {
  margin: 0;
  color: var(--portal-muted);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.portal-review-status {
  align-self: start;
  min-height: 20px;
  padding: .1rem .45rem;
  font-size: .72rem;
  line-height: 1.1;
}

.portal-review-link-actions {
  align-items: end;
}

.portal-editor-toolbar--format {
  gap: .35rem;
  border: 1px solid var(--portal-line);
  border-radius: 8px 8px 0 0;
  padding: .45rem;
  background: var(--portal-surface-strong);
}

.portal-editor-toolbar--format button {
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 5px;
  padding: .3rem .55rem;
  background: transparent;
  color: var(--portal-ink);
  cursor: pointer;
}

.portal-editor-toolbar--format button:hover,
.portal-editor-toolbar--format button:focus-visible {
  border-color: var(--portal-line);
  background: var(--portal-surface);
}

.portal-mdx-editor textarea {
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  line-height: 1.55;
  tab-size: 2;
}

.portal-mdx-help {
  margin: .5rem 0;
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  padding: .65rem .75rem;
  background: var(--portal-surface);
}

.portal-mdx-help summary {
  cursor: pointer;
  font-weight: 700;
}

.portal-mdx-help__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  margin-top: .75rem;
}

.portal-mdx-help pre {
  overflow-x: auto;
  margin: .35rem 0 0;
  border-radius: 6px;
  padding: .65rem;
  background: var(--portal-surface-strong);
}

.portal-editor-meta {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  margin: .35rem 0 0;
  color: var(--portal-muted);
  font-size: .85rem;
}

.portal-asset-list,
.portal-related-list {
  display: grid;
  gap: .6rem;
  min-height: 72px;
  border: 1px dashed var(--portal-line);
  border-radius: 8px;
  padding: .7rem;
  background: var(--portal-surface);
}

.portal-asset-list.is-dragging {
  border-color: var(--portal-accent);
  background: var(--portal-accent-soft);
}

.portal-asset-item,
.portal-related-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  padding: .6rem;
  background: var(--portal-panel);
}

.portal-asset-item img {
  width: 72px;
  height: 56px;
  border-radius: 6px;
  object-fit: cover;
}

.portal-asset-item .portal-field,
.portal-related-item > span {
  display: grid;
  flex: 1;
  gap: .15rem;
  margin: 0;
}

.portal-related-item small {
  color: var(--portal-muted);
}

.portal-authoring-settings {
  margin-top: .75rem;
}

.portal-authoring-settings > summary {
  cursor: pointer;
  font-weight: 700;
}

.portal-authoring-settings > .stack {
  margin-top: 1rem;
}

.portal-selected-reference {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-top: .4rem;
}

@media (max-width: 640px) {
  .portal-asset-item,
  .portal-related-item {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .portal-mdx-help__grid {
    grid-template-columns: 1fr;
  }
}

.portal-comment-list {
  display: grid;
  gap: .75rem;
}

.portal-comment {
  display: grid;
  gap: .4rem;
  border-left: 4px solid var(--portal-accent-line);
  border-radius: 6px;
  padding: .75rem .85rem;
  background: var(--portal-surface);
}

.portal-comment > div {
  display: flex;
  gap: .55rem;
  align-items: center;
  justify-content: space-between;
}

.portal-comment p {
  margin: 0;
}

.portal-choice-list {
  display: grid;
  gap: .5rem;
}

.portal-choice {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  padding: .7rem .8rem;
  background: var(--portal-surface);
  color: var(--portal-ink);
  text-align: left;
  cursor: pointer;
}

.portal-choice span:first-child,
.portal-chip span {
  display: grid;
  gap: .1rem;
}

.portal-choice small,
.portal-chip small {
  color: var(--portal-muted);
}

.portal-choice.is-selected {
  border-color: var(--portal-accent);
  background: var(--portal-accent-soft);
}

.portal-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.portal-chip {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  border: 1px solid var(--portal-line);
  border-radius: 999px;
  padding: .4rem .45rem .4rem .75rem;
  background: var(--portal-surface-strong);
}

.portal-chip button {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--portal-muted);
  cursor: pointer;
  font-size: 1.2rem;
}

.portal-editor-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr);
  align-items: start;
}

.portal-preview-panel {
  position: sticky;
  top: 1rem;
  min-height: 24rem;
  max-height: calc(100vh - 2rem);
  overflow: auto;
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  padding: 1rem;
  background: var(--portal-panel);
}

@media (max-width: 900px) {
  .portal-grid--dates {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portal-grid--dates input[type="date"] {
    width: 100%;
    min-width: 0;
  }

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

  .portal-preview-panel {
    position: static;
    max-height: none;
  }
}

.portal-profile-switch {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  max-width: 100%;
  min-height: 44px;
  border: 1px solid var(--portal-line);
  border-radius: 6px;
  padding: .25rem .35rem .25rem .65rem;
  background: var(--portal-surface);
  color: var(--portal-muted);
}

.portal-profile-switch__label {
  flex: 0 0 auto;
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.portal-profile-switch select {
  width: clamp(12rem, 24vw, 18rem);
  min-height: 34px;
  border: 0;
  border-left: 1px solid var(--portal-line);
  border-radius: 0;
  padding: .35rem .55rem;
  background: transparent;
  color: var(--portal-ink);
  font-weight: 700;
}

.portal-profile-switch select:disabled {
  color: var(--portal-muted);
  opacity: 1;
}

.portal-profile-switch:focus-within {
  outline: 3px solid rgba(37, 99, 235, .2);
  outline-offset: 2px;
  border-color: var(--portal-focus);
}

.portal-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  background: var(--portal-ink);
  color: #fff;
  min-height: 44px;
  padding: .58rem .95rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background .16s ease, box-shadow .16s ease, transform .16s ease;
}

.portal-button:hover {
  box-shadow: 0 8px 18px rgba(23, 32, 51, .14);
  transform: translateY(-1px);
}

.portal-button.portal-button--compact {
  align-self: start;
  width: auto;
  min-height: 38px;
  padding: .45rem .75rem;
  white-space: nowrap;
}

.portal-button.secondary {
  border: 1px solid var(--portal-accent-line);
  background: #fff;
  color: var(--portal-accent);
}

.portal-button.ghost {
  border: 1px solid var(--portal-line);
  background: #fff;
  color: var(--portal-ink);
}

.portal-button.danger {
  background: var(--portal-danger);
}

.portal-button:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.portal-code {
  overflow: auto;
  max-height: 220px;
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  padding: .75rem;
  background: #111827;
  color: #f8fafc;
  font-size: .82rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.portal-link {
  color: #1d4ed8;
  font-weight: 700;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.portal-notice {
  padding: .75rem;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a;
}

.portal-state {
  display: flex;
  gap: .65rem;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: .8rem;
  background: #eff6ff;
  color: #1e3a8a;
}

.portal-state[hidden] {
  display: none;
}

.portal-state__title {
  flex: 0 0 auto;
}

.portal-state__message {
  flex: 1 1 auto;
}

.portal-state--loading::before {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  content: "";
  animation: portal-spin .7s linear infinite;
}

.portal-state--success {
  border-color: #86efac;
  background: #ecfdf5;
  color: #065f46;
}

.portal-state--error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.portal-state--empty {
  border-color: var(--portal-line);
  border-style: dashed;
  background: var(--portal-surface);
  color: var(--portal-muted);
}

.portal-state__action {
  margin-left: auto;
}

.portal-toast {
  position: fixed;
  z-index: 100;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  display: flex;
  width: min(420px, calc(100vw - 2rem));
  gap: .75rem;
  align-items: flex-start;
  justify-content: space-between;
  border: 1px solid #86efac;
  border-radius: 10px;
  padding: .85rem 1rem;
  background: #ecfdf5;
  color: #065f46;
  box-shadow: 0 16px 40px rgba(23, 32, 51, .2);
}

.portal-toast[hidden] {
  display: none;
}

.portal-toast > div {
  display: grid;
  gap: .2rem;
}

.portal-toast--error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.portal-toast button {
  border: 0;
  padding: 0 .15rem;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

[aria-busy="true"] {
  cursor: progress;
}

@keyframes portal-spin {
  to { transform: rotate(360deg); }
}

.portal-notice--inline {
  margin-top: .75rem;
}

.portal-notice:focus {
  outline: 3px solid rgba(37, 99, 235, .2);
  outline-offset: 2px;
}

.portal-confirmation {
  display: grid;
  gap: .35rem;
  margin-top: 1rem;
  border: 1px solid #86efac;
  border-left: 4px solid #16a34a;
  border-radius: 8px;
  padding: .9rem;
  background: #f0fdf4;
  color: #14532d;
}

.portal-confirmation[hidden] {
  display: none;
}

.portal-confirmation:focus {
  outline: 3px solid rgba(22, 163, 74, .2);
  outline-offset: 2px;
}

.portal-confirmation h3,
.portal-confirmation p {
  margin: 0;
}

.portal-confirmation__eyebrow {
  color: #166534;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.portal-empty-state {
  margin: 0;
  border: 1px dashed var(--portal-line);
  border-radius: 8px;
  padding: .9rem;
  background: var(--portal-surface);
  color: var(--portal-muted);
}

.portal-error {
  background: #fef2f2;
  color: #991b1b;
}

.portal-success {
  background: #ecfdf5;
  color: #065f46;
}

.portal-submit-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  margin-top: .85rem;
  border: 1px solid var(--portal-soft-line);
  border-radius: 8px;
  padding: .75rem;
  background: var(--portal-accent-soft);
}

.portal-submit-strip[hidden] {
  display: none;
}

.portal-submit-strip p {
  margin: 0;
  color: var(--portal-ink);
  font-weight: 700;
}

.portal-calendar {
  display: grid;
  gap: .75rem;
}

.portal-availability-calendar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.portal-availability-month {
  border: 1px solid var(--portal-soft-line);
  border-radius: 10px;
  padding: .85rem;
  background: #fff;
}

.portal-availability-month__title {
  margin: 0 0 .75rem;
  color: var(--portal-ink);
  font-size: 1rem;
  text-align: center;
}

.portal-availability-month__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(34px, 1fr));
  gap: .3rem;
}

.portal-availability-weekday {
  padding: .2rem 0;
  color: var(--portal-muted);
  font-size: .72rem;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.portal-availability-day {
  position: relative;
  min-width: 0;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--portal-muted);
  font: inherit;
  font-weight: 700;
}

.portal-availability-day:disabled {
  opacity: .45;
}

.portal-availability-day--blank {
  min-height: 42px;
}

.portal-availability-day.is-available {
  border-color: var(--portal-accent);
  background: var(--portal-accent-soft);
  color: var(--portal-accent);
  cursor: pointer;
}

.portal-availability-day.is-available::after {
  position: absolute;
  bottom: 4px;
  left: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  content: '';
  transform: translateX(-50%);
}

.portal-availability-day.is-available:hover,
.portal-availability-day.is-available[aria-pressed="true"] {
  background: var(--portal-accent);
  color: #fff;
}

.portal-availability-day.is-available:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--portal-accent) 35%, transparent);
  outline-offset: 2px;
}

.portal-availability-times {
  margin-top: 1rem;
  border: 1px solid var(--portal-soft-line);
  border-radius: 10px;
  background: #fff;
}

.portal-availability-times__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .75rem;
  border-bottom: 1px solid var(--portal-soft-line);
  background: var(--portal-surface);
}

.portal-availability-times__header h3 {
  margin: 0;
  font-size: 1rem;
}

.portal-day {
  border: 1px solid var(--portal-soft-line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.portal-day-header {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  padding: .75rem;
  background: var(--portal-surface);
  border-bottom: 1px solid var(--portal-soft-line);
}

.portal-slot-list {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  padding: .75rem;
}

.portal-slot {
  border: 1px solid var(--portal-accent);
  color: var(--portal-accent);
  background: #fff;
  border-radius: 6px;
  min-height: 40px;
  padding: .44rem .72rem;
  cursor: pointer;
  font-weight: 700;
}

.portal-slot[aria-pressed="true"] {
  background: var(--portal-accent);
  color: #fff;
}

.portal-list {
  display: grid;
  gap: .65rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.portal-item {
  border: 1px solid var(--portal-soft-line);
  border-radius: 8px;
  padding: .85rem;
  background: #fff;
}

.portal-item-header {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
}

.portal-item-header--top {
  align-items: flex-start;
}

.portal-item-button {
  width: 100%;
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  background: #fff;
  padding: .75rem;
  text-align: left;
  cursor: pointer;
  color: var(--portal-ink);
}

.portal-item-button.is-active {
  border-color: var(--portal-accent);
  background: var(--portal-accent-soft);
}

.portal-meta-row {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  align-items: center;
}

.portal-footer-note {
  color: var(--portal-muted);
  font-size: .9rem;
}

.portal-embed-body {
  margin: 0;
  background: transparent;
}

.portal-embed-page {
  min-height: 0;
  padding: 0;
}

.portal-embed-card {
  width: 100%;
  max-width: none;
  min-height: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.portal-embed-card .card__body {
  padding: 0;
}

.portal-honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.portal-tabs {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--portal-line);
  padding-bottom: .2rem;
}

.portal-tab {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  padding: .55rem .75rem;
  color: var(--portal-muted);
  font-weight: 800;
  text-decoration: none;
}

.portal-tab:hover,
.portal-tab:focus {
  color: var(--portal-accent);
  outline: 0;
}

.portal-tab.is-active {
  border-color: var(--portal-line);
  background: var(--portal-panel);
  color: var(--portal-accent);
}

.portal-profile-summary {
  display: flex;
  align-items: center;
  gap: .85rem;
  min-width: 0;
}

.portal-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  overflow: hidden;
  border: 1px solid var(--portal-line);
  border-radius: 999px;
  background: var(--portal-accent-soft);
  color: var(--portal-accent);
  font-weight: 900;
}

.portal-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portal-form {
  display: grid;
  gap: .85rem;
}

.portal-subpanel h3 {
  margin: 0;
  font-size: 1rem;
}

.portal-check-list {
  display: grid;
  gap: .35rem;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.portal-search {
  width: min(100%, 260px);
  min-height: 40px;
  border: 1px solid var(--portal-line);
  border-radius: 6px;
  padding: .5rem .65rem;
  color: var(--portal-ink);
}

.portal-list--cards {
  display: grid;
  gap: .75rem;
}

.portal-list-item--card {
  align-items: flex-start;
  border: 1px solid var(--portal-line);
  border-radius: 8px;
  padding: .85rem;
  background: var(--portal-surface);
}

.portal-shell--embed {
  gap: .75rem;
  padding: .75rem;
}

.portal-shell--embed .portal-hero {
  gap: .7rem;
  padding: .85rem;
}

.portal-shell--embed .portal-hero h1 {
  font-size: 1.28rem;
}

.portal-shell--embed .portal-panel {
  padding: .85rem;
}

.portal-shell--embed .title--section {
  margin-bottom: .2rem;
  font-size: 1rem;
}

.portal-shell--embed .muted {
  font-size: .92rem;
}

.portal-shell--embed .portal-grid,
.portal-shell--embed .portal-cards {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
}

.portal-shell--embed .portal-card-button {
  min-height: 96px;
}

.portal-shell--embed .portal-progress {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.portal-shell--embed .portal-progress li {
  min-height: 40px;
  padding: .45rem .5rem;
}

.portal-shell--embed .portal-actions {
  align-items: stretch;
}

.portal-shell--embed .portal-button,
.portal-shell--embed .portal-link {
  max-width: 100%;
}

.portal-shell--embed .portal-day-header {
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .portal-availability-month {
    min-width: 0;
    padding: .55rem;
  }

  .portal-availability-month__grid {
    min-width: 0;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: .16rem;
  }

  .portal-availability-weekday {
    min-width: 0;
    overflow: hidden;
    padding: .15rem 0;
    font-size: .62rem;
  }

  .portal-availability-day,
  .portal-availability-day--blank {
    width: 100%;
    min-width: 0;
    min-height: 36px;
    padding: 0;
    border-radius: 6px;
    font-size: .78rem;
    line-height: 1;
  }

  .portal-hero h1 {
    font-size: 1.5rem;
  }

  .portal-panel {
    padding: .85rem;
  }

  .portal-image-toolbar,
  .portal-image-toolbar__options,
  .portal-editor-secondary__grid,
  .portal-author-stats {
    grid-template-columns: 1fr;
  }

  .portal-image-toolbar > .portal-button {
    justify-content: center;
    width: 100%;
  }

  .portal-workflow-card--feedback {
    grid-column: auto;
  }

  .portal-item-header {
    display: grid;
  }

  #booking-time-panel > .portal-item-header {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  #booking-time-panel > .portal-item-header .portal-actions,
  #booking-time-panel > .portal-item-header .portal-button {
    width: 100%;
  }

  .portal-calendar-navigation {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .portal-calendar-navigation .portal-button {
    width: 100%;
    min-width: 0;
    padding-right: .4rem;
    padding-left: .4rem;
  }

  .portal-section-actions {
    justify-content: flex-start;
  }

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

  .portal-filter-actions .portal-button {
    flex: 1 1 auto;
    justify-content: center;
  }

  .portal-filter-bar--analytics {
    grid-template-columns: 1fr;
  }

  .portal-analytics-table {
    min-width: 0;
  }

  .portal-analytics-table thead {
    display: none;
  }

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

  .portal-analytics-table tr {
    border: 1px solid var(--portal-line);
    border-radius: 8px;
    padding: .4rem .7rem;
  }

  .portal-analytics-table td {
    display: grid;
    grid-template-columns: minmax(90px, .45fr) minmax(0, 1fr);
    gap: .75rem;
    border-bottom: 0;
    padding: .4rem 0;
    text-align: right;
  }

  .portal-analytics-table td::before {
    color: var(--portal-muted);
    content: attr(data-label);
    font-weight: 800;
    text-align: left;
  }

  .portal-analytics-table td:first-child {
    text-align: right;
  }

  .portal-shell--embed {
    padding: .5rem;
  }

  .portal-grid,
  .portal-cards,
  .portal-dashboard-grid,
  .portal-home-grid,
  .portal-home-hero {
    grid-template-columns: 1fr;
  }

  .portal-home-hero__aside {
    min-height: 0;
  }

  .portal-home-section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .portal-home-utility {
    align-items: flex-start;
    flex-direction: column;
  }

  .portal-home-utility__links,
  .portal-site-utility .portal-home-utility__links {
    justify-content: flex-start;
  }

  .portal-dashboard-guidance {
    align-items: flex-start;
    flex-direction: column;
  }

  .portal-profile-disabled-banner {
    align-items: stretch;
    flex-direction: column;
  }

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

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

  .portal-profile-switch {
    width: 100%;
    display: grid;
    gap: .35rem;
    justify-content: space-between;
  }

  .portal-profile-switch select {
    width: 100%;
    min-width: 0;
  }

  .portal-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-bottom: 0;
    padding-bottom: 0;
  }

  .portal-tab {
    justify-content: center;
    border: 1px solid var(--portal-line);
    border-radius: 8px;
  }

  .portal-profile-summary {
    align-items: flex-start;
  }

  .portal-navigation.is-enhanced .portal-navigation__toggle {
    display: flex;
  }

  .portal-navigation.is-enhanced .portal-account-nav {
    display: none;
    grid-template-columns: 1fr;
  }

  .portal-navigation.is-open .portal-account-nav {
    display: grid;
  }

  .portal-account-overview {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .portal-calendar-toolbar,
  .portal-appointment-drawer__header {
    align-items: stretch;
    flex-direction: column;
  }

  .portal-month-controls {
    display: grid;
    width: 100%;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
  }

  .portal-month-controls strong {
    min-width: 0;
  }

  .portal-month-controls #calendarPreviousMonth {
    grid-column: 1;
    grid-row: 1;
  }

  .portal-month-controls #calendarMonthLabel {
    grid-column: 2;
    grid-row: 1;
  }

  .portal-month-controls #calendarNextMonth {
    grid-column: 3;
    grid-row: 1;
  }

  .portal-month-controls #calendarToday {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .portal-calendar-view-tabs {
    width: 100%;
  }

  .portal-month-calendar {
    overflow-x: visible;
  }

  .portal-month-calendar__weekdays,
  .portal-month-calendar__grid {
    min-width: 0;
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .portal-month-calendar__weekdays span {
    overflow: hidden;
    padding: .35rem 0;
    font-size: .67rem;
  }

  .portal-month-day {
    min-width: 0;
    min-height: 70px;
    padding: .2rem;
  }

  .portal-month-day__number {
    width: 28px;
    height: 28px;
    margin: 0 auto;
    font-size: .78rem;
  }

  .portal-month-day__events {
    justify-items: center;
    gap: .18rem;
    margin-top: .15rem;
  }

  .portal-month-day .portal-calendar-event {
    display: block;
    width: 28px;
    min-width: 28px;
    min-height: 22px;
    border: 0;
    border-radius: 999px;
    padding: 0;
    background: var(--portal-accent-soft);
    box-shadow: inset 0 0 0 1px var(--portal-accent-line);
    font-size: 0;
  }

  .portal-month-day .portal-calendar-event::after {
    display: block;
    width: 7px;
    height: 7px;
    margin: auto;
    border-radius: 999px;
    background: var(--portal-accent);
    content: "";
  }

  .portal-month-day .portal-calendar-event > * {
    display: none;
  }

  .portal-month-day .portal-calendar-event--cancelled::after {
    background: var(--portal-danger);
  }

  .portal-month-day .portal-calendar-event--past::after {
    background: var(--portal-muted);
  }

  .portal-calendar-empty,
  .portal-empty-state {
    min-width: 0;
    overflow-wrap: anywhere;
  }

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

  .portal-state__message {
    min-width: 0;
    flex-basis: calc(100% - 2rem);
    overflow-wrap: anywhere;
  }

  .portal-state__action {
    width: 100%;
    margin-left: 0;
  }

  .portal-calendar-event {
    grid-template-columns: 1fr auto;
  }

  .portal-calendar-event > span:not(.portal-calendar-event__time):not(.portal-pill) {
    grid-column: 1 / -1;
  }

  .portal-calendar-event strong {
    grid-column: 1 / -1;
  }

  .portal-stat {
    padding: .65rem;
  }

  .portal-stat strong {
    font-size: 1.3rem;
  }

  .portal-booking-summary {
    bottom: .35rem;
    grid-template-columns: 1fr auto;
  }

  .portal-booking-summary > div:first-child {
    display: none;
  }

  .portal-booking-summary dl {
    grid-template-columns: 1fr;
  }

  .portal-booking-summary dl div:not(:last-child) {
    display: none;
  }

  .portal-booking-summary .portal-button {
    min-width: 110px;
  }

  .portal-booking-summary__continue .muted {
    display: none;
  }

  .portal-appointment-drawer {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: min(88vh, 760px);
    border-radius: 14px 14px 0 0;
  }

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

  .portal-reschedule-comparison__arrow {
    transform: rotate(90deg);
    justify-self: center;
  }

  .portal-search {
    width: 100%;
  }

  .portal-shell--embed .portal-progress {
    grid-template-columns: 1fr;
  }

  .portal-shell--embed .portal-actions {
    display: grid;
  }

  .portal-shell--embed .portal-button,
  .portal-shell--embed .portal-link {
    justify-content: center;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .portal-completion__track span {
    transition: none;
  }
}

.portal-editor-mode {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
  margin-bottom: .65rem;
}

.portal-editor-mode .is-active {
  border-color: var(--portal-accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--portal-accent) 20%, transparent);
}

.portal-editor-mode .muted {
  flex: 1 1 18rem;
}

.portal-rich-editor-pane {
  border: 1px solid var(--portal-border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--portal-surface);
}

.portal-rich-editor-pane .portal-editor-toolbar {
  margin: 0;
  padding: .55rem;
  border-bottom: 1px solid var(--portal-border);
}

.portal-rich-editor {
  min-height: 22rem;
  padding: 1rem;
  line-height: 1.65;
  outline: none;
}

.portal-rich-editor:focus {
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--portal-accent) 28%, transparent);
}

.portal-rich-editor img {
  max-width: 100%;
  height: auto;
}

.portal-rich-editor figure {
  margin: 1.25rem 0;
}

.portal-rich-editor figcaption {
  margin-top: .4rem;
  color: var(--portal-muted);
  font-size: .9rem;
}
