:root {
  --paper: #f7f1e3;
  --paper-shadow: #d8cbb3;
  --ink: #2b2822;
  --graphite: #6a6358;
  --pencil: rgba(52, 46, 36, 0.72);
  --bg: #d9cdb6;
  --panel: #f7f1e3;
  --panel-border: rgba(52, 46, 36, 0.34);
  --text: #2b2822;
  --muted: #6a6358;
  --brand: #2a4538;
  --card: #f7f1e3;
  --surface: #efe6d2;
  --grid-cell: #ffffff;
  --grid-line: rgba(29, 48, 42, 0.13);
  --shadow: 0 18px 48px rgba(25, 42, 36, 0.11);
  --shadow-tight: 0 8px 22px rgba(25, 42, 36, 0.08);
  --focus-ring: rgba(38, 66, 54, 0.22);
  --motion-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --radius: 12px;
  --radius-card: 18px;
  --radius-control: 12px;
  /* Semantic fills used by calendar + status cards */
  --success: #4d8b66;
  --success-soft: #d4efe0;
  --warning: #b9863f;
  --warning-soft: #f3e4c8;
  --info: #3f78ad;
  --info-soft: #d4e7f7;
  --danger: #8f314e;
  --danger-soft: #f3d5de;
  --cal-today-bg: #f0dfc0;
  --cal-today-border: #c99a4e;
  --cal-today-text: #5a3f1c;
  --cal-upcoming-bg: #c5e8d4;
  --cal-upcoming-border: #3d7a56;
  --cal-upcoming-text: #17412c;
  --cal-recurring-bg: #c5dbf0;
  --cal-recurring-border: #3a6fa0;
  --cal-recurring-text: #1c446b;
  --cal-plan-bg: #e0edf8;
  --cal-plan-border: #7fb1df;
  --cal-plan-text: #2a5a88;
  --cal-following-bg: #efc8d4;
  --cal-following-border: #8f314e;
  --cal-following-text: #6a1830;
}

* {
  box-sizing: border-box;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a,
input,
select,
textarea {
  transition:
    background 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease,
    color 150ms ease,
    transform 150ms var(--motion-ease);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--focus-ring);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "DM Sans", system-ui, sans-serif;
  color: var(--text);
  display: flex;
  justify-content: center;
  background: var(--bg);
}

.page-shell {
  width: min(430px, calc(100vw - 18px));
  margin: 0;
  padding: clamp(10px, 3vw, 16px) 0 28px;
}

.portal-hero {
  margin-bottom: 12px;
}

.portal-hero > div {
  padding: 16px;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #58705e;
}

.portal-hero h1 {
  margin: 0;
  font-size: clamp(1.45rem, 6vw, 2rem);
  line-height: 1.08;
  max-width: 12ch;
}

.hero-summary {
  margin: 0;
  max-width: 34ch;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--muted);
}

.hero-chip-row {
  margin: 12px 0 6px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.38rem 0.7rem;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--text);
  font-weight: 700;
  font-size: 0.82rem;
}

.frequency-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0.34rem 0.68rem;
  border: 1px solid rgba(38, 66, 54, 0.14);
  border-radius: 999px;
  background: rgba(232, 242, 236, 0.96);
  color: #264236;
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

.frequency-pill[hidden] {
  display: none;
}

.is-pending {
  background: #fdf1cf;
  color: #9b6500;
}

.visit-progress {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.55rem;
  padding: 0.3rem 0 0.55rem;
}

.visit-progress__step {
  display: flex;
  align-items: center;
  gap: 0.32rem;
  min-width: 0;
}

.visit-progress__dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #d7deea;
  flex: 0 0 auto;
}

.visit-progress__line {
  flex: 1 1 20px;
  min-width: 12px;
  height: 2px;
  border-radius: 999px;
  background: #d7deea;
}

.visit-progress__label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #7b8796;
  white-space: nowrap;
}

.visit-progress__step.is-complete .visit-progress__dot,
.visit-progress__step.is-active .visit-progress__dot {
  background: #265c3f;
}

.visit-progress__step.is-complete .visit-progress__label,
.visit-progress__step.is-active .visit-progress__label {
  color: #1f2b23;
}

.grid-shell {
  padding: 10px;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.grid-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(41, 54, 43, 0.08);
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  overscroll-behavior-y: none;
  touch-action: pan-x;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.grid-toolbar::-webkit-scrollbar {
  display: none;
}

.grid-toolbar__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  appearance: none;
  border: 1px solid rgba(41, 54, 43, 0.12);
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  border-radius: 8px;
  padding: 0.42rem 0.72rem;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  box-shadow: 0 1px 0 rgba(25, 42, 36, 0.04);
  transition:
    transform 150ms var(--motion-ease),
    background 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease,
    color 150ms ease;
}
.grid-toolbar__button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-tight);
}

.grid-toolbar__button.is-active {
  border-color: rgba(41, 66, 54, 0.18);
  background: #264236;
  color: white;
}

.toolbar-icon {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 1.05rem;
  height: 1.05rem;
  color: currentColor;
}

.toolbar-icon::before,
.toolbar-icon::after {
  content: "";
  position: absolute;
  box-sizing: border-box;
}

.toolbar-icon--home::before {
  left: 0.13rem;
  right: 0.13rem;
  bottom: 0.11rem;
  height: 0.58rem;
  border: 0.12rem solid currentColor;
  border-top: 0;
  border-radius: 0.08rem 0.08rem 0.12rem 0.12rem;
}

.toolbar-icon--home::after {
  left: 0.2rem;
  top: 0.08rem;
  width: 0.65rem;
  height: 0.65rem;
  border-top: 0.13rem solid currentColor;
  border-left: 0.13rem solid currentColor;
  border-radius: 0.08rem 0 0 0;
  transform: rotate(45deg);
}

.toolbar-icon--visit::before {
  left: 0.1rem;
  top: 0.1rem;
  width: 0.62rem;
  height: 0.62rem;
  border: 0.13rem solid currentColor;
  border-radius: 999px;
}

.toolbar-icon--visit::after {
  right: 0.12rem;
  bottom: 0.14rem;
  width: 0.46rem;
  height: 0.13rem;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(45deg);
  transform-origin: right center;
}

.grid-toolbar__button--add {
  margin-left: auto;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 999px;
  border-color: rgba(41, 66, 54, 0.18);
  background: #264236;
  color: white;
  font-size: 1rem;
  line-height: 1;
}

.grid-view-panel[hidden] {
  display: none !important;
}

.grid-view-panel:not([hidden]),
.portal-gate:not([hidden]) {
  animation: panelReveal 220ms var(--motion-ease) both;
}

@keyframes panelReveal {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.panel-intro {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.panel-intro__eyebrow {
  margin: 0;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #6f7d72;
}

.panel-intro h2 {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.08;
}

.panel-intro__copy {
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.45;
  color: var(--muted);
}

.plan-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(41, 54, 43, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.plan-control[hidden] {
  display: none;
}

.plan-control__copy {
  display: grid;
  gap: 5px;
}

.plan-control__title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.plan-control h3,
.plan-control p {
  margin: 0;
}

.plan-control h3 {
  font-size: 0.86rem;
}

.plan-control p {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.plan-control__status {
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(38, 66, 54, 0.1);
  color: #264236;
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.plan-control__status.is-paused {
  background: rgba(143, 49, 78, 0.1);
  color: #8f314e;
}

.plan-control__feedback.is-error {
  color: #8f314e;
}

@media (max-width: 680px) {
  .plan-control {
    align-items: stretch;
    flex-direction: column;
  }
}

.portal-gate {
  display: grid;
  gap: 10px;
  padding: 18px;
  border-radius: 12px;
  border: 1px solid rgba(41, 54, 43, 0.08);
  background: var(--card);
  box-shadow: var(--shadow-tight);
}

.portal-gate[hidden],
#portalWorkspace[hidden] {
  display: none !important;
}

.portal-gate h2 {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.08;
}

.portal-link-form {
  display: grid;
  gap: 10px;
  margin-top: 2px;
}

.portal-link-field {
  display: grid;
  gap: 6px;
}

.portal-link-field span {
  font-size: 0.72rem;
  font-weight: 800;
  color: #4d5f52;
}

.portal-link-field input {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(41, 54, 43, 0.14);
  border-radius: 8px;
  padding: 0.72rem 0.78rem;
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
}

.portal-link-status {
  min-height: 1.1rem;
  margin: 0;
  font-size: 0.74rem;
  line-height: 1.4;
  color: var(--muted);
}

.portal-link-status.is-error {
  color: #7d2940;
}

.board-empty-state {
  padding: 16px 12px;
  border: 1px dashed rgba(41, 54, 43, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
  text-align: center;
}

.info-panel {
  min-height: 248px;
  display: grid;
  align-content: start;
  gap: 10px;
}

.info-panel__eyebrow {
  margin: 0;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #6f7d72;
}

.info-panel h2 {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.08;
}

.info-panel__stack {
  display: grid;
  gap: 8px;
}

.visit-intel-grid {
  display: grid;
  gap: 10px;
}

.visit-intel-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(41, 54, 43, 0.1);
  border-radius: 10px;
  background: var(--card);
  box-shadow: 0 1px 0 rgba(25, 42, 36, 0.03);
}

.visit-intel-card--readiness {
  border-color: rgba(38, 66, 54, 0.13);
}

.visit-intel-card--readiness[data-readiness-state="ready"] {
  background: var(--success-soft);
}

.visit-intel-card--readiness[data-readiness-state="needs-info"] {
  background: var(--warning-soft);
}

.visit-intel-card__head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.visit-intel-card__eyebrow {
  margin: 0 0 4px;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6f7d72;
}

.visit-intel-card h3 {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.14;
}

.visit-intel-card__copy {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--muted);
}

.visit-readiness-score {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  min-height: 34px;
  padding: 0.35rem 0.48rem;
  border-radius: 8px;
  background: #264236;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
}

.visit-missing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.visit-missing-actions button {
  appearance: none;
  width: auto;
  border: 1px solid rgba(38, 66, 54, 0.14);
  border-radius: 999px;
  padding: 0.44rem 0.64rem;
  background: rgba(255, 255, 255, 0.82);
  color: #264236;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
}

.visit-missing-actions button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-tight);
}

.visit-flag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.visit-flag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.32rem 0.56rem;
  border-radius: 999px;
  background: #eef2f7;
  color: #334155;
  font-size: 0.7rem;
  font-weight: 800;
}

.visit-flag--warning {
  background: #fdf1cf;
  color: #8a5a00;
}

.visit-flag--review {
  background: #e8f0ff;
  color: #244c89;
}

.visit-flag--locked {
  background: #f6e6e9;
  color: #7d2940;
}

.visit-flag--info {
  background: #e8f2ec;
  color: #264236;
}

.info-card {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(41, 54, 43, 0.08);
  background: var(--card);
  box-shadow: 0 1px 0 rgba(25, 42, 36, 0.03);
}

.info-card strong {
  font-size: 0.8rem;
  color: var(--text);
}

.info-card span {
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--muted);
}

.info-panel__action {
  appearance: none;
  border: 0;
  border-radius: 8px;
  padding: 0.72rem 0.9rem;
  background: #264236;
  color: white;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
}
.info-panel__action:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-tight);
}

.notes-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.notes-status {
  margin: 0;
  font-size: 0.74rem;
  line-height: 1.4;
  color: var(--muted);
}

.notes-status.is-error {
  color: #7d2940;
}

.visit-form {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid rgba(41, 54, 43, 0.08);
  background: rgba(255, 255, 255, 0.78);
}

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

.visit-form__field--wide {
  grid-column: 1 / -1;
}

.billing-layout {
  display: grid;
  gap: 10px;
}

.billing-pill--ready {
  background: #dceee2;
  color: #21543a;
}

.billing-pill--authorized {
  background: #d8edf6;
  color: #1b5670;
}

.billing-pill--confirmed {
  background: #e8ecf2;
  color: #304258;
}

.billing-pill--closed {
  background: #f4e4e8;
  color: #7d2940;
}

.billing-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.billing-stat {
  display: grid;
  gap: 3px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(244, 248, 245, 0.82);
  border: 1px solid rgba(41, 54, 43, 0.08);
}

.billing-stat strong {
  font-size: 0.68rem;
  color: #4d5f52;
}

.billing-stat span {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
}

.billing-note,
.billing-action-note {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--muted);
}

.billing-action-note.is-error {
  color: #8f314e;
}

.referral-portal-card {
  border-color: rgba(36, 77, 75, .28);
  background: linear-gradient(145deg, rgba(236, 246, 241, .95), rgba(255, 250, 239, .96));
}

.referral-portal-card .info-panel__action {
  width: fit-content;
}

.referral-gui-shell {
  position: fixed;
  inset: 0;
  z-index: 1200;
  padding: clamp(12px, 3vw, 28px);
  background: rgba(7, 22, 28, .82);
  backdrop-filter: blur(10px);
}

.referral-gui-shell[hidden] { display: none; }

.referral-gui-shell__frame {
  display: block;
  width: min(720px, 100%);
  height: min(760px, calc(100vh - 56px));
  margin: 0 auto;
  border: 0;
  border-radius: 22px;
  background: #f5f0e6;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .4);
}

.referral-gui-shell__close {
  position: fixed;
  top: clamp(18px, 4vw, 38px);
  right: clamp(18px, 4vw, 38px);
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 999px;
  padding: 9px 15px;
  background: #153b43;
  color: white;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.billing-actions-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.billing-secondary-action {
  appearance: none;
  border: 1px solid rgba(41, 54, 43, 0.12);
  border-radius: 8px;
  padding: 0.72rem 0.9rem;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
}
.billing-secondary-action:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-tight);
}

.billing-danger-action {
  width: 100%;
  border-color: rgba(176, 42, 42, 0.24);
  background: #b4232f;
  color: #fff;
  box-shadow: 0 8px 18px rgba(176, 42, 42, 0.18);
}

.billing-danger-action:hover:not(:disabled) {
  background: #9f1f2a;
  border-color: rgba(159, 31, 42, 0.32);
  box-shadow: 0 10px 22px rgba(176, 42, 42, 0.24);
}

.billing-danger-action:disabled {
  background: #d8b5b9;
  border-color: rgba(176, 42, 42, 0.12);
  color: rgba(255, 255, 255, 0.78);
  box-shadow: none;
}

.portal-confirm {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: grid;
  place-items: center;
  padding: 18px;
}

.portal-confirm__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 26, 22, 0.48);
  backdrop-filter: blur(5px);
}

.portal-confirm__dialog {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.8rem;
  width: min(430px, 100%);
  padding: 1.1rem;
  border-radius: 14px;
  border: 1px solid rgba(41, 54, 43, 0.12);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.portal-confirm__eyebrow {
  margin: 0;
  color: var(--accent-2);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.portal-confirm__dialog h2 {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.2rem, 3vw, 1.55rem);
  line-height: 1.1;
}

.portal-confirm__dialog p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.portal-confirm__field {
  display: grid;
  gap: 0.45rem;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 800;
}

.portal-confirm__field textarea {
  width: 100%;
  resize: vertical;
  min-height: 104px;
  border: 1px solid rgba(41, 54, 43, 0.16);
  border-radius: 8px;
  padding: 0.78rem 0.85rem;
  background: rgba(255, 255, 252, 0.94);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  line-height: 1.4;
}

.portal-confirm__check {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.portal-confirm__check input {
  margin-top: 0.1rem;
  accent-color: var(--accent);
}

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

.schedule-gui-shell {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: #0d0f12;
  opacity: 0;
  transition: opacity 220ms ease;
}

.schedule-gui-shell[hidden] {
  display: none;
}

.schedule-gui-shell.is-open {
  opacity: 1;
}

.schedule-gui-shell__loader {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background:
    radial-gradient(ellipse 70% 50% at 50% 40%, rgba(42, 155, 88, 0.14), transparent 65%),
    linear-gradient(180deg, #121a16 0%, #0b100e 100%);
  color: rgba(214, 228, 218, 0.72);
  font-size: 0.88rem;
  font-weight: 550;
  letter-spacing: -0.01em;
  transition: opacity 220ms ease;
}

.schedule-gui-shell.is-ready .schedule-gui-shell__loader {
  opacity: 0;
  pointer-events: none;
}

.schedule-gui-shell__spinner {
  width: 28px;
  height: 28px;
  border: 2.5px solid rgba(196, 220, 204, 0.12);
  border-top-color: rgba(62, 207, 122, 0.85);
  border-radius: 50%;
  animation: scheduleGuiSpin 0.7s linear infinite;
}

@keyframes scheduleGuiSpin {
  to { transform: rotate(360deg); }
}

.schedule-gui-shell__loader-text {
  margin: 0;
}

.schedule-gui-shell__loader--error .schedule-gui-shell__spinner {
  display: none;
}

.schedule-gui-shell__loader--error .schedule-gui-shell__loader-text {
  color: rgba(245, 245, 247, 0.82);
  max-width: 16rem;
  text-align: center;
  line-height: 1.45;
}

.schedule-gui-shell__frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #0b100e;
}

.schedule-gui-shell__close {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  z-index: 2;
  min-height: 36px;
  border: 1px solid rgba(62, 207, 122, 0.28);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(28, 40, 33, 0.92), rgba(16, 24, 20, 0.9));
  color: #f3f7f4;
  padding: 7px 15px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 680;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(18px) saturate(1.15);
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.schedule-gui-shell__close:hover {
  background: linear-gradient(180deg, rgba(38, 56, 44, 0.95), rgba(22, 34, 28, 0.92));
  border-color: rgba(62, 207, 122, 0.42);
}

.schedule-gui-shell__close:active {
  transform: scale(0.97);
}

body.schedule-gui-open {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .schedule-gui-shell,
  .schedule-gui-shell__loader {
    transition-duration: 1ms;
  }
  .schedule-gui-shell__spinner {
    animation-duration: 1ms;
    animation-iteration-count: 1;
  }
}


.next-visit-panel {
  display: grid;
  gap: 10px;
}

.next-visit-layout {
  display: grid;
  gap: 10px;
}

.next-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(41, 54, 43, 0.08);
  border-radius: 10px;
  background: var(--card);
  box-shadow: 0 1px 0 rgba(25, 42, 36, 0.03);
}

.next-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.next-card__header-actions {
  display: grid;
  gap: 6px;
  justify-items: end;
}

.next-visit-doors {
  display: grid;
  gap: 7px;
  margin: 0 0 12px;
}

.next-visit-doors[hidden] {
  display: none;
}

.next-visit-doors__label {
  margin: 0;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
}

.next-visit-doors__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 8px;
}

.next-visit-door {
  display: grid;
  align-content: start;
  gap: 1px;
  min-height: 0;
  padding: 6px 9px 7px;
  border: 1.7px solid var(--ink);
  border-radius: 18px 7px 16px 9px / 9px 16px 7px 18px;
  background:
    repeating-linear-gradient(
      -22deg,
      transparent,
      transparent 4px,
      rgba(52, 46, 36, 0.035) 4px,
      rgba(52, 46, 36, 0.035) 5px
    ),
    #fffaf1;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow:
    0.6px 1px 0 rgba(43, 40, 34, 0.42),
    1.5px 2.5px 0 rgba(43, 40, 34, 0.1);
  transform: rotate(-0.5deg);
}

.next-visit-door:nth-child(2) {
  border-radius: 7px 18px 8px 16px / 16px 8px 18px 7px;
  transform: rotate(0.45deg);
}

.next-visit-door:nth-child(3) {
  border-radius: 16px 8px 18px 7px / 8px 18px 7px 16px;
  transform: rotate(0.35deg);
}

.next-visit-door:nth-child(4) {
  border-radius: 8px 16px 7px 18px / 18px 7px 16px 9px;
  transform: rotate(-0.55deg);
}

.next-visit-door:hover:not(:disabled),
.next-visit-door:focus-visible {
  background:
    repeating-linear-gradient(
      -22deg,
      transparent,
      transparent 4px,
      rgba(52, 46, 36, 0.05) 4px,
      rgba(52, 46, 36, 0.05) 5px
    ),
    #f4ead3;
  box-shadow:
    0.6px 1px 0 rgba(43, 40, 34, 0.5),
    2px 3px 0 rgba(43, 40, 34, 0.12);
}

.next-visit-door:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.next-visit-door[hidden] {
  display: none;
}

.next-visit-door.is-active,
.next-visit-door[aria-expanded="true"] {
  background: #2a4538;
  color: #f6f1e3;
  box-shadow:
    1px 1.5px 0 rgba(43, 40, 34, 0.45),
    2px 3px 0 rgba(43, 40, 34, 0.16);
}

.next-visit-door strong {
  font-family: Georgia, "Palatino Linotype", "Book Antiqua", serif;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.next-visit-door span {
  color: inherit;
  opacity: 0.76;
  font-size: 0.61rem;
  line-height: 1.25;
}

@media (min-width: 760px) {
  .next-visit-doors__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .next-visit-door,
  .next-visit-door:nth-child(n) {
    transform: none;
  }
}

.next-card__eyebrow {
  margin: 0 0 3px;
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6f7d72;
}

.next-card h3 {
  margin: 0;
  font-size: 0.96rem;
  line-height: 1.12;
}

.next-card__copy {
  margin: -2px 0 0;
  font-size: 0.73rem;
  line-height: 1.42;
  color: var(--muted);
}

.next-visit-scheduler {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(138px, 0.9fr);
  gap: 10px;
  align-items: start;
}

.next-visit-scheduler__calendar,
.next-visit-sidecar {
  display: grid;
  gap: 10px;
}

.next-visit-sidecar {
  padding-left: 10px;
  border-left: 1px solid rgba(41, 54, 43, 0.08);
}

.calendar-inline-action {
  appearance: none;
  border: 1px solid rgba(41, 54, 43, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  padding: 0.42rem 0.72rem;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}

.calendar-inline-action--schedule {
  min-height: 42px;
  border: 1px solid rgba(20, 33, 26, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow:
    0 1px 2px rgba(20, 33, 26, 0.08),
    0 8px 18px rgba(20, 33, 26, 0.11);
  color: #18271f;
  padding: 0.58rem 1.05rem;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0;
  transition:
    background-color 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.calendar-inline-action--schedule:hover:not(:disabled) {
  background: #f8fbf8;
  box-shadow:
    0 2px 4px rgba(20, 33, 26, 0.1),
    0 10px 24px rgba(20, 33, 26, 0.14);
  transform: translateY(-1px);
}

.calendar-inline-action--schedule:active:not(:disabled) {
  box-shadow: 0 1px 3px rgba(20, 33, 26, 0.14);
  transform: translateY(0);
}

.calendar-inline-action--schedule.is-active {
  background: #1f342b;
  border-color: rgba(31, 52, 43, 0.18);
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 8px 18px rgba(31, 52, 43, 0.22);
}

.calendar-inline-action--danger {
  color: #7a2e28;
  border-color: rgba(122, 46, 40, 0.18);
}

.calendar-plan-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 0.4rem 0.66rem;
  border: 1px solid rgba(42, 92, 145, 0.16);
  border-radius: 999px;
  background: rgba(240, 247, 254, 0.9);
  color: #244f7c;
  font-size: 0.7rem;
  font-weight: 800;
  white-space: nowrap;
}

.calendar-plan-toggle[hidden] {
  display: none;
}

.calendar-plan-toggle input {
  width: 14px;
  height: 14px;
  accent-color: #3f78ad;
}

@media (min-width: 360px) {
  .next-card__header-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
  }
}

.calendar-inline-action.is-active {
  background: #264236;
  color: white;
  border-color: rgba(38, 66, 54, 0.18);
}

.calendar-inline-action.calendar-inline-action--schedule.is-active {
  background: #1f342b;
  border-color: rgba(31, 52, 43, 0.18);
  color: #fff;
}

.visit-timeline-tool {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(41, 54, 43, 0.08);
  border-radius: 8px;
  background: rgba(250, 253, 251, 0.82);
  overflow: hidden;
}

.visit-timeline-tool[hidden] {
  display: none;
}

.visit-timeline-toolbar,
.visit-timeline-pause-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.visit-timeline-intent {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
  padding: 3px;
  border: 1px solid rgba(41, 54, 43, 0.1);
  border-radius: 8px;
  background: rgba(241, 246, 243, 0.92);
}

.visit-timeline-intent__button {
  appearance: none;
  min-width: 70px;
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #5f6c62;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 800;
  transition:
    background 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.visit-timeline-intent__button.is-active {
  background: #ffffff;
  color: #21382e;
  box-shadow: 0 1px 5px rgba(25, 42, 36, 0.08);
}

.visit-timeline-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #53625a;
  font-size: 0.7rem;
  font-weight: 800;
  cursor: pointer;
}

.visit-timeline-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.visit-timeline-switch__track {
  position: relative;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: #d9e2dc;
  box-shadow: inset 0 0 0 1px rgba(41, 54, 43, 0.08);
  pointer-events: none;
  transition:
    background 180ms ease,
    box-shadow 180ms ease;
}

.visit-timeline-switch__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(25, 42, 36, 0.18);
  transition: transform 180ms var(--motion-ease);
}

.visit-timeline-switch input:checked + .visit-timeline-switch__track {
  background: #3f78ad;
  box-shadow: inset 0 0 0 1px rgba(36, 79, 124, 0.18);
}

.visit-timeline-switch input:checked + .visit-timeline-switch__track::after {
  transform: translateX(18px);
}

.visit-timeline-switch input:focus-visible + .visit-timeline-switch__track {
  outline: 2px solid rgba(63, 120, 173, 0.35);
  outline-offset: 2px;
}

.visit-timeline-readout {
  display: grid;
  gap: 2px;
}

.visit-timeline-readout strong {
  font-size: 0.82rem;
  line-height: 1.2;
}

.visit-timeline-readout span,
.visit-timeline-pause-panel,
.visit-timeline-guidance {
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.42;
}

.visit-timeline-scroll {
  margin-inline: -2px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}

.visit-timeline-track {
  position: relative;
  display: flex;
  align-items: end;
  gap: 8px;
  min-height: 76px;
  width: max-content;
  min-width: 100%;
  padding: 9px 2px 8px;
}

.visit-timeline-track::before {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 31px;
  height: 2px;
  border-radius: 999px;
  background: rgba(41, 54, 43, 0.08);
}

.visit-timeline-dot {
  position: relative;
  z-index: 1;
  appearance: none;
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  min-height: 60px;
  align-content: end;
  justify-items: center;
  gap: 5px;
  padding: 0 2px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #68756d;
  font: inherit;
  transition:
    flex-basis 220ms var(--motion-ease),
    width 220ms var(--motion-ease),
    opacity 180ms ease,
    transform 180ms var(--motion-ease),
    background 180ms ease;
}

.visit-timeline-dot__pip {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #cfdad3;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.92);
  transition:
    width 220ms var(--motion-ease),
    height 220ms var(--motion-ease),
    background 160ms ease,
    transform 180ms var(--motion-ease);
}

.visit-timeline-dot__label {
  max-width: 42px;
  overflow: hidden;
  color: inherit;
  font-size: 0.58rem;
  font-weight: 800;
  line-height: 1.12;
  text-align: center;
  white-space: nowrap;
  transition: opacity 160ms ease;
}

.visit-timeline-dot.is-recurring .visit-timeline-dot__pip {
  background: #3f78ad;
}

.visit-timeline-dot.is-current .visit-timeline-dot__pip {
  width: 22px;
  height: 22px;
  background: #4d8b66;
}

.visit-timeline-dot.is-following .visit-timeline-dot__pip {
  background: #8f314e;
}

.visit-timeline-dot.is-unavailable .visit-timeline-dot__pip {
  background: #b95560;
}

.visit-timeline-dot.is-weekend {
  opacity: 0.5;
}

.visit-timeline-dot.is-past {
  opacity: 0.46;
}

.visit-timeline-dot.is-selected {
  color: #21382e;
  transform: translateY(-2px);
}

.visit-timeline-dot.is-selected .visit-timeline-dot__pip {
  transform: scale(1.18);
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.96),
    0 0 0 7px rgba(63, 120, 173, 0.16);
}

.visit-timeline-dot.is-ignored {
  background: rgba(63, 120, 173, 0.08);
}

.visit-timeline-tool.is-pause-on .visit-timeline-dot.is-before-active {
  flex-basis: 15px;
  width: 15px;
  opacity: 0.72;
}

.visit-timeline-tool.is-pause-on .visit-timeline-dot.is-before-active .visit-timeline-dot__pip {
  width: 7px;
  height: 7px;
}

.visit-timeline-tool.is-pause-on .visit-timeline-dot.is-before-active .visit-timeline-dot__label {
  opacity: 0;
}

.visit-timeline-pause-panel {
  display: grid;
  gap: 8px;
  padding-top: 2px;
}

.visit-timeline-pause-panel[hidden],
.visit-timeline-guidance[hidden] {
  display: none;
}

.visit-timeline-pause-panel p,
.visit-timeline-guidance p {
  margin: 0;
}

.visit-timeline-guidance {
  display: grid;
  gap: 8px;
  padding: 8px;
  border-radius: 8px;
  background: rgba(240, 247, 254, 0.9);
  color: #244f7c;
}

.visit-timeline-guidance__choices {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.visit-timeline-guidance__choices .calendar-inline-action {
  min-height: 32px;
  border-color: rgba(42, 92, 145, 0.16);
  color: #244f7c;
}

.cleanflow-scheduler-app {
  --scheduler-bg: #0d0f12;
  --scheduler-panel: rgba(28, 30, 34, 0.78);
  --scheduler-panel-2: rgba(38, 40, 44, 0.72);
  --scheduler-line: rgba(255, 255, 255, 0.13);
  --scheduler-line-soft: rgba(255, 255, 255, 0.08);
  --scheduler-text: #f5f5f7;
  --scheduler-muted: rgba(235, 235, 245, 0.58);
  --scheduler-soft: rgba(245, 245, 247, 0.86);
  --scheduler-blue: #0a84ff;
  --scheduler-blue-soft: rgba(63, 140, 255, 0.2);
  --scheduler-red: #ff453a;
  --scheduler-red-soft: rgba(255, 69, 58, 0.18);
  --scheduler-green: #30d158;
  --scheduler-amber: #ffd60a;
  --scheduler-gray-dot: rgba(235, 235, 245, 0.56);
  --scheduler-shadow: rgba(0, 0, 0, 0.38);
  --scheduler-spring: cubic-bezier(0.16, 0.82, 0.32, 1.02);
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  min-height: 100dvh;
  z-index: 1000;
  display: grid;
  grid-template-rows: auto minmax(300px, 1fr) auto;
  gap: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--scheduler-bg);
  color: var(--scheduler-text);
  overflow: hidden;
  overscroll-behavior: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  animation: schedulerEnter 280ms var(--scheduler-spring) both;
}

.cleanflow-scheduler-app[hidden] {
  display: none;
}

.scheduler-app__topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 18px clamp(18px, 5vw, 44px) 6px;
  background: rgba(13, 15, 18, 0.82);
  backdrop-filter: blur(22px);
}

.scheduler-app__back {
  appearance: none;
  width: 36px;
  height: 36px;
  border: 1px solid var(--scheduler-line-soft);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--scheduler-text);
  cursor: pointer;
  font: inherit;
  font-size: 1.6rem;
  line-height: 1;
  transition:
    background 150ms ease,
    transform 150ms var(--scheduler-spring);
}

.scheduler-app__back:hover {
  background: rgba(255, 255, 255, 0.14);
  transform: scale(1.06);
}

.scheduler-app__eyebrow {
  margin: 0 0 3px;
  color: var(--scheduler-muted);
  font-size: 0.74rem;
  font-weight: 520;
}

.scheduler-app__topbar h4,
.scheduler-app__panel-head h4 {
  margin: 0;
  color: var(--scheduler-text);
  letter-spacing: 0;
}

.scheduler-app__topbar h4 {
  font-size: 1.05rem;
  line-height: 1.2;
  font-weight: 650;
}

.scheduler-app__topbar-close {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--scheduler-muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  padding: 6px 10px;
  border-radius: 6px;
  transition: color 150ms ease, background 150ms ease;
}

.scheduler-app__topbar-close:hover {
  color: var(--scheduler-text);
  background: rgba(255, 255, 255, 0.06);
}

.scheduler-app__legend {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.scheduler-app__pill {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--scheduler-line);
  color: var(--scheduler-muted);
  font-size: 0.76rem;
  white-space: nowrap;
  backdrop-filter: blur(14px);
}

.scheduler-app__pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--scheduler-gray-dot);
}

.scheduler-app__pill--blue::before {
  background: var(--scheduler-blue);
}

.scheduler-app__pill--red::before {
  background: var(--scheduler-red);
}

.scheduler-app__stage {
  position: relative;
  display: grid;
  grid-template-rows: auto auto minmax(220px, 1fr) auto;
  min-height: 0;
  padding: 4px 0 0;
  overflow: hidden;
}

.scheduler-app__readout {
  width: min(560px, calc(100vw - 32px));
  margin: 0 auto;
  min-height: 64px;
  display: grid;
  align-content: center;
  text-align: center;
}

.scheduler-app__readout strong {
  font-size: clamp(1.2rem, 6vw, 2.4rem);
  font-weight: 700;
  line-height: 1.15;
}

.scheduler-app__readout span {
  margin-top: 5px;
  color: var(--scheduler-muted);
  font-size: 0.82rem;
}

.scheduler-app__intent {
  width: min(360px, calc(100vw - 32px));
  margin: 4px auto 0;
  min-height: 36px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--scheduler-line-soft);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  backdrop-filter: blur(16px);
}

.scheduler-app__intent-tab {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--scheduler-muted);
  cursor: pointer;
  min-height: 30px;
  padding: 5px 10px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  transition:
    color 180ms ease,
    background 180ms var(--scheduler-spring),
    box-shadow 180ms var(--scheduler-spring),
    transform 180ms var(--scheduler-spring);
}

.scheduler-app__intent-tab.is-active {
  background: rgba(245, 245, 247, 0.13);
  color: var(--scheduler-text);
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.18);
  transform: scale(1.02);
}

.scheduler-app__timeline {
  position: relative;
  min-height: 210px;
  display: flex;
  align-items: center;
  overflow: hidden;
  touch-action: pan-x;
}

.scheduler-app__scroll {
  width: 100%;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  display: flex;
  align-items: center;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -ms-overflow-style: none;
  cursor: grab;
  touch-action: pan-x;
}

.scheduler-app__scroll::-webkit-scrollbar {
  display: none;
}

.scheduler-app__scroll.is-dragging {
  cursor: grabbing;
}

.scheduler-app__scroll.is-pause-intent {
  cursor: grab;
  touch-action: pan-x;
}

.scheduler-app__track {
  --pad: calc(50vw - 18px);
  --dot-open: var(--scheduler-gray-dot);
  --dot-unavailable: var(--scheduler-red);
  --dot-recurring: var(--scheduler-blue);
  --dot-current: var(--scheduler-green);
  --dot-following: #ff9f0a;
  --dot-selected-open: var(--scheduler-soft);
  position: relative;
  min-width: max-content;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 var(--pad);
}

.scheduler-app__track::before {
  content: "";
  position: absolute;
  left: var(--pad);
  right: var(--pad);
  top: 50%;
  height: 2px;
  background: var(--border);
  transform: translateY(-50%);
  z-index: 0;
}

.scheduler-app__center-line {
  position: absolute;
  left: 50%;
  top: 18px;
  bottom: 18px;
  width: 1px;
  background: rgba(235, 235, 245, 0.18);
  pointer-events: none;
  z-index: 0;
}

.day-dot {
  position: relative;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  scroll-snap-align: center;
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
  transition:
    width 200ms var(--scheduler-spring),
    height 200ms var(--scheduler-spring),
    margin 200ms var(--scheduler-spring),
    transform 180ms var(--scheduler-spring),
    box-shadow 180ms var(--scheduler-spring),
    opacity 180ms ease;
}

.day-dot::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--dot-size, 10px);
  height: var(--dot-size, 10px);
  border-radius: 50%;
  background: var(--dot-color, var(--dot-open));
  transform: translate(-50%, -50%);
  transition:
    width 150ms ease,
    height 150ms ease,
    background 150ms ease,
    box-shadow 150ms ease,
    opacity 150ms ease;
}

.day-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.day-dot.is-available {
  --dot-color: var(--dot-open);
}

.day-dot.is-unavailable {
  --dot-color: var(--dot-unavailable);
}

.day-dot.is-empty {
  --dot-color: var(--dot-unavailable);
  opacity: 0.62;
}

.day-dot.is-recurring {
  --dot-size: 16px;
  --dot-color: var(--dot-recurring);
}

.day-dot.is-current {
  --dot-size: 25px;
  --dot-color: var(--dot-current);
}

.day-dot.is-current::before {
  box-shadow: 0 0 0 7px var(--scheduler-blue-soft), 0 12px 30px var(--scheduler-shadow);
}

.day-dot.is-following {
  --dot-size: 14px;
  --dot-color: var(--dot-following);
}

.day-dot.is-past {
  opacity: 0.42;
}

.day-dot.is-selected {
  --dot-size: 32px;
  transform: translateY(-2px);
}

.day-dot.is-selected::before {
  box-shadow: 0 0 0 8px rgba(217, 212, 198, 0.1), 0 16px 34px var(--scheduler-shadow);
}

.day-dot.is-selected.is-available {
  --dot-color: var(--dot-selected-open);
}

.day-dot.is-selected.is-recurring {
  --dot-color: var(--dot-recurring);
}

.day-dot.is-selected.is-recurring::before {
  box-shadow: 0 0 0 9px var(--scheduler-blue-soft), 0 16px 34px var(--scheduler-shadow);
}

.day-dot.is-selected.is-unavailable {
  --dot-color: var(--dot-unavailable);
}

.day-dot.is-selected.is-unavailable::before {
  box-shadow: 0 0 0 9px var(--scheduler-red-soft), 0 16px 34px var(--scheduler-shadow);
}

.day-dot.is-selected.is-empty {
  --dot-color: rgba(245, 245, 247, 0.62);
  opacity: 1;
}

.day-dot.is-in-range::before {
  box-shadow: 0 0 0 9px rgba(227, 179, 65, 0.14);
}

.scheduler-app__track.is-pause-mode .day-dot {
  opacity: 0;
}

.scheduler-app__track.is-pause-mode .day-dot::before {
  opacity: 0;
  box-shadow: none;
}

.scheduler-app__range-band {
  position: absolute;
  top: 50%;
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 214, 10, 0.16);
  border: 1px solid rgba(255, 214, 10, 0.34);
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 1;
  transition:
    left 220ms var(--scheduler-spring),
    width 220ms var(--scheduler-spring),
    opacity 200ms ease;
}

.scheduler-app__range-handle {
  position: absolute;
  top: 50%;
  width: 44px;
  height: 58px;
  border: 0;
  padding: 0;
  border-radius: 6px;
  background: transparent;
  transform: translate(-50%, -50%);
  cursor: ew-resize;
  z-index: 30;
  touch-action: none;
  transition:
    left 220ms var(--scheduler-spring),
    opacity 180ms ease;
}

.scheduler-app__range-handle::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 20px;
  width: 4px;
  border-radius: 999px;
  background: var(--scheduler-amber);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.18), 0 0 22px rgba(255, 214, 10, 0.22);
  transition: box-shadow 180ms ease;
}

.scheduler-app__range-handle::after {
  content: "";
  position: absolute;
  left: 13px;
  top: 50%;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(15, 16, 19, 0.94);
  border: 1px solid rgba(255, 214, 10, 0.55);
  transform: translateY(-50%);
  box-shadow: 0 2px 10px rgba(0,0,0,0.4);
}

.scheduler-app__range-handle:hover::before,
.scheduler-app__range-handle:active::before {
  box-shadow: 0 0 0 1px rgba(0,0,0,0.24), 0 0 32px rgba(255, 214, 10, 0.38);
}

.scheduler-app__track.is-range-dragging .scheduler-app__range-band,
.scheduler-app__track.is-range-dragging .scheduler-app__range-handle,
.scheduler-app__track.is-range-dragging .scheduler-app__pause-decor {
  transition-duration: 0ms;
}

.scheduler-app__pause-decor {
  position: absolute;
  top: 50%;
  z-index: 11;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  transform: translateY(-50%);
  pointer-events: none;
  transition: left 220ms var(--scheduler-spring);
}

.scheduler-app__pause-decor[hidden] {
  display: none;
}

.scheduler-app__pause-decor-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(235, 235, 245, 0.48);
  box-shadow: 0 0 10px rgba(235, 235, 245, 0.1);
  animation: pauseDotSwoop 900ms var(--scheduler-spring) both;
}

.scheduler-app__pause-decor-dot.is-captured {
  background: rgba(235, 235, 245, 0.78);
  box-shadow: 0 0 0 5px rgba(235, 235, 245, 0.08);
  animation: pauseDotCapture 260ms var(--scheduler-spring) both;
}

.scheduler-app__pause-decor-dot:nth-child(2) {
  animation-delay: 50ms;
}

.scheduler-app__pause-decor-dot:nth-child(3) {
  animation-delay: 100ms;
}

.scheduler-app__pause-decor-token {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(235, 235, 245, 0.34);
  filter: blur(1.5px);
  box-shadow: 0 0 0 0 transparent;
}

.scheduler-app__pause-decor.has-earned-token .scheduler-app__pause-decor-token {
  background: var(--scheduler-blue);
  filter: blur(2px);
  box-shadow:
    0 0 0 7px var(--scheduler-blue-soft),
    0 0 22px rgba(10, 132, 255, 0.42);
}

@keyframes pauseDotSwoop {
  from {
    opacity: 0;
    transform: translateX(22px) scale(0.56);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes pauseDotCapture {
  from {
    transform: translateX(8px) scale(0.78);
  }
  to {
    transform: translateX(0) scale(1.42);
  }
}

.scheduler-app__actions {
  width: min(680px, calc(100vw - 32px));
  margin: 0 auto 18px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
}

.scheduler-app__mode-toggle,
.scheduler-app__btn {
  min-height: 34px;
  border: 1px solid var(--scheduler-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--scheduler-soft);
  cursor: pointer;
  backdrop-filter: blur(14px);
  font: inherit;
  font-size: 0.82rem;
}

.scheduler-app__mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--scheduler-muted);
  padding: 5px 10px 5px 6px;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.scheduler-app__mode-track {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: rgba(235, 235, 245, 0.16);
  transition: background 180ms ease;
}

.scheduler-app__mode-track::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(245, 245, 247, 0.92);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
  transition: transform 180ms ease;
}

.scheduler-app__mode-toggle.is-on {
  border-color: rgba(255, 214, 10, 0.34);
  background: rgba(255, 214, 10, 0.11);
  color: var(--scheduler-soft);
}

.scheduler-app__mode-toggle.is-on .scheduler-app__mode-track {
  background: rgba(255, 214, 10, 0.72);
}

.scheduler-app__mode-toggle.is-on .scheduler-app__mode-track::after {
  transform: translateX(18px);
}

.scheduler-app__range-copy {
  color: var(--scheduler-muted);
  font-size: 0.8rem;
  min-width: 0;
}

.scheduler-app__btn {
  padding: 7px 12px;
  white-space: nowrap;
}

.scheduler-app__btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.scheduler-app__btn--primary {
  border-color: rgba(48, 209, 88, 0.42);
  background: rgba(48, 209, 88, 0.13);
}

.scheduler-app__btn--danger {
  border-color: rgba(255, 69, 58, 0.36);
  background: rgba(255, 69, 58, 0.1);
}

.scheduler-app__bottom {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
  gap: 14px;
  background: transparent;
  padding: 0 clamp(12px, 4vw, 34px) 18px;
}

.scheduler-app__panel {
  min-height: 152px;
  background: var(--scheduler-panel);
  border: 1px solid var(--scheduler-line-soft);
  border-radius: 8px;
  padding: 14px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(18px);
  animation: panelFadeIn 260ms var(--scheduler-spring) both;
}

@keyframes panelFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.scheduler-app__panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.scheduler-app__panel-head h4 {
  font-size: 0.86rem;
  font-weight: 650;
}

.scheduler-app__panel-head span {
  color: var(--scheduler-muted);
  font-size: 0.76rem;
}

.scheduler-app__slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 7px;
}

.scheduler-app__slot-chip {
  min-height: 40px;
  border: 1px solid var(--scheduler-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--scheduler-soft);
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  transition:
    border-color 160ms ease,
    background 160ms var(--scheduler-spring),
    transform 160ms var(--scheduler-spring),
    box-shadow 160ms ease;
}

.scheduler-app__slot-chip:hover {
  border-color: rgba(10, 132, 255, 0.48);
  background: rgba(10, 132, 255, 0.08);
  transform: translateY(-1px);
}

.scheduler-app__slot-chip.is-picked {
  border-color: rgba(10, 132, 255, 0.72);
  background: var(--scheduler-blue-soft);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(10, 132, 255, 0.18);
}

.scheduler-app__empty,
.scheduler-app__decision p {
  color: var(--scheduler-muted);
  font-size: 0.84rem;
  line-height: 1.42;
}

.scheduler-app__empty {
  min-height: 44px;
  display: flex;
  align-items: center;
}

.scheduler-app__decision-stack {
  display: grid;
  gap: 10px;
}

.scheduler-app__decision {
  border: 1px solid var(--scheduler-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  padding: 11px;
}

.scheduler-app__decision strong {
  display: block;
  color: var(--scheduler-text);
  font-size: 0.9rem;
  margin-bottom: 5px;
}

.scheduler-app__decision p {
  margin: 0;
}

.scheduler-app__decision-actions,
.scheduler-app__guided-question {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.scheduler-app__guided-question {
  display: grid;
}

.scheduler-app__guided-choice {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--scheduler-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--scheduler-soft);
  padding: 9px 10px;
  text-align: left;
  cursor: pointer;
}

.scheduler-app__guided-choice strong {
  display: block;
  color: var(--scheduler-text);
  font-size: 0.82rem;
  margin-bottom: 3px;
}

.scheduler-app__guided-choice span {
  display: block;
  color: var(--scheduler-muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.scheduler-app__guided-choice.is-picked {
  border-color: rgba(10, 132, 255, 0.72);
  background: var(--scheduler-blue-soft);
}

body.scheduler-app-open {
  overflow: hidden;
}

@keyframes schedulerEnter {
  from {
    opacity: 0;
    transform: scale(0.995);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.cleanflow-scheduler-app.is-exiting {
  animation: schedulerExit 200ms ease-in both;
}

@keyframes schedulerExit {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.995);
  }
}

@media (max-width: 760px) {
  .cleanflow-scheduler-app {
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
  }

  .scheduler-app__topbar {
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: 10px;
    padding: 10px 12px 4px;
  }

  .scheduler-app__back {
    width: 32px;
    height: 32px;
    font-size: 1.35rem;
  }

  .scheduler-app__eyebrow {
    margin-bottom: 2px;
    font-size: 0.66rem;
  }

  .scheduler-app__topbar h4 {
    font-size: 0.94rem;
  }

  .scheduler-app__stage {
    grid-template-rows: auto auto minmax(148px, 1fr) auto;
    padding-top: 2px;
    overflow: hidden;
  }

  .scheduler-app__readout {
    min-height: 50px;
    width: min(100%, calc(100vw - 24px));
  }

  .scheduler-app__readout strong {
    font-size: clamp(1.02rem, 5vw, 1.35rem);
  }

  .scheduler-app__readout span {
    margin-top: 3px;
    font-size: 0.7rem;
  }

  .scheduler-app__intent {
    width: min(300px, calc(100vw - 24px));
    min-height: 32px;
  }

  .scheduler-app__intent-tab {
    min-height: 26px;
    padding-block: 3px;
    font-size: 0.72rem;
  }

  .scheduler-app__timeline {
    min-height: 148px;
  }

  .scheduler-app__center-line {
    top: 10px;
    bottom: 10px;
  }

  .scheduler-app__track {
    --pad: calc(50vw - 16px);
    gap: 16px;
  }

  .day-dot {
    width: 36px;
    height: 36px;
  }

  .day-dot.is-selected {
    --dot-size: 24px;
  }

  .day-dot.is-current {
    --dot-size: 20px;
  }

  .day-dot.is-selected.is-current {
    --dot-size: 24px;
  }

  .scheduler-app__actions {
    width: calc(100vw - 24px);
    margin-bottom: 4px;
    gap: 7px;
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .scheduler-app__mode-toggle,
  .scheduler-app__btn {
    min-height: 30px;
    font-size: 0.72rem;
  }

  .scheduler-app__mode-toggle {
    padding: 4px 8px 4px 5px;
  }

  .scheduler-app__mode-track {
    width: 36px;
    height: 20px;
  }

  .scheduler-app__mode-track::after {
    width: 14px;
    height: 14px;
  }

  .scheduler-app__mode-toggle.is-on .scheduler-app__mode-track::after {
    transform: translateX(16px);
  }

  .scheduler-app__range-copy {
    font-size: 0.66rem;
    line-height: 1.25;
  }

  .scheduler-app__btn {
    padding: 5px 8px;
  }

  .scheduler-app__range-band {
    height: 12px;
  }

  .scheduler-app__range-handle {
    width: 22px;
    height: 44px;
  }

  .scheduler-app__range-handle::before {
    top: 9px;
    bottom: 9px;
    left: 9px;
    width: 4px;
  }

  .scheduler-app__range-handle::after {
    left: 3px;
    width: 16px;
    height: 17px;
  }

  .scheduler-app__bottom {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 7px;
    padding: 0 8px max(8px, env(safe-area-inset-bottom));
  }

  .scheduler-app__panel {
    min-height: 112px;
    max-height: 176px;
    overflow: auto;
    padding: 9px;
  }

  .scheduler-app__panel-head {
    gap: 6px;
    margin-bottom: 7px;
  }

  .scheduler-app__panel-head h4 {
    font-size: 0.7rem;
  }

  .scheduler-app__panel-head span {
    font-size: 0.64rem;
  }

  .scheduler-app__slot-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .scheduler-app__slot-chip {
    min-height: 32px;
    font-size: 0.7rem;
  }

  .scheduler-app__empty,
  .scheduler-app__decision p {
    font-size: 0.7rem;
    line-height: 1.32;
  }

  .scheduler-app__decision-stack {
    gap: 7px;
  }

  .scheduler-app__decision {
    padding: 8px;
  }

  .scheduler-app__decision strong {
    font-size: 0.74rem;
    margin-bottom: 4px;
  }
}

@media (max-width: 360px), (max-height: 640px) {
  .scheduler-app__topbar {
    align-items: center;
    padding-bottom: 2px;
  }

  .scheduler-app__readout {
    min-height: 44px;
  }

  .scheduler-app__timeline {
    min-height: 120px;
  }

  .scheduler-app__actions {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .scheduler-app__mode-toggle {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .scheduler-app__bottom {
    max-height: 152px;
  }

  .scheduler-app__panel {
    min-height: 104px;
    max-height: 144px;
  }
}

.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.calendar-nav__button {
  appearance: none;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(41, 54, 43, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  line-height: 1;
}

.calendar-nav__label {
  margin: 0;
  min-width: 102px;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text);
}

.calendar-weekdays,
.next-visit-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}

.calendar-weekdays span {
  text-align: center;
  font-size: 0.62rem;
  font-weight: 700;
  color: #7f8b81;
}

.calendar-day {
  appearance: none;
  position: relative;
  aspect-ratio: 1 / 1;
  border: 1px solid rgba(41, 54, 43, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  /* Full-cell schedule markers use background + bottom accent so days read at a glance */
  box-shadow: none;
  transition:
    transform 150ms var(--motion-ease),
    border-color 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease,
    color 150ms ease;
}
.calendar-day:hover:not(:disabled):not(.is-today):not(.is-upcoming):not(.is-recurring):not(.is-following):not(.is-recurring-plan):not(.is-selected) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-tight);
}

.calendar-day.is-outside {
  opacity: 0.42;
}

.calendar-day.is-disabled:not(.is-today):not(.is-upcoming):not(.is-recurring):not(.is-following):not(.is-recurring-plan) {
  color: rgba(23, 36, 31, 0.38);
  background: rgba(246, 248, 247, 0.9);
}

/* Schedule highlights: solid cell fill + colored bottom bar (not just day number tint) */
.calendar-day.is-today {
  border-color: var(--cal-today-border);
  background: var(--cal-today-bg);
  color: var(--cal-today-text);
  box-shadow: inset 0 -3px 0 0 var(--cal-today-border);
}

.calendar-day.is-recurring-plan {
  border-color: var(--cal-plan-border);
  background: var(--cal-plan-bg);
  color: var(--cal-plan-text);
  box-shadow: inset 0 -3px 0 0 var(--cal-plan-border);
}

.calendar-day.is-upcoming {
  border-color: var(--cal-upcoming-border);
  background: var(--cal-upcoming-bg);
  color: var(--cal-upcoming-text);
  font-weight: 800;
  box-shadow: inset 0 -3px 0 0 var(--cal-upcoming-border);
}

.calendar-day.is-recurring {
  border-color: var(--cal-recurring-border);
  background: var(--cal-recurring-bg);
  color: var(--cal-recurring-text);
  font-weight: 800;
  box-shadow: inset 0 -3px 0 0 var(--cal-recurring-border);
}

.calendar-day.is-following {
  border-color: var(--cal-following-border);
  background: var(--cal-following-bg);
  color: var(--cal-following-text);
  font-weight: 800;
  box-shadow: inset 0 -3px 0 0 var(--cal-following-border);
}

.calendar-day.is-selected {
  border-color: rgba(35, 62, 51, 0.42);
  box-shadow:
    inset 0 0 0 2px rgba(35, 62, 51, 0.28),
    0 0 0 2px rgba(35, 62, 51, 0.12);
  transform: translateY(-1px);
}

/* Keep schedule fill visible when the day is also selected */
.calendar-day.is-selected.is-today {
  box-shadow:
    inset 0 0 0 2px rgba(35, 62, 51, 0.28),
    inset 0 -3px 0 0 var(--cal-today-border),
    0 0 0 2px rgba(35, 62, 51, 0.12);
}

.calendar-day.is-selected.is-upcoming {
  box-shadow:
    inset 0 0 0 2px rgba(35, 62, 51, 0.28),
    inset 0 -3px 0 0 var(--cal-upcoming-border),
    0 0 0 2px rgba(35, 62, 51, 0.12);
}

.calendar-day.is-selected.is-recurring,
.calendar-day.is-selected.is-recurring-plan {
  box-shadow:
    inset 0 0 0 2px rgba(35, 62, 51, 0.28),
    inset 0 -3px 0 0 var(--cal-recurring-border),
    0 0 0 2px rgba(35, 62, 51, 0.12);
}

.calendar-day.is-selected.is-following {
  box-shadow:
    inset 0 0 0 2px rgba(35, 62, 51, 0.28),
    inset 0 -3px 0 0 var(--cal-following-border),
    0 0 0 2px rgba(35, 62, 51, 0.12);
}

.calendar-day:hover:not(:disabled).is-today,
.calendar-day:hover:not(:disabled).is-upcoming,
.calendar-day:hover:not(:disabled).is-recurring,
.calendar-day:hover:not(:disabled).is-recurring-plan,
.calendar-day:hover:not(:disabled).is-following {
  filter: brightness(0.97);
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  padding: 6px 1px 0;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.calendar-legend[hidden] {
  display: none;
}

.calendar-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.calendar-legend__swatch {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  flex: 0 0 auto;
  box-shadow: inset 0 -2px 0 0 rgba(0, 0, 0, 0.12);
}

.calendar-legend__swatch--today {
  background: var(--cal-today-bg);
  border: 1px solid var(--cal-today-border);
  box-shadow: inset 0 -2px 0 0 var(--cal-today-border);
}

.calendar-legend__swatch--upcoming {
  background: var(--cal-upcoming-bg);
  border: 1px solid var(--cal-upcoming-border);
  box-shadow: inset 0 -2px 0 0 var(--cal-upcoming-border);
}

.calendar-legend__swatch--recurring {
  background: var(--cal-recurring-bg);
  border: 1px solid var(--cal-recurring-border);
  box-shadow: inset 0 -2px 0 0 var(--cal-recurring-border);
}

.calendar-legend__swatch--recurring-plan {
  background: var(--cal-plan-bg);
  border: 1px solid var(--cal-plan-border);
  box-shadow: inset 0 -2px 0 0 var(--cal-plan-border);
}

.calendar-legend__swatch--following {
  background: var(--cal-following-bg);
  border: 1px solid var(--cal-following-border);
  box-shadow: inset 0 -2px 0 0 var(--cal-following-border);
}

.visit-map {
  display: grid;
  gap: 6px;
}

.visit-map__card {
  display: grid;
  gap: 1px;
  padding: 8px 9px;
  border-radius: 8px;
  border: 1px solid transparent;
}

.visit-map__card--upcoming {
  border-color: rgba(46, 96, 70, 0.16);
  background: var(--success-soft);
}

.visit-map__card--following {
  border-color: rgba(126, 33, 53, 0.16);
  background: var(--danger-soft);
}

.visit-map__card strong {
  font-size: 0.76rem;
}

.visit-map__card span {
  font-size: 0.66rem;
  color: rgba(31, 43, 35, 0.78);
}

.visit-map__badge {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 2px;
  padding: 0.2rem 0.42rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  font-size: 0.54rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.visit-map__legend {
  display: grid;
  gap: 4px;
  font-size: 0.62rem;
  color: var(--muted);
}

.visit-map__legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.legend-dot--upcoming {
  background: #4d8b66;
}

.legend-dot--following {
  background: #8f314e;
}

.legend-dot--selected {
  background: #274236;
}

.slot-pill-row,
.addon-group {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.slot-pill,
.addon-pill {
  appearance: none;
  border: 1px solid rgba(41, 54, 43, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  padding: 0.58rem 0.7rem;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  transition:
    background 150ms ease,
    border-color 150ms ease,
    color 150ms ease,
    transform 150ms var(--motion-ease);
}

.slot-pill {
  border-color: rgba(57, 116, 83, 0.16);
  background: var(--success-soft);
  color: #254c38;
}

.slot-pill:hover {
  transform: translateY(-1px);
}

.slot-pill::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 999px;
  background: #4d8b66;
  vertical-align: middle;
}

.slot-pill.is-selected,
.addon-pill.is-selected {
  border-color: rgba(38, 66, 54, 0.18);
  background: #264236;
  color: white;
}

.slot-pill.is-selected::before {
  background: rgba(255, 255, 255, 0.92);
}

.slot-pill[disabled] {
  opacity: 0.55;
  cursor: wait;
}

.next-visit-status,
.next-visit-selection {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--muted);
}

.next-visit-status {
  display: grid;
  gap: 8px;
}

.next-visit-status__message {
  margin: 0;
}

.next-visit-status.is-error {
  color: #8f314e;
}

.next-visit-actions {
  display: grid;
  gap: 8px;
}

.next-visit-sidecar .slot-pill-row {
  display: grid;
  gap: 7px;
}

.next-visit-sidecar .slot-pill {
  width: 100%;
  text-align: left;
  justify-content: flex-start;
}

.next-visit-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.mini-field {
  display: grid;
  gap: 5px;
}

.mini-field span {
  font-size: 0.67rem;
  font-weight: 700;
  color: #617063;
}

.mini-field input,
.mini-field select {
  width: 100%;
  appearance: none;
  border: 1px solid rgba(41, 54, 43, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
  padding: 0.64rem 0.7rem;
  font: inherit;
  font-size: 0.73rem;
}

.mini-field textarea {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  border: 1px solid rgba(41, 54, 43, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
  padding: 0.68rem 0.72rem;
  font: inherit;
  font-size: 0.73rem;
  line-height: 1.45;
}

.mini-field input:focus,
.mini-field select:focus,
.mini-field textarea:focus {
  outline: none;
  border-color: rgba(38, 66, 54, 0.34);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.compact-section {
  display: grid;
  gap: 8px;
}

.compact-section__head strong {
  display: block;
  font-size: 0.78rem;
}

.compact-section__head span {
  display: block;
  margin-top: 2px;
  font-size: 0.68rem;
  color: var(--muted);
}

.addon-stack {
  display: grid;
  gap: 6px;
}

.addon-stack [hidden] {
  display: none !important;
}

.custom-addon-launcher {
  display: flex;
  justify-content: flex-end;
}

.saved-custom-addon-list {
  display: grid;
  gap: 6px;
}

.saved-custom-addon {
  display: grid;
  gap: 12px;
  padding: 0.7rem;
  border: 1px solid rgba(38, 66, 54, 0.16);
  border-radius: 10px;
  background: rgba(244, 248, 245, 0.96);
}

.saved-custom-addon__check {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.saved-custom-addon__check span {
  display: grid;
  gap: 2px;
}

.saved-custom-addon small {
  color: var(--muted);
}

.saved-custom-addon input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: #264236;
}

.saved-custom-addon__price {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.saved-custom-addon__price input[type="range"] {
  width: 100%;
  accent-color: #264236;
}

.saved-custom-addon__price span {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
}

.custom-addon-widget {
  display: grid;
  gap: 10px;
}

.compact-note-editor {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid rgba(41, 54, 43, 0.08);
  border-radius: 10px;
  background: rgba(249, 251, 249, 0.98);
}

.compact-note-editor span {
  font-size: 0.74rem;
  font-weight: 700;
}

.compact-note-editor textarea {
  min-height: 96px;
  resize: vertical;
}

.compact-note-editor input {
  width: 100%;
}

.compact-note-editor--custom-addon {
  padding: 0;
  border: 0;
  background: transparent;
}

.addon-card {
  display: grid;
  gap: 0;
  padding: 0.1rem;
  border: 1px solid rgba(41, 54, 43, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  transition:
    background 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease,
    transform 150ms var(--motion-ease);
}

.addon-card:hover {
  transform: translateY(-1px);
}

.addon-card.is-selected {
  border-color: rgba(38, 66, 54, 0.18);
  background: var(--brand);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.addon-card--custom-request {
  gap: 10px;
  padding: 0.68rem 0.72rem;
  background: var(--card);
}

.addon-card--custom-request.is-selected {
  border-color: rgba(38, 66, 54, 0.12);
  background: var(--card);
  box-shadow: inset 0 0 0 1px rgba(38, 66, 54, 0.03);
}

.custom-addon-card__collapsed {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.custom-addon-card__copy {
  display: grid;
  gap: 4px;
}

.custom-addon-card__preview {
  margin: 0;
  font-size: 0.67rem;
  line-height: 1.5;
  color: var(--muted);
}

.custom-addon-card__toggle {
  align-self: end;
  justify-self: end;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(38, 66, 54, 0.18);
  border-radius: 999px;
  background: #264236;
  color: white;
  font: inherit;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  transition:
    transform 150ms var(--motion-ease),
    box-shadow 150ms ease,
    background 150ms ease;
}

.custom-addon-card__toggle--edit {
  width: auto;
  min-width: 44px;
  padding: 0 10px;
  font-size: 0.72rem;
  font-weight: 800;
}

.custom-addon-card__toggle:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(38, 66, 54, 0.14);
}

.custom-addon-card__toggle:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  box-shadow: none;
}

.custom-addon-card__expanded {
  display: grid;
  gap: 10px;
}

.custom-addon-card__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.addon-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  appearance: none;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  padding: 0.56rem 0.62rem;
  font: inherit;
  text-align: left;
}

.addon-option__copy {
  display: grid;
  gap: 2px;
}

.addon-card.is-selected .addon-option {
  color: white;
}

.addon-option__label {
  font-size: 0.74rem;
  font-weight: 700;
}

.addon-option__meta {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #7b8a80;
}

.addon-card.is-selected .addon-option__meta {
  color: rgba(255, 255, 255, 0.72);
}

.addon-option__check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid rgba(41, 54, 43, 0.18);
  background: rgba(255, 255, 255, 0.9);
  color: transparent;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  transition:
    background 150ms ease,
    border-color 150ms ease,
    color 150ms ease,
    transform 150ms ease;
}

.addon-card.is-selected .addon-option__check {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.14);
  color: white;
  transform: scale(1.02);
}

.addon-inline-slider {
  min-height: 0;
  overflow: hidden;
}

.addon-slider-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 0 0.62rem 0.56rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.addon-slider-row input[type="range"] {
  width: 100%;
  margin: 0;
  accent-color: #264236;
}

.addon-slider-row__meta {
  display: grid;
  justify-items: end;
  gap: 2px;
}

.addon-slider-row__value {
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--text);
}

.addon-slider-row__hint {
  font-size: 0.62rem;
  color: var(--muted);
  white-space: nowrap;
}

.addon-card.is-selected .addon-slider-row__value,
.addon-card.is-selected .addon-slider-row__hint {
  color: rgba(255, 255, 255, 0.84);
}

.estimate-card {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid rgba(41, 54, 43, 0.08);
  border-radius: 10px;
  background: var(--surface);
}

.estimate-card__head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.estimate-card h4 {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.12;
}

.estimate-card__amount {
  font-size: 1.02rem;
  line-height: 1;
  color: #264236;
}

.estimate-card__breakdown,
.estimate-card__note {
  margin: 0;
  font-size: 0.7rem;
  line-height: 1.42;
}

.estimate-card__breakdown {
  color: var(--text);
}

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

.next-visit-savebar {
  display: grid;
  gap: 6px;
}

.next-visit-savebar .info-panel__action {
  justify-self: start;
}

.portal-rebook-card__action {
  display: inline-flex;
  width: fit-content;
  margin-top: 0.45rem;
  text-decoration: none;
}

.frequency-readout {
  display: block;
  margin: 0.2rem 0 0.45rem;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 750;
}

.mini-field small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.mini-field textarea[readonly] {
  background: var(--paper-soft, #f4efe5);
  color: var(--muted);
  cursor: default;
}

.square-grid {
  display: grid;
  grid-template-columns: repeat(var(--grid-columns, 6), minmax(0, 1fr));
  gap: 4px;
  min-width: 0;
}

.square-cell {
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  border: 1px solid var(--grid-line);
  background: var(--card);
}

.square-cell--task {
  --task-accent: rgb(41 66 54);
  --task-soft: rgb(232 241 231);
  --task-soft-deep: rgb(216 231 216);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px;
  border-color: color-mix(in srgb, var(--task-accent) 28%, white);
  background: var(--task-soft);
  cursor: grab;
  transition:
    transform 160ms var(--motion-ease),
    box-shadow 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.square-cell--task:active {
  cursor: grabbing;
}

.square-cell--task.is-dragging {
  opacity: 0.45;
  transform: scale(0.96);
}

.square-cell--task.is-drop-target {
  border-color: color-mix(in srgb, var(--task-accent) 72%, white);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--task-accent) 22%, transparent);
  background: var(--task-soft-deep);
}

.square-cell.is-drop-target:not(.square-cell--task) {
  border-color: rgba(106, 27, 44, 0.34);
  box-shadow: inset 0 0 0 2px rgba(106, 27, 44, 0.12);
  background: var(--danger-soft);
}

.task-label {
  font-size: 0.46rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--task-accent);
  line-height: 1.1;
  text-align: center;
}

.task-label--text {
  font-size: 0.56rem;
  letter-spacing: 0.02em;
  text-transform: none;
  line-height: 1.15;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100vw - 12px, 430px);
    padding: 10px 0 20px;
  }

  .portal-hero > div,
  .grid-shell {
    border-radius: 12px;
  }

  .grid-shell {
    padding: 8px;
  }

  .grid-toolbar {
    gap: 5px;
    margin-bottom: 8px;
    padding-bottom: 8px;
  }

  .grid-toolbar__button {
    padding: 0.4rem 0.62rem;
    font-size: 0.68rem;
  }

  .grid-toolbar__button--add {
    width: 30px;
    height: 30px;
    padding: 0;
    font-size: 0.95rem;
  }

  .info-panel {
    min-height: 220px;
    gap: 8px;
  }

  .panel-intro {
    gap: 5px;
    margin-bottom: 8px;
  }

  .panel-intro h2 {
    font-size: 1rem;
  }

  .panel-intro__copy {
    font-size: 0.72rem;
  }

  .portal-gate {
    padding: 14px;
  }

  .board-empty-state {
    padding: 14px 10px;
    font-size: 0.74rem;
  }

  .info-panel h2 {
    font-size: 1.08rem;
  }

  .info-card {
    padding: 10px;
  }

  .info-card strong {
    font-size: 0.76rem;
  }

  .info-card span,
  .info-panel__action {
    font-size: 0.74rem;
  }

  .visit-form__grid,
  .next-visit-form,
  .billing-summary-grid {
    grid-template-columns: 1fr;
  }

  .notes-actions {
    align-items: start;
    flex-direction: column;
  }

  .next-card {
    padding: 10px;
    gap: 8px;
  }

  .next-card h3 {
    font-size: 0.9rem;
  }

  .next-visit-scheduler {
    grid-template-columns: 1fr;
  }

  .next-visit-sidecar {
    padding-left: 0;
    padding-top: 8px;
    border-left: 0;
    border-top: 1px solid rgba(41, 54, 43, 0.08);
  }

  .calendar-nav__button {
    width: 26px;
    height: 26px;
  }

  .calendar-nav__label {
    min-width: 92px;
    font-size: 0.68rem;
  }

  .calendar-weekdays span,
  .calendar-day {
    font-size: 0.66rem;
  }

  .visit-map__card {
    padding: 7px 8px;
  }

  .visit-map__card strong {
    font-size: 0.72rem;
  }

  .visit-map__card span,
  .visit-map__legend,
  .slot-pill,
  .next-visit-status,
  .next-visit-selection,
  .mini-field select {
    font-size: 0.69rem;
  }

  .mini-field span {
    font-size: 0.64rem;
  }

  .next-card__copy,
  .estimate-card__breakdown,
  .estimate-card__note,
  .compact-section__head span,
  .addon-option__label {
    font-size: 0.68rem;
  }

  .addon-option__meta,
  .addon-slider-row__value,
  .addon-slider-row__hint {
    font-size: 0.6rem;
  }

  .square-grid {
    gap: 4px;
  }

  .square-cell--task {
    gap: 3px;
    padding: 4px;
  }

  .task-label {
    font-size: 0.44rem;
  }

  .task-label--text {
    font-size: 0.5rem;
  }
}

@media (min-width: 760px) {
  .page-shell {
    width: min(720px, calc(100vw - 32px));
  }

  .next-visit-layout {
    grid-template-columns: minmax(0, 1.08fr) minmax(240px, 0.82fr);
    align-items: start;
  }

  .billing-summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* 2026-06-12 customer portal UI refresh */
:root {
  --bg: #d9cdb6;
  --panel: #f7f1e3;
  --panel-border: rgba(52, 46, 36, 0.34);
  --text: #2b2822;
  --muted: #6a6358;
  --brand: #2a4538;
  --card: #f7f1e3;
  --surface: #efe6d2;
  --accent: #264236;
  --accent-2: #3f6f83;
  --warm: #a76038;
  --gold: #b98928;
  --danger: #8f314e;
  --grid-cell: #fffefa;
  --grid-line: rgba(31, 45, 38, 0.12);
  --shadow: 0 22px 60px rgba(23, 33, 28, 0.12);
  --shadow-tight: 0 10px 26px rgba(23, 33, 28, 0.09);
  --focus-ring: rgba(63, 111, 131, 0.24);
  --radius: 12px;
  --radius-card: 18px;
  --radius-control: 12px;
}

[hidden] {
  display: none !important;
}

body {
  display: block;
  min-width: 320px;
  background: var(--bg);
}

.page-shell {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 18px 0 42px;
}

.portal-hero {
  margin-bottom: 16px;
}

.portal-hero > div,
.portal-hero__card {
  border-radius: var(--radius-card);
}

.portal-hero__card {
  --hero-facts-stack: 0;
  --hero-facts-lift: clamp(0px, calc(var(--hero-facts-stack) * 88px), 88px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(270px, 0.42fr);
  gap: 20px;
  align-items: stretch;
  padding: 22px;
  border: 1px solid rgba(31, 45, 38, 0.12);
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.portal-hero__main {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
}

.portal-hero__topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.portal-hero .cleaning-hero__brand-overlay {
  display: inline-block;
  width: fit-content;
  max-width: 230px;
  flex: 0 0 auto;
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
}

.portal-hero .brand-lockup {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: auto;
  gap: 0.35rem;
  padding: 0.55rem 0.9rem 0.55rem 0.25rem;
  isolation: isolate;
}

.portal-hero .brand-lockup::before {
  content: "";
  position: absolute;
  inset: -0.25rem -0.45rem -0.3rem 0.85rem;
  background: url("assets/wooden-sign-v1.webp") center / 100% 100% no-repeat;
  filter: drop-shadow(0 5px 8px rgba(0, 0, 0, 0.24));
  z-index: -1;
  pointer-events: none;
}

.portal-hero .brand-line__logo {
  width: 52px;
  height: 52px;
  min-width: 52px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

.portal-hero .brand-lockup__text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.08rem;
}

.portal-hero .brand-line--main {
  position: relative;
  font-family: "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.05;
  color: rgba(244, 231, 212, 0.96);
  text-shadow:
    0 1px 0 rgba(44, 25, 10, 0.55),
    0 2px 6px rgba(16, 8, 3, 0.42);
  white-space: nowrap;
}

.portal-hero .brand-line--sub {
  position: relative;
  font-family: "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 0.54rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(236, 220, 197, 0.92);
  text-shadow:
    0 1px 0 rgba(44, 25, 10, 0.52),
    0 2px 5px rgba(16, 8, 3, 0.34);
  white-space: nowrap;
}

.portal-hero .eyebrow {
  margin: 0;
  color: #4f665b;
}

.portal-hero h1 {
  margin: 0;
  max-width: none;
  font-size: 2rem;
  line-height: 1.05;
  letter-spacing: 0;
}

.hero-customer-name {
  margin: 0 0 -6px;
  color: #4f665b;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.portal-live-banner {
  display: none;
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(29, 48, 42, 0.12);
  background: rgba(52, 211, 153, 0.14);
  color: #163528;
  font-size: 0.92rem;
  font-weight: 650;
  line-height: 1.35;
  opacity: 0;
  transform: translateY(-4px);
  transition:
    opacity 180ms ease,
    transform 180ms var(--motion-ease);
}

.portal-live-banner.is-visible {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.portal-live-banner[data-tone="live"] {
  border-color: rgba(16, 132, 94, 0.28);
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.22), rgba(96, 165, 250, 0.14));
}

.portal-live-banner[data-tone="info"] {
  border-color: rgba(59, 130, 246, 0.22);
  background: rgba(96, 165, 250, 0.14);
  color: #15253d;
}

.hero-summary {
  max-width: 68ch;
  font-size: 0.94rem;
  line-height: 1.55;
}

.hero-chip-row {
  margin: 0;
}

.hero-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  position: relative;
  z-index: 1;
  transform: translateY(calc(var(--hero-facts-lift) * -1));
  transition: transform 360ms cubic-bezier(0.2, 0, 0, 1);
  will-change: transform;
}

.hero-fact {
  --hero-fact-index: 0;
  --hero-fact-stack-offset: calc(var(--hero-fact-index) * -7px);
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(31, 45, 38, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow:
    0 1px 2px rgba(23, 33, 28, 0.06),
    0 8px 24px rgba(23, 33, 28, calc(0.06 + (var(--hero-facts-stack) * 0.08)));
  transform:
    translateY(calc(var(--hero-facts-stack) * var(--hero-fact-stack-offset)))
    scale(calc(1 - (var(--hero-facts-stack) * 0.035)));
  transform-origin: top center;
  opacity: calc(1 - (var(--hero-facts-stack) * 0.1));
  transition:
    box-shadow 360ms cubic-bezier(0.2, 0, 0, 1),
    opacity 280ms cubic-bezier(0.2, 0, 0, 1),
    transform 360ms cubic-bezier(0.2, 0, 0, 1);
  will-change: transform, opacity;
}

.hero-fact:nth-child(1) {
  --hero-fact-index: 0;
}

.hero-fact:nth-child(2) {
  --hero-fact-index: 1;
}

.hero-fact:nth-child(3) {
  --hero-fact-index: 2;
}

.hero-fact:nth-child(4) {
  --hero-fact-index: 3;
}

.hero-fact dt {
  margin: 0 0 5px;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: #6c7771;
}

.hero-fact dd {
  margin: 0;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.22;
  overflow-wrap: anywhere;
}

.hero-fact dd.is-muted {
  color: var(--muted);
  font-weight: 700;
}

.status-pill {
  min-height: 30px;
  border: 1px solid rgba(31, 45, 38, 0.08);
  border-radius: 999px;
  padding: 0.36rem 0.72rem;
  background: #eef2f7;
  color: #304258;
}

.status-pill--ready,
.billing-pill--ready {
  background: #e2f0e7;
  color: #21543a;
}

.status-pill--confirmed,
.billing-pill--confirmed {
  background: #e8ecf2;
  color: #304258;
}

.status-pill--live,
.billing-pill--authorized {
  background: #d8edf6;
  color: #1b5670;
}

.status-pill--closed,
.billing-pill--closed {
  background: #f4e4e8;
  color: #7d2940;
}

.visit-progress {
  margin-top: 2px;
  padding: 0;
  gap: 0.45rem;
  position: relative;
  z-index: 3;
  border-radius: 8px;
  background-color: rgba(255, 255, 252, calc(var(--hero-facts-stack) * 0.9));
  box-shadow: 0 8px 22px rgba(23, 33, 28, calc(var(--hero-facts-stack) * 0.1));
  transition:
    background-color 260ms cubic-bezier(0.2, 0, 0, 1),
    box-shadow 260ms cubic-bezier(0.2, 0, 0, 1);
}

.visit-progress__step {
  padding: 0.25rem 0.35rem 0.25rem 0;
}

.visit-progress__dot {
  width: 10px;
  height: 10px;
  background: #ccd6d1;
}

.visit-progress__line {
  max-width: 82px;
  background: #d8dfdb;
}

.visit-progress__label {
  font-size: 0.76rem;
  color: #68766f;
}

.visit-progress__step.is-complete .visit-progress__dot {
  background: var(--accent);
}

.visit-progress__step.is-active .visit-progress__dot {
  background: var(--warm);
  box-shadow: 0 0 0 4px rgba(167, 96, 56, 0.14);
}

.visit-progress.is-closed {
  opacity: 0.64;
}

.grid-shell {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

#portalWorkspace {
  display: grid;
  gap: 14px;
}

.grid-toolbar {
  position: sticky;
  top: max(0px, env(safe-area-inset-top));
  z-index: 12;
  gap: 6px;
  margin-bottom: 0;
  padding: 6px;
  border: 1px solid rgba(31, 45, 38, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 252, 0.86);
  box-shadow: 0 8px 24px rgba(23, 33, 28, 0.07);
  backdrop-filter: blur(14px);
}

.grid-toolbar__button {
  flex: 1 0 auto;
  min-height: 40px;
  border-radius: 6px;
  padding: 0.54rem 0.8rem;
  font-size: 0.82rem;
  letter-spacing: 0;
}

.grid-toolbar__button.is-active {
  background: var(--accent);
}

.grid-view-panel {
  padding: 18px;
  border: 1px solid rgba(31, 45, 38, 0.1);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-tight);
}

.next-visit-panel {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.panel-intro {
  gap: 7px;
  margin-bottom: 12px;
}

.panel-intro h2,
.info-panel h2 {
  font-size: 1.22rem;
  line-height: 1.16;
  letter-spacing: 0;
}

.panel-intro__copy,
.next-card__copy {
  font-size: 0.84rem;
}

.portal-gate {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.45fr);
  align-items: center;
  gap: 18px;
  padding: 22px;
  border-radius: 8px;
}

.portal-gate__copy {
  display: grid;
  gap: 8px;
}

.portal-link-form {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(31, 45, 38, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
}

.portal-link-field {
  display: grid;
  gap: 6px;
}

.portal-link-field span {
  font-size: 0.72rem;
  font-weight: 800;
  color: #59685f;
}

.portal-link-field input {
  min-height: 42px;
  width: 100%;
  border: 1px solid rgba(31, 45, 38, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
  padding: 0.7rem 0.78rem;
  font: inherit;
  font-size: 0.9rem;
}

.portal-link-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.portal-link-status.is-error {
  color: var(--danger);
}

.info-panel {
  min-height: 0;
}

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

.visit-intel-grid {
  grid-template-columns: 1fr;
}

.info-card,
.visit-intel-card,
.next-card,
.estimate-card,
.billing-stat,
.visit-form,
.compact-note-editor,
.addon-card {
  border-radius: var(--radius-card);
}

.next-card {
  gap: 12px;
  padding: 16px;
  border-color: rgba(31, 45, 38, 0.1);
  background: var(--card);
  box-shadow: var(--shadow-tight);
}

.next-card__header {
  gap: 12px;
}

.next-card h3 {
  font-size: 1.02rem;
  line-height: 1.16;
}

.next-card__eyebrow,
.panel-intro__eyebrow,
.info-panel__eyebrow {
  letter-spacing: 0.12em;
}

.next-visit-layout {
  gap: 14px;
}

.next-visit-scheduler {
  gap: 14px;
}

.calendar-inline-action,
.billing-secondary-action,
.info-panel__action {
  min-height: 44px;
  border-radius: var(--radius-control);
  font-size: 0.82rem;
  cursor: pointer;
}

.calendar-inline-action {
  border-radius: 8px;
}

.calendar-nav {
  justify-content: space-between;
  padding: 6px;
  border-radius: 8px;
  background: rgba(241, 246, 243, 0.82);
}

.calendar-nav__button {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.calendar-nav__label {
  min-width: 132px;
  font-size: 0.86rem;
}

.calendar-weekdays,
.next-visit-calendar-grid {
  gap: 6px;
}

.calendar-weekdays span {
  font-size: 0.7rem;
}

.calendar-day {
  border-radius: 8px;
  font-size: 0.84rem;
}

.next-visit-status,
.next-visit-selection,
.billing-note,
.billing-action-note,
.notes-status {
  font-size: 0.8rem;
}

.next-visit-form {
  gap: 10px;
}

.mini-field {
  gap: 6px;
}

.mini-field span {
  font-size: 0.72rem;
}

.mini-field input,
.mini-field select,
.mini-field textarea,
.compact-note-editor textarea {
  border-radius: 8px;
  font-size: 0.86rem;
}

.mini-field input,
.mini-field select {
  min-height: 42px;
  padding: 0.68rem 0.76rem;
}

.mini-field textarea,
.compact-note-editor textarea {
  padding: 0.76rem 0.8rem;
}

.addon-stack {
  gap: 8px;
}

.addon-option {
  padding: 0.66rem 0.7rem;
}

.addon-option__label {
  font-size: 0.82rem;
}

.addon-option__meta,
.addon-slider-row__hint {
  font-size: 0.66rem;
}

#nextVisitCustomAddonEditBtn.custom-addon-card__toggle {
  width: auto;
  min-width: 54px;
  padding: 0 0.72rem;
  border-radius: 8px;
  font-size: 0.78rem;
}

.estimate-card {
  gap: 8px;
  padding: 12px;
  background: var(--surface);
}

.estimate-card h4 {
  font-size: 0.96rem;
}

.estimate-card__amount {
  color: var(--accent);
  font-size: 1.22rem;
}

.estimate-card__breakdown,
.estimate-card__note {
  font-size: 0.78rem;
}

.billing-layout {
  gap: 12px;
}

.billing-actions-row {
  gap: 10px;
}

.billing-stat {
  padding: 12px;
}

.billing-stat strong {
  font-size: 0.76rem;
}

.billing-stat span {
  font-size: 0.9rem;
}

@media (min-width: 760px) {
  .grid-toolbar {
    top: 0;
    z-index: 12;
  }

  .page-shell {
    width: min(1120px, calc(100vw - 32px));
  }
}

@media (min-width: 920px) {
  .next-visit-layout {
    grid-template-columns: minmax(460px, 0.9fr) minmax(320px, 0.68fr);
    align-items: start;
  }

  .next-card--calendar {
    grid-column: 1;
    grid-row: 1 / span 3;
  }

  .recurring-setup-gate,
  .custom-addon-widget,
  #recurringOptionsPanel {
    grid-column: 2;
  }

  .billing-layout {
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
    align-items: start;
  }

}

@media (max-width: 720px) {
  .page-shell {
    width: min(100vw - 14px, 560px);
    padding: 10px 0 24px;
  }

  .portal-hero {
    position: sticky;
    top: 10px;
    z-index: 1;
    margin-bottom: 0;
  }

  .portal-hero__card {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 16px 16px 48px;
    border-radius: 22px;
    box-shadow: 0 18px 44px rgba(23, 33, 28, 0.12);
  }

  .grid-shell {
    position: relative;
    z-index: 2;
    width: calc(100% - 12px);
    margin: 10px auto 0;
    background: transparent;
  }

  #portalWorkspace {
    gap: 0;
    padding: 8px;
    border: 1px solid rgba(31, 45, 38, 0.11);
    border-radius: 22px;
    background: rgba(255, 255, 252, 0.98);
    box-shadow: 0 20px 48px rgba(23, 33, 28, 0.16);
  }

  .grid-toolbar {
    top: 0;
    z-index: 12;
    margin: 0 3px;
    padding: 6px;
    border: 1px solid rgba(31, 45, 38, 0.12);
    border-radius: 16px;
    background: rgba(255, 255, 252, 0.96);
    box-shadow:
      0 12px 30px rgba(23, 33, 28, 0.17),
      inset 0 0 0 1px rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(16px);
  }

  .grid-toolbar::after {
    content: none;
  }


  .grid-toolbar__button {
    position: relative;
    z-index: 1;
    min-height: 42px;
    border-color: transparent;
    border-radius: 11px;
    background: transparent;
    box-shadow: none;
  }

  .grid-toolbar__button.is-active {
    box-shadow: 0 5px 14px rgba(38, 66, 54, 0.2);
  }

  .portal-gate:not([hidden]) {
    padding: 18px;
    border: 1px solid rgba(31, 45, 38, 0.11);
    border-radius: 22px;
    background: rgba(255, 255, 252, 0.98);
    box-shadow: 0 20px 48px rgba(23, 33, 28, 0.16);
  }

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

  .hero-summary {
    font-size: 0.88rem;
  }

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

  .hero-fact {
    padding: 10px;
  }

  .hero-fact dd {
    font-size: 0.82rem;
  }

  .visit-progress {
    align-items: flex-start;
  }

  .visit-progress__line {
    flex-basis: 18px;
  }

  .portal-gate {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .grid-view-panel {
    margin-top: 12px;
    padding: 14px;
    border-radius: 16px;
  }

  .next-visit-panel {
    padding: 12px 0 0;
    border: 0;
    box-shadow: none;
  }

  .next-card {
    padding: 14px;
  }

  .next-card__header {
    align-items: stretch;
    flex-direction: column;
  }

  .next-card__header-actions {
    justify-items: stretch;
  }

  .calendar-inline-action {
    width: 100%;
  }

  .info-panel__stack {
    grid-template-columns: 1fr;
  }

  .visit-intel-grid {
    grid-template-columns: 1fr;
  }

  .billing-actions-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .portal-hero__topline {
    align-items: flex-start;
  }

  .portal-hero .brand-line__logo {
    width: 44px;
    height: 44px;
    min-width: 44px;
  }

  .portal-hero .brand-line--main {
    font-size: 0.9rem;
  }

  .portal-hero .brand-line--sub {
    font-size: 0.48rem;
  }

  .hero-facts,
  .billing-summary-grid {
    grid-template-columns: 1fr;
  }

  .grid-toolbar__button {
    min-width: max-content;
  }

  .grid-toolbar {
    top: 0;
  }

  .visit-progress__line {
    display: none;
  }
}

.portal-hero__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.notification-bell {
  width: 40px;
  height: 40px;
  border: 1px solid color-mix(in srgb, var(--line, #d8dee6) 100%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, var(--panel-solid, #fff) 96%, #eef1f4);
  color: color-mix(in srgb, var(--ink, #1f2933) 78%, #687386);
  box-shadow: none;
  cursor: pointer;
  position: relative;
  font: inherit;
  font-weight: 600;
  line-height: 1;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.notification-bell:hover,
.notification-bell:focus-visible {
  border-color: color-mix(in srgb, var(--ink, #1f2933) 22%, var(--line, #d8dee6));
  background: var(--panel-solid, #fff);
  color: var(--ink, #1f2933);
  outline: none;
}

.notification-bell__glyph {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: 0.95rem;
  font-weight: 750;
  font-style: italic;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1;
}

.notification-bell.has-unread {
  border-color: color-mix(in srgb, var(--gold, #c9a227) 42%, var(--line, #d8dee6));
  color: var(--ink, #1f2933);
  animation: none;
}

.notification-bell__count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, #fff 70%, transparent);
  background: color-mix(in srgb, var(--ink, #1f2933) 88%, #000);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 17px;
  box-shadow: none;
}

.portal-hero__card {
  position: relative;
}

/* Messages must paint above the sticky Home / Visit / Quote + calendar shell.
   That shell uses a higher stacking context on mobile, so the drawer is fixed
   to the viewport instead of trapped inside the hero card. */
.notification-drawer {
  position: fixed;
  z-index: 70;
  top: max(72px, calc(env(safe-area-inset-top) + 56px));
  right: max(14px, env(safe-area-inset-right));
  width: min(320px, calc(100vw - 28px));
  max-height: min(400px, calc(100dvh - 100px));
  overflow: auto;
  overscroll-behavior: contain;
  padding: 0;
  border: 1px solid rgba(31, 45, 38, 0.12);
  border-radius: 14px;
  /* Fully opaque so the scrim never “muddies” the panel. */
  background: #ffffff;
  color: var(--ink, #1f2933);
  isolation: isolate;
  box-shadow:
    0 22px 48px -16px rgba(15, 23, 32, 0.38),
    0 0 0 1px rgba(255, 255, 255, 0.9) inset;
  transition: opacity 160ms ease, transform 180ms ease, visibility 160ms ease;
}

/* On wider screens, make Messages feel like part of the portal card instead
   of a browser-corner overlay. Mobile keeps the fixed, viewport-safe drawer
   below because its sticky workspace needs that layering. */
@media (min-width: 721px) {
  .notification-drawer {
    position: absolute;
    top: 0;
    right: 0;
  }
}

body.portal-messages-open .portal-hero__card {
  overflow: visible;
}

/*
  Scrim dims the page behind messages. The panel must sit in a stacking
  context ABOVE this scrim — on mobile the sticky hero was z-index:1, so the
  fixed drawer was painted under body::before and looked darkened.
*/
body.portal-messages-open::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(12, 20, 16, 0.28);
  pointer-events: none;
}

/* Lift the whole hero (bell + drawer) above the scrim while messages are open. */
body.portal-messages-open .portal-hero {
  z-index: 60;
}

.notification-bell {
  z-index: 71;
}

/*
  Mobile: pin messages chrome to the same content column as .page-shell
  (not the raw viewport edge), and scale it to match the rest of the hub.
*/
@media (max-width: 720px) {
  :root {
    /* Match .page-shell mobile width so messages chrome tracks the card, not the raw screen edge. */
    --portal-shell-width: min(100vw - 14px, 560px);
    --portal-shell-gutter: max(7px, calc((100vw - var(--portal-shell-width)) / 2));
    /* page pad 10 + sticky offset 10 + card pad ~14 */
    --messages-bell-size: 34px;
    --messages-bell-top: calc(max(10px, env(safe-area-inset-top)) + 20px);
    --messages-bell-right: calc(var(--portal-shell-gutter) + 18px);
    --messages-panel-top: calc(var(--messages-bell-top) + var(--messages-bell-size) + 8px);
  }

  /* Fixed bell is out of flow — reserve its slot so Weekly / Quote ready sit left of it. */
  .portal-hero__topline {
    padding-right: calc(var(--messages-bell-size) + 10px);
  }

  .portal-hero__actions {
    justify-content: flex-end;
    gap: 6px;
    max-width: 100%;
    /* Extra room so the status pill never slides under the messages icon */
    padding-right: calc(var(--messages-bell-size) + 8px);
    margin-right: 2px;
  }

  .portal-hero__actions .frequency-pill,
  .portal-hero__actions .status-pill {
    position: relative;
    z-index: 1;
  }

  .notification-bell {
    position: fixed;
    top: var(--messages-bell-top);
    right: var(--messages-bell-right);
    z-index: 55;
    width: var(--messages-bell-size);
    height: var(--messages-bell-size);
    min-width: var(--messages-bell-size);
    min-height: var(--messages-bell-size);
    margin: 0;
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.8) inset,
      0 6px 14px -10px rgba(15, 23, 32, 0.4);
  }

  .notification-bell__glyph {
    font-size: 0.8rem;
  }

  .notification-bell__count {
    top: -3px;
    right: -3px;
    min-width: 15px;
    height: 15px;
    font-size: 9px;
    line-height: 15px;
  }

  .notification-drawer {
    top: var(--messages-panel-top);
    right: var(--messages-bell-right);
    left: auto;
    /* Compact popover under the bell — same visual weight as a next-card. */
    width: min(320px, calc(var(--portal-shell-width) - 24px));
    max-width: calc(100vw - var(--messages-bell-right) - var(--portal-shell-gutter) - 12px);
    max-height: min(68dvh, calc(100dvh - var(--messages-panel-top) - max(12px, env(safe-area-inset-bottom))));
    border-radius: 14px;
    background: #ffffff;
    box-shadow:
      0 18px 40px -14px rgba(15, 23, 32, 0.42),
      0 0 0 1px rgba(255, 255, 255, 0.95) inset;
  }

  /* Dim workspace; panel stays bright because hero is lifted above this scrim. */
  body.portal-messages-open::before {
    background: rgba(12, 20, 16, 0.32);
  }

  body.portal-messages-open .portal-hero {
    z-index: 60;
  }

  .notification-drawer__head {
    padding: 0.6rem 0.7rem 0.45rem;
  }

  .notification-drawer__head strong {
    font-size: 0.8rem;
  }

  .notification-drawer__sub {
    font-size: 0.66rem;
  }

  .notification-item {
    padding: 0.55rem 0.7rem;
  }

  .notification-item p {
    font-size: 0.8rem;
    line-height: 1.38;
  }

  .notification-item time,
  .notification-empty,
  .notification-email-toggle {
    font-size: 0.66rem;
  }

  .notification-email-toggle {
    padding: 0.5rem 0.7rem 0.65rem;
    gap: 0.4rem;
  }

  .notification-email-toggle input {
    width: 14px;
    height: 14px;
  }

  /* Scroll down: keep the bell tappable above the workspace, but close/hide the open panel. */
  body.portal-messages-scrolled .notification-drawer {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px) scale(0.98);
    visibility: hidden;
  }

  /* Quieter motion on touch-sized controls */
  .notification-bell:hover,
  .notification-bell:focus-visible {
    transform: none;
  }

  .notification-bell:active {
    transform: scale(0.96);
  }
}

@media (max-width: 420px) {
  :root {
    --messages-bell-size: 32px;
    --messages-bell-top: calc(max(8px, env(safe-area-inset-top)) + 18px);
    --messages-bell-right: calc(var(--portal-shell-gutter) + 16px);
  }

  .notification-drawer {
    width: min(320px, calc(var(--portal-shell-width) - 24px));
    max-height: min(68dvh, calc(100dvh - var(--messages-panel-top) - max(10px, env(safe-area-inset-bottom))));
    border-radius: 13px;
  }
}

.notification-drawer__head {
  display: grid;
  gap: 0.1rem;
  padding: 0.75rem 0.85rem 0.55rem;
  border-bottom: 1px solid color-mix(in srgb, var(--line, #d8dee6) 90%, transparent);
}

.notification-drawer__head strong {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink, #1f2933);
}

.notification-drawer__sub {
  font-size: 0.72rem;
  color: #687386;
}

.notification-drawer__scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.notification-list {
  padding: 0.25rem 0;
}

.notification-item {
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid #edf1f6;
  background: transparent;
}

.notification-item:last-child {
  border-bottom: 0;
}

.notification-item.is-unread {
  background: color-mix(in srgb, var(--ink, #1f2933) 3.5%, transparent);
  box-shadow: inset 2px 0 0 color-mix(in srgb, var(--gold, #c9a227) 70%, transparent);
}

.notification-item p {
  margin: 0 0 4px;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--ink, #1f2933);
}

.notification-item time,
.notification-empty,
.notification-email-toggle {
  color: #687386;
  font-size: 0.72rem;
}

.notification-empty {
  padding: 0.9rem 0.85rem 0.7rem;
}

.notification-email-toggle {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 0;
  padding: 0.7rem 0.85rem 0.8rem;
  border-top: 1px solid color-mix(in srgb, var(--line, #d8dee6) 90%, transparent);
  background: color-mix(in srgb, var(--ink, #1f2933) 2%, transparent);
}

.notification-email-toggle input {
  margin-top: 2px;
}

.notification-email-toggle small {
  display: block;
  margin-top: 2px;
  color: var(--muted, #687386);
  font-size: 0.68rem;
  line-height: 1.35;
}

.notification-review-link {
  position: relative;
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 0.7rem;
  min-height: 72px;
  padding: 0.72rem 0.78rem;
  border-top: 2px solid color-mix(in srgb, var(--green, #2f5242) 52%, var(--gold, #c9a227));
  border-radius: 0 0 13px 13px;
  background:
    linear-gradient(120deg, color-mix(in srgb, var(--gold, #c9a227) 13%, #fff), transparent 46%),
    color-mix(in srgb, var(--green, #2f5242) 9%, #fff);
  color: var(--ink, #1f2933);
  text-decoration: none;
  box-shadow: 0 -10px 24px -22px rgba(31, 82, 66, 0.8);
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.notification-review-link:hover,
.notification-review-link:focus-visible {
  background:
    linear-gradient(120deg, color-mix(in srgb, var(--gold, #c9a227) 18%, #fff), transparent 48%),
    color-mix(in srgb, var(--green, #2f5242) 15%, #fff);
  color: var(--green, #2f5242);
  box-shadow:
    0 -10px 24px -22px rgba(31, 82, 66, 0.8),
    0 0 0 3px color-mix(in srgb, var(--green, #2f5242) 16%, transparent) inset;
  outline: 2px solid transparent;
  outline-offset: -2px;
}

.notification-review-link strong,
.notification-review-link small {
  display: block;
}

.notification-review-link strong {
  font-size: 0.82rem;
  line-height: 1.3;
}

.notification-review-link small {
  margin-top: 2px;
  color: var(--muted, #687386);
  font-size: 0.68rem;
  line-height: 1.35;
}

.notification-review-link__icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid color-mix(in srgb, var(--gold, #c9a227) 55%, #fff);
  border-radius: 50%;
  background: color-mix(in srgb, var(--gold, #c9a227) 16%, #fff);
  color: color-mix(in srgb, var(--gold, #c9a227) 88%, #6b5510);
  font-size: 1rem;
  box-shadow: 0 3px 9px -7px rgba(31, 41, 51, 0.8);
}

.notification-review-link__copy {
  flex: 1 1 auto;
  min-width: 0;
}

.notification-review-link__arrow {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--green, #2f5242);
  color: #fff;
  font-size: 0.86rem;
  line-height: 1;
}

.recurring-setup-gate {
  border: 1px solid #d8e4dc;
  background: #f6faf7;
}

.recurring-setup-gate h3 {
  margin: 0.35rem 0 0.65rem;
}

/* Customer portal cleanup: keep the home view calm and balanced on desktop. */
@media (min-width: 920px) {
  .next-visit-layout {
    gap: 16px 18px;
  }

  .next-card--calendar {
    max-width: 650px;
    min-height: 0;
    padding: 14px;
  }

  .next-card--calendar .next-card__header {
    align-items: start;
  }

  .next-card--calendar .next-card__header-actions {
    display: grid;
    gap: 8px;
    width: min(240px, 46%);
  }

  .next-card--calendar .calendar-inline-action {
    min-height: 40px;
    padding-inline: 0.8rem;
  }

  .next-visit-scheduler {
    grid-template-columns: 1fr;
  }

  .next-visit-scheduler__calendar {
    max-width: 440px;
  }

  .next-visit-sidecar {
    padding: 12px 0 0;
    border-top: 1px solid rgba(41, 54, 43, 0.08);
    border-left: 0;
  }

  .calendar-nav {
    margin-top: 2px;
  }

  .calendar-weekdays,
  .next-visit-calendar-grid {
    gap: 5px;
  }

  .calendar-day {
    min-height: 42px;
  }

  .recurring-setup-gate,
  .custom-addon-widget {
    box-shadow: 0 14px 34px rgba(23, 33, 28, 0.08);
  }

  .custom-addon-widget {
    padding: 14px 16px;
  }

  .custom-addon-widget .next-card__header {
    align-items: center;
  }

  .custom-addon-widget .custom-addon-card__toggle {
    width: 38px;
    height: 38px;
  }
}

.recurring-config-note {
  margin: 0.85rem 0 1rem;
  padding: 0.8rem 0.9rem;
  border-left: 3px solid #4f7d63;
  border-radius: 0 8px 8px 0;
  background: #f2f7f4;
  color: #345443;
  font-size: 0.9rem;
  line-height: 1.45;
}

.recurring-deep-choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.78rem;
  margin: 0 0 1rem;
  padding: 0.9rem;
  border: 1px solid rgba(41, 54, 43, 0.14);
  border-radius: 12px;
  background: #f6f8f3;
  cursor: pointer;
}

.recurring-deep-choice[hidden] {
  display: none;
}

.recurring-deep-choice input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.recurring-deep-choice__switch {
  position: relative;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: #aeb8ae;
  box-shadow: inset 0 0 0 1px rgba(41, 54, 43, 0.16);
  transition: background 160ms ease;
}

.recurring-deep-choice__switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(23, 33, 28, 0.2);
  transition: transform 160ms ease;
}

.recurring-deep-choice input:checked + .recurring-deep-choice__switch {
  background: #287466;
}

.recurring-deep-choice input:checked + .recurring-deep-choice__switch::after {
  transform: translateX(20px);
}

.recurring-deep-choice input:focus-visible + .recurring-deep-choice__switch {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.recurring-deep-choice__copy {
  display: grid;
  gap: 0.22rem;
}

.recurring-deep-choice__copy strong {
  color: var(--text);
  font-size: 0.86rem;
  line-height: 1.3;
}

.recurring-deep-choice__copy small {
  color: #536457;
  font-size: 0.75rem;
  line-height: 1.4;
}

.recurring-deep-choice input:checked ~ .recurring-deep-choice__copy small {
  color: #245f54;
}

.billing-payment-choices {
  display: grid;
  gap: 0.7rem;
  margin: 0 0 1rem;
  padding: 0;
  border: 0;
}

.billing-payment-choices[hidden] {
  display: none;
}

.billing-payment-choices legend {
  padding: 0;
  margin: 0 0 0.55rem;
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 700;
}

.billing-payment-choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 0.78rem;
  min-height: 44px;
  margin: 0;
  padding: 0.9rem;
  border: 1px solid rgba(41, 54, 43, 0.14);
  border-radius: 12px;
  background: #f6f8f3;
  cursor: pointer;
}

.billing-payment-choice:has(input:checked) {
  border-color: rgba(40, 116, 102, 0.42);
  background: #eef6f3;
}

.billing-payment-choice input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.billing-payment-choice__mark {
  width: 22px;
  height: 22px;
  margin-top: 0.1rem;
  border: 2px solid rgba(41, 54, 43, 0.28);
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 4px transparent;
}

.billing-payment-choice input:checked + .billing-payment-choice__mark {
  border-color: #287466;
  box-shadow: inset 0 0 0 5px #287466;
}

.billing-payment-choice input:focus-visible + .billing-payment-choice__mark {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.billing-payment-choice__copy {
  display: grid;
  gap: 0.22rem;
}

.billing-payment-choice__copy strong {
  color: var(--text);
  font-size: 0.86rem;
  line-height: 1.3;
}

.billing-payment-choice__copy small {
  color: #536457;
  font-size: 0.75rem;
  line-height: 1.4;
}

.billing-consent-choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 0.78rem;
  min-height: 44px;
  margin: 0 0 1rem;
  padding: 0.9rem;
  border: 1px solid rgba(41, 54, 43, 0.14);
  border-radius: 12px;
  background: #f6f8f3;
  cursor: pointer;
}

.billing-consent-choice[hidden] {
  display: none;
}

.billing-consent-choice input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.billing-consent-choice__check {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-top: 0.1rem;
  border: 2px solid rgba(41, 54, 43, 0.28);
  border-radius: 6px;
  background: #fff;
  color: transparent;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
}

.billing-consent-choice input:checked + .billing-consent-choice__check {
  border-color: #287466;
  background: #287466;
  color: #fff;
}

.billing-consent-choice input:focus-visible + .billing-consent-choice__check {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.billing-consent-choice__copy {
  display: grid;
  gap: 0.22rem;
}

.billing-consent-choice__copy strong {
  color: var(--text);
  font-size: 0.86rem;
  line-height: 1.3;
}

.billing-consent-choice__copy small {
  color: #536457;
  font-size: 0.75rem;
  line-height: 1.4;
}

@keyframes notification-pop {
  0%, 100% { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .notification-bell.has-unread { animation: none; }
}

/* Narrow viewport hardening: keep the portal usable in split-screen and zoomed views. */
body {
  min-width: 0;
  overflow-x: clip;
}

.page-shell,
.portal-hero,
.portal-hero__card,
.portal-hero__main,
.portal-hero__topline,
.portal-hero__actions,
.grid-shell,
#portalWorkspace,
.grid-toolbar,
.grid-view-panel,
.portal-gate,
.panel-intro,
.next-visit-layout,
.next-visit-scheduler,
.next-visit-scheduler__calendar,
.next-visit-sidecar,
.next-card,
.next-card__header,
.next-card__header > *,
.info-panel,
.info-panel__stack,
.info-card,
.visit-form,
.visit-form__grid,
.next-visit-form,
.billing-layout,
.billing-summary-grid,
.plan-control,
.plan-control__copy,
.plan-control__title-row {
  min-width: 0;
  max-width: 100%;
}

.portal-hero h1,
.hero-summary,
.status-pill,
.panel-intro h2,
.panel-intro__copy,
.next-card h3,
.next-card__copy,
.info-card,
.notification-item,
.recurring-config-note {
  overflow-wrap: anywhere;
}

@media (max-width: 320px) {
  .page-shell {
    width: calc(100vw - 8px);
    padding-top: 4px;
  }

  .portal-hero {
    top: 4px;
  }

  .portal-hero__card {
    gap: 10px;
    padding: 10px 10px 34px;
    border-radius: 14px;
  }

  .portal-hero__topline {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .portal-hero .cleaning-hero__brand-overlay {
    max-width: 100%;
  }

  .portal-hero .brand-lockup {
    max-width: 100%;
    padding: 0.35rem 0.55rem 0.35rem 0.1rem;
  }

  .portal-hero .brand-lockup::before {
    inset: -0.18rem -0.25rem -0.22rem 0.65rem;
  }

  .portal-hero .brand-line__logo {
    width: 38px;
    height: 38px;
    min-width: 38px;
  }

  .portal-hero .brand-line--main {
    font-size: 0.76rem;
  }

  .portal-hero .brand-line--sub {
    font-size: 0.4rem;
    letter-spacing: 0.08em;
  }

  .portal-hero__actions {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 6px;
    /* Keep Weekly / Quote ready clear of the fixed messages icon */
    padding-right: calc(var(--messages-bell-size, 32px) + 10px);
  }

  .notification-bell {
    width: var(--messages-bell-size, 32px);
    height: var(--messages-bell-size, 32px);
    min-width: var(--messages-bell-size, 32px);
    min-height: var(--messages-bell-size, 32px);
    flex: 0 0 auto;
  }

  .status-pill {
    min-height: 28px;
    max-width: 100%;
    padding: 0.3rem 0.58rem;
    font-size: 0.74rem;
    white-space: normal;
  }

  .frequency-pill {
    min-height: 28px;
    padding: 0.3rem 0.58rem;
    font-size: 0.7rem;
  }

  .portal-hero h1 {
    max-width: 100%;
    font-size: 1.35rem;
  }

  .hero-summary {
    max-width: 100%;
    font-size: 0.8rem;
  }

  .visit-progress {
    align-items: flex-start;
    gap: 0.28rem 0.48rem;
  }

  .visit-progress__step {
    padding-right: 0;
  }

  .visit-progress__line {
    display: none;
  }

  .visit-progress__label {
    font-size: 0.68rem;
  }

  .hero-facts,
  .billing-summary-grid {
    grid-template-columns: 1fr;
  }

  .grid-shell {
    width: calc(100% - 4px);
    margin-top: 6px;
  }

  #portalWorkspace {
    padding: 5px;
    border-radius: 14px;
  }

  .grid-toolbar {
    top: 0;
    max-width: 100%;
    margin: 0;
    padding: 4px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }

  .grid-toolbar__button {
    flex: 0 0 auto;
    min-width: max-content;
    min-height: 38px;
    padding: 0.45rem 0.62rem;
    font-size: 0.72rem;
  }

  .grid-view-panel {
    padding: 10px;
    border-radius: 12px;
  }

  .next-visit-panel {
    padding: 8px 0 0;
  }

  .next-card,
  .portal-gate:not([hidden]) {
    padding: 10px;
    border-radius: 12px;
  }

  .plan-control,
  .plan-control__title-row,
  .next-card__header,
  .notes-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .next-card__header-actions,
  .billing-actions-row,
  .visit-form__grid,
  .next-visit-form,
  .info-panel__stack {
    grid-template-columns: 1fr;
  }

  .calendar-inline-action,
  .billing-secondary-action,
  .info-panel__action {
    width: 100%;
    max-width: 100%;
    white-space: normal;
  }

  .calendar-nav {
    gap: 3px;
    padding: 4px;
  }

  .calendar-nav__button {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
  }

  .calendar-nav__label {
    min-width: 0;
    font-size: 0.76rem;
  }

  .calendar-weekdays,
  .next-visit-calendar-grid {
    gap: 2px;
    min-width: 0;
  }

  .calendar-weekdays span,
  .calendar-day {
    min-width: 0;
    font-size: 0.58rem;
  }

  /* Drawer positioning for narrow screens is handled with the fixed messages chrome above. */
}
.billing-checklist-summary {
  display: grid;
  gap: 0.55rem;
}

.billing-checklist-meter {
  height: 0.45rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.22);
}

.billing-checklist-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--success);
}

.billing-checklist-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.billing-checklist-counts span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
}

.billing-checklist-list {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.85rem;
}

.billing-checklist-empty {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.4;
}

.billing-checklist-item {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  padding: 0.62rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.88rem;
}

.billing-checklist-item strong {
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.76rem;
}

.billing-checklist-item--done {
  border-color: rgba(22, 163, 74, 0.42);
  background: rgba(22, 163, 74, 0.08);
}

.billing-checklist-item--done strong {
  color: #15803d;
}

.billing-checklist-item--flagged {
  border-color: rgba(217, 119, 6, 0.5);
  background: rgba(217, 119, 6, 0.08);
}

.billing-checklist-item--skipped {
  opacity: 0.78;
}

@media (max-width: 560px) {
  .billing-checklist-item {
    align-items: flex-start;
    flex-direction: column;
  }
}


/* === Dropdown Menu === */
.dropdown-menu-container {
  position: relative;
}

#portalPanelQuote .billing-layout > .next-card:first-child {
  position: relative;
}

#portalPanelQuote .billing-layout > .next-card:first-child .next-card__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px 10px;
  padding-right: 0;
  flex-direction: unset;
}

#portalPanelQuote .billing-layout > .next-card:first-child .next-card__header > div:first-child {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}

#portalPanelQuote #billingStatusPill {
  grid-column: 1;
  grid-row: 2;
  justify-self: start;
  align-self: center;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  max-width: 100%;
  min-height: 28px;
  height: 28px;
  padding: 0 0.78rem;
  border-radius: 999px;
  white-space: nowrap;
  overflow: hidden;
  overflow-wrap: normal;
  word-break: keep-all;
  text-align: center;
  line-height: 1;
  font-size: 0.74rem;
  font-weight: 700;
}

#portalPanelQuote .billing-layout > .next-card:first-child .dropdown-menu-container {
  position: relative;
  top: auto;
  right: auto;
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: start;
  z-index: 2;
}

#portalPanelQuote .dropdown-menu-trigger {
  width: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-control);
  background: var(--paper);
  color: var(--ink);
}

.dropdown-menu-trigger {
  background: transparent;
  border: 1px solid rgba(41, 54, 43, 0.14);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.5rem;
  transition: background 150ms var(--motion-ease);
  font-size: 1.5rem;
  line-height: 1;
  color: var(--muted);
}

.dropdown-menu-trigger:hover,
.dropdown-menu-trigger:focus-visible {
  background: var(--panel);
  border-color: rgba(41, 54, 43, 0.24);
}

.dropdown-menu-trigger:disabled,
.dropdown-menu-item:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 0.75rem;
  box-shadow: var(--shadow);
  min-width: 200px;
  z-index: 100;
  padding: 0.25rem;
  animation: dropdownReveal 200ms var(--motion-ease) both;
}

@keyframes dropdownReveal {
  from {
    opacity: 0;
    transform: translateY(-0.5rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-menu[hidden] {
  display: none;
}

.dropdown-menu-item {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  background: transparent;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 0.875rem;
  text-align: left;
  color: var(--text);
  transition: background 150ms var(--motion-ease);
}

.dropdown-menu-item:hover,
.dropdown-menu-item:focus-visible {
  background: var(--panel-border);
  outline: none;
}

.dropdown-menu-item--danger {
  color: #8f314e;
}

.dropdown-menu-item--danger:hover,
.dropdown-menu-item--danger:focus-visible {
  background: rgba(143, 49, 78, 0.1);
}

/* Surgical accessibility polish; preserve the customer portal's visual identity. */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.portal-link-form input,
.portal-link-form button,
.grid-toolbar__button,
.calendar-nav__button,
.calendar-inline-action,
.info-panel__action,
.billing-secondary-action,
.dropdown-menu-trigger,
.dropdown-menu-item,
.custom-addon-card__toggle,
.schedule-gui-shell__close {
  min-height: 44px;
}

.notification-email-toggle,
.portal-confirm__check {
  min-height: 44px;
  align-items: center;
}

.notification-consent-copy {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.mini-field .notification-consent-copy__text {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.mini-field .notification-consent-copy input[type="checkbox"] {
  flex: 0 0 auto;
  appearance: auto;
  width: 18px;
  height: 18px;
  min-height: 0;
  padding: 0;
  margin-top: 0.2rem;
  accent-color: var(--accent);
}

.grid-toolbar__button[aria-selected="true"] {
  position: relative;
}

.grid-view-panel:focus {
  outline: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}


/* ═══════════════════════════════════════════════════════════════════════════
   Stylish quiet motion — 2026-07-09
   Refined animations + button craft. Graphite/gold, not rainbow carnival.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --notify-spring: cubic-bezier(0.16, 0.82, 0.32, 1.02);
  --notify-soft: cubic-bezier(0.22, 1, 0.36, 1);
}

.notification-bell {
  border-radius: 999px;
  background:
    linear-gradient(180deg, color-mix(in srgb, #fff 55%, transparent), transparent),
    color-mix(in srgb, var(--panel-solid, #fff) 94%, #e8edf1);
  border: 1px solid color-mix(in srgb, var(--ink, #1f2933) 10%, var(--line, #d8dee6));
  box-shadow:
    0 1px 0 color-mix(in srgb, #fff 70%, transparent) inset,
    0 6px 16px -10px rgba(15, 23, 32, 0.35);
  transition:
    transform 180ms var(--notify-spring),
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 180ms ease,
    color 160ms ease;
}

.notification-bell:hover,
.notification-bell:focus-visible {
  transform: translateY(-1px) scale(1.03);
  border-color: color-mix(in srgb, var(--ink, #1f2933) 22%, var(--line, #d8dee6));
  box-shadow:
    0 1px 0 color-mix(in srgb, #fff 80%, transparent) inset,
    0 10px 22px -12px rgba(15, 23, 32, 0.4);
}

.notification-bell:active {
  transform: translateY(0) scale(0.97);
  transition-duration: 80ms;
}

.notification-bell__glyph {
  transition: transform 220ms var(--notify-spring);
}

.notification-bell:hover .notification-bell__glyph,
.notification-bell:focus-visible .notification-bell__glyph {
  transform: scale(1.06);
}

.notification-bell.has-unread {
  border-color: color-mix(in srgb, var(--gold, #c9a227) 48%, var(--line, #d8dee6));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--gold, #c9a227) 12%, transparent), transparent),
    color-mix(in srgb, var(--panel-solid, #fff) 94%, #eef1f4);
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--gold, #c9a227) 14%, transparent),
    0 8px 18px -10px color-mix(in srgb, var(--gold, #c9a227) 35%, transparent);
  animation: bell-soft-attention 2.4s var(--notify-soft) infinite;
}

.notification-bell.has-unread .notification-bell__glyph {
  animation: glyph-nudge 2.4s var(--notify-soft) infinite;
}

.notification-bell__count {
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  line-height: 18px;
  border: 1.5px solid #fff;
  background: linear-gradient(180deg, #3a4550, #1f2933);
  box-shadow: 0 4px 10px -4px rgba(15, 23, 32, 0.55);
  animation: count-pop 420ms var(--notify-spring) both;
}

.notification-drawer:not([hidden]) {
  display: flex;
  flex-direction: column;
  animation: drawer-rise 260ms var(--notify-spring) both;
  transform-origin: top right;
  box-shadow:
    0 1px 0 color-mix(in srgb, #fff 55%, transparent) inset,
    0 18px 40px -18px rgba(15, 23, 32, 0.38);
  border-radius: 14px;
  overflow: hidden;
}

.notification-drawer__head {
  flex: 0 0 auto;
  background: color-mix(in srgb, var(--ink, #1f2933) 2.5%, var(--panel-solid, #fff));
}

.notification-item {
  transition: background 160ms ease, transform 160ms var(--notify-soft);
}

.notification-item.is-unread {
  animation: unread-in 320ms var(--notify-soft) both;
}

.notification-item:hover {
  background: color-mix(in srgb, var(--ink, #1f2933) 3%, transparent);
}

/* Primary buttons — more crafted, still local-service sober */
.info-panel__action,
.portal-link-form .info-panel__action,
button.info-panel__action {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, #1a2e24 88%, #000);
  border-radius: 11px;
  padding: 0.78rem 1.05rem;
  background:
    linear-gradient(180deg, color-mix(in srgb, #fff 16%, transparent), transparent 46%),
    linear-gradient(180deg, #2f5242, #234033);
  color: #f7faf8;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow:
    0 1px 0 color-mix(in srgb, #fff 18%, transparent) inset,
    0 8px 18px -12px rgba(20, 40, 30, 0.55);
  transition:
    transform 160ms var(--notify-spring),
    box-shadow 180ms ease,
    filter 160ms ease,
    border-color 160ms ease;
}

.info-panel__action::after,
.portal-link-form .info-panel__action::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, color-mix(in srgb, #fff 18%, transparent) 48%, transparent 62%);
  transform: translateX(-120%);
  transition: transform 520ms var(--notify-soft);
  pointer-events: none;
  z-index: -1;
}

.info-panel__action:hover:not(:disabled),
.portal-link-form .info-panel__action:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow:
    0 1px 0 color-mix(in srgb, #fff 22%, transparent) inset,
    0 12px 24px -12px rgba(20, 40, 30, 0.6);
}

.info-panel__action:hover:not(:disabled)::after,
.portal-link-form .info-panel__action:hover:not(:disabled)::after {
  transform: translateX(120%);
}

.info-panel__action:active:not(:disabled),
.portal-link-form .info-panel__action:active:not(:disabled) {
  transform: translateY(1px) scale(0.99);
  filter: brightness(0.98);
  box-shadow:
    0 1px 0 color-mix(in srgb, #000 18%, transparent) inset,
    0 4px 10px -8px rgba(20, 40, 30, 0.45);
}

.info-panel__action:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.grid-toolbar__button {
  transition:
    transform 150ms var(--notify-spring),
    background 150ms ease,
    border-color 150ms ease,
    color 150ms ease,
    box-shadow 160ms ease;
}

.grid-toolbar__button:hover {
  transform: translateY(-1px);
}

.grid-toolbar__button.is-active {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--green, #2f5242) 24%, transparent);
}

.calendar-inline-action,
.next-card button[type="button"]:not(.notification-bell) {
  transition: transform 150ms var(--notify-spring), box-shadow 160ms ease, border-color 150ms ease;
}

@keyframes bell-soft-attention {
  0%, 100% {
    box-shadow:
      0 0 0 3px color-mix(in srgb, var(--gold, #c9a227) 12%, transparent),
      0 8px 18px -10px color-mix(in srgb, var(--gold, #c9a227) 28%, transparent);
  }
  50% {
    box-shadow:
      0 0 0 5px color-mix(in srgb, var(--gold, #c9a227) 20%, transparent),
      0 10px 22px -10px color-mix(in srgb, var(--gold, #c9a227) 40%, transparent);
  }
}

@keyframes glyph-nudge {
  0%, 100% { transform: rotate(0deg) scale(1); }
  18% { transform: rotate(-8deg) scale(1.05); }
  36% { transform: rotate(7deg) scale(1.04); }
  52% { transform: rotate(-4deg) scale(1.03); }
  70% { transform: rotate(2deg) scale(1.01); }
}

@keyframes count-pop {
  0% { transform: scale(0.6); opacity: 0; }
  70% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes drawer-rise {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes unread-in {
  from { opacity: 0; transform: translateX(4px); }
  to { opacity: 1; transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
  .notification-bell,
  .notification-bell.has-unread,
  .notification-bell.has-unread .notification-bell__glyph,
  .notification-bell__count,
  .notification-drawer:not([hidden]),
  .notification-item.is-unread,
  .info-panel__action,
  .info-panel__action::after {
    animation: none !important;
    transition: none !important;
  }
  .notification-bell:hover,
  .info-panel__action:hover:not(:disabled) {
    transform: none;
  }
}


/* Special-request quote transparency */
.billing-note__review {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.billing-addon-block {
  margin-top: 12px;
  padding: 13px 14px;
  border-radius: 12px;
  font-size: 0.84rem;
}
.billing-addon-block--included {
  background: linear-gradient(165deg, rgba(220, 238, 226, 0.95), rgba(236, 246, 239, 0.98));
  color: #1f3d2d;
  border: 1px solid rgba(48, 110, 72, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}
.billing-addon-block--not-included {
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
}
.billing-addon-block__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
.billing-addon-block strong {
  display: block;
  margin-bottom: 0;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}
.billing-addon-block__total {
  font-weight: 700;
  font-size: 0.9rem;
  color: #21543a;
  white-space: nowrap;
}
.billing-addon-block__note {
  margin: 0 0 10px;
  opacity: 0.88;
  font-size: 0.76rem;
  line-height: 1.45;
}
.billing-addon-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
  padding: 7px 0;
  border-top: 1px solid rgba(33, 84, 58, 0.1);
  flex-wrap: wrap;
}
.billing-addon-block--not-included .billing-addon-row {
  border-top-color: rgba(154, 52, 18, 0.12);
}
.billing-addon-row:first-of-type {
  border-top: 0;
  padding-top: 0;
}
.billing-addon-row__price {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #21543a;
}
.billing-addon-block--not-included .billing-addon-row__price {
  color: inherit;
}

/* Quiet the repeated helper line under Accept when the quote card already said it */
#portalPanelQuote .billing-action-note:not(.is-error) {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}
.billing-addon-actions {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}
.billing-addon-actions .btn--small {
  font-size: 12px;
  padding: 6px 10px;
}

.portal-signout {
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 6px 2px;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.portal-install-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  min-height: 44px;
  padding: 0.44rem 0.7rem 0.44rem 0.55rem;
  border: 1px solid rgba(38, 66, 54, 0.18);
  border-radius: 999px;
  background: rgba(239, 247, 242, 0.96);
  color: #264236;
  font: inherit;
  font-size: 0.73rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(38, 66, 54, 0.08);
}

.portal-install-button::before {
  content: "+";
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  border-radius: 6px;
  background: #315f4c;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
}

.portal-install-button:hover,
.portal-install-button:focus-visible {
  border-color: rgba(38, 66, 54, 0.34);
  background: #deeee5;
}

.portal-hero .status-pill--access {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.4rem 0.2rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
  line-height: 1.2;
  white-space: nowrap;
}

.portal-install-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(38, 66, 54, 0.12);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(246, 250, 247, 0.98), rgba(255, 252, 245, 0.98));
  box-shadow: var(--shadow-tight);
}

.portal-install-card:not(:has(.portal-install-button:not([hidden]))) {
  display: none;
}

.portal-install-card__copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.portal-install-card__copy span {
  color: #58705e;
  font-size: 0.62rem;
  font-weight: 850;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.portal-install-card__copy strong {
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.25;
}

.portal-install-card__copy small {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.4;
}

@media (max-width: 720px) {
  .portal-hero__topline {
    padding-right: 0;
  }

  .portal-hero__actions {
    max-width: 100%;
    padding-right: 0;
    margin-right: 0;
    gap: 6px 9px;
  }

  .portal-hero__actions .frequency-pill,
  .portal-hero__actions .status-pill:not(.status-pill--access) {
    white-space: nowrap;
  }

  .portal-signout:not([hidden]) {
    position: absolute;
    top: 16px;
    right: calc(var(--messages-bell-size, 34px) + 28px);
    z-index: 55;
  }
}

@media (max-width: 480px) {
  .portal-hero__topline {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 9px;
  }

  .portal-hero__actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .portal-hero__actions:has(.status-pill--access):not(:has(.frequency-pill:not([hidden]))):not(:has(.notification-bell:not([hidden]))):not(:has(.portal-signout:not([hidden]))) {
    display: none;
  }

  .portal-install-card {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
  }

  .portal-install-card .portal-install-button {
    width: 100%;
  }
}

.portal-install__steps {
  display: grid;
  gap: 0.72rem;
  margin: 0;
  padding-left: 1.4rem;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.45;
}

.portal-install__steps li {
  padding-left: 0.2rem;
}

.portal-install__dialog {
  max-height: calc(100dvh - 36px);
  overflow-y: auto;
}

.portal-install__dialog .portal-install__note {
  padding: 0.68rem 0.75rem;
  border-radius: 8px;
  background: var(--surface);
  font-size: 0.78rem;
}

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

@media (display-mode: standalone), (display-mode: minimal-ui), (display-mode: fullscreen) {
  .portal-install-button {
    display: none !important;
  }
}

.portal-rebook-card__address,
.repeat-request-fresh__address {
  display: grid;
  gap: 3px;
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.portal-rebook-card__address strong,
.repeat-request-fresh__address strong {
  color: var(--text);
}

.portal-rebook-card__different {
  width: fit-content;
  color: #315f4c;
  font-size: 0.76rem;
  font-weight: 700;
}

.repeat-request-fresh {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.repeat-request-fresh__address {
  grid-column: 1 / -1;
}

.estimate-card__referral {
  margin: 2px 0 0;
  padding: 7px 9px;
  border-radius: 8px;
  background: rgba(45, 108, 78, 0.09);
  color: #285a43;
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.4;
}

.next-visit-savebar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.repeat-special-request {
  display: grid;
  gap: 10px;
  padding: 11px;
  border: 1px solid rgba(41, 54, 43, 0.1);
  border-radius: 10px;
  background: var(--surface);
}

.repeat-special-request__toggle {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.repeat-special-request__toggle input {
  width: 20px;
  height: 20px;
  margin-top: 1px;
  accent-color: #315f4c;
}

.repeat-special-request__toggle span,
.repeat-special-request__fields {
  display: grid;
  gap: 5px;
}

.repeat-special-request__toggle small {
  color: var(--muted);
  line-height: 1.4;
}

.repeat-special-request__fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding-top: 9px;
  border-top: 1px solid rgba(41, 54, 43, 0.08);
}

.repeat-special-request__fields .mini-field:nth-child(2) {
  grid-column: 1 / -1;
}

.next-visit-layout.is-repeat-request #recurringOptionsPanel,
.next-visit-layout.is-repeat-request .next-card--calendar {
  grid-column: 1 / -1;
  grid-row: auto;
  width: 100%;
  max-width: none;
}

.next-visit-layout.is-repeat-request #recurringOptionsPanel {
  order: 1;
}

.next-visit-layout.is-repeat-request .next-card--calendar {
  order: 2;
}

.next-visit-layout.is-repeat-request .next-visit-savebar {
  margin-top: 10px;
}

@media (max-width: 720px) {
  .repeat-request-fresh {
    grid-template-columns: 1fr;
  }

  .repeat-special-request__fields {
    grid-template-columns: 1fr;
  }
}

/* 2026-08-12 portal calm polish */
.portal-hero__card:has(.hero-facts[hidden]) {
  grid-template-columns: 1fr;
}

.hero-fact {
  border-radius: var(--radius-card);
}

.grid-toolbar__button {
  border-radius: var(--radius-control);
}

.arrival-brief {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(31, 45, 38, 0.1);
  border-radius: var(--radius-card);
  background: var(--card);
  box-shadow: var(--shadow-tight);
}

.arrival-brief__head h3 {
  margin: 0.2rem 0 0;
  font-size: 1.02rem;
  line-height: 1.16;
}

.arrival-brief__list {
  display: grid;
  gap: 0;
  margin: 0;
}

.arrival-brief__row {
  display: grid;
  grid-template-columns: 7.4rem minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 11px 0;
  border-top: 1px solid rgba(31, 45, 38, 0.08);
}

.arrival-brief__row:first-child {
  border-top: 0;
  padding-top: 0;
}

.arrival-brief__row dt {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #6f7d72;
}

.arrival-brief__row dd {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text);
}

#portalPanelQuote.is-waiting .billing-layout > .next-card:first-child {
  background: #f4f8f5;
  border-color: rgba(38, 66, 54, 0.16);
}

#portalPanelQuote.is-quote-ready .billing-layout > .next-card:first-child {
  background: #fff;
  border-color: rgba(38, 66, 54, 0.18);
}

#nextVisitScopeEditBtn[aria-expanded="true"] {
  background: #1f342b;
  border-color: rgba(31, 52, 43, 0.18);
  color: #fff;
}

.grid-toolbar[aria-label] .grid-toolbar__button.is-active,
.grid-toolbar[aria-label] .grid-toolbar__button[aria-selected="true"] {
  background: var(--brand);
  border-color: rgba(31, 45, 38, 0.18);
  color: #fff;
}

#portalPanelVisit,
#portalPanelQuote {
  background: var(--paper);
}

#portalPanelQuote .next-card,
#portalPanelVisit .arrival-brief,
#portalPanelVisit .visit-intel-card {
  background: var(--paper);
}

#portalPanelQuote .info-panel__action:not(:disabled) {
  background: var(--brand);
  color: #fff;
}

@media (min-width: 760px) {
  .next-card--calendar .next-card__header-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    width: auto;
    max-width: none;
  }

  .next-card--calendar .calendar-inline-action {
    width: auto;
  }
}

@media (max-width: 720px) {
  .portal-hero__card:has(.hero-facts[hidden]) {
    padding-bottom: 16px;
  }

  .arrival-brief__row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

/* Account cluster + Home Screen card */
.portal-hero__account {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  min-width: 0;
}

.portal-hero__account:not(:has(> :not([hidden]))) {
  display: none;
}

.portal-hero__topline {
  align-items: center;
}

.portal-call,
.portal-signout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 0.78rem;
  border: 1px solid rgba(31, 45, 38, 0.12);
  border-radius: 999px;
  background: #fff;
  color: #3d5148;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  text-underline-offset: unset;
}

.portal-call:hover,
.portal-call:focus-visible,
.portal-signout:hover,
.portal-signout:focus-visible {
  border-color: rgba(31, 45, 38, 0.22);
  background: #f6f8f6;
  color: var(--text);
}

.portal-hero__account .notification-bell {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border: 1px solid rgba(31, 45, 38, 0.12);
  background: #fff;
  color: #3d5148;
  box-shadow: none;
}

.portal-hero__account .notification-bell:hover,
.portal-hero__account .notification-bell:focus-visible {
  border-color: rgba(31, 45, 38, 0.22);
  background: #f6f8f6;
  color: var(--text);
}

.portal-install-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px 14px;
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(31, 45, 38, 0.1);
  border-radius: var(--radius-card, 18px);
  background: var(--card, #fff);
  box-shadow: var(--shadow-tight);
}

.portal-install-card__glyph {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #264236;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.portal-install-card__glyph::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 1.5px solid #fff;
  border-radius: 4px;
  background:
    linear-gradient(#fff, #fff) center / 8px 1.5px no-repeat,
    linear-gradient(#fff, #fff) center / 1.5px 8px no-repeat;
}

.portal-install-card__copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.portal-install-card__copy span {
  display: none;
}

.portal-install-card__copy strong {
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 750;
  line-height: 1.2;
}

.portal-install-card__copy small {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.portal-install-button {
  min-height: 44px;
  padding: 0 0.9rem;
  border: 1px solid rgba(38, 66, 54, 0.16);
  border-radius: var(--radius-control, 12px);
  background: #fff;
  color: #264236;
  font-size: 0.78rem;
  font-weight: 750;
  box-shadow: none;
}

.portal-install-button::before {
  display: none;
}

.portal-install-button:hover,
.portal-install-button:focus-visible {
  border-color: rgba(38, 66, 54, 0.3);
  background: #f4f8f5;
}

@media (max-width: 720px) {
  .portal-hero__topline {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding-right: 0;
  }

  .portal-hero__account {
    position: relative;
    z-index: 56;
    padding-top: 2px;
  }

  .portal-signout:not([hidden]) {
    position: static;
    top: auto;
    right: auto;
    z-index: auto;
    min-height: 40px;
  }

  .notification-bell {
    position: relative;
    top: auto;
    right: auto;
    z-index: 56;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    margin: 0;
    box-shadow: none;
  }

  .portal-hero__actions {
    justify-content: flex-start;
    max-width: 100%;
    padding-right: 0;
    margin-right: 0;
  }
}

@media (max-width: 480px) {
  .portal-hero__topline {
    display: flex;
    grid-template-columns: none;
    align-items: flex-start;
    gap: 10px;
  }

  .portal-hero__account {
    width: auto;
  }
}

@media (max-width: 360px) {
  .portal-install-card {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    padding: 14px;
  }

  .portal-install-card .portal-install-button {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 44px;
  }
}

/* === Portal layout polish (clean borders, no pencil stroke) === */
body {
  background-color: var(--bg);
  background-image: none;
  color: var(--ink);
}

.page-shell h1,
.page-shell h2,
.page-shell h3,
.panel-intro h2,
.info-panel h2,
.next-card h3 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  letter-spacing: 0;
}

.notebook-card,
.portal-hero__card,
.portal-gate,
.grid-toolbar,
.portal-install-card,
.dropdown-menu {
  background: var(--paper);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-tight);
}

.next-card,
.visit-intel-card,
.arrival-brief,
#portalPanelQuote .next-card {
  background: var(--paper);
  border: 1px solid color-mix(in srgb, var(--ink) 14%, transparent);
  border-radius: var(--radius-card);
  box-shadow: none;
}

.notebook-card::before,
.portal-hero__card::before,
.next-card::before,
.portal-gate::before,
.visit-intel-card::before,
.arrival-brief::before,
#portalPanelQuote::before,
#portalPanelVisit::before,
.grid-toolbar::before,
.portal-install-card::before,
.dropdown-menu::before,
.notebook-card::after,
.portal-hero__card::after,
.next-card::after,
.portal-gate::after,
.visit-intel-card::after,
.arrival-brief::after,
#portalPanelQuote::after,
#portalPanelVisit::after,
.grid-toolbar::after,
.portal-install-card::after {
  content: none;
  filter: none;
}

.portal-hero > div,
.portal-hero__card {
  display: grid;
  grid-template-columns: 1fr;
  background: var(--paper);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-tight);
  padding-bottom: 20px;
}

.portal-hero h1 {
  max-width: 22ch;
  font-family: "Fraunces", Georgia, serif;
}

.hero-summary {
  max-width: 42ch;
  color: var(--graphite);
}

.hero-customer-name {
  font-family: "Fraunces", Georgia, serif;
}

.portal-hero__actions {
  margin-top: 0.35rem;
}

.frequency-pill {
  display: none !important;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: keep-all;
  text-align: center;
  line-height: 1;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  background: #efe8d6;
  box-shadow: none;
}

.hero-quote-jump,
.info-panel__action,
.portal-install-button {
  border-radius: 999px;
}

.hero-quote-jump {
  appearance: none;
  justify-self: start;
  width: auto;
  margin-top: 0.85rem;
  min-height: 44px;
  padding: 0.55rem 1.15rem;
  background: var(--brand);
  color: #f6f1e3;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}

.hero-quote-jump[hidden] {
  display: none !important;
}

a.hero-quote-jump {
  text-decoration: none;
  text-align: center;
}

.quote-estimate-link {
  display: inline-flex;
  width: fit-content;
  margin-top: 0.75rem;
  color: #315f4c;
  font-size: 0.88rem;
  font-weight: 700;
}

.quote-estimate-link[hidden] {
  display: none !important;
}

.portal-estimate-card .info-panel__action {
  display: inline-flex;
  width: fit-content;
  margin-top: 0.45rem;
  text-decoration: none;
}

.portal-signout {
  min-height: 36px;
  padding: 0.2rem 0.15rem;
  border: 0;
  border-bottom: 1.5px solid var(--pencil);
  border-radius: 0;
  background: transparent;
  color: var(--graphite);
  font-size: 0.78rem;
  font-weight: 600;
  box-shadow: none;
}

.notification-bell {
  border: 1.7px solid rgba(52, 46, 36, 0.7);
  background: var(--paper);
  box-shadow: none;
  color: var(--ink);
}

.notification-bell__glyph {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: 0;
  line-height: 0;
}

.notification-bell__glyph::after {
  content: none;
}

.notification-bell__glyph svg {
  display: block;
  width: 18px;
  height: 18px;
  overflow: visible;
}

.notification-bell__glyph path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.grid-toolbar.notebook-tabs,
.grid-toolbar {
  background: var(--paper);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-tight);
}

.grid-toolbar__button {
  background: transparent;
  border-radius: var(--radius-control);
}

.grid-toolbar__button.is-active {
  background: var(--brand);
  color: #f6f1e6;
}

.grid-toolbar__button.has-attention::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 0.4rem;
  border-radius: 50%;
  background: #c45a3a;
  vertical-align: 1px;
}

.visit-readiness-score {
  display: none !important;
}

.visit-intel-card--readiness[data-readiness-state="needs-info"],
.visit-intel-card--readiness[data-readiness-state="partial"],
.visit-intel-card--readiness[data-readiness-state="ready"] {
  background: var(--paper);
}

.recurring-deep-choice,
.billing-payment-choice,
.billing-consent-choice {
  border-radius: var(--radius-control);
}

.recurring-deep-choice {
  margin-bottom: 0.7rem;
  padding: 0.55rem 0.7rem;
}

.billing-payment-choice:has(input:checked),
.billing-consent-choice:has(input:checked) {
  background: #e8f0e6;
  border-color: rgba(42, 69, 56, 0.7);
}

#portalPanelQuote .info-panel__action:disabled,
#portalPanelQuote .info-panel__action:disabled:hover {
  background: #f4ecda !important;
  color: var(--graphite) !important;
  border: 1.6px solid rgba(52, 46, 36, 0.45);
  opacity: 1;
  box-shadow: none;
}

.billing-stat,
.calendar-day {
  background: #f8f2e6;
}
