/* ===========================================
   LOGO BOX
   =========================================== */
.logo-box {
  width: 60px;
  height: 60px;
  background: var(--gradient-brand);
  border-radius: var(--radius-2xl);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg), 0 4px 16px rgba(14, 124, 123, 0.25);
}

.logo-box .icon {
  width: 30px;
  height: 30px;
  color: var(--white);
}

/* ===========================================
   PHOTO STRIP
   =========================================== */
.photo-strip {
  display: flex;
  gap: 12px;
  padding: 16px 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.photo-strip::-webkit-scrollbar {
  display: none;
}

.photo-thumb {
  position: relative;
  width: 88px;
  height: 88px;
  flex-shrink: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--grey-100);
}

.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-thumb .remove-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  background: rgba(0, 0, 0, 0.7);
  border: none;
  border-radius: var(--radius-full);
  color: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}

.photo-thumb .remove-btn:hover {
  background: var(--error);
}

.photo-thumb .remove-btn .icon {
  width: 14px;
  height: 14px;
}

/* ===========================================
   PHOTO CAROUSEL - GLASS MORPHISM
   =========================================== */
.photo-carousel {
  position: relative;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-3xl);
  overflow: hidden;
  box-shadow: var(--shadow-xl), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  aspect-ratio: 4/5;
}

.carousel-track {
  display: flex;
  height: 100%;
  transition: transform 0.3s var(--ease-out-expo);
}

.carousel-slide {
  min-width: 100%;
  height: 100%;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 16px 0;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  background: var(--grey-300);
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  padding: 0;
  transition: all var(--transition-base);
}

.carousel-dot.active {
  background: var(--teal-600);
  width: 24px;
  border-radius: 4px;
}

.swipe-hint {
  text-align: center;
  font-size: 0.8125rem;
  color: var(--grey-400);
}

/* ===========================================
   LIMIT REACHED STATE
   =========================================== */
.limit-container {
  align-items: center;
  justify-content: center;
  text-align: center;
}

.limit-icon {
  width: 88px;
  height: 88px;
  background: var(--warning-light);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 28px;
}

.limit-icon .icon {
  width: 44px;
  height: 44px;
  color: var(--warning);
}

.limit-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: 12px;
  color: var(--grey-900);
}

.limit-message {
  font-size: 1rem;
  color: var(--grey-600);
  margin-bottom: 28px;
}

/* Upgrade Box - Glass Morphism */
.upgrade-box {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-2xl);
  padding: 28px;
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  width: 100%;
  max-width: 340px;
  text-align: left;
}

.upgrade-box h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
  margin-bottom: 20px;
  color: var(--grey-900);
}

.upgrade-features {
  list-style: none;
  margin-bottom: 24px;
}

.upgrade-features li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  font-size: 0.9375rem;
  color: var(--grey-700);
}

.upgrade-features li::before {
  content: '';
  width: 20px;
  height: 20px;
  background: var(--success);
  border-radius: var(--radius-full);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  flex-shrink: 0;
}

.reset-note {
  margin-top: 24px;
  font-size: 0.8125rem;
  color: var(--grey-500);
}

/* ===========================================
   LANDING PAGE
   =========================================== */
.landing-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.landing-content h1 {
  font-family: var(--font-display);
  font-size: 1.875rem;
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 16px;
  color: var(--grey-900);
}

.landing-content h1 em {
  color: var(--teal-600);
  font-style: italic;
}

.landing-content .subtitle {
  font-size: 1.0625rem;
  color: var(--grey-600);
  margin-bottom: 36px;
  max-width: 320px;
  line-height: 1.6;
}

/* Video Facade - Lazy YouTube Embed */
.video-facade {
  position: relative;
  width: 100%;
  margin-bottom: 32px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 16 / 9;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.video-facade:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.video-facade .facade-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.video-facade .play-btn {
  width: 64px;
  height: 64px;
  background: var(--gradient-brand);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md), 0 4px 16px rgba(14, 124, 123, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.video-facade:hover .play-btn {
  transform: scale(1.1);
  box-shadow: var(--shadow-lg), 0 6px 20px rgba(14, 124, 123, 0.3);
}

.video-facade .play-btn svg {
  width: 28px;
  height: 28px;
  margin-left: 3px;
  color: var(--white);
}

.video-facade .facade-label {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--grey-500);
  letter-spacing: 0.02em;
}

.video-facade iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Trust Signal Reviews */
.trust-reviews {
  width: 100%;
  margin-top: 32px;
  margin-bottom: 8px;
}

.trust-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

.trust-stars {
  display: flex;
  gap: 2px;
}

.trust-stars svg {
  width: 16px;
  height: 16px;
  fill: #f59e0b;
}

.trust-label {
  font-size: 0.8125rem;
  color: var(--grey-500);
  font-weight: 500;
}

.review-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 10px;
  text-align: left;
}

.review-card:last-child {
  margin-bottom: 0;
}

.review-stars {
  display: flex;
  gap: 1px;
  margin-bottom: 8px;
}

.review-stars svg {
  width: 14px;
  height: 14px;
  fill: #f59e0b;
}

.review-text {
  font-size: 0.875rem;
  color: var(--grey-700);
  line-height: 1.5;
  margin-bottom: 10px;
  font-style: italic;
}

.review-author {
  display: flex;
  align-items: center;
  gap: 10px;
}

.review-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gradient-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.review-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--grey-800);
  line-height: 1.3;
}

.review-role {
  font-size: 0.75rem;
  color: var(--grey-500);
  font-weight: 400;
}

/* Features Grid - Glass Cards */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 36px;
  width: 100%;
}

.feature {
  text-align: center;
  padding: 20px 12px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-xl);
  transition: all var(--transition-base);
}

.feature:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.feature-icon {
  width: 52px;
  height: 52px;
  background: var(--gradient-brand);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px auto;
  box-shadow: var(--shadow-sm);
}

.feature-icon .icon {
  width: 24px;
  height: 24px;
  color: var(--white);
}

.feature h3 {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--grey-800);
}

.feature p {
  font-size: 0.75rem;
  color: var(--grey-500);
  line-height: 1.4;
}

.free-note {
  font-size: 0.875rem;
  color: var(--grey-500);
  margin-top: 16px;
}

/* ===========================================
   APP DRAWER (replaces the old dropdown menu)
   =========================================== */
.yk-app-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  z-index: 1000;
}
.yk-app-drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}
.yk-app-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(300px, 88vw);
  background: var(--white);
  box-shadow: -8px 0 24px rgba(15, 23, 42, 0.12);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.yk-app-drawer.active {
  transform: translateX(0);
}
.yk-app-drawer-header {
  padding: 20px 20px 16px 20px;
  border-bottom: 1px solid var(--grey-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.yk-app-drawer-header-info {
  min-width: 0;
  flex: 1;
}
.yk-app-drawer-salon-name {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--grey-900);
  margin: 0 0 4px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.yk-app-drawer-plan-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  /* Free = quiet neutral so it does not compete with the brand. */
  background: var(--grey-100);
  color: var(--grey-600);
  font-size: 0.6875rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.yk-app-drawer-plan-tag.pro {
  /* Paid = brand gradient so the tier reads at a glance. */
  background: var(--gradient-brand);
  color: var(--white);
}
.yk-app-drawer-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--grey-700);
  cursor: pointer;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}
.yk-app-drawer-close:hover {
  background: var(--grey-100);
}
.yk-app-drawer-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}
.yk-app-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  background: none;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--grey-800);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.yk-app-menu-item:hover {
  background: var(--grey-50);
}
.yk-app-menu-item:focus-visible {
  outline: 2px solid var(--teal-500);
  outline-offset: 2px;
}
.yk-app-menu-item-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--grey-600, #4b5563);
}
.yk-app-menu-item-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.yk-app-menu-item-label {
  font-weight: 500;
  line-height: 1.2;
}
.yk-app-menu-item-hint {
  font-size: 0.75rem;
  color: var(--grey-500);
  line-height: 1.3;
  margin-top: 2px;
  display: none;
}
.yk-app-menu-item.active {
  background: var(--teal-50, #f0fdfa);
  color: var(--teal-700);
}
.yk-app-menu-item.active .yk-app-menu-item-icon {
  color: var(--teal-700);
}
.yk-app-menu-item.yk-app-menu-item--locked {
  color: var(--grey-500);
}
.yk-app-menu-item.yk-app-menu-item--locked .yk-app-menu-item-icon {
  color: var(--grey-400, #9ca3af);
}
.yk-app-menu-item.yk-app-menu-item--locked .yk-app-menu-item-hint {
  display: block;
}
/* Reveal the secondary hint on the premium entry point so its value prop is
   visible; most rows stay single-line for a minimal menu. */
.yk-app-menu-item.yk-app-menu-item--phase3-premium .yk-app-menu-item-hint {
  display: block;
}
/* Loading state for a drawer menu item (e.g. Edit listing): dim the label and
   show a trailing spinner the instant the row is tapped. setButtonLoading()
   toggles the .loading class + the disabled attribute. */
.yk-app-menu-item.loading {
  pointer-events: none;
}
.yk-app-menu-item.loading .yk-app-menu-item-label {
  opacity: 0.55;
}
.yk-app-menu-item.loading::after {
  content: "";
  width: 16px;
  height: 16px;
  margin-left: auto;
  flex-shrink: 0;
  border: 2px solid var(--grey-300, #d4d4d4);
  border-top-color: var(--teal-500);
  border-radius: 50%;
  animation: yk-menu-spin 0.6s linear infinite;
}
@keyframes yk-menu-spin {
  to { transform: rotate(360deg); }
}
.yk-app-menu-divider {
  height: 1px;
  background: var(--grey-100);
  margin: 8px 4px;
}
/* Neutral at rest, red on hover/focus -- persistent red reads alarming and
   cheapens the list. The "Sign out" label carries the meaning either way. */
.yk-app-menu-signout {
  color: var(--grey-700);
}
.yk-app-menu-signout .yk-app-menu-item-icon {
  color: var(--grey-500);
}
.yk-app-menu-signout:hover,
.yk-app-menu-signout:focus-visible {
  background: #fef2f2;
  color: #dc2626;
}
.yk-app-menu-signout:hover .yk-app-menu-item-icon,
.yk-app-menu-signout:focus-visible .yk-app-menu-item-icon {
  color: #dc2626;
}

/* =========================================
   ANALYTICS MODE
   ========================================= */
.analytics-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 0 16px 24px;
}
@media (min-width: 720px) {
  .analytics-grid { grid-template-columns: 1fr 1fr; }
}

.analytics-card {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-xl);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.analytics-card--hero,
.analytics-card--full { grid-column: 1 / -1; }
.analytics-card-label {
  font-size: 0.75rem;
  color: var(--grey-600);
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.analytics-card-value {
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1.05;
  color: var(--grey-900);
}
.analytics-card-sub {
  font-size: 0.8125rem;
  color: var(--grey-600);
}
.analytics-card-delta {
  font-size: 0.8125rem;
  margin-top: 2px;
}
.analytics-card-delta--up    { color: var(--teal-700); }
.analytics-card-delta--down  { color: var(--warning); }
.analytics-card-delta--flat  { color: var(--grey-500); }

.analytics-sparkline {
  width: 100%;
  height: 36px;
  overflow: visible;
  margin-top: 6px;
}
.analytics-sparkline path {
  fill: none;
  stroke: var(--teal-600);
  stroke-width: 1.5;
}

.analytics-card--locked {
  opacity: 0.78;
  background: rgba(248, 248, 250, 0.85);
  border-style: dashed;
}
.analytics-card--locked .analytics-card-value {
  font-size: 0.9375rem;
  font-weight: 400;
  font-family: var(--font-body);
  color: var(--grey-700);
  line-height: 1.4;
}
.analytics-card--locked .btn {
  align-self: flex-start;
  margin-top: 8px;
}

.analytics-window-pills {
  display: flex;
  gap: 8px;
  padding: 0 16px;
  margin-bottom: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.analytics-window-pills::-webkit-scrollbar { display: none; }
.analytics-pill {
  flex-shrink: 0;
  padding: 8px 14px;
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-full);
  background: var(--white);
  color: var(--grey-700);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
}
.analytics-pill.is-active {
  background: var(--teal-600);
  color: var(--white);
  border-color: var(--teal-600);
}

.analytics-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px 8px;
  font-size: 0.75rem;
  color: var(--grey-500);
}
.analytics-refresh {
  background: none;
  border: none;
  color: var(--teal-600);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 4px 6px;
}

.analytics-loading,
.analytics-empty,
.analytics-error {
  text-align: center;
  padding: 32px 24px;
  color: var(--grey-600);
}

.analytics-service-row {
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--grey-700);
}
.analytics-service-bar {
  height: 8px;
  border-radius: 4px;
  background: var(--grey-100);
  overflow: hidden;
}
.analytics-service-bar > span {
  display: block;
  height: 100%;
  background: var(--teal-600);
  border-radius: 4px;
}

.heatmap-grid {
  display: grid;
  grid-template-columns: auto repeat(7, 1fr);
  gap: 3px;
  margin-top: 6px;
}
.heatmap-row-label {
  font-size: 0.6875rem;
  color: var(--grey-500);
  align-self: center;
  padding-right: 6px;
  text-align: right;
}
.heatmap-cell {
  aspect-ratio: 1.4 / 1;
  border-radius: 4px;
  background: var(--grey-100);
}
.heatmap-col-labels {
  display: grid;
  grid-template-columns: auto repeat(7, 1fr);
  gap: 3px;
  margin-top: 4px;
  font-size: 0.6875rem;
  color: var(--grey-500);
  text-align: center;
}

/* GSC per-page + top-queries breakdown (Card 9) */
.gsc-pages, .gsc-top-queries {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--grey-100);
}
.gsc-pages-label, .gsc-top-queries-label {
  font-size: 0.75rem;
  color: var(--grey-600);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.gsc-page-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  align-items: start;
  padding: 6px 0;
  font-size: 0.8125rem;
}
.gsc-page-label {
  color: var(--grey-900);
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
}
.gsc-page-impr, .gsc-page-clicks {
  font-variant-numeric: tabular-nums;
  color: var(--grey-700);
}
.gsc-query-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: start;
  padding: 6px 0;
  font-size: 0.8125rem;
}
.gsc-query-text {
  color: var(--grey-900);
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
}
.gsc-metric-pair {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  white-space: nowrap;
}
.gsc-metric {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-variant-numeric: tabular-nums;
  color: var(--grey-700);
}
.gsc-query-spark { width: 120px; }
.gsc-query-spark .analytics-sparkline {
  height: 22px;
  margin-top: 0;
}
.gsc-query-impr {
  font-variant-numeric: tabular-nums;
  color: var(--grey-700);
  font-size: 0.8125rem;
}

.metric-icon {
  display: inline-flex;
  align-items: center;
}
.metric-icon-svg {
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
  color: var(--grey-500);
  flex-shrink: 0;
}

.analytics-detail {
  margin-top: 4px;
}
.analytics-detail > summary {
  cursor: pointer;
  font-size: 0.75rem;
  color: var(--teal-700);
  list-style: none;
}
.analytics-detail > summary::-webkit-details-marker { display: none; }
.analytics-detail > summary::after {
  content: ' ›';
}
.analytics-detail[open] > summary::after {
  content: ' ⌄';
}
.analytics-detail-body {
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--grey-500);
  line-height: 1.5;
}

/* =========================================
   DASHBOARD AUTH
   ========================================= */
.dash-auth-intro {
  font-size: 0.9375rem;
  color: var(--grey-600);
  line-height: 1.6;
  margin-bottom: 24px;
}

/* Sign-in gate (renderAuthGate) - elevated to the design-system standard.
   Shared by the full-screen boot path and the in-modal re-auth path. */
.auth-gate-card {
  max-width: 420px;
  margin: 0 auto;
  padding: 40px 24px;
}

.auth-gate-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 400;
  line-height: 1.15;
  color: var(--grey-900);
  margin: 0 0 8px;
}

.auth-gate-code-input {
  text-align: center;
  font-size: 1.5rem;
  letter-spacing: 0.3em;
  font-weight: 600;
}

.auth-gate-label {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--grey-800);
  margin: 0 0 10px;
}

.auth-gate-durations {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.auth-gate-chip {
  flex: 1;
  min-width: 96px;
  padding: 12px 8px;
  border: 2px solid var(--grey-200);
  background: var(--white);
  color: var(--grey-600);
  border-radius: var(--radius-lg);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
}

.auth-gate-chip.is-selected {
  border-color: var(--teal-600);
  background: var(--teal-50);
  color: var(--teal-700);
}

.auth-gate-error {
  margin-top: 12px;
  color: #dc2626;
  font-size: 0.8125rem;
}

.auth-gate-foot {
  margin-top: 24px;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--grey-500);
}

.auth-gate-foot a {
  color: var(--teal-600);
  font-weight: 600;
  text-decoration: underline;
}

/* Passwordless sign-in (run pwa-passwordless-signin): Google button + divider. */
.auth-gate-google {
  display: flex;
  justify-content: center;
  min-height: 44px;
  margin-bottom: 4px;
}

.auth-gate-or {
  display: flex;
  align-items: center;
  text-align: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--grey-500);
  font-size: 0.8125rem;
}

.auth-gate-or::before,
.auth-gate-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--grey-200, #e5e7eb);
}

/* Password-flow additions: capslock indicator, signin error variant,
   sr-only username hidden input for password managers, and surfaces
   specific to the new sub-views and the change-password modal. */
.capslock-warning {
  display: none;
  margin-top: 6px;
  color: var(--warning, #f59e0b);
  font-size: 0.8125rem;
  font-weight: 500;
}

.signin-error {
  color: var(--error, #dc2626);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.auth-gate-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 8px;
  font-size: 0.9375rem;
  color: var(--grey-700);
  cursor: pointer;
}

.auth-gate-remember input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--teal-600);
}

.auth-gate-email-readonly {
  padding: 12px 16px;
  background: var(--grey-50, #f8fafc);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-md, 8px);
  color: var(--grey-700);
  font-size: 0.9375rem;
  margin: 0 0 16px;
  word-break: break-all;
}

.change-password-form .form-group {
  margin-bottom: 16px;
}

.change-password-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 16px;
  font-size: 0.9375rem;
  color: var(--grey-700);
  cursor: pointer;
}

.change-password-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--teal-600);
}

.change-password-hint {
  margin-top: 12px;
  font-size: 0.8125rem;
  color: var(--grey-500);
  line-height: 1.5;
}

/* =========================================
   DASHBOARD VIEW
   ========================================= */
.dash-stats {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.dash-stat {
  text-align: center;
  padding: 16px 8px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: all var(--transition-base);
}
.dash-stat:active {
  transform: scale(0.98);
}
.dash-stat.dash-stat-active {
  border-color: var(--teal-600);
  box-shadow: 0 0 0 3px rgba(14, 124, 123, 0.1);
}
.dash-stat-hero {
  background: linear-gradient(135deg, rgba(14, 124, 123, 0.05) 0%, rgba(255, 138, 108, 0.05) 100%);
  border-color: var(--teal-200);
}
.dash-stat-hero .dash-stat-num {
  font-size: 2rem;
}
.dash-stat-num {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--grey-800);
  line-height: 1.1;
  /* Clients-rebuild Phase 5: serif numerals so the metric reads as a
     headline number, not a data label. Fallback if this looks too
     editorial: revert to font-family:var(--font-body); font-weight:700;
     and keep serif only for .client-drawer-name. */
  font-family: var(--font-display);
  margin-bottom: 4px;
}
.dash-stat-approved .dash-stat-num { color: var(--teal-700); }
.dash-stat-pending .dash-stat-num { color: var(--warning); }
.dash-stat-label {
  font-size: 0.75rem;
  color: var(--grey-600);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.dash-stats-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 16px;
  font-size: 0.75rem;
  color: var(--grey-500);
}
.dash-stat-mini {
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--grey-500);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-full);
  transition: background var(--transition-fast);
}
.dash-stat-mini:hover,
.dash-stat-mini.dash-stat-active {
  background: var(--grey-100);
  color: var(--grey-700);
}
.dash-stat-mini-divider {
  color: var(--grey-300);
}
.dash-directory-card {
  background: var(--white);
  border: 1px solid var(--teal-200);
  border-radius: var(--radius-xl);
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.dash-directory-card-inner {
  display: flex;
  align-items: center;
  gap: 10px;
}
.dash-directory-icon {
  font-size: 1.25rem;
  color: var(--teal-600);
  flex-shrink: 0;
}
.dash-directory-info {
  flex: 1;
  min-width: 0;
}
.dash-directory-info strong {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--grey-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-directory-sub {
  font-size: 0.75rem;
  color: var(--grey-500);
}
.dash-directory-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}
.dash-directory-link {
  font-size: 0.8125rem;
  color: var(--teal-600);
  text-decoration: none;
  font-weight: 600;
}
.dash-directory-link:hover {
  text-decoration: underline;
}
.dash-directory-edit-btn {
  background: var(--teal-600);
  color: var(--white);
  border: none;
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
}
.dash-directory-edit-btn:hover {
  background: var(--teal-700);
}
.dash-directory-banner {
  margin-top: 10px;
  padding: 10px 12px;
  background: #fef7e6;
  border: 1px solid #f5d77a;
  border-radius: var(--radius-lg);
  color: #6b4d00;
  font-size: 0.8125rem;
  line-height: 1.4;
}
/* Connect card: the directory on-ramp for unlinked salons. Elevated to a
   brand-gradient surface so it reads as the primary action on the page. */
/* Redesign 2026-06-07: teal-outline card (no brand gradient ad). Matches the
   stat-tile treatment the salon owner preferred; the Go Pro gradient ad that
   used to sit beside this card has moved into the app menu. */
.dash-linkage-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, rgba(14, 124, 123, 0.06) 0%, rgba(255, 138, 108, 0.06) 100%);
  border: 1px solid var(--teal-200);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  font-family: var(--font-body);
  text-align: left;
  color: var(--grey-900);
  transition: all var(--transition-base);
}
.dash-linkage-card:hover {
  transform: translateY(-2px);
  border-color: var(--teal-400);
  box-shadow: 0 8px 22px rgba(14, 124, 123, 0.14);
}
.dash-linkage-card:active {
  transform: translateY(0);
}
.dash-linkage-icon {
  font-size: 1.75rem;
  color: var(--teal-600);
  flex-shrink: 0;
  opacity: 1;
}
.dash-linkage-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.dash-linkage-text strong {
  font-size: 1rem;
  font-weight: 700;
  color: var(--grey-900);
}
.dash-linkage-text span {
  font-size: 0.8125rem;
  color: var(--grey-600);
  line-height: 1.45;
}
.dash-linkage-arrow {
  font-size: 1.5rem;
  color: var(--teal-600);
  flex-shrink: 0;
  opacity: 1;
}
.dash-services-entry {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
  background: var(--white);
  border: 1px solid var(--teal-200);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  font-family: var(--font-body);
  text-align: left;
  color: inherit;
}
.dash-services-entry:hover {
  border-color: var(--teal-300);
  background: var(--teal-50, #f3fafa);
}
.dash-services-entry-icon {
  font-size: 1.25rem;
  color: var(--teal-600);
  font-weight: 700;
  flex-shrink: 0;
  min-width: 24px;
  text-align: center;
}
.dash-services-entry-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.dash-services-entry-text strong {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--grey-900);
}
.dash-services-entry-text span {
  font-size: 0.8125rem;
  color: var(--grey-600);
  line-height: 1.4;
}
.dash-services-entry-arrow {
  font-size: 1.25rem;
  color: var(--teal-600);
  flex-shrink: 0;
}

/* Manage Services mode -- service/price editor */
.mng-svcs-intro {
  font-size: 0.875rem;
  color: var(--grey-600);
  margin: 0 0 16px;
  line-height: 1.5;
}
.mng-svcs-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mng-svcs-cat-header {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--grey-500);
  margin: 18px 0 8px;
  padding: 0 4px;
  font-weight: 600;
}
.mng-svcs-cat-header:first-child { margin-top: 0; }
.mng-svc-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-lg);
}
.mng-svc-row[data-active="true"] {
  border-color: var(--teal-300);
  background: var(--teal-50, #f3fafa);
}
.mng-svc-chip {
  flex: 1;
  background: transparent;
  border: none;
  padding: 6px 4px;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--grey-700);
  text-align: left;
  cursor: pointer;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.mng-svc-chip[aria-pressed="true"] {
  color: var(--grey-900);
  font-weight: 600;
}
.mng-svc-chip::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--grey-300);
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--white);
  transition: all 120ms ease;
}
.mng-svc-chip[aria-pressed="true"]::before {
  background: var(--teal-600);
  border-color: var(--teal-600);
}
.mng-svc-price {
  width: 100px;
  padding: 8px 10px;
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--grey-800);
  background: var(--white);
}
.mng-svc-price:disabled {
  background: var(--grey-50);
  color: var(--grey-400);
  cursor: not-allowed;
}
.mng-svc-price:focus {
  outline: none;
  border-color: var(--teal-600);
}
.mng-svc-state {
  width: 66px;
  font-size: 0.6875rem;
  color: var(--grey-500);
  text-align: right;
  flex-shrink: 0;
  line-height: 1.2;
}
.mng-svc-state.is-saving { color: var(--grey-500); }
.mng-svc-state.is-saved { color: var(--teal-600); font-weight: 600; }
.mng-svc-state.is-error { color: #b54708; font-weight: 600; cursor: pointer; }
.mng-svcs-error {
  color: var(--grey-700);
  font-size: 0.875rem;
  padding: 12px;
  text-align: center;
}
.mng-svcs-retry-btn {
  background: var(--teal-600);
  color: var(--white);
  border: none;
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-left: 8px;
  cursor: pointer;
  font-family: var(--font-body);
}
.mng-svcs-skeleton-row {
  display: flex;
  gap: 8px;
  padding: 14px 12px;
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-lg);
  margin-bottom: 4px;
}
.mng-svcs-skeleton-row::before,
.mng-svcs-skeleton-row::after {
  content: '';
  display: block;
  height: 16px;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--grey-100) 0%, var(--grey-200) 50%, var(--grey-100) 100%);
  background-size: 200% 100%;
  animation: mng-shimmer 1.4s ease infinite;
}
.mng-svcs-skeleton-row::before { flex: 1; }
.mng-svcs-skeleton-row::after { width: 80px; }
@keyframes mng-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Capture-form service dropdown: visible-fail state. Shown when the
   directory-services fetch fails or returns empty for a linked salon. */
.service-load-error {
  margin-top: 8px;
  font-size: 0.8125rem;
  color: #b54708;
}
.service-load-retry {
  background: none;
  border: none;
  color: var(--teal-600);
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: var(--font-body);
  padding: 0;
  margin-left: 4px;
}

/* Capture-form service dropdown: empty-catalogue state. Shown when the
   salon has no active services yet -- the catalogue-onboarding funnel. */
.service-empty-state {
  margin-top: 8px;
}
.service-empty-hint {
  font-size: 0.8125rem;
  color: var(--gray-600, #475467);
  margin: 0 0 8px;
}
.service-empty-add {
  background: none;
  border: 1px dashed var(--teal-600);
  color: var(--teal-600);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font-body);
  padding: 8px 14px;
  border-radius: 8px;
}

/* Capture-form quick-add: searchable taxonomy picker for the empty state. */
.service-quickadd {
  margin-top: 10px;
  border: 1px solid var(--gray-200, #e4e7ec);
  border-radius: 10px;
  padding: 10px;
}
.service-quickadd-search {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 8px;
}
.service-quickadd-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.service-quickadd-cat {
  background: none;
  border: 1px solid var(--gray-300, #d0d5dd);
  color: var(--gray-700, #344054);
  font-size: 0.75rem;
  font-family: var(--font-body);
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
}
.service-quickadd-cat.is-active {
  background: var(--teal-600);
  border-color: var(--teal-600);
  color: #fff;
}
.service-quickadd-list {
  max-height: 220px;
  overflow-y: auto;
}
.service-quickadd-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--gray-100, #f2f4f7);
}
.service-quickadd-name {
  flex: 1;
  font-size: 0.875rem;
}
.service-quickadd-price {
  width: 64px;
  box-sizing: border-box;
}
.service-quickadd-add {
  background: var(--teal-600);
  border: none;
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: var(--font-body);
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.service-quickadd-add:disabled { opacity: 0.6; cursor: default; }
.service-quickadd-empty {
  font-size: 0.8125rem;
  color: var(--gray-600, #475467);
  padding: 8px 0;
  margin: 0;
}

.dash-filters {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.dash-filters::-webkit-scrollbar { display: none; }
.dash-filter {
  flex-shrink: 0;
  padding: 8px 16px;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-full);
  background: var(--white);
  color: var(--grey-600);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.dash-filter.active {
  background: var(--teal-600);
  color: var(--white);
  border-color: var(--teal-600);
}
.dash-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}
.dash-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--grey-500);
  font-size: 0.875rem;
}
.dash-request-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--transition-fast);
}
.dash-request-card:active {
  box-shadow: var(--shadow-sm);
}
.dash-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: var(--grey-100);
  flex-shrink: 0;
}
.dash-thumb-mono {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--teal-50);
  color: var(--teal-700);
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: 600;
}
.dash-request-info {
  flex: 1;
  min-width: 0;
}
.dash-client-name {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--grey-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-service {
  display: block;
  font-size: 0.75rem;
  color: var(--grey-500);
}
.dash-date {
  display: block;
  font-size: 0.6875rem;
  color: var(--grey-400);
  margin-top: 2px;
}
.dash-status-badge {
  flex-shrink: 0;
  padding: 4px 10px;
  font-size: 0.6875rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  text-transform: capitalize;
}
.dash-status-approved {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}
.dash-status-pending {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}
.dash-status-declined {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
}
.dash-status-expired {
  background: var(--grey-100);
  color: var(--grey-400);
}
.dash-status-shared {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}
.dash-status-revoked {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
}
.dash-filters-secondary {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to right, black 90%, transparent 100%);
  mask-image: linear-gradient(to right, black 90%, transparent 100%);
}
.dash-filters-secondary::-webkit-scrollbar { display: none; }
.dash-bulk-check-label {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  padding: 4px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.dash-bulk-check {
  display: none;
}
.dash-check-mark {
  width: 22px;
  height: 22px;
  border: 2px solid var(--grey-300);
  border-radius: 6px;
  transition: all var(--transition-fast);
  position: relative;
}
.dash-bulk-check:checked + .dash-check-mark {
  background: var(--teal-600);
  border-color: var(--teal-600);
}
.dash-bulk-check:checked + .dash-check-mark::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 2px;
  width: 6px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.dash-select-all {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  margin-bottom: 8px;
  font-size: 0.8125rem;
  color: var(--grey-500);
}
.dash-bulk-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--white);
  border-top: 1px solid var(--grey-200);
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
  z-index: 998;
}
.dash-bulk-bar.active { display: flex; }
.dash-bulk-count {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--grey-700);
}
.dash-bulk-actions {
  display: flex;
  gap: 8px;
}
.dash-bulk-actions .drawer-btn {
  width: auto;
  padding: 10px 20px;
}

/* ============================================================
   Clients-rebuild Phase 1 -- grouped client cards
   The Clients view collapses many requests into one card per
   person. Coral is reserved for the "due" signal so the colour
   itself reads as "act on this".
   ============================================================ */

.dash-view-toggle {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
}
.dash-view-tab {
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--grey-500);
  padding: 4px 0;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}
.dash-view-tab.is-active {
  color: var(--teal-700);
  border-bottom-color: var(--teal-600);
}

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

.dash-client-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xs);
  transition: transform var(--transition-base),
              box-shadow var(--transition-base);
  cursor: pointer;
  animation: dashRowIn 0.35s var(--ease-out-expo) both;
}
.dash-client-card:active {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.dash-client-avatar {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.375rem;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}
.dash-client-card[data-due="true"] .dash-client-avatar {
  box-shadow: inset 0 0 0 1.5px rgba(255, 138, 108, 0.5);
}
.dash-client-avatar-mono {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.dash-client-avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.dash-av-0 { background: var(--teal-50);   color: var(--teal-700);  }
.dash-av-1 { background: var(--teal-100);  color: var(--teal-700);  }
.dash-av-2 { background: var(--coral-50);  color: var(--coral-600); }
.dash-av-3 { background: var(--coral-100); color: var(--coral-600); }
.dash-av-4 { background: var(--grey-100);  color: var(--grey-700);  }

.dash-client-info {
  flex: 1;
  min-width: 0;
}
/* Scoped override of the existing flat-view .dash-client-name rule:
   client-book names use display:flex so the due-dot sits inline. */
.dash-client-card .dash-client-name {
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--grey-900);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.9375rem;
}
.dash-client-meta {
  display: block;
  font-size: 0.75rem;
  color: var(--grey-500);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-client-due {
  color: var(--coral-600);
  font-weight: 600;
}
.dash-client-due-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--coral-500);
  flex-shrink: 0;
}
.dash-client-rail {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  width: 64px;
  flex-shrink: 0;
}
.dash-client-rating {
  font-size: 0.6875rem;
  color: var(--warning);
  font-weight: 600;
  min-height: 1em;
  white-space: nowrap;
}
/* Softer status pills inside the client rail; the base
   .dash-status-badge rule is not modified. */
.dash-client-rail .dash-status-badge {
  font-weight: 500;
}

/* Phase 2: pagination control. Quiet teal text button under the list. */
.dash-show-more {
  display: block;
  margin: 8px auto 0;
  background: none;
  border: none;
  color: var(--teal-700);
  font-family: var(--font-body);
  font-size: 0.875rem;
  cursor: pointer;
  padding: 8px;
}
.dash-show-more:hover { color: var(--teal-800); }

/* ============================================================
   Clients-rebuild Phase 3 -- pill chips, search field, freshness
   The base .dash-select rule is preserved untouched; .dash-chip-select
   augments it with a pill radius and warmer .is-filtered tint.
   ============================================================ */

.dash-chip-select {
  border-radius: var(--radius-full);
  padding: 8px 30px 8px 14px;
  font-size: 0.8125rem;
  background-color: var(--white);
  border-color: var(--grey-300);
  box-shadow: var(--shadow-xs);
  transition: background-color var(--transition-fast),
              color var(--transition-fast),
              border-color var(--transition-fast);
}
.dash-chip-select:focus {
  outline: none;
  border-color: var(--teal-400);
  box-shadow: 0 0 0 3px rgba(14, 124, 123, 0.10);
}
.dash-chip-select.is-filtered {
  background-color: var(--teal-50);
  color: var(--teal-700);
  border-color: var(--teal-200);
}

/* Phase 3 search wrapper: inset magnifier icon + warm focus ring.
   Replaces the inline padding/font-size that previously lived on the
   input. */
.dash-search {
  position: relative;
  margin-bottom: 12px;
}
.dash-search::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
  pointer-events: none;
}
.dash-search-input {
  width: 100%;
  padding: 12px 16px 12px 40px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--grey-800);
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.dash-search-input::placeholder { color: var(--grey-400); }
.dash-search-input:focus {
  outline: none;
  border-color: var(--teal-400);
  box-shadow: 0 0 0 3px rgba(14, 124, 123, 0.10);
}

/* ============================================================
   Clients-rebuild Phase 4 -- person-centric drawer
   Built around the client (header + history + sticky actions),
   not the receipt. The Instrument Serif name is the signature
   moment; everything else is operational DM Sans.
   ============================================================ */

.client-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 4px 0;
  margin-bottom: 12px;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  color: var(--teal-700);
  cursor: pointer;
}
.client-back-btn:hover { color: var(--teal-800); }

.client-drawer-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 8px;
  margin-bottom: 16px;
}
.client-drawer-avatar {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.625rem;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}
.client-drawer-headline { flex: 1; min-width: 0; }
.client-drawer-name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--grey-900);
  margin: 0;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.client-drawer-email {
  font-size: 0.8125rem;
  color: var(--grey-500);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.client-drawer-summary {
  font-size: 0.8125rem;
  color: var(--grey-600);
  line-height: 1.5;
  margin: 0 0 20px;
}

.client-visits {
  margin-bottom: 16px;
}
.client-visits-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--grey-400);
  margin-bottom: 8px;
}
.client-visit-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px;
  background: var(--white);
  border: 1px solid var(--grey-100);
  border-radius: var(--radius-lg);
  margin-bottom: 6px;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-body);
  transition: background var(--transition-fast), border-color var(--transition-fast);
}
.client-visit-row:hover {
  background: var(--grey-50);
  border-color: var(--grey-200);
}
.client-visit-thumb-wrap {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
  background: var(--grey-100);
  color: var(--grey-600);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1rem;
  overflow: hidden;
}
.client-visit-thumb-mono {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.client-visit-thumb-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.client-visit-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.client-visit-svc {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--grey-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.client-visit-date {
  font-size: 0.6875rem;
  color: var(--grey-500);
  margin-top: 2px;
}
.client-visit-rating {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--warning);
  white-space: nowrap;
  margin-left: 4px;
}

.client-action-hint {
  font-size: 0.75rem;
  color: var(--coral-600);
  margin-bottom: 8px;
  text-align: center;
}
.client-action-bar {
  position: sticky;
  bottom: 0;
  background: var(--white);
  display: flex;
  gap: 10px;
  padding: 12px 0;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--grey-100);
  z-index: 2;
}
.client-action-btn {
  flex: 1;
  min-height: 44px;
  padding: 12px 16px;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.client-action-call {
  text-decoration: none;
}
.client-action-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px 0 8px;
}
.client-action-link {
  background: none;
  border: none;
  padding: 6px 0;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  color: var(--grey-600);
  cursor: pointer;
}
.client-action-link:hover { color: var(--grey-800); }
.client-action-link-danger { color: var(--error); }
.client-action-link-danger:hover { color: var(--error); opacity: 0.85; }

/* =========================================
   MESSAGE COMPOSER
   ========================================= */
.message-recipients {
  padding: 10px 14px;
  background: var(--grey-50);
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  color: var(--grey-600);
  margin-bottom: 16px;
}
.message-templates {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to right, black 90%, transparent 100%);
  mask-image: linear-gradient(to right, black 90%, transparent 100%);
  margin-bottom: 16px;
  padding: 2px 0;
}
.message-templates::-webkit-scrollbar { display: none; }
.message-tokens {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}
.message-tokens-label {
  font-size: 0.75rem;
  color: var(--grey-500);
  font-weight: 500;
  margin-right: 2px;
}
.message-token-chip {
  flex-shrink: 0;
  padding: 6px 12px;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--teal-50);
  color: var(--teal-700);
  border: 1px solid var(--teal-200);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.message-token-chip:hover {
  background: var(--teal-100);
  border-color: var(--teal-600);
}
.message-token-chip:active {
  transform: scale(0.96);
}
.message-recipient {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 20px;
  background: var(--grey-50);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-lg);
}
.message-recipient-thumb {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--grey-100);
}
.message-recipient-thumb-mono {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--teal-50);
  color: var(--teal-700);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
}
.message-recipient-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.message-recipient-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--grey-800);
}
.message-recipient-email {
  font-size: 0.75rem;
  color: var(--grey-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.message-template-pill {
  flex-shrink: 0;
  padding: 8px 14px;
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  background: var(--white);
  color: var(--grey-600);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.message-template-pill.active {
  background: var(--teal-600);
  color: var(--white);
  border-color: var(--teal-600);
}
.message-hint {
  font-size: 0.75rem;
  color: var(--grey-400);
  margin-bottom: 16px;
}
.message-quota {
  text-align: center;
  font-size: 0.8125rem;
  color: var(--grey-500);
  margin-top: 12px;
}
.dash-select {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  color: var(--grey-700);
  background: var(--white);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

/* =========================================
   DETAIL DRAWER
   ========================================= */
.dash-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 999;
}
.dash-drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.dash-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 85vh;
  background: var(--white);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
  transform: translateY(100%);
  transition: transform 0.3s var(--ease-out-expo);
  z-index: 1000;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.dash-drawer.open {
  transform: translateY(0);
}
.dash-drawer-handle {
  display: flex;
  justify-content: center;
  padding: 12px 0 8px 0;
  cursor: grab;
}
.dash-drawer-handle-bar {
  width: 40px;
  height: 4px;
  background: var(--grey-300);
  border-radius: var(--radius-full);
  margin: 12px auto 8px auto;
}
.dash-drawer-content {
  padding: 0 24px 24px 24px;
}
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.drawer-close {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--grey-100);
  border-radius: var(--radius-full);
  font-size: 1.25rem;
  color: var(--grey-500);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.drawer-photos {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.drawer-photos::-webkit-scrollbar { display: none; }
.drawer-photo {
  flex-shrink: 0;
  width: 96px;
  height: 96px;
  border-radius: var(--radius-lg);
  object-fit: cover;
  cursor: pointer;
  background: var(--grey-100);
  border: 1px solid var(--grey-200);
  transition: transform var(--transition-fast);
}
.drawer-photo:active { transform: scale(0.95); }
.drawer-field {
  margin-bottom: 16px;
}
.drawer-field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--grey-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.drawer-field input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--grey-800);
  transition: border-color var(--transition-fast);
}
.drawer-field input:focus {
  outline: none;
  border-color: var(--teal-600);
}
.drawer-field input[readonly] {
  background: var(--grey-50);
  color: var(--grey-500);
  cursor: default;
}
.drawer-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  margin: 16px 0;
  background: var(--grey-50);
  border-radius: var(--radius-lg);
}
.drawer-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.drawer-meta-label {
  font-size: 0.75rem;
  color: var(--grey-500);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.drawer-meta-value {
  font-size: 0.875rem;
  color: var(--grey-800);
  font-weight: 500;
  text-align: right;
  min-width: 0;
}
.drawer-meta-item {
  font-size: 0.8125rem;
  color: var(--grey-600);
}
.drawer-meta-item strong {
  color: var(--grey-700);
}
.drawer-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 20px;
}
.drawer-btn {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-lg);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  background: var(--white);
  color: var(--grey-700);
}
.drawer-btn:active { transform: scale(0.98); }
.drawer-btn-primary {
  background: var(--teal-600);
  color: var(--white);
  border-color: var(--teal-600);
}
.drawer-btn-danger {
  color: var(--error);
  border-color: rgba(239, 68, 68, 0.3);
}
.drawer-btn-danger:active {
  background: rgba(239, 68, 68, 0.05);
}
.drawer-btn:disabled {
  opacity: 0.5;
  cursor: default;
}
.drawer-btn .btn-loading {
  display: none;
}
.drawer-btn.loading .btn-text {
  display: none;
}
.drawer-btn.loading .btn-loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.drawer-delete-link {
  background: none;
  border: none;
  color: var(--error);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 8px;
  margin-top: 4px;
  text-align: center;
  width: 100%;
}
.drawer-delete-link:hover {
  color: var(--error);
  opacity: 0.8;
}
.dash-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.dash-lightbox.active { display: flex; }
.dash-lightbox img {
  max-width: 100%;
  max-height: 85vh;
  border-radius: var(--radius-lg);
  object-fit: contain;
}
.dash-lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.dash-loading-skeleton {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dash-skeleton-card {
  height: 76px;
  background: linear-gradient(90deg, var(--grey-100) 25%, var(--grey-50) 50%, var(--grey-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-xl);
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===========================================
   MEDIA UPLOAD SECTION
   =========================================== */
.media-upload-section {
  margin-bottom: 28px;
}

/* (Removed: .media-label / .media-label-text / .media-counter -- the standalone
   "Add Photos N/M" row was deleted; the count now lives in the card hint
   (#addMediaHint). These classes were used by nothing else.) */

/* Media Strip - Premium Thumbnails */
.media-strip {
  display: flex;
  gap: 12px;
  padding: 0 0 16px 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.media-strip::-webkit-scrollbar {
  display: none;
}

.media-strip:empty {
  display: none;
}

.media-thumb {
  position: relative;
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--grey-100);
  scroll-snap-align: start;
  box-shadow: var(--shadow-md);
  border: 2px solid var(--white);
  transition: all var(--transition-base);
}

.media-thumb:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-lg);
}

.media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-thumb .remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  border: none;
  border-radius: var(--radius-full);
  color: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all var(--transition-fast);
  opacity: 0.8;
}

.media-thumb:hover .remove-btn {
  opacity: 1;
}

.media-thumb .remove-btn:hover {
  background: var(--error);
  transform: scale(1.1);
}

.media-thumb .remove-btn svg {
  width: 12px;
  height: 12px;
}

/* Upload Zone - Premium Glass Morphism */
.upload-zone-unified {
  width: 100%;
  touch-action: manipulation;
}

.add-media-btn-unified {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 28px;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-2xl);
  cursor: pointer;
  transition: all var(--transition-base);
  -webkit-tap-highlight-color: transparent;
  box-shadow:
    var(--shadow-md),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(0, 0, 0, 0.02);
  position: relative;
  overflow: hidden;
}

/* Subtle gradient overlay */
.add-media-btn-unified::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
      rgba(240, 253, 250, 0.4) 0%,
      rgba(255, 247, 237, 0.3) 100%);
  opacity: 0;
  transition: opacity var(--transition-base);
  pointer-events: none;
}

.add-media-btn-unified:hover,
.add-media-btn-unified:focus {
  transform: translateY(-4px);
  border-color: var(--teal-200);
  box-shadow:
    var(--shadow-lg),
    0 8px 32px rgba(14, 124, 123, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.add-media-btn-unified:hover::before,
.add-media-btn-unified:focus::before {
  opacity: 1;
}

.add-media-btn-unified:active {
  transform: translateY(-2px);
}

/* Icon containers with gradient */
.add-media-icons {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  position: relative;
  z-index: 1;
}

.add-media-icon-box {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(14, 124, 123, 0.08);
  border: 1px solid rgba(14, 124, 123, 0.12);
  border-radius: var(--radius-xl);
  transition: all var(--transition-base);
}

.add-media-icon-box svg {
  color: var(--teal-700);
  transition: all var(--transition-base);
}

.add-media-btn-unified:hover .add-media-icon-box,
.add-media-btn-unified:focus .add-media-icon-box {
  background: var(--gradient-brand);
  border-color: transparent;
  box-shadow: var(--shadow-teal);
}

.add-media-btn-unified:hover .add-media-icon-box svg,
.add-media-btn-unified:focus .add-media-icon-box svg {
  color: var(--white);
}

.add-media-plus {
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--coral-500);
  transition: color var(--transition-base);
}

.add-media-btn-unified:hover .add-media-plus,
.add-media-btn-unified:focus .add-media-plus {
  color: var(--teal-400);
}

.add-media-title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 400;
  color: var(--grey-800);
  margin-bottom: 6px;
  position: relative;
  z-index: 1;
}

.add-media-hint {
  font-size: 0.875rem;
  color: var(--grey-500);
  position: relative;
  z-index: 1;
}

/* Compact mode when photos exist */
.upload-zone-unified.has-photos .add-media-btn-unified {
  padding: 20px 24px;
  flex-direction: row;
  gap: 16px;
}

.upload-zone-unified.has-photos .add-media-btn-unified::before {
  display: none;
}

.upload-zone-unified.has-photos .add-media-icons {
  margin-bottom: 0;
  gap: 12px;
}

.upload-zone-unified.has-photos .add-media-icon-box {
  width: 44px;
  height: 44px;
}

.upload-zone-unified.has-photos .add-media-icon-box svg {
  width: 20px;
  height: 20px;
}

.upload-zone-unified.has-photos .add-media-plus {
  display: none;
}

.upload-zone-unified.has-photos .add-media-title {
  margin-bottom: 0;
  font-size: 1rem;
}

.upload-zone-unified.has-photos .add-media-hint {
  display: none;
}

/* ===========================================
   CAMERA MODAL
   =========================================== */
.camera-modal {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 1000;
  display: none;
}

.camera-modal.active {
  display: block;
}

.camera-modal-content {
  position: relative;
  width: 100%;
  height: 100%;
}

.camera-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Camera Grid Overlay */
.camera-grid {
  position: absolute;
  inset: 0;
  display: none;
  pointer-events: none;
}

.camera-grid.active {
  display: block;
}

.camera-grid::before,
.camera-grid::after {
  content: '';
  position: absolute;
  background: rgba(255, 255, 255, 0.3);
}

.camera-grid::before {
  left: 33.33%;
  right: 33.33%;
  top: 0;
  bottom: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.3);
  border-right: 1px solid rgba(255, 255, 255, 0.3);
  background: transparent;
}

.camera-grid::after {
  top: 33.33%;
  bottom: 33.33%;
  left: 0;
  right: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  background: transparent;
}

/* Camera Top Controls */
.camera-top-controls {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 16px;
  padding-top: calc(16px + env(safe-area-inset-top, 0));
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.5) 0%, transparent 100%);
}

.camera-close-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  border-radius: var(--radius-full);
  color: var(--white);
  cursor: pointer;
  backdrop-filter: blur(12px);
}

.camera-top-right {
  display: flex;
  gap: 10px;
}

.camera-tool-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  border-radius: var(--radius-full);
  color: var(--white);
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: background var(--transition-fast);
}

.camera-tool-btn.active {
  background: var(--teal-600);
}

/* Camera Bottom Controls */
.camera-bottom-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 28px;
  padding-bottom: calc(28px + env(safe-area-inset-bottom, 0));
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, transparent 100%);
}

.camera-switch-btn,
.camera-gallery-btn {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: var(--radius-full);
  color: var(--white);
  cursor: pointer;
  backdrop-filter: blur(12px);
}

.camera-capture-btn {
  width: 76px;
  height: 76px;
  background: var(--white);
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-full);
  cursor: pointer;
  padding: 4px;
  transition: transform 0.1s;
}

.camera-capture-btn:active {
  transform: scale(0.95);
}

.capture-btn-inner {
  width: 100%;
  height: 100%;
  background: var(--white);
  border-radius: var(--radius-full);
  transition: background var(--transition-fast);
}

.camera-capture-btn:active .capture-btn-inner {
  background: var(--grey-200);
}

/* Camera Loading State */
.camera-loading {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.8);
  color: var(--white);
}

.camera-loading.active {
  display: flex;
}

.camera-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

/* Camera Error State */
.camera-error {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.9);
  color: var(--white);
  padding: 32px;
  text-align: center;
}

.camera-error.active {
  display: flex;
}

.camera-error svg {
  color: var(--grey-400);
  margin-bottom: 20px;
}

.camera-error p {
  margin-bottom: 28px;
  color: var(--grey-300);
  line-height: 1.5;
}

/* ===========================================
   CAPTURE FORM
   =========================================== */
.capture-form {
  flex: 1;
}

.capture-footer {
  padding: 44px 0 24px 0;
  text-align: center;
}

.capture-footer p {
  font-size: 0.8125rem;
  color: var(--grey-400);
}

.capture-footer a {
  color: var(--teal-600);
  text-decoration: none;
  font-weight: 500;
}

.capture-footer .footer-divider {
  margin: 0 8px;
  color: var(--grey-300);
}

/* ===========================================
   SIGNUP PAGE
   =========================================== */
.signup-footer {
  padding: 20px 0;
  text-align: center;
}

.signup-legal {
  font-size: 0.8125rem;
  color: var(--grey-500);
  line-height: 1.6;
}

.signup-legal a {
  color: var(--teal-600);
  text-decoration: none;
  font-weight: 500;
}

.signup-legal a:hover {
  text-decoration: underline;
}

/* ===========================================
   PWA: INSTALL BANNER
   =========================================== */
.pwa-install-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 900;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.pwa-install-banner.visible {
  transform: translateY(0);
}

.pwa-install-inner {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px 16px;
}

.pwa-install-card {
  background: var(--white);
  border-radius: var(--radius-2xl);
  padding: 20px;
  box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.pwa-install-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.pwa-install-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(14, 124, 123, 0.2);
}

.pwa-install-text h3 {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--grey-900);
  margin-bottom: 2px;
}

.pwa-install-text p {
  font-size: 0.8125rem;
  color: var(--grey-500);
  line-height: 1.4;
}

.pwa-install-actions {
  display: flex;
  gap: 10px;
}

.pwa-install-actions .btn {
  flex: 1;
  padding: 12px 16px;
  font-size: 0.875rem;
  border-radius: var(--radius-xl);
}

.pwa-btn-dismiss {
  /* The Install button gets its sizing from `.pwa-install-actions .btn`, but
     this dismiss button carries no `.btn` class, so it must repeat the same
     padding / radius / font-size itself -- otherwise it renders as an
     unstyled square grey box next to the rounded Install button. */
  padding: 12px 16px;
  font-size: 0.875rem;
  border-radius: var(--radius-xl);
  background: var(--grey-100);
  color: var(--grey-600);
  border: none;
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--font-body);
  font-weight: 500;
  transition: background 0.2s;
}

.pwa-btn-dismiss:hover {
  background: var(--grey-200);
}

/* iOS-specific manual instructions */
.pwa-ios-steps {
  margin: 14px 0 4px;
  padding: 14px;
  background: var(--grey-50);
  border-radius: var(--radius-xl);
}

.pwa-ios-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  font-size: 0.8125rem;
  color: var(--grey-700);
}

.pwa-ios-step + .pwa-ios-step {
  border-top: 1px solid var(--grey-200);
}

.pwa-ios-num {
  width: 24px;
  height: 24px;
  background: var(--teal-600);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0;
}

.pwa-ios-step svg {
  width: 18px;
  height: 18px;
  color: var(--teal-600);
  flex-shrink: 0;
}

/* Hide install banner when already in standalone */
@media (display-mode: standalone) {
  .pwa-install-banner { display: none !important; }
}

@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .pwa-install-inner {
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }
}

/* ===========================================
   SALON FEED
   =========================================== */
.feed-toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

.feed-status-card {
  display: none;
  padding: 12px 14px;
  background: var(--teal-50);
  border: 1px solid var(--teal-200);
  border-radius: var(--radius-lg);
  color: var(--teal-700);
  font-size: 0.875rem;
  font-weight: 600;
}

.feed-status-card.show {
  display: block;
}

.feed-filter-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  padding-right: 18px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to right, black 86%, transparent 100%);
  mask-image: linear-gradient(to right, black 86%, transparent 100%);
}
.feed-filter-pills::-webkit-scrollbar { display: none; }
@media (prefers-reduced-motion: reduce) {
  .feed-filter-pills {
    -webkit-mask-image: none;
    mask-image: none;
  }
}

.feed-pill {
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-full);
  background: var(--white);
  color: var(--grey-700);
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.feed-pill.active {
  background: var(--teal-50);
  border-color: var(--teal-600);
  color: var(--teal-700);
}

.feed-scope-row {
  display: flex;
  gap: 8px;
}

.feed-scope-row .feed-pill {
  flex: 1 1 0;
  text-align: center;
}

.feed-services-cta {
  padding: 12px 14px;
  background: var(--teal-50);
  border: 1px solid var(--teal-200);
  border-radius: var(--radius-lg);
  color: var(--teal-700);
  font-size: 0.875rem;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.feed-services-cta .btn {
  align-self: stretch;
}

.feed-search-row {
  display: grid;
  grid-template-columns: 1fr 126px;
  gap: 10px;
}

.feed-search-input,
.feed-select,
.social-select {
  min-height: 44px;
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--grey-200);
  border-radius: var(--radius-lg);
  background: var(--white);
  color: var(--grey-800);
  font-family: var(--font-body);
  font-size: 0.875rem;
}

.feed-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.feed-card {
  overflow: hidden;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}

.feed-card-media {
  position: relative;
  width: 100%;
  background: #0f172a;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feed-card-media[data-aspect="9/16"] { max-height: 520px; }
.feed-card-media[data-aspect="4/5"]  { max-height: 480px; }

.feed-card-media img,
.feed-card-media video,
.feed-card-media iframe {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border: 0;
}

.feed-card-media iframe { object-fit: contain; }

.feed-media-play,
.feed-media-external {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 0;
  color: #fff;
  text-decoration: none;
}

.feed-media-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  line-height: 1;
  padding-left: 6px;
  transition: transform 0.15s ease, background 0.15s ease;
}

.feed-media-play:hover .feed-media-play-icon,
.feed-media-external:hover .feed-media-play-icon {
  background: rgba(0, 0, 0, 0.78);
  transform: translate(-50%, -50%) scale(1.06);
}

.feed-media-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(15, 23, 42, 0.85);
  color: #fff;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.feed-media-placeholder {
  width: 100%;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--grey-200);
  font-size: 0.8125rem;
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

.feed-card-body {
  padding: 16px;
}

.feed-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
  color: var(--grey-500);
  font-size: 0.75rem;
  font-weight: 600;
}

.feed-card h2 {
  font-size: 1rem;
  line-height: 1.35;
  color: var(--grey-900);
  margin-bottom: 8px;
}

.feed-card p {
  color: var(--grey-600);
  font-size: 0.875rem;
  line-height: 1.45;
  margin-bottom: 12px;
}

.feed-score {
  padding: 8px 10px;
  background: var(--grey-50);
  border-radius: var(--radius-md);
  color: var(--grey-600);
  font-size: 0.75rem;
  line-height: 1.35;
  margin-bottom: 12px;
}

/* Stage 1: actions row -- primary + two icon buttons */
.feed-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}
.feed-action-primary { flex: 1 1 auto; }
.feed-icon-btn {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-lg);
  background: var(--white);
  color: var(--grey-600);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}
.feed-icon-btn:hover { border-color: var(--teal-600); color: var(--teal-700); }
.feed-icon-btn:active { transform: scale(0.96); }
.feed-icon-btn:focus-visible,
.feed-action-primary:focus-visible {
  outline: 2px solid var(--teal-600);
  outline-offset: 2px;
}
.feed-icon-btn .icon { width: 20px; height: 20px; }
.feed-save-btn.is-saved {
  background: var(--teal-600);
  border-color: var(--teal-600);
  color: var(--white);
}
.feed-save-btn.is-saved .icon { fill: var(--white); }

/* Gradient media fallback (FEED_GRAD_V4: light branded tints, no centre glyph).
   The old white .feed-card-media--gradient text colour and .feed-media-glyph
   rule are removed -- imageless cards now show a clean light tint + badge. */
.feed-media-play-icon--static {
  background: rgba(15, 23, 42, 0.55);
}

/* Meta and engagement */
.feed-meta-source { color: var(--grey-500); font-size: 0.75rem; font-weight: 600; }
.feed-card-engagement { display: flex; gap: 14px; margin: 4px 0 10px; }
.feed-eng-stat { color: var(--grey-600); font-size: 0.8125rem; font-weight: 600; }
/* The comment count is a real button (opens the comments modal); strip the
   native button chrome so it reads as inline text, with a clear hover/focus. */
button.feed-eng-stat { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.feed-eng-comments:hover { color: var(--teal-700); text-decoration: underline; }
.feed-eng-comments:focus-visible { outline: 2px solid var(--teal-600); outline-offset: 2px; border-radius: 4px; }

/* Comments modal list (Phase 2) */
.feed-comments-modal-list { max-height: 60vh; overflow-y: auto; margin-top: 4px; }
.feed-comment-row {
  font-size: 0.875rem; line-height: 1.5; color: var(--grey-800);
  padding: 10px 0; border-bottom: 1px solid var(--grey-200);
}
.feed-comment-row:last-child { border-bottom: 0; }
.feed-comments-empty { color: var(--grey-500); font-size: 0.875rem; padding: 8px 0; }

/* Suggest angles (Phase 3) */
.feed-angles { margin: 4px 0 10px; }
.feed-angles-toggle {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 8px 10px;
  background: none; border: 0; cursor: pointer;
  color: var(--grey-500); font-size: 0.8125rem; font-weight: 600;
}
.feed-angles-toggle:hover { color: var(--grey-700); }
.feed-angles-toggle:focus-visible { outline: 2px solid var(--teal-600); outline-offset: 2px; border-radius: 6px; }
.feed-angles-chevron {
  width: 0; height: 0;
  border-left: 5px solid transparent; border-right: 5px solid transparent;
  border-top: 6px solid currentColor;
  transition: transform 0.18s ease;
}
.feed-angles-toggle.is-open .feed-angles-chevron { transform: rotate(180deg); }
.feed-angles-panel { margin-top: 6px; }
.feed-angles-loading, .feed-angles-empty {
  color: var(--grey-500); font-size: 0.8125rem; padding: 10px 2px;
}
.feed-angles-scroller {
  display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 6px;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to right, black 88%, transparent 100%);
  mask-image: linear-gradient(to right, black 88%, transparent 100%);
}
.feed-angles-scroller::-webkit-scrollbar { display: none; }
@media (prefers-reduced-motion: reduce) {
  .feed-angles-scroller { -webkit-mask-image: none; mask-image: none; }
  .feed-angles-chevron { transition: none; }
}
.feed-angle-card {
  flex: 0 0 auto; width: 200px; text-align: left;
  display: flex; flex-direction: column; gap: 6px;
  padding: 12px; cursor: pointer;
  background: var(--white); border: 1px solid var(--grey-200);
  border-radius: var(--radius-lg);
}
.feed-angle-card:hover { border-color: var(--teal-600); }
.feed-angle-card:focus-visible { outline: 2px solid var(--teal-600); outline-offset: 2px; }
.feed-angle-card-title { font-size: 0.8125rem; font-weight: 700; color: var(--teal-700); }
.feed-angle-card-hook { font-size: 0.8125rem; line-height: 1.45; color: var(--grey-700); }
.feed-angles-refresh {
  margin-top: 8px; padding: 0; border: 0; background: none;
  color: var(--teal-700); font-size: 0.8125rem; font-weight: 600; cursor: pointer;
}
.feed-angles-refresh:focus-visible { outline: 2px solid var(--teal-600); outline-offset: 2px; }

/* Suggest angles -- Pro lock (mirrors the .video-tier pattern) */
.feed-angle-locked {
  padding: 16px; text-align: center;
  background: var(--grey-50); border: 1px solid var(--grey-200);
  border-radius: var(--radius-lg);
}
.feed-angle-locked-title {
  font-weight: 700; font-size: 0.9375rem; color: var(--grey-900); margin-bottom: 6px;
}
.feed-angle-locked-help {
  font-size: 0.8125rem; line-height: 1.5; color: var(--grey-600); margin: 0 0 12px;
}

/* Reason chip */
.feed-reason-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; margin-bottom: 10px;
  background: var(--teal-50); color: var(--teal-700);
  border-radius: var(--radius-full);
  font-size: 0.75rem; font-weight: 600;
}
.feed-reason-chip .icon-xs { width: 14px; height: 14px; }

/* Comments block */
.feed-comments {
  margin: 10px 0 4px; padding: 12px;
  background: var(--grey-50); border-radius: var(--radius-md);
}
.feed-comments-label {
  font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--grey-500); margin-bottom: 8px;
}
.feed-comment {
  font-size: 0.8125rem; line-height: 1.4; color: var(--grey-700);
  padding: 6px 0; border-bottom: 1px solid var(--grey-200);
}
.feed-comment:last-child { border-bottom: 0; }
.feed-comments-toggle {
  margin-top: 8px; padding: 0; border: 0; background: none;
  color: var(--teal-700); font-size: 0.8125rem; font-weight: 600; cursor: pointer;
}
.feed-comments-toggle:focus-visible {
  outline: 2px solid var(--teal-600);
  outline-offset: 2px;
}

.feed-empty {
  padding: 28px 18px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px dashed var(--grey-300);
  border-radius: var(--radius-xl);
  color: var(--grey-600);
  text-align: center;
  font-size: 0.9375rem;
}

.social-option-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 18px;
}

.social-option-label {
  display: block;
  margin-bottom: 6px;
  color: var(--grey-700);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ===========================================
   SOCIAL POST GENERATOR
   =========================================== */
.social-entry-card {
  margin-top: 28px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-md);
}
.social-entry-card .social-entry-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 400;
  color: var(--grey-900);
  margin-bottom: 6px;
}
.social-entry-card .social-entry-blurb {
  font-size: 0.875rem;
  color: var(--grey-600);
  margin-bottom: 16px;
}
.social-entry-card .social-credits {
  display: block;
  margin-top: 10px;
  font-size: 0.8125rem;
  color: var(--grey-500);
  text-align: center;
}

.social-section-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--grey-900);
  margin-bottom: 4px;
}
.social-section-subtitle {
  font-size: 0.9375rem;
  color: var(--grey-600);
  margin-bottom: 24px;
}

.social-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 0.8125rem;
  color: var(--grey-500);
}
.social-progress-dots {
  display: flex;
  gap: 6px;
}
.social-progress-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--grey-200);
}
.social-progress-dot.active {
  background: var(--teal-600);
  width: 24px;
}
.social-progress-dot.done {
  background: var(--teal-300);
}

/* ===========================================
   SOCIAL POST GENERATOR — PHASE A ADDITIONS
   =========================================== */

/* Field label, used across the new form */
.social-field-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--grey-700);
  margin: 20px 0 8px 0;
}
.social-field-label:first-of-type { margin-top: 4px; }

/* Idea label rendered as the screen's headline, not a field label */
.social-field-label.social-field-label--hero {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--grey-900);
  margin: 4px 0 10px 0;
  letter-spacing: 0.01em;
}

.social-field-hint {
  font-size: 0.8125rem;
  color: var(--grey-500);
  margin: -4px 0 10px 0;
  line-height: 1.4;
}

/* Idea textarea: elevated input, more visual weight */
.social-idea-textarea {
  min-height: 88px;
  font-size: 1rem;
  line-height: 1.45;
  box-shadow: var(--shadow-md);
}
.social-idea-textarea:focus {
  box-shadow: 0 0 0 4px rgba(14, 124, 123, 0.1);
}

/* Idea field gets a relative wrapper so the mic button can sit inside it */
.social-idea-wrap { position: relative; }
.social-idea-wrap .social-idea-textarea { padding-right: 52px; }

.social-dictate-btn {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--grey-500);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color var(--transition-fast);
}
.social-dictate-btn:hover { color: var(--grey-700); }
.social-dictate-btn:focus-visible {
  outline: 2px solid var(--teal-500);
  outline-offset: 2px;
}

/* Active listening: teal glyph plus a quiet privacy-ring pulse */
.social-dictate-btn.is-listening { color: var(--teal-600); }
.social-dictate-btn.is-listening::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: var(--radius-full);
  border: 2px solid var(--teal-400);
  animation: social-mic-pulse 1.4s ease-out infinite;
}
@keyframes social-mic-pulse {
  0%   { transform: scale(0.85); opacity: 0.7; }
  100% { transform: scale(1.5);  opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .social-dictate-btn.is-listening::before { animation: none; opacity: 0.5; }
}

/* AI-thinking ambient state on the idea textarea */
@keyframes social-thinking-sweep {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}
.social-textarea.is-thinking {
  background-image: linear-gradient(90deg,
    transparent 0%,
    rgba(14, 124, 123, 0.06) 50%,
    transparent 100%);
  background-size: 200% 100%;
  animation: social-thinking-sweep 1.6s linear infinite;
  border-color: var(--teal-400);
  box-shadow: 0 0 0 4px rgba(14, 124, 123, 0.08);
}

/* Credit chip in page header */
.social-credit-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--teal-200);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--teal-700);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.social-credit-chip:hover { border-color: var(--teal-400); }
.social-credit-chip:focus-visible { outline: 2px solid var(--teal-500); outline-offset: 2px; }
.social-credit-chip.is-low { color: var(--coral-700); border-color: var(--coral-200); background: var(--coral-50); }
.social-credit-chip.is-empty { color: var(--coral-700); border-color: var(--coral-400); background: var(--coral-50); }

/* Phase 7 polish: photo control is secondary to the primary CTA, so it
   reads as an inline dashed chip rather than a full-width gradient. */
.social-photo-attach {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
  min-height: 44px;
  padding: 8px 16px;
  border: 1px dashed var(--teal-300);
  border-radius: var(--radius-full);
  background: var(--white);
  color: var(--teal-700);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}
.social-photo-attach:hover {
  border-color: var(--teal-600);
  background: var(--teal-50);
}
.social-photo-attach:focus-visible {
  outline: 2px solid var(--teal-500);
  outline-offset: 2px;
}

/* Primary CTA shadow, scoped to the three social-flow buttons only */
#socialGenerateBtn,
#socialContinueBriefBtn,
#socialContinueWriteBtn {
  box-shadow: var(--shadow-teal);
}
#socialGenerateBtn:hover,
#socialContinueBriefBtn:hover,
#socialContinueWriteBtn:hover {
  box-shadow: var(--shadow-coral);
}
/* Phase 6: quiet crossfade when the CTA flips between
   "Create your post" and "Save to your plan". */
#socialGenerateBtn .btn-text {
  transition: opacity var(--transition-fast);
}
@media (prefers-reduced-motion: reduce) {
  #socialGenerateBtn .btn-text { transition: none; }
}

/* Multi-select platform pill: tick on selected */
.social-pill.is-multi {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.social-pill .social-pill-tick {
  width: 14px;
  height: 14px;
  border-radius: var(--radius-full);
  background: var(--teal-600);
  color: var(--white);
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.social-pill.active .social-pill-tick { display: inline-flex; }
.social-pill .social-pill-tick svg { width: 10px; height: 10px; }
.social-pill.is-primary { box-shadow: 0 0 0 2px rgba(14, 124, 123, 0.15); }

/* Horizontal scroll card rail (Template, Style) */
.social-card-rail {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 4px 16px 12px 0;
  margin: 0 -16px 8px -16px;
  padding-left: 16px;
  scrollbar-width: none;
  /* Right-edge fade hints at more content; removed once scrolled to end
     (see .is-scroll-end) so the final card isn't visually clipped. */
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent 100%);
          mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent 100%);
}
.social-card-rail.is-scroll-end {
  -webkit-mask-image: none;
          mask-image: none;
}
.social-card-rail::-webkit-scrollbar { display: none; }

.social-card {
  flex: 0 0 auto;
  width: 156px;
  /* Uniform row height: clamp gives every card the same visual height; an
     expanded card grows from this floor without disturbing siblings. */
  min-height: 150px;
  padding: 14px;
  background: var(--white);
  border: 2px solid var(--grey-200);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-base);
  scroll-snap-align: start;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: visible;
}
.social-card:hover {
  border-color: var(--teal-300);
  transform: translateY(-1px);
}
.social-card.active {
  background: var(--teal-50);
  border-color: var(--teal-600);
  box-shadow: 0 0 0 4px rgba(14, 124, 123, 0.08);
}
.social-card.is-auto {
  background: linear-gradient(135deg, rgba(240, 253, 250, 0.6), rgba(255, 247, 237, 0.4));
  border-color: var(--teal-200);
}
.social-card.is-auto.active {
  background: linear-gradient(135deg, var(--teal-50), var(--coral-50));
  border-color: var(--teal-600);
}
.social-card-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--grey-100);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--teal-700);
}
.social-card.is-auto .social-card-icon {
  background: var(--white);
  color: var(--teal-600);
}
.social-card-icon svg { width: 20px; height: 20px; }
.social-card-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--grey-900);
  line-height: 1.3;
}
.social-card-desc {
  display: block;
  position: relative;
  font-size: 0.75rem;
  color: var(--grey-500);
  line-height: 1.35;
}
/* Description clamps to three lines so the rail stays even; the wrapper
   carries position so an absolutely-positioned tick still sits cleanly. */
.social-card-desc-text {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.social-card-desc.is-expanded .social-card-desc-text {
  -webkit-line-clamp: unset;
  overflow: visible;
}
.social-card-more {
  margin-top: 4px;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--teal-600);
  cursor: pointer;
}
.social-card-more:hover { color: var(--teal-700); }
.social-card-more:focus-visible {
  outline: 2px solid var(--teal-500);
  outline-offset: 2px;
}
.social-card-tick {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  background: var(--teal-600);
  color: var(--white);
  display: none;
  align-items: center;
  justify-content: center;
}
.social-card.active .social-card-tick { display: inline-flex; }
.social-card-tick svg { width: 12px; height: 12px; }

/* Template preview panel: appears below selected Template card */
.social-preview-panel {
  margin: 4px 0 12px 0;
  padding: 14px 16px;
  background: var(--grey-50);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-lg);
  font-size: 0.8125rem;
  color: var(--grey-700);
  line-height: 1.5;
}
.social-preview-panel .social-preview-title {
  font-weight: 600;
  color: var(--grey-900);
  margin-bottom: 4px;
  font-size: 0.875rem;
}
.social-preview-panel .social-preview-image {
  margin-top: 10px;
  width: 100%;
  max-width: 280px;
  border-radius: var(--radius-md);
  border: 1px solid var(--grey-200);
  display: block;
  background: var(--grey-100);
}

/* Progress step labels (under dots) */
.social-progress-labels {
  display: flex;
  gap: 6px;
  margin: -12px 0 20px 0;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--grey-400);
}
.social-progress-labels span {
  flex: 0 0 auto;
  width: 32px;
  text-align: center;
}
.social-progress-labels span:first-child { width: 24px; text-align: left; }
.social-progress-labels span.active { color: var(--teal-700); }
.social-progress-labels span.done { color: var(--teal-500); }

/* Visual direction scene timeline */
.social-scene-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: scene;
}
.social-scene {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  align-items: flex-start;
  border-bottom: 1px solid var(--grey-100);
}
.social-scene:last-child { border-bottom: none; padding-bottom: 0; }
.social-scene-num {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: var(--teal-50);
  border: 1px solid var(--teal-200);
  color: var(--teal-700);
  font-size: 0.6875rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}
.social-scene-body { flex: 1 1 auto; min-width: 0; }
.social-scene-time {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--grey-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}
.social-scene-body p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--grey-700);
  line-height: 1.5;
}

.social-platform-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.social-platform-shape-hint {
  font-size: 0.75rem;
  color: var(--grey-500);
  margin: -16px 0 16px 0;
  font-style: italic;
  line-height: 1.4;
}
.social-pill {
  /* Phase 7 polish: flex centres the label so the 44px floor doesn't
     push the text top-aligned. min-height ensures comfortable touch. */
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--grey-700);
  background: var(--white);
  border: 2px solid var(--grey-200);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-base);
  -webkit-tap-highlight-color: transparent;
}
.social-pill:hover {
  border-color: var(--teal-300);
}
.social-pill.active {
  background: var(--teal-50);
  border-color: var(--teal-600);
  color: var(--teal-700);
}

.social-type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}
.social-type-card {
  padding: 16px;
  background: var(--white);
  border: 2px solid var(--grey-200);
  border-radius: var(--radius-xl);
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-base);
  -webkit-tap-highlight-color: transparent;
}
.social-type-card:hover {
  border-color: var(--teal-300);
  transform: translateY(-1px);
}
.social-type-card.active {
  background: var(--teal-50);
  border-color: var(--teal-600);
  box-shadow: 0 0 0 4px rgba(14, 124, 123, 0.1);
}
.social-type-icon {
  font-size: 1.5rem;
  margin-bottom: 6px;
  display: block;
}
.social-type-label {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--grey-900);
  margin-bottom: 2px;
}
.social-type-desc {
  font-size: 0.75rem;
  color: var(--grey-500);
  line-height: 1.4;
}

.social-textarea {
  width: 100%;
  min-height: 110px;
  padding: 14px 16px;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--grey-800);
  background: var(--white);
  border: 2px solid var(--grey-200);
  border-radius: var(--radius-lg);
  resize: vertical;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}
.social-textarea:focus {
  outline: none;
  border-color: var(--teal-600);
  box-shadow: 0 0 0 4px rgba(14, 124, 123, 0.1);
}

/* Stage 2.2: schedule-date input on Create a post. Tokens match the other
   social-* field styles so the field reads as a peer of the textareas. */
.social-date-input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-md);
  font: inherit;
  color: var(--text-primary);
  background: var(--white);
}
.social-date-input:focus-visible {
  outline: 2px solid var(--teal-600);
  outline-offset: -1px;
}

.social-result-card {
  padding: 16px;
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-xl);
  margin-bottom: 16px;
  box-shadow: var(--shadow-md);
}
.social-result-card:has(textarea) {
  box-shadow: var(--shadow-md), 0 0 0 1px var(--teal-100);
}
.social-result-label {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--teal-700);
  margin-bottom: 8px;
}
.social-result-text {
  font-size: 0.9375rem;
  color: var(--grey-800);
  line-height: 1.5;
  white-space: pre-wrap;
}
.social-result-card.muted {
  background: var(--grey-50);
  border-color: var(--grey-200);
  box-shadow: none;
}
.social-result-card.muted .social-result-text {
  color: var(--grey-600);
  font-size: 0.875rem;
}

.social-tone-pill {
  display: inline-block;
  padding: 6px 12px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--coral-700);
  background: var(--coral-50);
  border: 1px solid var(--coral-200);
  border-radius: var(--radius-full);
  margin-top: 10px;
}

.social-result-label-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.social-result-label-row .social-result-label { margin-bottom: 0; }
.social-result-label-row .social-tone-pill { margin: 0; }
.social-edit-hint {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--grey-400);
}
.social-textarea:focus ~ .social-edit-hint,
.social-result-card:focus-within .social-edit-hint { color: var(--teal-600); }

.social-section {
  margin-bottom: 14px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-xl);
  overflow: hidden;
}
.social-section-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--grey-800);
  font-family: var(--font-body);
}
.social-section-body {
  padding: 0 16px 16px 16px;
  font-size: 0.9375rem;
  color: var(--grey-700);
  line-height: 1.5;
  white-space: pre-wrap;
}
.social-section.collapsed .social-section-body { display: none; }
.social-section .chevron {
  transition: transform 0.2s;
  color: var(--grey-400);
}
.social-section.collapsed .chevron { transform: rotate(-90deg); }

.social-final-card {
  padding: 22px;
  background: var(--white);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-md);
  margin-bottom: 16px;
}
.social-final-caption {
  font-size: 1rem;
  color: var(--grey-900);
  line-height: 1.55;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.social-hashtags {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--grey-100);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.social-hashtag {
  font-size: 0.8125rem;
  color: var(--teal-700);
  background: var(--teal-50);
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.social-copy-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}
.social-copy-btn {
  padding: 12px 14px;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font-body);
  color: var(--teal-700);
  background: var(--teal-50);
  border: 1px solid var(--teal-200);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-base);
  -webkit-tap-highlight-color: transparent;
}
.social-copy-btn:hover {
  background: var(--teal-100);
}
.social-copy-btn.copied {
  background: var(--success);
  color: var(--white);
  border-color: var(--success);
}

/* ===========================================
   YOUR POSTS - list, chips, cards, modal
   =========================================== */
.my-posts-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.my-posts-chip {
  padding: 8px 14px;
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: var(--font-body);
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-full);
  color: var(--grey-700);
  cursor: pointer;
  transition: all var(--transition-base);
}
.my-posts-chip.active {
  background: var(--teal-50);
  border-color: var(--teal-300);
  color: var(--teal-700);
}
.my-posts-status {
  padding: 12px 14px;
  background: var(--grey-50);
  border-radius: var(--radius-lg);
  color: var(--grey-600);
  font-size: 0.875rem;
  text-align: center;
  margin-bottom: 12px;
}
.my-posts-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.my-post-card {
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-lg);
  padding: 14px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
}
.my-post-card:hover {
  border-color: var(--teal-300);
  box-shadow: var(--shadow-md);
}
.my-post-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.my-post-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  text-transform: capitalize;
}
.my-post-status-badge.draft     { background: var(--grey-100);  color: var(--grey-700); }
.my-post-status-badge.published { background: rgba(34, 197, 94, 0.15); color: rgb(21, 128, 61); }
.my-post-status-badge.failed    { background: rgba(220, 38, 38, 0.12); color: rgb(153, 27, 27); }
.my-post-mode-badge {
  font-size: 0.75rem;
  color: var(--grey-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.my-post-card-time {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--grey-500);
}
.my-post-card-caption {
  font-size: 0.875rem;
  color: var(--grey-700);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.my-post-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 9000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}
.my-post-modal-card {
  background: var(--white);
  border-radius: var(--radius-2xl) var(--radius-2xl) var(--radius-lg) var(--radius-lg);
  padding: 22px 18px 18px 18px;
  max-width: 520px;
  width: 100%;
  position: relative;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.18);
  margin-top: auto;
}
.my-post-modal-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--grey-500);
  cursor: pointer;
  padding: 4px 8px;
}
.my-post-modal-meta {
  font-size: 0.75rem;
  color: var(--grey-500);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.my-post-modal-title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 400;
  margin: 0 0 16px 0;
  color: var(--grey-900);
}
.my-post-modal-section { margin-bottom: 14px; }
.my-post-modal-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--grey-600);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.my-post-modal-caption {
  font-size: 0.9375rem;
  color: var(--grey-800);
  line-height: 1.55;
  white-space: pre-wrap;
}
.my-post-modal-hashtags {
  font-size: 0.875rem;
  color: var(--teal-700);
  word-break: break-word;
}
.my-post-modal-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.social-back-link {
  display: inline-block;
  margin-top: 12px;
  padding: 10px 4px;
  background: none;
  border: none;
  color: var(--grey-500);
  font-size: 0.875rem;
  cursor: pointer;
  font-family: var(--font-body);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.social-back-link:hover { color: var(--grey-800); }

.social-loading-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 40px 20px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-md);
  text-align: center;
}
.social-skeleton {
  width: 56px;
  height: 56px;
  border: 4px solid var(--teal-100);
  border-top-color: var(--teal-600);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
.social-loading-message {
  font-size: 1rem;
  font-weight: 600;
  color: var(--grey-800);
}
.social-loading-hint {
  font-size: 0.8125rem;
  color: var(--grey-500);
}

.social-error-card {
  padding: 22px;
  text-align: center;
  background: rgba(255, 247, 237, 0.9);
  border: 1px solid var(--coral-200);
  border-radius: var(--radius-2xl);
}
.social-error-card p {
  font-size: 0.9375rem;
  color: var(--grey-800);
  margin-bottom: 14px;
}

/* Style references panel */
.social-style-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 8px 0;
  background: none;
  border: none;
  color: var(--teal-700);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
}
.social-style-link:hover { color: var(--teal-800); }

.social-style-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.social-style-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--grey-200);
  background: var(--grey-100);
}
.social-style-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.social-style-thumb-delete {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: var(--white);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
}
.social-style-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 24px;
  background: var(--white);
  border: 2px dashed var(--grey-300);
  border-radius: var(--radius-xl);
  cursor: pointer;
  color: var(--grey-600);
  transition: all var(--transition-base);
}
.social-style-upload:hover {
  border-color: var(--teal-400);
  color: var(--teal-700);
}
.social-style-upload-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.social-style-explainer {
  font-size: 0.8125rem;
  color: var(--grey-500);
  margin-bottom: 14px;
}
.social-style-counter {
  font-size: 0.8125rem;
  color: var(--grey-500);
  text-align: right;
  margin-top: 6px;
}

.social-icon-sparkle::before {
  content: '✨';
  font-size: 1.125rem;
}

/* Review prompt - shared by inline (success screen) and dedicated review page */
.review-prompt-card {
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-2xl);
  padding: 24px;
  margin: 0 auto;
  max-width: 420px;
  box-shadow: var(--shadow-md);
  text-align: center;
}
/* review-artifact-v1: photo strip and context block above the heading */
.review-photo-strip {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.review-photo-strip::-webkit-scrollbar { display: none; }
.review-photo-strip:empty { display: none; }
.review-photo {
  width: 92px;
  height: 92px;
  flex-shrink: 0;
  border-radius: var(--radius-lg);
  object-fit: cover;
  cursor: zoom-in;
  box-shadow: var(--shadow-sm);
}
.review-context {
  text-align: center;
  margin-bottom: 16px;
}
.review-context:empty { display: none; }
.review-context-service {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--grey-900, #0f172a);
  margin-bottom: 4px;
}
.review-context-service:empty { display: none; }
.review-context-stylist-date {
  font-size: 0.875rem;
  color: var(--grey-500);
}
.review-context-stylist-date:empty { display: none; }
/* Public-display consent checkbox shown below the textarea on both surfaces */
.review-public-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--grey-50);
  border-radius: var(--radius-md);
  margin: 12px 0 16px 0;
  cursor: pointer;
  font-size: 0.8125rem;
  color: var(--grey-600);
  line-height: 1.4;
  text-align: left;
}
.review-public-consent input[type="checkbox"] {
  margin-top: 2px;
  accent-color: var(--teal-600);
  flex-shrink: 0;
}
.review-public-consent strong {
  color: var(--grey-800);
  font-weight: 600;
}
.review-prompt-heading {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--grey-800);
  margin: 0 0 4px 0;
}
.review-prompt-sub {
  font-size: 0.9375rem;
  color: var(--grey-500);
  margin: 0 0 20px 0;
}
.star-rating-row {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 20px;
}
.star-btn {
  width: 48px;
  height: 48px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-md);
  transition: transform var(--transition-base);
  -webkit-tap-highlight-color: transparent;
}
.star-btn:active { transform: scale(0.9); }
.star-btn:focus-visible { outline: 2px solid var(--teal-600); outline-offset: 2px; }
.star-btn svg {
  width: 100%;
  height: 100%;
  fill: var(--grey-200);
  transition: fill 0.15s ease;
  pointer-events: none;
}
.star-btn.active svg { fill: #f59e0b; }
.star-btn.hover svg { fill: #fbbf24; }

.review-textarea {
  width: 100%;
  padding: 14px 16px;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--grey-800);
  background: var(--white);
  border: 2px solid var(--grey-200);
  border-radius: var(--radius-lg);
  resize: vertical;
  min-height: 80px;
  margin-bottom: 12px;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}
.review-textarea:focus {
  outline: none;
  border-color: var(--teal-600);
  box-shadow: 0 0 0 4px rgba(14, 124, 123, 0.1);
}
.review-textarea::placeholder { color: var(--grey-400); }

.review-google-prompt {
  font-size: 0.9375rem;
  color: var(--grey-700, #334155);
  margin: 0 0 16px 0;
  line-height: 1.5;
}
.review-thanks-text {
  font-size: 0.9375rem;
  color: var(--grey-600);
  margin: 0;
  line-height: 1.5;
}
.review-stars-display {
  display: inline-flex;
  gap: 2px;
  font-size: 1.125rem;
  letter-spacing: 1px;
}

/* Dashboard review additions */
.dash-review-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin-top: 8px;
  background: var(--grey-100);
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  color: var(--grey-600);
}
.review-settings-content {
  padding: 24px 24px max(28px, env(safe-area-inset-bottom, 28px));
}
.review-settings-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}
.review-settings-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--grey-900);
  margin: 0;
  letter-spacing: -0.01em;
}
.review-settings-body {
  font-size: 0.9375rem;
  color: var(--grey-600);
  line-height: 1.5;
  margin: 0 0 20px 0;
}
.review-settings-hint {
  font-size: 0.8125rem;
  color: var(--grey-500);
  margin: 8px 0 20px 0;
}
.dash-review-avg {
  font-weight: 600;
  color: var(--grey-800);
}
.dash-review-avg::before {
  content: '\2605';
  color: #f59e0b;
  margin-right: 4px;
}
.dash-review-stars {
  display: inline-block;
  padding: 2px 8px;
  margin-left: 6px;
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}
.dash-review-stars::before {
  content: '\2605 ';
  color: #f59e0b;
}
.drawer-review {
  background: var(--grey-100);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  margin-top: 12px;
}
.drawer-review label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--grey-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.drawer-review-stars {
  font-size: 1.25rem;
  letter-spacing: 2px;
  margin-bottom: 6px;
}
.drawer-review-text {
  font-size: 0.875rem;
  color: var(--grey-700, #334155);
  margin: 6px 0;
  line-height: 1.5;
  font-style: italic;
}
/* ===========================================
   SALON SEARCH COMPONENT - Phase 1 connect flow
   =========================================== */
.salon-search-hint {
  font-size: 0.8125rem;
  color: var(--grey-700);
  margin: 0 0 16px 0;
  padding: 12px 14px;
  background: var(--teal-50);
  border-radius: 8px;
  line-height: 1.5;
}
.salon-search-hint a {
  color: var(--teal-700);
  font-weight: 600;
  text-decoration: underline;
}
.salon-search-input-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.salon-search-name {
  flex: 2;
  min-width: 0;
  padding: 12px 14px;
  font-size: 0.9375rem;
  border: 1px solid var(--grey-200);
  border-radius: 8px;
  font-family: inherit;
}
.salon-search-postcode {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  font-size: 0.9375rem;
  border: 1px solid var(--grey-200);
  border-radius: 8px;
  font-family: inherit;
  text-transform: uppercase;
}
.salon-search-btn {
  margin-bottom: 16px;
}
.salon-search-loading {
  text-align: center;
  padding: 24px 16px;
  color: var(--grey-600);
  font-size: 0.875rem;
}
.salon-search-results {
  margin-bottom: 16px;
}
.salon-search-empty {
  text-align: center;
  padding: 24px 16px;
  color: var(--grey-600);
  font-size: 0.875rem;
}
.salon-search-result {
  display: block;
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1px solid var(--grey-200);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 8px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s;
}
.salon-search-result:hover,
.salon-search-result:focus {
  border-color: var(--teal-600);
  background: var(--teal-50);
  outline: none;
}
.salon-search-result-name {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--grey-900);
  margin-bottom: 4px;
}
.salon-search-result-address {
  font-size: 0.8125rem;
  color: var(--grey-600);
  margin-bottom: 2px;
}
.salon-search-result-phone {
  font-size: 0.75rem;
  color: var(--grey-500);
}
.salon-search-fallback-link {
  display: block;
  width: 100%;
  text-align: center;
  background: none;
  border: none;
  color: var(--teal-600);
  font-size: 0.875rem;
  cursor: pointer;
  padding: 12px;
  margin-top: 8px;
  font-family: inherit;
}
.salon-search-fallback-link:hover {
  text-decoration: underline;
}
.salon-search-fallback-block {
  margin-top: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--grey-200);
}
.salon-search-manual-label {
  display: block;
  font-size: 0.8125rem;
  color: var(--grey-700);
  margin-bottom: 8px;
  font-weight: 500;
}
.salon-search-manual-input {
  width: 100%;
  padding: 12px 14px;
  font-size: 0.9375rem;
  border: 1px solid var(--grey-200);
  border-radius: 8px;
  margin-bottom: 12px;
  font-family: inherit;
  box-sizing: border-box;
}

/* =====================================================================
   V2-12 PREMIUM PATTERN -- BASE COMPONENT CLASSES
   Mirrored from operator-side .tpl-* family in PTFMFrontend.html, but
   re-namespaced to .social-* per locked decision (cross-app boundary).
   These render on post-onboarding surfaces only (Create Post, My Posts,
   My Style, Settings, Templates), so async load via this file is safe.
   Tokens live in the inline <style> in ugc-consent.html so var() resolves
   on first paint without waiting for this stylesheet.
   ===================================================================== */

/* Warm-card surface. Pairs with --text-on-warm (~7:1 AAA on body text)
   for nested cards/panels/banners. Never use --grey-500 on warm. */
.social-warm-card {
  background: var(--surface-warm);
  border: 1px solid var(--surface-warm-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  color: var(--text-on-warm);
}
.social-warm-card .social-warm-hint,
.social-warm-card .form-hint {
  color: var(--text-on-warm);
}

/* Badge polish. One recipe; variants by state class. Pill radius, 0.04em
   tracking, --font-medium weight. Teal for active/ready; muted grey for
   inactive/absent; warning amber for caution. */
.social-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: var(--font-medium);
  letter-spacing: 0.04em;
  border-radius: 9999px;
  background: var(--grey-100);
  color: var(--grey-700);
  white-space: nowrap;
}
.social-badge.is-active {
  background: var(--teal-50);
  color: var(--teal-700);
}
.social-badge.is-muted {
  background: var(--grey-100);
  color: var(--grey-500);
}
.social-badge.is-warn {
  background: var(--warning-light);
  color: var(--coral-700);
}

/* Empty-state pattern: small SVG icon -> Instrument Serif headline ->
   DM Sans hint (max ~44ch) -> ONE primary CTA. Mirrors operator-side
   ptfm_tplEmptyState_. Centered, generous padding, never two CTAs. */
.social-emptystate {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 32px 24px;
  gap: 12px;
}
.social-emptystate-icon {
  color: var(--teal-600);
  margin-bottom: 4px;
}
.social-emptystate.social-emptystate-coral .social-emptystate-icon {
  color: var(--coral-500);
}
.social-emptystate-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
  letter-spacing: var(--tracking-tight);
  color: var(--grey-900);
  margin: 0;
}
.social-emptystate-hint {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--grey-600);
  max-width: 44ch;
  margin: 0;
}
.social-emptystate-cta {
  margin-top: 8px;
}

/* Sticky-rail layout. Two-column grid on desktop with a sticky left rail;
   collapses to a horizontal strip below 640px. The host mode-container
   must be a single flex-column scroll container for the IntersectionObserver
   scroll-spy root to work (header fixed, body scrolls). */
.social-detail-layout {
  display: grid;
  grid-template-columns: 168px 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 640px) {
  .social-detail-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}
.social-rail {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 0;
}
@media (max-width: 640px) {
  .social-rail {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    padding: 8px 0;
    gap: 4px;
  }
}
.social-rail a {
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--grey-500);
  padding: 8px 12px;
  border-left: 2px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}
.social-rail a:hover {
  color: var(--grey-800);
  background: var(--grey-50);
}
.social-rail a.is-active {
  color: var(--teal-700);
  border-left-color: var(--teal-600);
  font-weight: var(--font-medium);
}
@media (max-width: 640px) {
  .social-rail a {
    border-left: none;
    border-bottom: 2px solid transparent;
  }
  .social-rail a.is-active {
    border-left: none;
    border-bottom-color: var(--teal-600);
  }
}

/* Sanctioned reveal pattern. The ONLY motion exception. max-height
   transition toggled by .is-open. No fade-ins, no entrance animations,
   no scroll choreography. Respects prefers-reduced-motion because
   max-height doesn't trigger the reduced-motion media query (browsers
   only auto-reduce transform/opacity transitions). */
.social-reveal {
  overflow: hidden;
  max-height: 0;
  transition: max-height 250ms var(--ease-out);
}
.social-reveal.is-open {
  max-height: 2000px;
}



/* =====================================================================
   V2-10 calendar -- RELOCATED FROM ugc-consent.js lines 12475-12601
   (function socialCalendar_injectStyles_).
   Sweep deferred to Phase C: hex literals (e.g. var(--coral-50), var(--coral-200), var(--coral-700),
   var(--error), var(--teal-700)) and bespoke styles will be tokenised + badge-polished
   alongside socialConfigMode in Phase C. Pasted verbatim here.
   ===================================================================== */
.cal-strip-wrap { margin: 0 0 16px 0; }
.cal-strip-title { font-size: 13px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; margin: 0 0 8px 0; }
.cal-cards { display: flex; gap: 12px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 4px 2px 8px 2px; }
.cal-card { flex: 0 0 240px; background: var(--white); border: 1px solid var(--grey-200); border-radius: 12px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04); overflow: hidden; display: flex; flex-direction: column; }
.cal-thumb-wrap { aspect-ratio: 16/9; background: linear-gradient(135deg, var(--teal-600), var(--coral-400)); position: relative; overflow: hidden; }
.cal-thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.cal-body { padding: 10px 12px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.cal-basis-pill { align-self: flex-start; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 10px; text-transform: uppercase; letter-spacing: 0.03em; }
.cal-basis-joined { background: var(--teal-50); color: var(--teal-600); }
.cal-basis-ugc_only { background: var(--coral-100); color: var(--coral-600); }
.cal-basis-history_only { background: var(--grey-100); color: var(--grey-600); }
.cal-rationale { font-size: 13px; line-height: 1.4; color: var(--text-primary); }
.cal-service { font-size: 11px; color: var(--text-secondary); font-style: italic; }
.cal-actions { display: flex; gap: 6px; padding: 0 12px 12px 12px; }
.cal-btn-accept { flex: 1; background: var(--teal-700); color: var(--white); border: none; border-radius: 6px; padding: 7px 10px; font-size: 13px; font-weight: 600; cursor: pointer; }
.cal-btn-accept:hover { background: var(--teal-700); }
.cal-btn-dismiss { background: transparent; color: var(--text-secondary); border: 1px solid var(--grey-200); border-radius: 6px; padding: 7px 10px; font-size: 16px; cursor: pointer; line-height: 1; }
.cal-btn-dismiss:hover { background: var(--grey-100); color: var(--grey-700); }
.cal-empty { background: var(--grey-50); border: 1px dashed var(--grey-300); border-radius: 12px; padding: 16px; text-align: center; }
.cal-empty-title { font-size: 14px; font-weight: 600; margin: 0 0 4px 0; color: var(--text-primary); }
.cal-empty-help { font-size: 13px; color: var(--text-secondary); margin: 0 0 10px 0; }
.cal-empty-cta { background: var(--teal-700); color: var(--white); border: none; border-radius: 6px; padding: 8px 14px; font-size: 13px; font-weight: 600; cursor: pointer; }
.cal-spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--grey-200); border-top-color: var(--teal-700); border-radius: 50%; animation: cal-spin 0.7s linear infinite; vertical-align: middle; margin-right: 6px; }
@keyframes cal-spin { to { transform: rotate(360deg); } }
.cal-loading { font-size: 13px; color: var(--text-secondary); padding: 8px 0; }
.cal-error { font-size: 13px; color: var(--error); padding: 8px 0; }
.cal-error-retry { background: none; border: none; color: var(--teal-600); cursor: pointer; text-decoration: underline; padding: 0; margin-left: 6px; font-size: 13px; }
/* --- V2-10.5 page + slim CTA + modal styles --- */
.cal-link-cta { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--white); border: 1px solid var(--grey-200); border-radius: 12px; text-decoration: none; color: var(--text-primary); margin: 0 0 16px 0; min-height: 56px; }
.cal-link-cta:hover { background: var(--grey-50); }
.cal-link-icon { width: 24px; height: 24px; color: var(--teal-700); flex-shrink: 0; }
.cal-link-text { display: flex; flex-direction: column; gap: 2px; }
#socialCalendarLinkCount { font-size: 14px; font-weight: 600; }
.cal-link-action { font-size: 12px; color: var(--teal-700); text-transform: uppercase; letter-spacing: 0.04em; }
/* Plan page layout. */
#socialCalendarMode { padding-bottom: 96px; }
/* Calendar redesign 2026-06-05: upgrade nudge restyled and moved to the
   very bottom of the calendar body, separated from the calendar by a
   faint hairline demarcator. Centred copy with a full-width Upgrade
   button beneath, rather than the old inline coral strip. */
.cal-tier-banner { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 18px 16px 16px; margin: 28px 0 0 0; background: var(--grey-50); border: none; border-top: 1px solid var(--grey-200); border-radius: 0; }
.cal-tier-banner p { margin: 0; font-size: 13px; line-height: 1.45; color: var(--text-secondary); max-width: 280px; }
/* Premium re-skin 2026-06-05 (round 2): the banner button drops the
   brand gradient and goes solid teal, so the bottom-right FAB is the ONE
   gradient hero on screen (no duplicated/competing gradients). */
.cal-tier-banner button { width: 100%; max-width: 280px; background: var(--teal-700); color: var(--white); border: none; border-radius: 10px; padding: 12px 16px; font-size: 14px; font-weight: 600; cursor: pointer; min-height: 46px; box-shadow: 0 4px 12px rgba(14, 124, 123, 0.18); transition: background var(--transition-fast), box-shadow var(--transition-fast); }
.cal-tier-banner button:hover { background: var(--teal-800, #085554); box-shadow: 0 6px 16px rgba(14, 124, 123, 0.28); }
/* Premium re-skin 2026-06-05 (round 2): kill the dead-space between the
   minimal back-bar and the month label so the calendar starts high
   (directive 1). Two-class selector beats the inline .page-header rule
   regardless of stylesheet order. */
.page-header.page-header-minimal { padding-top: 2px; padding-bottom: 2px; }
.cal-month-nav { display: flex; align-items: center; justify-content: space-between; padding: 2px 12px 0; gap: 8px; }
/* The month label is the screen's signature moment -- Instrument Serif at
   weight 400, the same display treatment every other headline in the app
   uses (e.g. .social-section-title). */
.cal-month-title { font-family: var(--font-display); font-size: 22px; font-weight: 400; letter-spacing: 0.01em; line-height: 1.15; margin: 0; text-align: center; flex: 1; }
.cal-nav-btn { width: 44px; height: 44px; min-width: 44px; min-height: 44px; border-radius: 8px; background: var(--white); border: 1px solid var(--grey-200); color: var(--text-primary); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.cal-nav-btn:hover:not(:disabled) { background: var(--grey-50); }
.cal-nav-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.cal-loading-page, .cal-error-page, .cal-empty-page { padding: 32px 16px; text-align: center; color: var(--text-secondary); }
.cal-empty-page h3 { margin: 0 0 6px 0; color: var(--text-primary); font-size: 16px; }
.cal-empty-page p { margin: 0 0 12px 0; font-size: 14px; }
/* Desktop grid (>= 500px). */
.cal-grid-desktop { display: none; padding: 0 12px; }
.cal-grid-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 4px; }
.cal-grid-weekday { font-size: 11px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; text-align: center; padding: 6px 0; }
.cal-grid-body { display: flex; flex-direction: column; gap: 4px; }
.cal-grid-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-day-cell { position: relative; min-height: 96px; padding: 6px; background: var(--white); border: 1px solid var(--grey-200); border-radius: 8px; cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 3px; overflow: hidden; font: inherit; color: inherit; }
.cal-day-cell:hover { background: var(--grey-50); }
.cal-day-cell:focus-visible { outline: 2px solid var(--teal-700); outline-offset: 1px; z-index: 1; }
.cal-day-cell.cal-day-outside { opacity: 0.4; background: var(--grey-50); cursor: default; }
.cal-day-cell.cal-day-today { border-color: var(--teal-700); border-width: 2px; padding: 5px; }
.cal-day-num { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
/* Stage 1.2: today's date number becomes a filled teal token so today is
   the strongest anchor on the grid, not just a thin border. */
.cal-day-cell.cal-day-today .cal-day-num {
  color: var(--white);
  background: var(--teal-700);
  border-radius: var(--radius-full);
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
}
.cal-day-add { position: absolute; bottom: 4px; right: 4px; width: 22px; height: 22px; border-radius: 11px; background: var(--teal-700); color: var(--white); font-size: 14px; font-weight: 600; display: none; align-items: center; justify-content: center; cursor: pointer; }
/* Stage 2.1: per-cell hover "+" retired; the whole cell is tappable. */
.cal-day-cell:hover .cal-day-add { display: none; }
/* Phase 7 v4 -- status colour tokens. Brand-adjacent palette so the
   salon can read state at a glance: gold (suggested / pending review),
   teal (accepted / committed), coral (user-planned / their own
   addition), grey (dismissed / lapsed / posted-historical),
   deep-teal (posted / shipped). The owner's red/yellow/green mental
   model maps to gold/teal/coral via brand-adjacent hues. Legend at
   the top of #socialCalendarMode renders the same five tokens so the
   salon never has to guess. */
:root {
  --status-suggested:    #d1a659;
  --status-suggested-bg: #faf3e0;
  --status-accepted:     #0e7c7b;
  --status-accepted-bg:  #d4f0ef;
  --status-planned:      #ff8a6c;
  --status-planned-bg:   #ffe4dd;
  --status-dismissed:    #9ca3af;
  --status-dismissed-bg: #f3f4f6;
  --status-posted:       #085857;
  --status-posted-bg:    #c8dfde;
}
/* Chips. */
.cal-chip { display: inline-block; max-width: 100%; padding: 2px 6px; border-radius: 4px; font-size: 11px; font-weight: 500; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.cal-chip-suggested  { background: var(--status-suggested-bg); color: var(--status-suggested); }
.cal-chip-accepted   { background: var(--status-accepted-bg);  color: var(--status-accepted); }
.cal-chip-planned    { background: var(--status-planned-bg);   color: var(--status-planned); }
.cal-chip-in_progress { background: var(--status-accepted-bg); color: var(--status-accepted); font-style: italic; }
.cal-chip-posted     { background: var(--status-posted-bg);    color: var(--status-posted); font-weight: 600; }
.cal-chip-lapsed     { background: var(--status-dismissed-bg); color: var(--status-dismissed); text-decoration: line-through; }
.cal-chip-dismissed  { background: var(--status-dismissed-bg); color: var(--status-dismissed); text-decoration: line-through; }
.cal-chip-pending    { background: var(--status-suggested-bg); color: var(--status-suggested); opacity: 0.7; font-style: italic; }
.cal-chip-more { background: var(--grey-100); color: var(--text-secondary); cursor: default; }
.cal-chip-consent-warn { background: var(--coral-50); color: var(--error); font-weight: 600; }
/* Compact-mode chip: hides text, shows only a colour-coded dot. Used
   on the month grid at viewports < 500px so day cells can shrink to
   ~36px squares while still surfacing per-day status density. */
.cal-chip-compact { display: inline-block; width: 8px; height: 8px; padding: 0; border-radius: 50%; vertical-align: middle; margin: 0 1px; cursor: pointer; }
.cal-chip-compact.cal-chip-suggested  { background: var(--status-suggested); }
.cal-chip-compact.cal-chip-accepted   { background: var(--status-accepted); }
.cal-chip-compact.cal-chip-planned    { background: var(--status-planned); }
.cal-chip-compact.cal-chip-in_progress { background: var(--status-accepted); opacity: 0.6; }
.cal-chip-compact.cal-chip-posted     { background: var(--status-posted); }
.cal-chip-compact.cal-chip-lapsed,
.cal-chip-compact.cal-chip-dismissed  { background: var(--status-dismissed); }
.cal-chip-compact.cal-chip-pending    { background: var(--status-suggested); opacity: 0.5; }

/* Phase 7 v4 -- legend (always visible, top of calendar page). */
/* Calendar redesign 2026-06-05: legend centred. */
/* Premium re-skin 2026-06-05 (round 2): the legend reads as a quiet KEY,
   not a banner of metadata -- smaller dots, lower-weight grey-600 labels
   (>= 4.5:1 on the light gradient), a faint hairline beneath it. */
.cal-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; padding: 6px 12px 10px; margin: 0 0 6px 0; font-size: 11px; color: var(--grey-600); border-bottom: 1px solid var(--grey-100); }
.cal-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.cal-legend-dot.cal-legend-suggested  { background: var(--status-suggested); }
.cal-legend-dot.cal-legend-accepted   { background: var(--status-accepted); }
.cal-legend-dot.cal-legend-planned    { background: var(--status-planned); }
.cal-legend-dot.cal-legend-dismissed  { background: var(--status-dismissed); }
.cal-legend-dot.cal-legend-posted     { background: var(--status-posted); }

/* Phase 7 v4 -- view toggle (Month / Week). Persisted in
   localStorage.yeroku.cal.view -- defaults to 'month'. */
/* Calendar redesign 2026-06-05: Month/Week selector centred. */
/* Premium re-skin 2026-06-05 (round 2): iOS-style segmented control --
   a soft grey track with a white "thumb" sliding under the active label,
   instead of the hard bordered box. */
.cal-view-toggle { display: flex; justify-content: center; gap: 0; padding: 0 12px 12px 12px; }
.cal-view-toggle-group { display: inline-flex; gap: 3px; padding: 3px; border: none; border-radius: var(--radius-full); background: var(--grey-100); }
.cal-view-btn { background: transparent; border: none; padding: 8px 22px; font: inherit; font-size: 13px; color: var(--grey-600); cursor: pointer; min-height: 40px; min-width: 84px; border-radius: var(--radius-full); transition: background var(--transition-fast), color var(--transition-fast); }
.cal-view-btn + .cal-view-btn { border-left: none; }
.cal-view-btn:hover:not(.is-active) { color: var(--grey-800); }
.cal-view-btn.is-active { background: var(--white); color: var(--teal-700); font-weight: 600; box-shadow: var(--shadow-sm); }
.cal-view-btn:focus-visible { outline: 2px solid var(--teal-700); outline-offset: 2px; }
/* Mobile strip (< 500px). */
.cal-strip-mobile { display: none; flex-direction: column; gap: 16px; padding: 0 12px; }
.cal-strip-week { background: var(--white); border: 1px solid var(--grey-200); border-radius: 12px; padding: 12px; }
.cal-strip-week-title { font-size: 12px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; margin: 0 0 10px 0; }
.cal-strip-day { margin-bottom: 12px; }
.cal-strip-day:last-child { margin-bottom: 0; }
.cal-strip-day-title { font-size: 13px; font-weight: 600; margin: 0 0 6px 0; color: var(--text-primary); }
.cal-row { display: flex; gap: 10px; padding: 10px; background: var(--grey-50); border-radius: 8px; margin-bottom: 6px; }
.cal-row-lapsed { opacity: 0.55; }
.cal-row-thumb-wrap { width: 56px; height: 56px; flex-shrink: 0; border-radius: 6px; background: linear-gradient(135deg, var(--teal-600), var(--coral-400)); overflow: hidden; }
.cal-row-thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.cal-row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cal-row-rationale { margin: 0; font-size: 13px; line-height: 1.4; color: var(--text-primary); }
.cal-row-anchor { margin: 0; font-size: 11px; color: var(--text-secondary); font-style: italic; }
/* Calendar redesign 2026-06-05 (Phase 3): dial rows replace the prose
   description in the Week (day) view. Reuses the .cal-comp-* tokens. */
.cal-row-dials { display: flex; flex-direction: column; gap: 3px; margin: 2px 0 2px; }
.cal-row-dials .cal-comp-empty .cal-comp-val { color: var(--text-secondary); font-style: italic; font-weight: 400; }
.cal-row-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.cal-row-btn { min-height: 36px; padding: 6px 12px; font-size: 13px; }
.cal-row-pending-hint, .cal-row-posted-hint { font-size: 12px; color: var(--text-secondary); font-style: italic; }
/* Header + sticky add buttons. */
.cal-header-add { width: 44px; height: 44px; min-width: 44px; min-height: 44px; border: none; background: transparent; color: var(--teal-700); cursor: pointer; display: flex; align-items: center; justify-content: center; border-radius: 8px; }
.cal-header-add:hover { background: var(--grey-100); }
/* Calendar redesign 2026-06-05: brand gradient rounded SQUARE (teal ->
   coral), replacing the old round teal FAB. 16px corners read as a soft
   square, not a circle. */
/* Premium re-skin 2026-06-05 (round 2): smoother squircle + softer,
   longer brand shadow, with a tactile press. The single gradient hero. */
.cal-add-btn-sticky { position: fixed; bottom: 24px; right: 24px; width: 56px; height: 56px; min-width: 56px; min-height: 56px; border-radius: var(--radius-2xl); background: linear-gradient(135deg, #0e7c7b, #ff8a6c); color: var(--white); border: none; box-shadow: var(--shadow-teal); cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 20; transition: transform 0.12s var(--ease-out-expo), box-shadow 0.12s ease; }
.cal-add-btn-sticky:hover { box-shadow: 0 10px 28px rgba(14, 124, 123, 0.40); transform: translateY(-1px); }
.cal-add-btn-sticky:active { transform: scale(0.94); }
/* Modal. */
.cal-modal-backdrop:not([hidden]) { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5); display: flex; align-items: flex-end; justify-content: center; z-index: 200; padding: 0; }
.cal-modal { width: 100%; max-width: 520px; max-height: 95vh; background: var(--white); border-radius: 16px 16px 0 0; display: flex; flex-direction: column; overflow: hidden; }
.cal-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--grey-200); }
.cal-modal-header h2 { margin: 0; font-size: 17px; font-weight: 600; }
.cal-modal-close { width: 44px; height: 44px; min-width: 44px; min-height: 44px; border: none; background: transparent; font-size: 24px; line-height: 1; color: var(--text-secondary); cursor: pointer; border-radius: 8px; }
.cal-modal-close:hover { background: var(--grey-100); }
.cal-modal-body { padding: 16px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.cal-modal-field { display: flex; flex-direction: column; gap: 6px; }
.cal-modal-label { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.cal-modal-input, .cal-modal-textarea { width: 100%; padding: 10px 12px; min-height: 44px; border: 1px solid var(--grey-300); border-radius: 8px; font: inherit; color: inherit; background: var(--white); }
.cal-modal-input:focus, .cal-modal-textarea:focus { outline: 2px solid var(--teal-700); outline-offset: 1px; }
.cal-modal-textarea { resize: vertical; min-height: 88px; }
.cal-modal-hint { align-self: flex-end; font-size: 11px; color: var(--text-secondary); }
.cal-modal-choice { display: flex; flex-direction: column; gap: 8px; }
.cal-modal-radio { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--grey-200); border-radius: 8px; cursor: pointer; min-height: 48px; }
.cal-modal-radio:hover { background: var(--grey-50); }
.cal-modal-radio input { margin-top: 3px; flex-shrink: 0; }
.cal-modal-radio-body { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.cal-modal-radio-body strong { font-size: 13px; }
.cal-modal-radio-hint { font-size: 12px; color: var(--text-secondary); }
.cal-modal-photo-btn { padding: 10px 14px; min-height: 44px; border: 1px dashed var(--grey-300); border-radius: 8px; background: var(--white); cursor: pointer; font: inherit; color: var(--teal-700); font-weight: 600; text-align: center; }
.cal-modal-photo-btn:hover { background: var(--grey-50); }
.cal-modal-photo-preview { display: flex; align-items: center; gap: 12px; padding: 10px; background: var(--grey-50); border-radius: 8px; }
.cal-modal-photo-preview img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; }
.cal-modal-photo-remove { background: transparent; border: none; color: var(--error); cursor: pointer; padding: 8px 12px; font-size: 13px; font-weight: 600; min-height: 36px; }
.cal-modal-actions { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--grey-200); background: var(--white); }
.cal-modal-actions .btn { min-height: 44px; padding: 10px 18px; }

/* Stage 3.3: day drilldown composition card. Tokens match the existing
   cal-* palette so the cards read as peers of the strip rows. */
.cal-modal-empty { padding: 16px; color: var(--text-secondary); text-align: center; }
.cal-comp-card { display: flex; gap: 12px; padding: 12px; background: var(--grey-50); border-radius: var(--radius-lg); margin-bottom: 10px; }
.cal-comp-card:last-child { margin-bottom: 0; }
.cal-comp-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: var(--radius-md); flex-shrink: 0; }
.cal-comp-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.cal-comp-rationale { margin: 0; font-size: 14px; line-height: 1.4; color: var(--text-primary); }
.cal-comp-row { display: flex; gap: 8px; font-size: 12px; }
.cal-comp-label { color: var(--text-secondary); min-width: 72px; }
.cal-comp-val { color: var(--text-primary); font-weight: 500; }
.cal-comp-caption { font-size: 13px; line-height: 1.5; color: var(--text-primary); background: var(--white); border: 1px solid var(--grey-200); border-radius: var(--radius-md); padding: 10px; white-space: pre-wrap; }
.cal-comp-card .cal-row-actions { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 8px; }
.btn-tertiary { background: transparent; border: none; color: var(--teal-700); font-weight: 600; padding: 6px 8px; min-height: 36px; cursor: pointer; }
.btn-tertiary:hover { color: var(--teal-800, var(--teal-700)); text-decoration: underline; }

/* Stage 4.4: hybrid Week view. Sideways 7-day selector + selected-day
   panel below. Replaces the flat "Suggested this week" strip. */
/* Calendar redesign 2026-06-05: the grey horizontal scrollbar is gone --
   all 7 day pills now share the row (flex:1) and fit without scrolling. */
/* Premium re-skin 2026-06-05 (round 2): the 7 day pills gain real
   presence -- taller, more vertical padding, a larger date numeral and a
   clearer selected/today state -- WITHOUT horizontal scroll, so the
   week-nav swipe bound to #socialCalendarMode stays unambiguous and all
   seven days stay glanceable (directive 2). */
.cal-week-strip { display: flex; gap: 7px; padding: 6px 12px 14px; }
.cal-week-pill { flex: 1 1 0; min-width: 0; min-height: 78px; padding: 12px 4px 10px; border: 1px solid var(--grey-200); border-radius: var(--radius-lg); background: var(--white); display: flex; flex-direction: column; align-items: center; gap: 5px; cursor: pointer; font: inherit; transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast); }
.cal-week-pill .cal-week-wd { font-size: 11px; font-weight: 600; color: var(--grey-500); text-transform: uppercase; letter-spacing: 0.04em; }
.cal-week-pill .cal-week-dn { font-size: 19px; font-weight: 600; color: var(--text-primary); line-height: 1; }
.cal-week-pill .cal-week-dots { display: flex; gap: 3px; min-height: 8px; align-items: center; }
.cal-week-dot { width: 6px; height: 6px; border-radius: 50%; }
.cal-week-pill.is-today .cal-week-wd { color: var(--teal-700); }
.cal-week-pill.is-today .cal-week-dn { color: var(--teal-700); }
.cal-week-pill.is-selected { border-color: var(--teal-600); background: var(--teal-50, #f0fdfa); box-shadow: var(--shadow-sm); }
.cal-week-pill.is-selected .cal-week-dn { color: var(--teal-700); }
.cal-week-pill:active { transform: scale(0.96); }
.cal-week-pill:focus-visible { outline: 2px solid var(--teal-700); outline-offset: 1px; }
.cal-week-panel { padding: 8px 12px 16px; }
.cal-week-panel-title { font-size: 14px; font-weight: 600; color: var(--text-primary); margin: 4px 0 10px; }
/* Empty day adopts the house empty-state shape: small icon -> Instrument
   Serif line -> DM Sans hint -> a single calm CTA (directive 3 / F). */
.cal-week-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 28px 16px 8px; }
.cal-week-empty-icon { color: var(--teal-600); opacity: 0.9; }
.cal-week-empty-title { font-family: var(--font-display); font-weight: 400; font-size: 1.125rem; color: var(--grey-800); margin: 0; }
.cal-week-empty-hint { font-size: 13px; line-height: 1.45; color: var(--grey-500); margin: 0; max-width: 30ch; }
.cal-week-empty-cta { margin-top: 4px; min-height: 40px; }
/* Stage 4.3: parked suggestions read as ideas, not commitments. */
.cal-row-parked { border: 1px dashed var(--grey-300); background: var(--white); }
.cal-row-parked-hint { font-size: 11px; color: var(--text-secondary); font-style: italic; }
/* Responsive switch -- Phase 7 v4. The pre-Phase-7 mobile view hid
   the month grid entirely and showed a flat "Suggested this week"
   list. The regression visible in the screenshot. Now the month grid
   renders on EVERY viewport, with mobile getting a compact
   modifier (smaller cells, dots instead of chip text). The week-list
   view is opt-in via the Month / Week toggle (data-view='list'
   attribute on #socialCalendarMode). */
.cal-grid-desktop { display: block; padding: 0 12px; }
.cal-strip-mobile { display: none; flex-direction: column; gap: 16px; padding: 0 12px; }
/* When the salon flips to Week view via the toggle. */
#socialCalendarMode[data-view='list'] .cal-grid-desktop { display: none; }
#socialCalendarMode[data-view='list'] .cal-strip-mobile { display: flex; }
@media (min-width: 500px) {
  /* Calendar redesign 2026-06-05: the bottom-right gradient add stays
     visible on every viewport (was hidden >= 500px when it was the old
     retired FAB). */
  .cal-modal { max-height: 85vh; border-radius: 16px; align-self: center; margin: auto 16px; }
  .cal-modal-backdrop { align-items: center; }
}
@media (max-width: 499px) {
  .cal-day-add { display: none !important; }
  /* Compact month grid: shrink cells, hide chip text. The compact
     dots come from .cal-chip-compact rules above. */
  .cal-grid-desktop .cal-day-cell { min-height: 56px; padding: 4px; gap: 1px; }
  .cal-grid-desktop .cal-day-cell.cal-day-today { padding: 3px; }
  .cal-grid-desktop .cal-day-num { font-size: 11px; }
  /* On mobile, the regular chips are hidden -- compact dots used
     instead. JS branches on viewport to render the right shape. */
  .cal-grid-desktop .cal-chip:not(.cal-chip-compact):not(.cal-chip-more) { display: none; }
  .cal-grid-weekday { font-size: 10px; padding: 4px 0; }
  /* Tighter legend on narrow screens. */
  .cal-legend { gap: 6px 10px; font-size: 11px; }
  .cal-view-toggle { padding: 0 12px 8px 12px; }
}

/* =====================================================================
   Calendar premium re-skin 2026-06-05 (round 2): below-fold upgrade,
   entrance choreography, day-select feedback. ALL motion is gated by
   prefers-reduced-motion at the foot of this block.
   ===================================================================== */

/* Directive 4: on the FREE tier the calendar owns the first viewport and
   the upgrade banner sits one scroll below. A margin can't guarantee that
   on a short (empty) day, so the visible view fills at least one dynamic
   viewport -- structurally pushing #socialCalendarTierBanner below the
   fold however little the day holds. Scoped to .cal-free so paid users
   (no banner) get no dead whitespace. */
#socialCalendarMode.cal-free .cal-grid-desktop,
#socialCalendarMode.cal-free .cal-strip-mobile { min-height: 100dvh; }

/* Quiet "there's more below" cue -- free tier only (what's below is the
   upgrade). Sticky to the foot of the viewport; slides away as the user
   scrolls toward the banner. Decorative (aria-hidden in markup). */
.cal-scroll-cue { display: none; }
#socialCalendarMode.cal-free .cal-scroll-cue {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  position: sticky; bottom: 12px; z-index: 5; width: max-content;
  margin: 0 auto; padding-top: 8px; color: var(--grey-400);
  pointer-events: none; animation: cal-cue-bob 1.8s var(--ease-out-expo) infinite;
}
.cal-scroll-cue span { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; }

/* One-time entrance: stagger the stable wrapper blocks. .cal-enter is
   added to #socialCalendarMode on mount (socialCalendarOnMount_) and
   removed after it plays, so later data re-renders don't replay it. */
.cal-enter .cal-month-nav { animation: cal-fade-up 360ms var(--ease-out-expo) both; }
.cal-enter .cal-legend { animation: cal-fade-up 360ms var(--ease-out-expo) 60ms both; }
.cal-enter .cal-view-toggle { animation: cal-fade-up 360ms var(--ease-out-expo) 120ms both; }
.cal-enter .cal-strip-mobile,
.cal-enter .cal-grid-desktop { animation: cal-fade-up 360ms var(--ease-out-expo) 180ms both; }

/* Day-select: the panel fades + lifts when the selected day changes
   (one-shot class emitted by the strip builder when the select flag set
   in socialCalendarSelectWeekDay_ is consumed). */
.cal-week-panel--enter { animation: cal-fade-up 220ms var(--ease-out-expo) both; }

@keyframes cal-fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes cal-cue-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(4px); } }

@media (prefers-reduced-motion: reduce) {
  .cal-enter .cal-month-nav,
  .cal-enter .cal-legend,
  .cal-enter .cal-view-toggle,
  .cal-enter .cal-strip-mobile,
  .cal-enter .cal-grid-desktop,
  .cal-week-panel--enter,
  #socialCalendarMode.cal-free .cal-scroll-cue { animation: none; }
  .cal-week-pill, .cal-add-btn-sticky, .cal-view-btn, .cal-tier-banner button { transition: none; }
}


/* =====================================================================
   V2-10 photo picker modal (RELOCATED from ugc-consent.js socialPhotoPicker_injectStyles_)
   Sweep deferred to Phase C-2 (token replacement, badge polish, focus rings).
   Pasted verbatim.
   ===================================================================== */
.social-picker-overlay {
      position: fixed; inset: 0;
      background: rgba(0, 0, 0, 0.55);
      display: flex; align-items: center; justify-content: center;
      z-index: 9999; padding: 16px;
    }
    .social-picker-modal {
      background: var(--white); border-radius: 12px;
      max-width: 880px; width: 100%; max-height: 92vh;
      display: flex; flex-direction: column; overflow: hidden;
    }
    .social-picker-header {
      display: flex; align-items: center; justify-content: space-between;
      padding: 16px 20px; border-bottom: 1px solid var(--grey-200);
    }
    .social-picker-header h2 { margin: 0; font-size: 18px; }
    .social-picker-close {
      background: transparent; border: 0; font-size: 24px;
      cursor: pointer; padding: 4px 10px; line-height: 1;
    }
    .social-picker-tabs {
      display: flex; padding: 0 20px; border-bottom: 1px solid var(--grey-200);
    }
    .social-picker-tab {
      background: transparent; border: 0; padding: 12px 16px;
      cursor: pointer; font-weight: 500; color: var(--grey-600);
      border-bottom: 2px solid transparent;
    }
    .social-picker-tab.is-active { color: var(--teal-600); border-bottom-color: var(--teal-600); }
    .social-picker-tab:disabled { color: var(--grey-300); cursor: not-allowed; }
    .social-picker-controls {
      display: flex; gap: 12px; padding: 12px 20px;
      align-items: center; flex-wrap: wrap;
    }
    .social-picker-search {
      flex: 1; min-width: 200px;
      padding: 8px 12px; border: 1px solid var(--grey-300); border-radius: 6px;
      font-size: 14px;
    }
    .social-picker-past {
      display: flex; gap: 6px; align-items: center;
      font-size: 13px; color: var(--grey-600); cursor: pointer;
    }
    .social-picker-body { overflow-y: auto; padding: 16px 20px; flex: 1; }
    .social-picker-status { padding: 12px 0; color: var(--grey-600); font-size: 13px; }
    .social-picker-status.is-error { color: var(--error); }
    .social-picker-grid {
      display: grid; gap: 12px;
      grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
    .social-picker-card {
      border: 1px solid var(--grey-200); border-radius: 8px; overflow: hidden;
      background: var(--grey-50); display: flex; flex-direction: column;
    }
    .social-picker-img-frame {
      position: relative;
      width: 100%;
      aspect-ratio: 1;
      overflow: hidden;
      background: linear-gradient(135deg, var(--teal-600), var(--coral-400));
    }
    .social-picker-img-frame img {
      width: 100%; height: 100%; object-fit: cover; display: block;
    }
    .social-picker-img-frame.is-fallback img { display: none; }
    .social-picker-img-mono {
      position: absolute; inset: 0;
      display: none;
      align-items: center; justify-content: center;
      color: rgba(255,255,255,0.92);
      font: 700 44px/1 system-ui, -apple-system, "Segoe UI", sans-serif;
      letter-spacing: -1px;
      text-shadow: 0 2px 8px rgba(0,0,0,0.18);
      user-select: none;
    }
    .social-picker-img-frame.is-fallback .social-picker-img-mono { display: flex; }
    .social-picker-card.is-past .social-picker-img-frame {
      background: linear-gradient(135deg, rgba(14,124,123,0.55), rgba(255,138,108,0.55));
    }
    .social-picker-card-meta { padding: 8px; font-size: 12px; }
    .social-picker-customer {
      display: block; font-weight: 500; color: var(--grey-800);
      overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }
    .social-picker-pill {
      display: inline-block; margin-top: 4px;
      padding: 2px 8px; border-radius: 10px;
      font-size: 11px; color: var(--white); background: var(--teal-600);
    }
    .social-picker-pill.is-expiring { background: var(--error); }
    .social-picker-pill.is-expired { background: var(--grey-400); }
    .social-picker-pill.is-revoked { background: var(--grey-600); }
    .social-picker-attach,
    .social-picker-renew {
      width: 100%; padding: 8px; border: 0; cursor: pointer;
      font-size: 13px; font-weight: 500;
    }
    .social-picker-attach { background: var(--teal-600); color: var(--white); }
    .social-picker-attach:hover { background: var(--teal-700); }
    .social-picker-renew { background: var(--grey-200); color: var(--grey-600); cursor: not-allowed; }
    .social-picker-past-group {
      margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--grey-200);
    }
    .social-picker-past-group h3 {
      margin: 0 0 12px; font-size: 14px; color: var(--grey-600);
    }
    .social-picker-footer {
      padding: 12px 20px; border-top: 1px solid var(--grey-200);
      display: flex; justify-content: center;
    }
    .social-picker-load-more {
      padding: 8px 24px; background: var(--grey-50); border: 1px solid var(--grey-300);
      border-radius: 6px; cursor: pointer; font-size: 13px;
    }
    .social-subject-photo-status {
      padding: 10px 12px; background: var(--teal-50); border-radius: 6px;
      font-size: 13px; color: var(--teal-700); margin-top: 8px;
      display: flex; align-items: center; justify-content: space-between;
      gap: 12px;
    }
    .social-subject-photo-status-clear {
      background: transparent; border: 0; color: var(--error);
      cursor: pointer; font-size: 12px;
    }

    /* Phase 1 (CP7): multi-select picker + multi-photo subject chip. */
    .social-picker-card.is-selected {
      box-shadow: 0 0 0 3px var(--teal-600);
      border-color: var(--teal-600);
    }
    .social-picker-badge {
      position: absolute; top: 6px; left: 6px;
      min-width: 22px; height: 22px; padding: 0 6px;
      display: flex; align-items: center; justify-content: center;
      border-radius: 11px;
      background: var(--teal-600); color: var(--white);
      font: 700 12px/1 system-ui, -apple-system, "Segoe UI", sans-serif;
      box-shadow: 0 1px 4px rgba(0,0,0,0.25);
      z-index: 2;
    }
    .social-picker-toggle {
      width: 100%; padding: 8px; border: 0; cursor: pointer;
      font-size: 13px; font-weight: 500;
      background: var(--grey-200); color: var(--grey-800);
    }
    .social-picker-toggle.is-on { background: var(--teal-600); color: var(--white); }
    .social-picker-toggle:disabled { background: var(--grey-100); color: var(--grey-400); cursor: not-allowed; }
    .social-picker-slot {
      display: flex; align-items: center; gap: 6px;
      padding: 6px 8px; font-size: 12px; color: var(--grey-700);
    }
    .social-picker-slot-cap { color: var(--grey-500); }
    .social-picker-slot-select {
      flex: 1; padding: 4px 6px; border: 1px solid var(--grey-300);
      border-radius: 6px; font-size: 12px; background: var(--white);
    }
    .social-picker-slot.is-position {
      justify-content: center; font-weight: 500; color: var(--teal-700);
      background: var(--teal-50);
    }
    .social-picker-own-disabled-note {
      display: block; padding: 6px 8px; font-size: 11px;
      color: var(--grey-500); text-align: center;
    }
    .social-picker-done {
      padding: 8px 24px; border-radius: 6px; cursor: pointer;
      font-size: 13px; font-weight: 600;
      background: var(--teal-600); color: var(--white); border: 0;
      margin-left: 8px;
    }
    /* Multi-photo subject chip: overlapping thumbnail stack. */
    .social-subject-photo-status { flex-wrap: wrap; }
    .social-subject-photo-stack { display: inline-flex; align-items: center; }
    .social-subject-photo-stack-item {
      position: relative; width: 36px; height: 36px;
      border-radius: 8px; overflow: hidden;
      border: 2px solid var(--white);
      margin-left: -10px;
      background: linear-gradient(135deg, var(--teal-600), var(--coral-400));
      box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    }
    .social-subject-photo-stack-item:first-child { margin-left: 0; }
    .social-subject-photo-stack-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
    .social-subject-photo-stack-item.is-fallback img { display: none; }
    .social-subject-photo-count { font-weight: 600; }
    .social-subject-photo-roles { color: var(--teal-600); font-size: 12px; }
    .social-subject-photo-belowmin {
      flex-basis: 100%; font-size: 12px; color: var(--grey-600);
    }


/* =====================================================================
   V2-10 photo upload modal (RELOCATED from ugc-consent.js socialPhotoPicker_injectUploadStyles_)
   Sweep deferred to Phase C-2 (token replacement, badge polish, focus rings).
   Pasted verbatim.
   ===================================================================== */
.social-upload-overlay {
      position: fixed; inset: 0;
      background: rgba(0, 0, 0, 0.7);
      display: flex; align-items: center; justify-content: center;
      z-index: 10000; padding: 16px;
    }
    .social-upload-modal {
      background: var(--white); border-radius: 12px;
      max-width: 520px; width: 100%; max-height: 92vh;
      display: flex; flex-direction: column; overflow: hidden;
    }
    .social-upload-header {
      display: flex; align-items: center; justify-content: space-between;
      padding: 16px 20px; border-bottom: 1px solid var(--grey-200);
    }
    .social-upload-header h2 { margin: 0; font-size: 18px; }
    .social-upload-close {
      background: transparent; border: 0; font-size: 24px;
      cursor: pointer; padding: 4px 10px; line-height: 1;
    }
    .social-upload-body { padding: 16px 20px; overflow-y: auto; flex: 1; }
    .social-upload-intro { color: var(--grey-600); font-size: 14px; line-height: 1.5; margin: 0 0 16px; }
    .social-upload-file-area {
      border: 2px dashed var(--grey-300); border-radius: 8px;
      padding: 24px 16px; text-align: center; margin-bottom: 16px;
      background: var(--grey-50);
    }
    .social-upload-file-area.has-file { border-style: solid; background: var(--teal-50); }
    .social-upload-file-name { display: block; margin-top: 8px; font-size: 13px; color: var(--grey-700); word-break: break-all; }
    .social-upload-file-hint { display: block; margin-top: 8px; font-size: 12px; color: var(--grey-500); }
    .social-upload-attestation { margin: 16px 0; padding: 12px; background: var(--warning-light); border-radius: 6px; }
    .social-upload-tick { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; cursor: pointer; }
    .social-upload-tick input { margin-top: 3px; flex-shrink: 0; }
    .social-upload-tick-label { font-size: 14px; color: var(--grey-700); line-height: 1.4; font-weight: 500; }
    .social-upload-tick-help { display: block; margin-top: 4px; font-size: 12px; color: var(--grey-600); font-weight: normal; line-height: 1.4; }
    .social-upload-model-release { margin-top: 10px; padding-left: 22px; display: none; }
    .social-upload-model-release.is-visible { display: block; }
    .social-upload-model-release label { display: block; font-size: 13px; color: var(--grey-700); margin-bottom: 4px; font-weight: 500; }
    .social-upload-model-release p { margin: 0 0 6px; font-size: 12px; color: var(--grey-600); }
    .social-upload-model-release input {
      width: 100%; padding: 8px 10px; border: 1px solid var(--grey-300); border-radius: 6px;
      font-size: 13px;
    }
    .social-upload-error { padding: 10px 12px; background: var(--coral-50); color: var(--error); border-radius: 6px; margin-bottom: 12px; font-size: 13px; }
    .social-upload-actions { display: flex; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--grey-200); }
    .social-upload-actions button { flex: 1; padding: 12px; border: 0; border-radius: 6px; font-size: 14px; font-weight: 600; cursor: pointer; }
    .social-upload-actions .btn-primary { background: var(--teal-600); color: var(--white); }
    .social-upload-actions .btn-primary:disabled { background: var(--grey-300); cursor: not-allowed; }
    .social-upload-actions .btn-primary:hover:not(:disabled) { background: var(--teal-700); }
    .social-upload-actions .btn-secondary { background: var(--grey-200); color: var(--grey-700); }
    .social-picker-card.is-own .social-picker-attach-own { background: var(--teal-600); color: var(--white); }
    .social-picker-card.is-own .social-picker-delete-own {
      width: 100%; padding: 6px; border: 0; cursor: pointer;
      font-size: 12px; background: var(--coral-50); color: var(--error);
    }
    .social-picker-card.is-own .social-picker-delete-own:hover { background: var(--coral-50); }
    .social-picker-pill.is-own-tag { background: var(--grey-600); }
    .social-picker-pill.is-id-person { background: var(--coral-600); margin-left: 4px; }
    .social-picker-upload-btn {
      padding: 8px 14px; border: 0; border-radius: 6px;
      background: var(--teal-600); color: var(--white); font-size: 13px; font-weight: 600;
      cursor: pointer;
    }
    .social-picker-upload-btn:hover { background: var(--teal-700); }


/* =====================================================================
   V2-09 hero image card (RELOCATED from ugc-consent.js socialHero_injectStyles_)
   Sweep deferred to Phase C-2 (token replacement, badge polish, focus rings).
   Pasted verbatim.
   ===================================================================== */
.social-hero-card{background:var(--grey-50);border:1px solid var(--grey-200);border-radius:12px;padding:16px}
.hero-empty,.hero-pending,.hero-failed,.hero-complete{text-align:center}
.hero-empty-title,.hero-failed-title,.hero-complete-title{font-weight:600;font-size:15px;margin-bottom:6px}
.hero-empty-help,.hero-pending-help,.hero-failed-help{color:var(--grey-600);font-size:13px;margin:6px 0 12px}
.hero-pending-text{font-weight:500;font-size:14px;margin:8px 0 4px}
.hero-spinner{width:32px;height:32px;border:3px solid var(--grey-200);border-top-color:var(--teal-600);border-radius:50%;margin:0 auto 8px;animation:hero-spin 1s linear infinite}
@keyframes hero-spin{to{transform:rotate(360deg)}}
.hero-thumb-wrap{max-width:240px;margin:0 auto;border-radius:8px;overflow:hidden;background:linear-gradient(135deg,var(--teal-600),var(--coral-400))}
.hero-thumb{width:100%;height:auto;display:block;min-height:120px}
.hero-failed-title{color:var(--error)}


/* =====================================================================
   V3-2 hero video card (RELOCATED from ugc-consent.js socialVideo_injectStyles_)
   Sweep deferred to Phase C-2 (token replacement, badge polish, focus rings).
   Pasted verbatim.
   ===================================================================== */
.social-video-card{background:var(--grey-50);border:1px solid var(--grey-200);border-radius:12px;padding:16px;margin-top:16px}
.video-empty,.video-pending,.video-failed,.video-complete,.video-tier,.video-quota,.video-outage{text-align:center}
.video-empty-title,.video-failed-title,.video-complete-title,.video-tier-title,.video-quota-title,.video-outage-title{font-weight:600;font-size:15px;margin-bottom:6px}
.video-empty-help,.video-pending-help,.video-failed-help,.video-tier-help,.video-quota-help,.video-outage-help{color:var(--grey-600);font-size:13px;margin:6px 0 12px}
.video-pending-text{font-weight:500;font-size:14px;margin:8px 0 4px}
.video-spinner{width:32px;height:32px;border:3px solid var(--grey-200);border-top-color:var(--teal-600);border-radius:50%;margin:0 auto 8px;animation:video-spin 1s linear infinite}
@keyframes video-spin{to{transform:rotate(360deg)}}
.video-player-wrap{max-width:320px;margin:0 auto;border-radius:8px;overflow:hidden;background:linear-gradient(135deg,var(--teal-600),var(--coral-400))}
.video-player{width:100%;height:auto;display:block;min-height:160px;background:black}
.video-failed-title{color:var(--error)}
.video-download{margin:8px 0;font-size:13px}
.video-download a{color:var(--teal-600);text-decoration:underline}
.video-chat{margin-top:14px;padding-top:14px;border-top:1px solid var(--grey-200);text-align:left}
.video-chat-title{font-weight:600;font-size:14px;margin-bottom:4px}
.video-chat-help{font-size:12px;color:var(--grey-500);margin:0 0 8px}
.video-chat-input{width:100%;box-sizing:border-box;resize:vertical;min-height:48px;padding:10px 12px;border:1px solid var(--grey-300);border-radius:10px;font:inherit;font-size:14px}
.video-chat-input:focus{outline:none;border-color:var(--teal-600);box-shadow:0 0 0 3px rgba(14,124,123,0.12)}
.video-chat-result{margin:8px 0 0;font-size:13px;padding:8px 10px;border-radius:8px}
.video-chat-result-ok{color:var(--teal-600);background:rgba(14,124,123,0.08)}
.video-chat-result-error{color:var(--error);background:rgba(239,68,68,0.07)}
.video-chip-row{display:flex;flex-wrap:wrap;gap:6px;justify-content:center;margin:10px 0}
.video-chip{font-size:12px;padding:5px 10px;border-radius:14px;border:1px solid var(--grey-300);background:var(--white);cursor:pointer}
.video-chip-active{background:var(--teal-600);color:var(--white);border-color:var(--teal-600)}
.video-chip-disabled{opacity:0.5;cursor:not-allowed}
.video-tier .btn,.video-quota .btn{margin-top:6px}


/* =====================================================================
   V2-12 PHASE D -- My Posts Premium Pattern lift
   Overrides for existing .my-posts-* and .my-post-* rules (defined earlier
   in this file). Adds warm-card framing on post cards, badge polish on
   filter chips + status badges, and saved/archived status states (the
   existing rules covered draft/published/failed which renderMyPosts does
   not actually emit -- see ugc-consent.js renderMyPosts).
   ===================================================================== */

/* Filter chips -- minimal Premium Pattern overlay. Original rule at
   line ~3835 already supplies touch-friendly padding (8px 14px) and
   readable font-size (0.8125rem); we only add the editorial cues
   (uppercase, tracking, font-medium weight) plus an active-state polish.
   Avoid shrinking padding -- chips are interactive and must satisfy the
   >=48x48 touch target floor; the badge recipe in section 7 is for
   non-interactive status indicators, not filter chips. */
#myPostsFilters .my-posts-chip {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: var(--font-medium);
}
#myPostsFilters .my-posts-chip.active {
  background: var(--teal-50);
  border-color: transparent;
  color: var(--teal-700);
}

/* Post cards -- warm-card framing. */
.my-post-card {
  background: var(--surface-warm);
  border-color: var(--surface-warm-border);
  color: var(--text-on-warm);
}
.my-post-card:hover {
  border-color: var(--coral-300);
  box-shadow: var(--shadow-md);
}
.my-post-card-caption,
.my-post-card-time,
.my-post-mode-badge {
  color: var(--text-on-warm);
}

/* Status badges -- align with social-badge recipe; add the saved/archived
   states that renderMyPosts actually emits. The existing draft/published/
   failed rules above remain (defensive in case status semantics change). */
.my-post-status-badge {
  padding: 3px 10px;
  font-weight: var(--font-medium);
  letter-spacing: 0.04em;
  font-size: 0.75rem;
  text-transform: uppercase;
}
.my-post-status-badge.saved {
  background: var(--teal-50);
  color: var(--teal-700);
}
.my-post-status-badge.archived {
  background: var(--grey-100);
  color: var(--grey-600);
}

/* salon-posts-library Phase 2 -- thumbnail-list card. Card is a flex row:
   hero thumbnail left, body right. Gradient fallback (teal -> coral) shows
   when there is no hero or the image fails to load. */
.my-post-card {
  display: flex;
  gap: 12px;
  align-items: stretch;
}
.my-post-thumb {
  flex: 0 0 auto;
  width: 84px;
  height: 84px;
  border-radius: var(--radius-md, 8px);
  overflow: hidden;
  background: linear-gradient(135deg, #0e7c7b 0%, #ff8a6c 100%);
  position: relative;
}
.my-post-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.my-post-card-body {
  flex: 1 1 auto;
  min-width: 0;
}
.my-post-platform-chip {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--teal-700);
  background: var(--teal-50);
  border-radius: var(--radius-full);
  padding: 2px 8px;
}
.my-post-archived-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--grey-600);
  background: var(--grey-100);
  border-radius: var(--radius-full);
  padding: 2px 8px;
}
.my-post-card-meta {
  margin-top: 6px;
}
.my-post-expiry {
  font-size: 0.72rem;
  color: var(--grey-500);
}
.my-post-expiry.warn {
  color: rgb(153, 27, 27);
  font-weight: 600;
}


/* =====================================================================
   V2-12 PHASE E -- My Style Premium Pattern lift
   The actual #socialStyleMode surface is single-section (upload grid +
   upload button + counter). The plan-anticipated style-profile-summary
   and example-gallery sections do not exist in the current PWA -- those
   would need new mode-containers to be built and are out of scope for
   V2-12 (cosmetic only). Sticky rail therefore skipped.

   The visible Premium Pattern touch here is warm-card framing on the
   upload affordance: cream background, cream border (kept dashed for the
   upload semantic), text-on-warm content, coral accent on hover.
   ===================================================================== */

.social-style-upload {
  background: var(--surface-warm);
  border-color: var(--surface-warm-border);
  color: var(--text-on-warm);
}
.social-style-upload:hover {
  border-color: var(--coral-300);
  color: var(--coral-700);
}
.social-style-thumb {
  border-color: var(--surface-warm-border);
  background: var(--surface-warm);
}


/* =====================================================================
   Revoke confirmation page (RELOCATED from ugc-consent.js socialRevokeInjectStyles_)
   Sweep applied in this same Phase F pass (token replacement).
   ===================================================================== */
#revokeMode.mode-container { padding: 24px 20px; max-width: 560px; margin: 0 auto; }
      .revoke-page { background: var(--white); padding: 28px; border-radius: 12px;
        box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
      .revoke-page h1 { font-size: 24px; margin: 0 0 16px; color: var(--grey-800); }
      .revoke-page h2 { font-size: 16px; margin: 20px 0 8px; color: var(--grey-700); font-weight: 600; }
      .revoke-page p { margin: 0 0 12px; line-height: 1.55; color: var(--grey-700); font-size: 15px; }
      .revoke-page strong { color: var(--grey-800); }
      .revoke-page ul { margin: 8px 0 16px; padding-left: 22px; color: var(--grey-700); font-size: 15px; line-height: 1.6; }
      .revoke-page li { margin-bottom: 6px; }
      .revoke-actions { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
      .revoke-btn { padding: 12px 20px; border: 0; border-radius: 8px;
        font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none;
        display: inline-block; text-align: center; }
      .revoke-btn-primary { background: var(--error); color: var(--white); flex: 1; min-width: 180px; }
      .revoke-btn-primary:hover { background: var(--error); }
      .revoke-btn-primary:disabled { background: var(--grey-400); cursor: not-allowed; }
      .revoke-btn-secondary { background: var(--grey-200); color: var(--grey-700); }
      .revoke-btn-secondary:hover { background: var(--grey-300); }
      .revoke-close-hint { margin-top: 20px; color: var(--grey-500); font-size: 13px; }
      .revoke-loading { text-align: center; padding: 40px 20px; color: var(--grey-600); }


/* =====================================================================
   Salon profile editor (RELOCATED from ugc-consent.js salonProfile_injectStyles_)
   Sweep applied in this same Phase F pass (token replacement).
   ===================================================================== */
.profile-panel{max-width:680px;margin:0 auto;padding:24px 16px 64px}
.profile-panel h1{font-size:22px;margin:0 0 4px;color:var(--grey-900)}
.profile-panel .profile-lede{color:var(--grey-600);margin:0 0 24px;font-size:14px;line-height:1.5}
.profile-field{margin-bottom:20px}
.profile-field label{display:block;font-weight:600;font-size:14px;margin-bottom:4px;color:var(--grey-900)}
.profile-field .profile-help{font-size:12px;color:var(--grey-600);margin:0 0 6px;line-height:1.4}
.profile-field input[type="text"],.profile-field textarea,.profile-field select{width:100%;padding:10px 12px;border:1px solid var(--grey-300);border-radius:8px;font:inherit;font-size:14px;box-sizing:border-box;background:var(--white)}
.profile-field textarea{min-height:72px;resize:vertical}
.profile-field input:focus,.profile-field textarea:focus,.profile-field select:focus{outline:2px solid var(--teal-600);outline-offset:1px;border-color:var(--teal-600)}
.profile-status{position:sticky;bottom:0;background:var(--white);border-top:1px solid var(--grey-200);padding:12px 16px;margin:16px -16px -64px;font-size:13px;color:var(--grey-600);text-align:center;min-height:18px}
.profile-status.saving{color:var(--teal-600)}
.profile-status.saved{color:var(--success)}
.profile-status.error{color:var(--error)}
.profile-loading{text-align:center;padding:48px 16px;color:var(--grey-600);font-size:14px}
.profile-error{text-align:center;padding:32px 16px;color:var(--error);font-size:14px}
.profile-warning{background:var(--warning-light);border:1px solid var(--warning);border-radius:6px;padding:8px 12px;margin-top:6px;font-size:12px;color:var(--coral-700);line-height:1.4}
.profile-back{display:inline-block;margin-bottom:12px;color:var(--teal-600);text-decoration:none;font-size:14px;cursor:pointer;background:none;border:0;padding:6px 0}

/* --- V2-08 profile-canon-sync: tap-disclosure, specialities, category --- */
.profile-field input[type="number"]{width:100%;padding:10px 12px;border:1px solid var(--grey-300);border-radius:8px;font:inherit;font-size:14px;box-sizing:border-box;background:var(--white)}
.profile-field input[type="number"]:focus{outline:2px solid var(--teal-600);outline-offset:1px;border-color:var(--teal-600)}
/* Tap-to-reveal disclosure (NOT hover -- this is a touch PWA). */
.profile-disclosure-toggle{display:inline-flex;align-items:center;gap:4px;margin-top:6px;padding:2px 0;background:none;border:0;color:var(--teal-600);font:inherit;font-size:12px;font-weight:600;cursor:pointer}
.profile-disclosure-toggle::before{content:"+";font-size:14px;line-height:1;font-weight:700}
.profile-disclosure-toggle[aria-expanded="true"]::before{content:"-"}
.profile-disclosure{margin-top:8px;padding:10px 12px;background:var(--teal-50,#f0fdfa);border:1px solid var(--teal-200,#99f6e4);border-radius:8px}
.profile-disclosure p{margin:0 0 6px;font-size:12px;line-height:1.5;color:var(--grey-700,#374151)}
.profile-disclosure p:last-child{margin-bottom:0}
.profile-tag{display:inline-block;font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:0.04em;color:var(--teal-700);margin-right:6px}
.profile-meta-detail{color:var(--grey-600)!important}
/* Hover as a desktop-only progressive enhancement (pointer:fine only). */
@media (hover:hover) and (pointer:fine){
  .profile-disclosure-toggle:hover{text-decoration:underline}
}
/* Specialities chip selector */
.profile-spec-count{font-size:12px;color:var(--teal-700);font-weight:600;margin:0 0 8px}
.profile-spec-cats{display:flex;flex-direction:column;gap:8px}
.profile-spec-cat{border:1px solid var(--grey-200);border-radius:10px;padding:8px;background:var(--white)}
.profile-spec-cat.is-open{border-color:var(--teal-200,#99f6e4);background:var(--teal-50,#f0fdfa)}
.profile-spec-main{width:100%;text-align:left;background:none;border:1px solid var(--grey-300);border-radius:999px;padding:8px 14px;font:inherit;font-size:13px;font-weight:600;color:var(--grey-900);cursor:pointer}
.profile-spec-main.selected{background:var(--teal-600);border-color:var(--teal-600);color:var(--white)}
.profile-spec-main.disabled{opacity:0.45;cursor:not-allowed}
.profile-spec-subs{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.profile-spec-sub{background:var(--white);border:1px solid var(--grey-300);border-radius:999px;padding:6px 12px;font:inherit;font-size:12px;color:var(--grey-700);cursor:pointer}
.profile-spec-sub.selected{background:var(--teal-50,#f0fdfa);border-color:var(--teal-600);color:var(--teal-700);font-weight:600}
/* Category "Other" free-text */
.profile-category-other{margin-top:8px}
/* Prose AI helper (P4) -- on-brand teal */
.profile-ai{margin-top:8px}
.profile-ai-btn{display:inline-flex;align-items:center;gap:6px;padding:7px 12px;border:1px solid var(--teal-200,#99f6e4);border-radius:999px;background:linear-gradient(180deg,var(--teal-50,#f0fdfa),var(--white));color:var(--teal-700);font:inherit;font-size:12px;font-weight:600;cursor:pointer}
.profile-ai-btn:hover{border-color:var(--teal-600)}
.profile-ai-spark{color:var(--teal-600);flex:0 0 auto}
.profile-ai-panel{margin-top:8px;padding:12px;border:1px solid var(--teal-200,#99f6e4);border-radius:10px;background:var(--teal-50,#f0fdfa)}
.profile-ai-label{display:block;font-size:12px;color:var(--grey-700,#374151);margin-bottom:6px;line-height:1.4;font-weight:500}
.profile-ai-dir{width:100%;padding:9px 11px;border:1px solid var(--grey-300);border-radius:8px;font:inherit;font-size:14px;box-sizing:border-box;background:var(--white);resize:vertical;min-height:48px}
.profile-ai-dir:focus{outline:2px solid var(--teal-600);outline-offset:1px;border-color:var(--teal-600)}
.profile-ai-actions{display:flex;align-items:center;gap:10px;margin-top:8px}
.profile-ai-draft{padding:8px 16px;border:0;border-radius:8px;background:var(--teal-600);color:var(--white);font:inherit;font-size:13px;font-weight:600;cursor:pointer}
.profile-ai-draft:hover{background:var(--teal-700)}
.profile-ai-draft:disabled{opacity:0.6;cursor:default}
.profile-ai-status{font-size:12px;color:var(--teal-700);line-height:1.4}

/* =========================================================================
   DRAWER MENU SECTIONS + ACCORDION + POLISH (nav restructure)
   ========================================================================= */
.yk-app-menu-section {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--grey-500);
  margin: 12px 12px 4px;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.yk-app-menu-section--toggle {
  width: calc(100% - 8px);
  margin: 4px 4px;
  padding: 8px 8px;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-md);
  min-height: 40px;
}
.yk-app-menu-section--toggle:hover { background: var(--grey-50); }
.yk-app-menu-section-icon { width: 16px; height: 16px; color: var(--grey-500); flex: 0 0 auto; }
.yk-app-menu-section-label { flex: 1 1 auto; text-align: left; }
.yk-app-menu-section-chevron {
  width: 16px; height: 16px; color: var(--grey-400); flex: 0 0 auto;
  transition: transform 0.25s var(--ease-premium);
}
.yk-app-menu-section--toggle[aria-expanded="true"] .yk-app-menu-section-chevron {
  transform: rotate(180deg);
}
.yk-app-menu-accordion-body[hidden] { display: none; }

/* Press feedback + entry stagger */
.yk-app-menu-item:active { transform: scale(0.98); }
.yk-app-drawer.active .yk-app-menu-item,
.yk-app-drawer.active .yk-app-menu-section {
  animation: ykMenuIn 0.32s var(--ease-premium) both;
}
@keyframes ykMenuIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Header avatar + review line */
.yk-app-drawer-avatar {
  width: 40px; height: 40px; flex: 0 0 auto; border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--teal-600) 0%, #FF8A6C 100%);
}
.yk-app-drawer-header { gap: 12px; }
.yk-app-drawer-review-line {
  display: block; margin-top: 4px; font-size: 0.75rem; color: var(--grey-500);
}

/* Bottom upgrade CTA -- free plan only. Quiet premium card: white surface,
   hairline border, a single brand-gradient icon chip as the only saturated
   element. Full state machine (hover / focus-visible / active / loading)
   because this is the highest-value action in the drawer. */
/* Redesign 2026-06-07: teal-outline CTA, taller and lifted off the bottom edge
   (was a compact gradient-icon row). Icon removed in the markup to drop the
   last brand-gradient element from the drawer. */
.yk-app-drawer-cta {
  display: flex; flex-direction: column; justify-content: center; gap: 4px;
  margin: 12px 12px 22px; padding: 20px 18px; min-height: 78px;
  border-radius: var(--radius-xl);
  background: var(--white);
  color: var(--grey-900);
  border: 1px solid var(--teal-300);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}
.yk-app-drawer-cta:hover {
  border-color: var(--teal-600);
  background: var(--teal-50, #f0fdfa);
  box-shadow: 0 4px 14px rgba(14, 124, 123, 0.12);
}
.yk-app-drawer-cta:focus-visible {
  outline: 2px solid var(--teal-500);
  outline-offset: 2px;
}
.yk-app-drawer-cta:active { transform: scale(0.98); }
.yk-app-drawer-cta-icon {
  width: 36px; height: 36px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md);
  background: var(--gradient-brand);
  color: var(--white);
}
.yk-app-drawer-cta-icon svg { width: 20px; height: 20px; }
.yk-app-drawer-cta-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.yk-app-drawer-cta-title { font-weight: 700; font-size: 1rem; color: var(--teal-700); }
.yk-app-drawer-cta-sub { font-size: 0.8125rem; color: var(--grey-500); line-height: 1.3; }
.yk-app-drawer-cta[hidden] { display: none; }
/* Loading: reuse the menu-item spinner pattern. pointer-events:none blocks a
   re-tap while the Stripe checkout session is being created. */
.yk-app-drawer-cta.loading { pointer-events: none; opacity: 0.85; }
.yk-app-drawer-cta.loading::after {
  content: ""; width: 16px; height: 16px; margin-left: auto; flex: 0 0 auto;
  border: 2px solid var(--grey-300, #d4d4d4);
  border-top-color: var(--teal-500);
  border-radius: 50%;
  animation: yk-menu-spin 0.6s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .yk-app-drawer.active .yk-app-menu-item,
  .yk-app-drawer.active .yk-app-menu-section { animation: none; }
  .yk-app-menu-section-chevron { transition: none; }
  .yk-app-menu-item:active { transform: none; }
  .yk-app-drawer-cta:active { transform: none; }
}

/* ============================================================
   Reviews console (Phase 2.4) -- premium card + filter + sheet
   Additive. All values from shared.css tokens.
   ============================================================ */

/* --- page + header --- */
#gbpReviewsMode { background: var(--grey-50); min-height: 100%; }
#gbpReviewsMode .page-header h1 { font-family: var(--font-display); }
.pwa-rev-aggregate {
  display: flex; align-items: center; gap: 6px;
  padding: 0 20px 4px; font-size: 14px; color: var(--grey-500);
}
.pwa-rev-aggregate .pwa-rev-star.is-filled { color: var(--star); font-size: 15px; }

/* --- filter pill row (sticky) --- */
.pwa-rev-filters {
  position: sticky; top: 0; z-index: 5;
  display: flex; gap: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding: 12px 20px; margin-bottom: 4px;
  background: var(--grey-50);
  scrollbar-width: none;
}
.pwa-rev-filters::-webkit-scrollbar { display: none; }
.pwa-rev-filter-group { display: flex; gap: 8px; flex: 0 0 auto; }
.pwa-rev-filter-group + .pwa-rev-filter-group { margin-left: 8px; }
.pwa-rev-pill {
  flex: 0 0 auto; border: none; cursor: pointer;
  font-family: var(--font-body); font-size: 14px; font-weight: 500;
  padding: 8px 14px; border-radius: var(--radius-full);
  background: var(--grey-100); color: var(--grey-700);
  transition: var(--transition-base);
}
.pwa-rev-pill.is-active {
  background: var(--teal-600); color: var(--white); box-shadow: var(--shadow-sm);
}
.pwa-rev-pill:active { transform: scale(0.96); }
.pwa-rev-clear {
  flex: 0 0 auto; border: none; background: none; cursor: pointer;
  font-family: var(--font-body); font-size: 14px; color: var(--teal-600);
  padding: 8px 6px;
}

/* --- review list + card --- */
.pwa-rev-list { display: flex; flex-direction: column; gap: 14px; padding: 4px 20px 32px; }
.pwa-rev-card {
  background: var(--white); border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-sm); padding: 20px;
  transition: var(--transition-base);
}
/* Left-side card accent removed by design (never reintroduce a one-side coloured
   border on cards). The needs-reply state carries no border now -- the default
   "Needs reply" filter already scopes the list to what needs action. */
.pwa-rev-stars { display: flex; gap: 2px; margin-bottom: 10px; }
.pwa-rev-star { font-size: 18px; line-height: 1; color: var(--grey-300); }
.pwa-rev-star.is-filled { color: var(--star); }
.pwa-rev-card-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin-bottom: 8px;
}
.pwa-rev-name { font-size: 15px; font-weight: 600; color: var(--grey-900); }
.pwa-rev-date { font-size: 13px; color: var(--grey-500); flex: 0 0 auto; }
.pwa-rev-text {
  font-size: 15px; line-height: 1.6; color: var(--grey-700); margin: 0;
}
.pwa-rev-text.is-clamped {
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical;
  overflow: hidden;
}
.pwa-rev-more {
  border: none; background: none; cursor: pointer; padding: 4px 0 0;
  font-family: var(--font-body); font-size: 14px; color: var(--teal-600);
}
/* .pwa-rev-source (source provenance pill, e.g. APIFY_COMPASS) removed -- it is
   internal plumbing, not operator-facing, and is no longer rendered. */

/* --- owner reply (replied state) --- */
.pwa-rev-owner-reply {
  margin-top: 14px; padding: 10px 14px;
  background: var(--teal-50); border-left: 3px solid var(--teal-600);
  border-radius: var(--radius-md);
}
.pwa-rev-owner-reply strong {
  display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--teal-700); margin-bottom: 4px;
}
.pwa-rev-owner-reply p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--grey-700); }

/* --- reply composer (needs-reply state) --- */
.pwa-rev-reply-trigger {
  margin-top: 14px; width: 100%;
  background: var(--white); color: var(--teal-700);
  border: 1px solid var(--teal-200); border-radius: var(--radius-lg);
  padding: 10px 16px; font-family: var(--font-body); font-size: 14px; font-weight: 500;
  cursor: pointer; transition: var(--transition-base);
}
.pwa-rev-reply-trigger:active { transform: scale(0.98); }
.pwa-rev-composer {
  margin-top: 12px; overflow: hidden;
  max-height: 0; opacity: 0;
  transition: max-height 0.4s var(--ease-premium), opacity 0.3s var(--ease-premium);
}
.pwa-rev-composer.is-open { max-height: 420px; opacity: 1; }
/* AI assist sits in a top-right tools row -- a subtle GHOST pill (no gradient),
   so the single primary "Copy & open Google" gradient owns the hierarchy. */
.pwa-rev-composer-tools { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.pwa-rev-composer-ai {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; color: var(--teal-700);
  border: 1px solid var(--teal-200); border-radius: var(--radius-full); box-shadow: none;
  padding: 6px 12px; font-family: var(--font-body); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: var(--transition-base);
}
.pwa-rev-composer-ai:hover { background: var(--teal-50); border-color: var(--teal-300); }
.pwa-rev-composer-ai:active { transform: scale(0.97); }
.pwa-rev-composer-ai[disabled] { opacity: 0.6; cursor: progress; }
.pwa-rev-ai-spark { flex: 0 0 auto; color: var(--teal-600); }
.pwa-rev-composer textarea {
  width: 100%; box-sizing: border-box; min-height: 96px; resize: vertical;
  border: 1px solid var(--grey-300); border-radius: var(--radius-lg);
  padding: 12px; font-family: var(--font-body); font-size: 15px; line-height: 1.5;
  color: var(--grey-900);
}
.pwa-rev-composer textarea:focus { outline: none; border-color: var(--teal-500); }
/* Right-align a SINGLE, right-sized primary action (not a full-width slab). */
.pwa-rev-composer-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.pwa-rev-composer-send { flex: 0 0 auto; padding: 10px 18px; }

/* --- QR bottom sheet --- */
.pwa-rev-qr-sheet {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0; pointer-events: none; transition: opacity 0.3s var(--ease-premium);
}
.pwa-rev-qr-sheet.is-open { opacity: 1; pointer-events: auto; }
.pwa-rev-qr-sheet-panel {
  width: 100%; max-width: 480px; background: var(--white);
  border-radius: var(--radius-3xl) var(--radius-3xl) 0 0;
  box-shadow: var(--shadow-xl); padding: 12px 20px 28px;
  transform: translateY(100%); transition: transform 0.4s var(--ease-premium);
}
.pwa-rev-qr-sheet.is-open .pwa-rev-qr-sheet-panel { transform: translateY(0); }
.pwa-rev-qr-grab {
  width: 40px; height: 4px; border-radius: var(--radius-full);
  background: var(--grey-300); margin: 0 auto 16px;
}
.pwa-rev-qr-sheet h2 { font-family: var(--font-display); text-align: center; margin: 0 0 4px; }
.pwa-rev-qr-sheet > .pwa-rev-qr-sheet-panel > p {
  text-align: center; color: var(--grey-500); font-size: 14px; margin: 0 0 16px;
}
.pwa-rev-qr-frame {
  background: var(--grey-50); border-radius: var(--radius-2xl);
  padding: 24px; display: flex; justify-content: center; margin-bottom: 20px;
}
.pwa-rev-qr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pwa-rev-qr-grid .btn { width: 100%; }

/* --- status / empty / filtered-empty --- */
.pwa-rev-status { text-align: center; color: var(--grey-500); padding: 32px 20px; }
.pwa-rev-empty, .pwa-rev-filtered-empty { text-align: center; color: var(--grey-500); padding: 40px 24px; }
.pwa-rev-filtered-empty .pwa-rev-clear { display: inline-block; margin-top: 8px; }

/* --- skeleton loading --- */
.pwa-rev-skel {
  background: var(--white); border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-sm); padding: 20px; margin-bottom: 14px;
}
.pwa-rev-skel-line {
  height: 12px; border-radius: var(--radius-full); background: var(--grey-100);
  margin-bottom: 10px; animation: pwaRevPulse 1.4s ease-in-out infinite;
}
.pwa-rev-skel-line.w40 { width: 40%; } .pwa-rev-skel-line.w90 { width: 90%; }
.pwa-rev-skel-line.w70 { width: 70%; }
@keyframes pwaRevPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

/* --- QR header trigger (Phase 2.4 Stage 5) ---
   Replaces the right-side .page-header .spacer for the Reviews console.
   Same 44x44 footprint as .page-header .back-btn so the header stays
   visually balanced. */
.pwa-rev-qr-trigger {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-lg);
  cursor: pointer;
  color: var(--grey-600);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  padding: 0;
}
.pwa-rev-qr-trigger:hover { border-color: var(--teal-300); color: var(--teal-600); }
.pwa-rev-qr-trigger:active { transform: scale(0.96); }
.pwa-rev-qr-trigger svg { width: 22px; height: 22px; }

/* ============================================================
   PWA AUDIT (Stage 3b, 2026-05-31)
   Owner-facing Google Business Profile audit screen.
   Renderer: pwa-audit.js (window.pwa_renderAuditMode).
   Uses shared.css brand tokens (--teal-*, --coral-*, --grey-*,
   --gradient-brand, --font-display, --shadow-*, --radius-*).
   ============================================================ */

#auditMode { padding: 0 16px 64px; min-height: 100vh; background: var(--bg-gradient-main); }
.pwa-audit-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 0 18px;
    position: sticky;
    top: 0;
    background: var(--bg-gradient-main);
    z-index: 5;
}
.pwa-audit-header .back-btn {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    border: none; background: transparent; border-radius: var(--radius-full);
    color: var(--grey-700); cursor: pointer;
    transition: background var(--transition-fast);
}
.pwa-audit-header .back-btn:hover { background: var(--grey-100); }
.pwa-audit-header .back-btn svg { width: 22px; height: 22px; }
.pwa-audit-title {
    flex: 1;
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--grey-900);
    letter-spacing: -0.01em;
}
.pwa-audit-save-indicator {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--grey-500);
    min-height: 1.25rem;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    transition: background var(--transition-fast), color var(--transition-fast);
}
.pwa-audit-save-indicator.is-saving { color: var(--teal-700); background: var(--teal-50); }
.pwa-audit-save-indicator.is-saved  { color: var(--success); background: rgba(16, 185, 129, 0.1); }
.pwa-audit-save-indicator.is-error  { color: var(--coral-700); background: var(--coral-50); }

.pwa-audit-status { padding: 24px 8px; color: var(--grey-500); text-align: center; }
.pwa-audit-empty { padding: 48px 16px; text-align: center; color: var(--grey-600); }
.pwa-audit-empty-copy { font-size: 1rem; line-height: 1.5; }
.pwa-audit-error { padding: 32px 16px; text-align: center; }
.pwa-audit-error-msg { color: var(--coral-700); margin-bottom: 12px; }

/* ---- Hero ---- */
.pwa-audit-hero {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px 20px;
    background: var(--white);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-md);
    margin-bottom: 20px;
    border: 1px solid var(--grey-100);
}
.pwa-audit-hero-ring { position: relative; width: 120px; height: 120px; flex-shrink: 0; }
.pwa-audit-hero-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.pwa-audit-hero-ring-track { fill: none; stroke: var(--grey-100); stroke-width: 10; }
.pwa-audit-hero-ring-fill  { fill: none; stroke: var(--score-color, var(--teal-600)); stroke-width: 10; stroke-linecap: round; transition: stroke-dasharray 0.6s var(--ease-out-expo), stroke 0.4s ease; }
.pwa-audit-hero-num {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display); color: var(--grey-900);
}
.pwa-audit-hero-num strong { font-size: 2.25rem; font-weight: 500; line-height: 1; }
.pwa-audit-hero-num span { font-size: 1rem; color: var(--grey-500); margin-left: 2px; }
.pwa-audit-hero-text { flex: 1; min-width: 0; }
.pwa-audit-hero-label { font-family: var(--font-display); font-size: 1.25rem; font-weight: 500; color: var(--grey-900); margin: 0 0 4px; }
.pwa-audit-hero-completeness { font-size: 0.875rem; color: var(--grey-600); margin: 0 0 8px; }
.pwa-audit-hero-completeness strong { color: var(--grey-900); }
.pwa-audit-hero-meter { height: 6px; background: var(--grey-100); border-radius: var(--radius-full); overflow: hidden; margin-bottom: 12px; }
.pwa-audit-hero-meter-fill { height: 100%; background: var(--gradient-brand); border-radius: var(--radius-full); transition: width 0.6s var(--ease-out-expo); }
.pwa-audit-hero-blurb { font-size: 0.8125rem; color: var(--grey-500); line-height: 1.45; margin: 0; }

@media (max-width: 480px) {
    .pwa-audit-hero { flex-direction: column; align-items: stretch; text-align: left; }
    .pwa-audit-hero-ring { width: 96px; height: 96px; margin: 0 auto; }
    .pwa-audit-hero-num strong { font-size: 1.875rem; }
}

/* ---- Top fixes ---- */
.pwa-audit-h2 {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--grey-900);
    margin: 0 4px 12px;
    letter-spacing: -0.005em;
}
.pwa-audit-fixes { margin-bottom: 20px; }
.pwa-audit-fixes-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.pwa-audit-fix {
    background: var(--white);
    border: 1px solid var(--grey-100);
    border-left: 3px solid var(--coral-400);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
}
.pwa-audit-fix-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 6px; }
.pwa-audit-fix-issue { font-size: 0.9375rem; color: var(--grey-900); font-weight: 600; }
.pwa-audit-fix-section-pill {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--grey-500);
    background: var(--grey-50);
    padding: 3px 8px;
    border-radius: var(--radius-full);
    white-space: nowrap;
    flex-shrink: 0;
}
.pwa-audit-fix-why { font-size: 0.8125rem; color: var(--grey-600); margin: 0 0 6px; line-height: 1.5; }
.pwa-audit-fix-action { font-size: 0.875rem; color: var(--grey-800); margin: 0; line-height: 1.5; }
.pwa-audit-fix-action strong { color: var(--teal-700); }

/* ---- Section list ---- */
.pwa-audit-sections { margin-bottom: 24px; }
.pwa-audit-section-list { display: flex; flex-direction: column; gap: 10px; }
.pwa-audit-section {
    background: var(--white);
    border: 1px solid var(--grey-100);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.pwa-audit-section.is-pending { background: var(--grey-50); }
.pwa-audit-section-head {
    width: 100%;
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    font: inherit;
}
.pwa-audit-section-head:focus-visible { outline: 2px solid var(--teal-500); outline-offset: -2px; }
.pwa-audit-section-title { flex: 1; font-size: 0.9375rem; font-weight: 600; color: var(--grey-900); }
.pwa-audit-section-pill {
    --pill-color: var(--grey-400);
    color: var(--pill-color);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    background: color-mix(in srgb, var(--pill-color) 10%, transparent);
    white-space: nowrap;
}
@supports not (background: color-mix(in srgb, red, blue)) {
    .pwa-audit-section-pill { background: var(--grey-100); }
}
.pwa-audit-section.is-pending .pwa-audit-section-pill { background: var(--grey-100); font-weight: 500; }
.pwa-audit-section-chevron { width: 16px; height: 16px; color: var(--grey-400); transition: transform var(--transition-base); flex-shrink: 0; }
.pwa-audit-section.is-expanded .pwa-audit-section-chevron { transform: rotate(180deg); }

.pwa-audit-section-body { padding: 4px 16px 16px; border-top: 1px solid var(--grey-100); }
.pwa-audit-section-pending-copy { font-size: 0.875rem; color: var(--grey-600); margin: 12px 0; line-height: 1.5; }

/* ---- Detail row ---- */
.pwa-audit-detail {
    padding: 14px 0;
    border-bottom: 1px solid var(--grey-100);
}
.pwa-audit-detail:last-child { border-bottom: none; }
.pwa-audit-detail-row {
    display: grid;
    grid-template-columns: 12px 1fr auto;
    align-items: center;
    gap: 10px;
}
.pwa-audit-detail-status {
    width: 10px; height: 10px;
    border-radius: var(--radius-full);
    background: var(--grey-300);
}
.pwa-audit-detail.is-pass    .pwa-audit-detail-status { background: var(--success); }
.pwa-audit-detail.is-partial .pwa-audit-detail-status { background: var(--warning); }
.pwa-audit-detail.is-fail    .pwa-audit-detail-status { background: var(--coral-600); }
.pwa-audit-detail.is-pending .pwa-audit-detail-status { background: var(--grey-300); }
.pwa-audit-detail-label { font-size: 0.9375rem; color: var(--grey-900); }
.pwa-audit-detail.is-pending .pwa-audit-detail-label { color: var(--grey-600); }
.pwa-audit-detail-value { font-size: 0.875rem; color: var(--grey-600); white-space: nowrap; }
.pwa-audit-detail.is-pending .pwa-audit-detail-value { font-style: italic; }

.pwa-audit-detail-guidance {
    margin-top: 8px;
    padding: 10px 12px;
    background: var(--grey-50);
    border-radius: var(--radius-md);
    border-left: 2px solid var(--teal-400);
}
.pwa-audit-detail-why    { font-size: 0.8125rem; color: var(--grey-600); margin: 0 0 4px; line-height: 1.5; }
.pwa-audit-detail-action { font-size: 0.8125rem; color: var(--grey-800); margin: 0; line-height: 1.5; }
.pwa-audit-detail-action strong { color: var(--teal-700); }

.pwa-audit-detail-readonly {
    margin: 8px 0 0;
    font-size: 0.75rem;
    color: var(--grey-500);
    font-style: italic;
}

.pwa-audit-detail-editor { margin-top: 10px; }
.pwa-audit-detail-editor-label { font-size: 0.75rem; color: var(--grey-500); margin: 0 0 6px; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.pwa-audit-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pwa-audit-chip {
    min-height: 32px;
    padding: 6px 12px;
    background: var(--white);
    border: 1px solid var(--grey-200);
    border-radius: var(--radius-full);
    color: var(--grey-700);
    font-size: 0.8125rem;
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}
.pwa-audit-chip:hover { border-color: var(--teal-400); color: var(--teal-700); }
.pwa-audit-chip:focus-visible { outline: 2px solid var(--teal-500); outline-offset: 2px; }
.pwa-audit-chip.is-active { background: var(--teal-600); border-color: var(--teal-600); color: var(--white); }
.pwa-audit-detail-number {
    width: 120px;
    padding: 8px 12px;
    border: 1px solid var(--grey-200);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    color: var(--grey-900);
    background: var(--white);
}
.pwa-audit-detail-number:focus { outline: 2px solid var(--teal-500); outline-offset: 0; border-color: var(--teal-500); }

.pwa-audit-detail-controls { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.pwa-audit-detail-tick {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    min-height: 32px;
}
.pwa-audit-detail-tick input { width: 18px; height: 18px; cursor: pointer; accent-color: var(--teal-600); }
.pwa-audit-detail-tick-label { font-size: 0.8125rem; color: var(--grey-700); }

.pwa-audit-detail-note-wrap summary {
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--teal-700);
    list-style: none;
    padding: 4px 0;
    user-select: none;
}
.pwa-audit-detail-note-wrap summary::-webkit-details-marker { display: none; }
.pwa-audit-detail-note-wrap summary::before {
    content: '+ ';
    color: var(--grey-400);
    margin-right: 2px;
}
.pwa-audit-detail-note-wrap[open] summary::before { content: '- '; }
.pwa-audit-detail-note {
    width: 100%;
    margin-top: 6px;
    padding: 8px 10px;
    border: 1px solid var(--grey-200);
    border-radius: var(--radius-md);
    font: inherit;
    font-size: 0.8125rem;
    color: var(--grey-900);
    background: var(--white);
    resize: vertical;
    min-height: 56px;
}
.pwa-audit-detail-note:focus { outline: 2px solid var(--teal-500); outline-offset: 0; border-color: var(--teal-500); }

/* ---- Trend (Stage 4): sparkline + MoM delta ---- */
.pwa-audit-trend {
    background: var(--white);
    border-radius: var(--radius-xl);
    border: 1px solid var(--grey-100);
    box-shadow: var(--shadow-sm);
    padding: 16px 18px;
    margin-bottom: 20px;
}
.pwa-audit-trend-head {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 10px;
}
.pwa-audit-trend-h2 { margin: 0; font-size: 1rem; }
.pwa-audit-trend-spark { margin: 4px 0 6px; min-height: 40px; color: var(--teal-600); }
.pwa-audit-trend-spark svg { width: 100%; height: auto; display: block; }
.pwa-audit-trend-blurb { font-size: 0.75rem; color: var(--grey-500); margin: 0; }
.pwa-audit-trend--building .pwa-audit-trend-blurb { font-style: italic; }

/* End PWA AUDIT block */

