*, *::before, *::after {
  -webkit-user-select: none !important;
  user-select: none !important;
}
input, textarea, select, [contenteditable="true"], .selectable {
  -webkit-user-select: text !important;
  user-select: text !important;
}
/* PlanSwatch — Exterior, Interior & Blueprint-to-3D Studio (planswatch.com)
 * Palette: Warm Alabaster, Pure White, Deep Architectural Navy, Warm Terracotta & Gold
 */

:root {
  --bg: #F6F5F1;
  --surface: #FFFFFF;
  --surface-alt: #EFEDE7;
  --ink: #161A1E;
  --ink-secondary: #4B535C;
  --ink-muted: #6C757D;
  --border: #E2DFD7;
  --border-strong: #CCC7BC;
  --emerald: #0E5A3E;
  --emerald-hover: #0A4630;
  --emerald-soft: #E7F3EE;
  --navy: #13293D;
  --navy-hover: #0C1C2B;
  --navy-soft: #E8EFF6;
  --terracotta: #C26543;
  --terracotta-hover: #A65234;
  --terracotta-soft: #FBF0EC;
  --gold: #C49645;
  --gold-soft: #FBF5E8;
  --amber: #B45309;
  --amber-soft: #FEF3C7;
  --danger: #B42318;
  --danger-soft: #FEE4E2;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(22, 26, 30, 0.06), 0 1px 2px rgba(22, 26, 30, 0.04);
  --shadow-md: 0 8px 24px rgba(22, 26, 30, 0.08);
  --shadow-lg: 0 18px 42px rgba(22, 26, 30, 0.14);
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --header-h: 64px;
  --bottom-nav-h: 68px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  max-width: 100vw;
}

img {
  max-width: 100%;
  display: block;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}

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

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 16px;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #10253F;
  color: #FFFFFF;
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(16, 37, 63, 0.22);
  flex-shrink: 0;
}

.brand-mark-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-name {
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.brand-sub {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-muted);
  letter-spacing: 0.01em;
}

/* Desktop Nav */
.desktop-nav {
  display: none;
  align-items: center;
  gap: 4px;
  background: var(--surface-alt);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.nav-pill {
  border: 0;
  background: transparent;
  color: var(--ink-secondary);
  font-weight: 600;
  font-size: 13.5px;
  padding: 8px 14px;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}

.nav-pill:hover {
  color: var(--ink);
}

.nav-pill.active {
  background: var(--surface);
  color: var(--navy);
  box-shadow: var(--shadow-sm);
}

/* Header right: allowance + tier switcher */
.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.allowance-bar {
  background: var(--navy);
  color: #FFFFFF;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.allowance-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 8px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  font-size: 12.5px;
}

.allowance-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.allowance-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.14);
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12.5px;
  color: #FFFFFF;
}

.allowance-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34D399;
}

.allowance-note {
  color: rgba(255,255,255,0.82);
  font-size: 12px;
}

.tier-switcher-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tier-switcher-label {
  font-size: 11.5px;
  color: rgba(255,255,255,0.72);
  font-weight: 600;
}

.tier-select {
  background: rgba(255,255,255,0.12);
  color: #FFFFFF;
  border: 1px solid rgba(255,255,255,0.24);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.tier-select option {
  color: var(--ink);
  background: #FFFFFF;
}

/* Main container */
.app-main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 20px 16px calc(var(--bottom-nav-h) + 28px);
}

.view-section {
  display: none;
}

.view-section.active {
  display: block;
}

/* Hero strip */
.studio-hero {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--emerald);
}

.hero-title {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--ink);
}

.hero-desc {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 14.5px;
  max-width: 680px;
}

/* Studio 2-column grid */
.studio-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 18px;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.card-header > div:first-child {
  min-width: 0;
  flex: 1 1 auto;
}
.card-header > .btn,
.card-header > .card-header-actions {
  flex-shrink: 0;
}

.card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.card-subtitle {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--ink-muted);
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Upload dropzone */
.upload-zone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg);
  padding: 18px 14px;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}

.upload-zone.dragover {
  border-color: var(--emerald);
  background: var(--emerald-soft);
}

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

.upload-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--ink-muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 16px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, transform 0.1s, color 0.15s;
  text-decoration: none;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.985);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--navy);
  color: #FFFFFF;
}

.btn-primary:hover:not(:disabled) {
  background: var(--navy-hover);
}

.btn-navy {
  background: var(--navy);
  color: #FFFFFF;
}

.btn-navy:hover:not(:disabled) {
  background: var(--navy-hover);
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border-strong);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--surface-alt);
}

.btn-soft {
  background: var(--emerald-soft);
  color: var(--emerald);
  border-color: rgba(14, 90, 62, 0.2);
}

.btn-soft:hover:not(:disabled) {
  background: #D6ECE2;
}

.btn-sm {
  padding: 7px 12px;
  font-size: 13px;
  border-radius: 8px;
}

.btn-full {
  width: 100%;
}

/* Preview Canvas & Before/After Slider */
.stage-wrap {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #1B1F24;
  aspect-ratio: 4 / 3;
  width: 100%;
  border: 1px solid var(--border);
  user-select: none;
  -webkit-user-select: none;
}

.stage-empty {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
  background: linear-gradient(160deg, #F4F2EC 0%, #E9E6DD 100%);
  color: var(--ink-secondary);
}

.stage-single {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Interactive Before/After Comparison Slider */
.ba-slider {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  cursor: ew-resize;
}

.ba-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
}

.ba-after-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
  -webkit-clip-path: inset(0 0 0 50%);
  clip-path: inset(0 0 0 50%);
}

.ba-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: #FFFFFF;
  box-shadow: 0 0 10px rgba(0,0,0,0.45);
  transform: translateX(-1px);
  pointer-events: none;
}

.ba-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #FFFFFF;
  color: var(--ink);
  box-shadow: 0 4px 14px rgba(0,0,0,0.3);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 14px;
  pointer-events: none;
}

.ba-tag {
  position: absolute;
  top: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(22, 26, 30, 0.74);
  color: #FFFFFF;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  backdrop-filter: blur(4px);
  pointer-events: none;
}

.ba-tag-before { left: 12px; }
.ba-tag-after { right: 12px; background: rgba(14, 90, 62, 0.88); }

/* Loading overlay */
.stage-loading {
  position: absolute;
  inset: 0;
  background: rgba(22, 26, 30, 0.78);
  backdrop-filter: blur(6px);
  color: #FFFFFF;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  text-align: center;
  z-index: 10;
}

.stage-loading.active,
.stage-loading.show {
  display: flex;
}

.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(255,255,255,0.25);
  border-top-color: #34D399;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Result toolbar */
.result-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.status-banner {
  margin-top: 12px;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  display: none;
  align-items: flex-start;
  gap: 8px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.status-banner.show { display: flex; }
.status-banner.info { background: var(--navy-soft); color: var(--navy); border: 1px solid rgba(27,54,93,0.18); }
.status-banner.success { background: var(--emerald-soft); color: var(--emerald); border: 1px solid rgba(14,90,62,0.2); }
.status-banner.warn { background: var(--amber-soft); color: #78350F; border: 1px solid rgba(180,83,9,0.22); }
.status-banner.error { background: var(--danger-soft); color: var(--danger); border: 1px solid rgba(180,35,24,0.2); }

/* Form Controls & Swatches */
.control-group {
  margin-bottom: 16px;
}

.control-group:last-child {
  margin-bottom: 0;
}

.control-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}

.control-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.control-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--emerald);
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.choice-pill {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink-secondary);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s;
}

.choice-pill:hover {
  border-color: var(--navy);
  color: var(--ink);
}

.choice-pill.active {
  background: var(--navy);
  color: #FFFFFF;
  border-color: var(--navy);
}

.swatch-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.swatch-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px 5px 6px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--ink-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.14s, background 0.14s;
}

.swatch-btn:hover {
  border-color: var(--ink-secondary);
}

.swatch-btn.active {
  border-color: var(--emerald);
  background: var(--emerald-soft);
  color: var(--ink);
}

.swatch-dot {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.18);
  flex-shrink: 0;
}

.swatch-dot.keep {
  background: repeating-linear-gradient(45deg, #E2DFD7, #E2DFD7 3px, #FFFFFF 3px, #FFFFFF 6px);
}

/* PDF page bar */
.pdf-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--surface-alt);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  font-size: 12.5px;
}

.pdf-bar.show { display: flex; }

/* White-Label Mode */
.wl-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.input-field {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
}

.input-field:focus {
  border-color: var(--emerald);
}

.color-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.color-picker {
  width: 42px;
  height: 38px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 2px;
  background: var(--surface);
  cursor: pointer;
}

/* Branded Client Portal Preview Card */
.client-portal-frame {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.portal-header {
  padding: 16px 18px;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.portal-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.portal-logo-box {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(255,255,255,0.18);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 17px;
  color: #FFFFFF;
  overflow: hidden;
  flex-shrink: 0;
}

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

.portal-company {
  font-weight: 800;
  font-size: 16px;
  line-height: 1.2;
}

.portal-sub {
  font-size: 12px;
  opacity: 0.86;
}

.portal-call-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #FFFFFF;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 13px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}

.portal-body {
  padding: 18px;
}

.spec-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 16px;
}

.spec-chip {
  font-size: 12px;
  font-weight: 600;
  background: var(--surface-alt);
  color: var(--ink-secondary);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.lead-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
}

.lead-box h4 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 800;
}

.lead-box p {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--ink-secondary);
}

.lead-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
}

/* Pricing Section */
.trial-banner {
  background: linear-gradient(135deg, #162E4E 0%, #0E5A3E 100%);
  color: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  box-shadow: var(--shadow-md);
}

.trial-banner-title {
  margin: 0 0 4px;
  font-size: 16.5px;
  font-weight: 800;
  line-height: 1.3;
}

.trial-banner-sub {
  margin: 0;
  font-size: 13px;
  color: rgba(255,255,255,0.86);
}

.pricing-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.price-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.price-card.featured {
  border: 2px solid var(--terracotta);
  box-shadow: var(--shadow-md);
}

.price-card.unlimited {
  border: 2px solid var(--navy);
  background: linear-gradient(180deg, #FFFFFF 0%, #F4F7FB 100%);
}

.price-badge {
  position: absolute;
  top: -11px;
  right: 16px;
  background: var(--emerald);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 999px;
}

.price-badge.navy {
  background: var(--navy);
}

.price-tier {
  font-size: 17px;
  font-weight: 800;
  margin: 0;
  color: var(--ink);
}

.price-tagline {
  font-size: 12.5px;
  color: var(--ink-muted);
  margin: 2px 0 12px;
}

.price-amount-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 14px;
}

.price-amount {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.price-period {
  font-size: 13.5px;
  color: var(--ink-muted);
  font-weight: 600;
}

.price-features {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.price-features li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13.5px;
  color: var(--ink-secondary);
}

.check-icon {
  color: var(--emerald);
  font-weight: 800;
  flex-shrink: 0;
}

.hover-callout {
  background: var(--navy-soft);
  border: 1px solid rgba(27,54,93,0.18);
  color: var(--navy);
  font-size: 12.5px;
  font-weight: 700;
  padding: 9px 11px;
  border-radius: 10px;
  margin-bottom: 14px;
}

.price-actions {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

/* Mobile Bottom Nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 45;
  height: var(--bottom-nav-h);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 6px 4px env(safe-area-inset-bottom, 6px);
}

.bnav-item {
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 10px;
  padding: 4px 2px;
  min-width: 0;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.bnav-item.active {
  color: var(--navy);
  background: var(--navy-soft);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(22, 26, 30, 0.56);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 440px;
  padding: 22px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

.modal-close {
  border: 0;
  background: var(--surface-alt);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
  color: var(--ink-secondary);
}

.billing-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
}

.billing-chip {
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 6px;
  background: var(--surface-alt);
  color: var(--ink-secondary);
  border: 1px solid var(--border);
}

/* Share link output box */
.share-url-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

/* Footer */
.app-footer {
  max-width: 1240px;
  margin: 28px auto 0;
  padding: 18px 16px 8px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  color: var(--ink-muted);
}

.footer-link-btn {
  background: none;
  border: 0;
  color: var(--navy);
  font-weight: 700;
  font-size: 12.5px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

/* Standalone /share/<id> mode */
body.share-mode .app-header,
body.share-mode .allowance-bar,
body.share-mode .bottom-nav,
body.share-mode .app-footer {
  display: none !important;
}

body.share-mode .app-main {
  max-width: 820px;
  padding: 20px 16px 40px;
}

/* Responsive Breakpoints */
@media (min-width: 768px) {
  .desktop-nav {
    display: flex;
  }
  .bottom-nav {
    display: none;
  }
  .app-main {
    padding: 28px 24px 48px;
  }
  .hero-title {
    font-size: 30px;
  }
  .studio-grid {
    grid-template-columns: 1.15fr 0.85fr;
    gap: 22px;
  }
  .wl-grid {
    grid-template-columns: 0.85fr 1.15fr;
    gap: 22px;
  }
  .pricing-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .lead-form-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1080px) {
  .pricing-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Blueprint Uploaded File Badge & 3-View Gallery */
.bp-file-bar {
  display: none;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--emerald-soft);
  border: 1px solid rgba(14, 90, 62, 0.22);
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  font-size: 12.5px;
  color: var(--emerald);
}
.bp-file-bar.show {
  display: flex;
}
.bp-file-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}
.bp-file-pill {
  background: var(--emerald);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 999px;
  flex-shrink: 0;
}
.bp-file-name {
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bp-pdf-nav {
  display: none;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.bp-pdf-nav.show {
  display: flex;
}
.bp-pdf-nav span {
  font-weight: 700;
  color: var(--ink-secondary);
  font-size: 12px;
  white-space: nowrap;
}

.bp-views-wrap {
  display: none;
  margin-top: 12px;
}
.bp-views-wrap.show {
  display: block;
}
.bp-views-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.bp-views-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}
.bp-view-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.bp-view-tab {
  flex: 1;
  padding: 7px 8px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink-secondary);
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}
.bp-view-tab.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.bp-views-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.bp-view-card {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid var(--border);
  background: var(--surface-alt);
  cursor: pointer;
  padding: 0;
  text-align: left;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.bp-view-card:hover {
  border-color: var(--navy);
}
.bp-view-card.active {
  border-color: var(--emerald);
  box-shadow: 0 0 0 2px rgba(14, 90, 62, 0.18);
}
.bp-view-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.bp-view-card-label {
  display: block;
  padding: 5px 7px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  background: var(--surface);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bp-view-card.active .bp-view-card-label {
  background: var(--emerald);
  color: #fff;
}
/* mobile ba-tag & bp-file-bar polish */
@media (max-width: 480px) {
  .bp-file-bar .bp-file-meta {
    flex: 1 1 100%;
  }
  .bp-file-bar .bp-pdf-nav {
    width: 100%;
    justify-content: space-between;
  }
  .ba-tag {
    font-size: 10px;
    padding: 3px 7px;
    max-width: 46%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* Mobile footer clearance above fixed bottom tab bar */
@media (max-width: 900px) {
  .app-footer { padding-bottom: 108px !important; }
}

/* Multi-page PDF scan summary chip & architectural fidelity badge */
.bp-scan-summary {
  display: none;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 10px;
  border-radius: 10px;
  background: rgba(14, 90, 62, 0.07);
  border: 1px solid rgba(14, 90, 62, 0.22);
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--ink);
}
.bp-scan-summary.show {
  display: flex;
}
.bp-scan-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--emerald);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.bp-scan-text {
  color: var(--ink-secondary);
  font-weight: 600;
  flex: 1 1 180px;
}
.bp-views-wrap.show {
  display: block !important;
}
.bp-views-header {
  flex-wrap: wrap;
}
.bp-fidelity-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(14, 90, 62, 0.1);
  color: var(--emerald);
  border: 1px solid rgba(14, 90, 62, 0.25);
  font-size: 11px;
  font-weight: 700;
}
.bp-view-card.disabled,
.bp-view-tab:disabled {
  opacity: 0.4;
  pointer-events: none;
}


/* --- Blueprint 3D Custom Material Pickers --- */
.bp-fidelity-row {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.bp-custom-materials {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.bp-custom-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.bp-custom-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.bp-custom-sub {
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: 2px;
  line-height: 1.35;
}

.bp-reset-btn {
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--navy);
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.bp-reset-btn:hover {
  background: #EEF2F8;
  border-color: var(--navy);
}

.bp-mat-group {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px dashed rgba(27, 54, 93, 0.1);
}

.bp-mat-group:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

/* --- White-Label Frosted Glass Lock Overlay --- */
.wl-stage-container {
  position: relative;
}

.wl-grid.wl-locked-blur {
  filter: blur(5px);
  -webkit-filter: blur(5px);
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  opacity: 0.84;
  transition: filter 0.25s ease, opacity 0.25s ease;
}

.wl-lock-overlay {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 25;
  padding: 28px 16px;
  background: linear-gradient(
    180deg,
    rgba(247, 248, 250, 0.42) 0%,
    rgba(247, 248, 250, 0.24) 55%,
    rgba(247, 248, 250, 0.48) 100%
  );
  border-radius: 18px;
  align-items: flex-start;
  justify-content: center;
}

.wl-lock-overlay.show {
  display: flex;
}

.wl-lock-card {
  position: sticky;
  top: 132px;
  width: 100%;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(27, 54, 93, 0.14);
  border-radius: 20px;
  padding: 26px 22px 22px;
  text-align: center;
  box-shadow: 0 22px 48px rgba(15, 23, 42, 0.16), 0 4px 14px rgba(15, 23, 42, 0.08);
}

.wl-lock-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  border-radius: 14px;
  background: linear-gradient(135deg, #1B365D 0%, #2D538A 100%);
  color: #FFFFFF;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 18px rgba(27, 54, 93, 0.24);
}

.wl-lock-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(27, 54, 93, 0.08);
  color: var(--navy);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.wl-lock-title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.wl-lock-desc {
  margin: 0 0 18px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-secondary);
}

.wl-lock-cta {
  padding: 13px 18px;
  font-size: 15px;
  font-weight: 700;
}

@media (max-width: 767px) {
  .wl-lock-overlay {
    padding: 18px 10px;
  }
  .wl-lock-card {
    top: 124px;
    padding: 22px 18px 18px;
  }
  .wl-lock-title {
    font-size: 18px;
  }
}

/* PlanSwatch Footer & Legal Modals */
.footer-domain-link {
  color: var(--navy);
  font-weight: 700;
  text-decoration: none;
}

.footer-domain-link:hover {
  text-decoration: underline;
  color: var(--terracotta);
}

.footer-links-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
}

.modal-card-wide {
  max-width: 540px;
}

.legal-body {
  max-height: 58vh;
  overflow-y: auto;
  padding-right: 4px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-secondary);
}

.legal-body p {
  margin: 0 0 10px;
}

.legal-body h4 {
  margin: 14px 0 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
}


/* === Account Pill, Auth Modal & Owner Stripe Setup === */
.account-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.account-pill-wrap {
  position: relative;
}

.account-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.account-pill:hover {
  border-color: var(--navy);
  box-shadow: 0 2px 10px rgba(19, 41, 61, 0.08);
}

.account-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--navy);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.account-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
  text-align: left;
}

.account-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  max-width: 112px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-plan-badge {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--terracotta);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.account-caret {
  font-size: 11px;
  color: var(--ink-muted);
}

.account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 230px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(19, 41, 61, 0.16);
  padding: 8px;
  z-index: 120;
  display: none;
}

.account-menu.open {
  display: block;
}

.account-menu-head {
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}

.account-menu-email {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--navy);
  word-break: break-all;
}

.account-menu-quota {
  font-size: 11.5px;
  color: var(--ink-muted);
  margin-top: 3px;
}

.account-menu-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-radius: 9px;
  padding: 9px 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  font-family: inherit;
}

.account-menu-item:hover {
  background: var(--surface-alt);
}

.account-menu-item.danger {
  color: #b42318;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: var(--surface-alt);
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 14px;
}

.auth-tab {
  border: none;
  background: transparent;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-muted);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}

.auth-tab.active {
  background: #ffffff;
  color: var(--navy);
  box-shadow: 0 2px 6px rgba(19, 41, 61, 0.08);
}

.owner-setup-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}

.owner-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.owner-card-title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 800;
  color: var(--navy);
}

.owner-card-sub {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--ink-muted);
}

.owner-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  background: rgba(19, 41, 61, 0.08);
  color: var(--navy);
  white-space: nowrap;
}

.owner-status-pill.active {
  background: var(--emerald-soft);
  color: var(--emerald);
}

.owner-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.modal-card {
  max-height: 90vh;
  overflow-y: auto;
}

.webhook-url-box {
  margin-top: 10px;
  padding: 10px 12px;
  background: #ffffff;
  border: 1px dashed var(--border-strong, #cbd5e1);
  border-radius: 10px;
  display: grid;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}

.webhook-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-secondary);
  line-height: 1.4;
}

.webhook-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.webhook-row code {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  color: var(--navy);
  background: var(--surface-alt);
  padding: 4px 6px;
  border-radius: 6px;
  word-break: break-all;
}

.webhook-row .btn {
  flex-shrink: 0;
}

.btn-xs {
  padding: 4px 9px;
  font-size: 11.5px;
  border-radius: 7px;
}

@media (max-width: 640px) {
  .owner-grid-2 {
    grid-template-columns: 1fr;
  }
  .account-controls #headerTrialBtn {
    display: none;
  }
  .account-name {
    max-width: 78px;
  }
}

/* Non-dismissible Studio Auth Gate */
body.auth-gate-open {
  overflow: hidden;
}
.modal-backdrop.auth-gate-locked {
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 80;
}
.auth-gate-card {
  max-width: 430px;
}

/* Account Menu Dividers, Legal Links & Native Mobile App Compliance */
.account-menu-divider {
  height: 1px;
  background: var(--border, #E2DDD2);
  margin: 5px 0;
}
.account-menu-link {
  display: block;
  text-decoration: none;
  color: inherit;
}
body.native-mobile-app .web-only-billing {
  display: none !important;
}

/* Mobile overflow guard for long PDF filenames & fidelity badges */
html, body {
  max-width: 100%;
  overflow-x: clip;
}
.pdf-bar, .bp-scan-summary, .bp-fidelity-row, .stage-card, .panel-card {
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.pdf-bar {
  flex-wrap: wrap;
}
.pdf-bar > *, .pdf-bar span, #bpPdfName, #bpFileName, .bp-scan-text, .bp-fidelity-badge {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.bp-fidelity-badge {
  white-space: normal;
  text-align: left;
  line-height: 1.3;
}


/* === PlanSwatch Upgraded Pickers (Exterior Accordions & Interior Room Focus) === */
.control-value.muted {
  color: var(--ink-muted, #6B7280);
  font-weight: 500;
}

.control-sublabel {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted, #6B7280);
  margin: 8px 0 5px;
}

.control-sublabel:first-child {
  margin-top: 2px;
}

.picker-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted, #6B7280);
  margin: 14px 0 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.picker-accordion {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  margin-bottom: 8px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.picker-accordion[open] {
  border-color: var(--border-strong);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.picker-accordion.customized {
  border-color: rgba(16, 122, 87, 0.45);
  background: rgba(16, 122, 87, 0.02);
}

.picker-accordion > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  cursor: pointer;
  user-select: none;
}

.picker-accordion > summary::-webkit-details-marker {
  display: none;
}

.picker-acc-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.picker-acc-chevron {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--ink-muted, #6B7280);
  transition: transform 0.16s ease;
}

.picker-accordion[open] .picker-acc-chevron {
  transform: rotate(90deg);
}

.picker-acc-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}

.picker-acc-val {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--emerald);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 55%;
}

.picker-acc-val.muted {
  color: var(--ink-muted, #6B7280);
  font-weight: 500;
}

.picker-acc-body {
  padding: 2px 12px 12px;
  border-top: 1px solid var(--border);
}

/* Interior Room Focus Segmented Pill Bar */
.room-focus-wrap {
  margin-bottom: 14px;
}

.room-focus-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 4px;
  background: var(--bg-subtle, #F3F4F6);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.room-focus-pill {
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-secondary);
  border-radius: 7px;
  padding: 8px 6px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: all 0.14s ease;
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.room-focus-pill:hover {
  color: var(--ink);
}

.room-focus-pill.active {
  background: var(--navy);
  color: #FFFFFF;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.14);
}

.int-room-panel {
  display: none;
}

.int-room-panel.active {
  display: block;
}

@media (max-width: 480px) {
  .room-focus-bar {
    gap: 5px;
    padding: 4px;
  }
  .room-focus-pill {
    font-size: 11.5px;
    padding: 8px 4px;
  }
  .picker-acc-val {
    max-width: 48%;
  }
}


/* ==========================================================================
   Native App & Mobile Studio Polish (Android 15 Edge-to-Edge + iOS Safe Area)
   ========================================================================== */

/* Sleek native-app top layout on mobile (<= 768px) and native app shells */
@media (max-width: 768px) {
  .allowance-bar {
    display: none !important;
  }

  .app-header {
    background: rgba(255, 255, 255, 0.97);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  }

  .header-inner {
    min-height: 52px;
    padding: 6px 14px;
    gap: 8px;
  }

  .brand {
    gap: 8px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 9px;
  }

  .brand-name {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.025em;
  }

  .brand-sub {
    display: none;
  }

  .account-pill {
    padding: 4px 10px 4px 5px;
    gap: 6px;
  }

  .account-avatar {
    width: 26px;
    height: 26px;
    font-size: 11px;
  }

  .app-main {
    padding: 12px 12px calc(var(--bottom-nav-h) + 28px);
  }

  /* Jump straight into studio cards on mobile: hide long marketing hero blocks */
  #view-photo .studio-hero,
  #view-interior .studio-hero,
  #view-blueprint .studio-hero,
  #view-whitelabel .studio-hero {
    display: none !important;
  }

  /* Keep a compact 1-line header on the Upgrade tab */
  #view-pricing .studio-hero {
    gap: 4px;
    margin-bottom: 12px;
  }

  #view-pricing .hero-eyebrow,
  #view-pricing .hero-desc {
    display: none !important;
  }

  #view-pricing .hero-title {
    font-size: 18px;
    line-height: 1.25;
  }

  .card {
    padding: 14px;
    border-radius: 16px;
  }

  .card-header {
    margin-bottom: 10px;
  }

  .upload-zone {
    padding: 14px 12px;
  }
}

/* Native app shell rules (Capacitor / Android WebView) regardless of viewport */
html.is-native-app .allowance-bar {
  display: none !important;
}

html.is-native-app #view-photo .studio-hero,
html.is-native-app #view-interior .studio-hero,
html.is-native-app #view-blueprint .studio-hero,
html.is-native-app #view-whitelabel .studio-hero {
  display: none !important;
}

html.is-native-app .brand-sub {
  display: none;
}

html.is-native-app .brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}

html.is-native-app .header-inner {
  min-height: 52px;
  padding: 6px 14px;
}

html.is-native-app .web-only-billing {
  display: none !important;
}

/* Android 15 Edge-to-Edge Safe-Area Clearance */
html.is-native-android .app-header {
  padding-top: max(env(safe-area-inset-top, 0px), 40px) !important;
  background: #ffffff;
}

html.is-native-android .bottom-nav {
  height: auto !important;
  padding: 6px 4px max(env(safe-area-inset-bottom, 0px), 54px) !important;
  background: #ffffff !important;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 -2px 10px rgba(15, 23, 42, 0.04);
}

html.is-native-android .bottom-nav .bnav-item {
  min-height: 50px;
}

html.is-native-android .app-main {
  padding-bottom: calc(140px + env(safe-area-inset-bottom, 0px)) !important;
}

html.is-native-android .modal-backdrop {
  padding-top: max(env(safe-area-inset-top, 0px), 44px);
  padding-bottom: max(env(safe-area-inset-bottom, 0px), 58px);
}

/* iOS Safe-Area Clearance */
html.is-native-ios .app-header {
  padding-top: env(safe-area-inset-top, 0px) !important;
}

html.is-native-ios .bottom-nav {
  height: auto !important;
  padding: 6px 4px max(env(safe-area-inset-bottom, 0px), 16px) !important;
  background: rgba(255, 255, 255, 0.98);
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

html.is-native-ios .bottom-nav .bnav-item {
  min-height: 50px;
}

html.is-native-ios .app-main {
  padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)) !important;
}

/* Permanent Mobile Overflow & Right-Edge Cutoff Protection */
html, body {
  max-width: 100%;
  overflow-x: clip;
}

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

.app-main,
.view-section,
.studio-grid,
.workspace-grid,
.studio-view,
.card,
.stage-wrap,
.ba-slider,
.picker-accordion,
.picker-acc-body,
.picker-accordion > summary,
.accordion,
.accordion-body,
.accordion-head,
.upload-zone,
.status-banner,
.status-box,
.control-group {
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

@media (max-width: 768px) {
  .card-header,
  .stage-head {
    flex-wrap: wrap;
    gap: 8px;
  }

  .card-header > div {
    min-width: 0;
    flex: 1 1 170px;
  }

  .picker-accordion > summary,
  .accordion-head {
    gap: 8px;
    width: 100%;
    min-width: 0;
  }

  .picker-acc-left {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
  }

  .picker-acc-title {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .picker-acc-val,
  .accordion-head .acc-val {
    min-width: 0;
    max-width: 44%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 1;
    text-align: right;
  }

  .control-label-row {
    flex-wrap: wrap;
    gap: 6px;
  }

  .control-value {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .pill-row,
  .swatch-grid,
  .chip-row,
  .upload-actions,
  .room-focus-bar {
    flex-wrap: wrap;
    max-width: 100%;
  }

  .choice-pill,
  .chip,
  .swatch-btn {
    max-width: 100%;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    text-align: left;
    line-height: 1.25;
  }

  .upload-actions .btn,
  .stage-actions .btn,
  .card-header .btn {
    max-width: 100%;
    white-space: normal;
    word-break: break-word;
  }

  .status-banner,
  .status-box,
  .render-note,
  .upload-hint {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
  }
}

/* Save HD Image Modal (Mobile WebView & Direct Download Sheet) */
.save-hd-card {
  max-width: 440px;
  width: 100%;
  padding: 18px;
  box-sizing: border-box;
}
.save-hd-preview-wrap {
  width: 100%;
  background: #0f172a;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  max-height: 46vh;
}
.save-hd-preview-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 46vh;
  object-fit: contain;
  -webkit-touch-callout: default;
  user-select: auto;
}
.save-hd-caption {
  margin: 10px 0 12px;
  font-size: 12.5px;
  color: var(--ink-muted);
  text-align: center;
  line-height: 1.4;
}
.save-hd-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.save-hd-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  text-decoration: none;
  text-align: center;
  padding: 12px 16px;
  font-size: 14.5px;
  font-weight: 700;
  box-sizing: border-box;
}
.save-hd-secondary-row {
  display: flex;
  gap: 8px;
  width: 100%;
}
.save-hd-btn-secondary {
  flex: 1 1 auto;
  min-width: 0;
  justify-content: center;
}
.save-hd-btn-close {
  flex: 0 0 auto;
  min-width: 82px;
  justify-content: center;
}

/* Device Limit Confirmation Modal */
.modal-backdrop.device-limit-backdrop {
  z-index: 95;
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.device-limit-card {
  max-width: 440px;
  width: 100%;
  box-sizing: border-box;
}
.device-limit-badge {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(13, 148, 136, 0.12);
  color: var(--teal, #0D9488);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}
.device-limit-message {
  margin: 4px 0 14px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-secondary, #334155);
  word-wrap: break-word;
}
.device-limit-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 14px;
}
@media (max-width: 480px) {
  .device-limit-card {
    padding: 18px 16px;
  }
  .device-limit-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .device-limit-actions .btn {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
}

/* ============================================================
   ONE-TIME RENDER CREDIT TOP-UP PACKS
   ============================================================ */

/* Low-renders banner */
.low-renders-banner {
  display: none;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: #fff8e6;
  border: 1.5px solid #f5a623;
  border-radius: 10px;
  padding: 10px 14px;
  margin: 0 0 14px 0;
  font-size: 0.875rem;
  color: #6b4a00;
}
.low-renders-banner[style*="display: "]:not([style*="none"]),
.low-renders-banner:not([style*="display"]) {
  display: flex;
}
.low-renders-dismiss {
  margin-left: auto;
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: #6b4a00;
  padding: 0 4px;
  line-height: 1;
  opacity: 0.6;
}
.low-renders-dismiss:hover { opacity: 1; }
.btn-topup-cta {
  background: #f5a623;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.btn-topup-cta:hover { background: #e09410; }

/* Bonus credits badge in allowance bar */
.bonus-credits-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #e8f4e8;
  color: #2a6a2a;
  border: 1px solid #b6d9b6;
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 6px;
}
.bonus-credits-badge::before { content: "🎁 "; }
.account-menu-bonus {
  font-size: 0.75rem;
  color: #2a6a2a;
  font-weight: 600;
  margin-top: 2px;
}
.account-menu-bonus::before { content: "🎁 "; }

/* Top-up section */
.topup-section {
  margin-top: 32px;
  padding: 28px 0 8px;
  border-top: 2px solid #e8ecf0;
}
.topup-header {
  text-align: center;
  margin-bottom: 20px;
}
.topup-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0d1f2d;
  margin: 0 0 6px;
}
.topup-sub {
  font-size: 0.875rem;
  color: #5a6a7a;
  margin: 0;
}
.topup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  max-width: 580px;
  margin: 0 auto;
}
.topup-card {
  position: relative;
  background: #fff;
  border: 1.5px solid #d8e2ec;
  border-radius: 14px;
  padding: 18px 16px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.topup-card.featured {
  border-color: #162E4E;
  box-shadow: 0 2px 10px rgba(22,46,78,0.10);
}
.topup-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: #162E4E;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 20px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.topup-renders {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0d1f2d;
}
.topup-price {
  font-size: 1.75rem;
  font-weight: 800;
  color: #162E4E;
  line-height: 1;
}
.topup-rate {
  font-size: 0.75rem;
  color: #7a8a9a;
}
.topup-note {
  text-align: center;
  font-size: 0.78rem;
  color: #7a8a9a;
  margin-top: 14px;
}

/* Mobile */
@media (max-width: 430px) {
  .topup-grid {
    grid-template-columns: 1fr;
    max-width: 340px;
  }
  .topup-card { padding: 14px 12px 12px; }
  .topup-price { font-size: 1.5rem; }
}

/* Desktop monitor fit: keep Exterior & Interior before/after previews sized so the full house + buttons fit on screen without scrolling */
@media (min-width: 1024px) {
  .studio-shell {
    max-width: 1560px;
    padding: 8px 24px 12px;
  }
  #view-photo .studio-hero,
  #view-interior .studio-hero,
  #view-blueprint .studio-hero {
    margin: 0 0 8px 0;
    padding: 0;
  }
  #view-photo .studio-hero .hero-eyebrow,
  #view-interior .studio-hero .hero-eyebrow,
  #view-blueprint .studio-hero .hero-eyebrow,
  #view-photo .studio-hero .hero-desc,
  #view-interior .studio-hero .hero-desc,
  #view-blueprint .studio-hero .hero-desc {
    display: none;
  }
  #view-photo .studio-hero .hero-title,
  #view-interior .studio-hero .hero-title,
  #view-blueprint .studio-hero .hero-title {
    font-size: 18px;
    margin: 0;
    line-height: 1.2;
  }
  #view-photo .studio-grid,
  #view-interior .studio-grid,
  #view-blueprint .studio-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.38fr) minmax(380px, 0.82fr);
    gap: 18px;
    align-items: start;
  }
  #view-photo .studio-grid > .card,
  #view-interior .studio-grid > .card,
  #view-blueprint .studio-grid > .card {
    height: auto;
    max-height: none;
    overflow: visible;
    overscroll-behavior: auto;
  }
  #view-photo .studio-grid > .card:first-child,
  #view-interior .studio-grid > .card:first-child,
  #view-blueprint .studio-grid > .card:first-child {
    position: sticky;
    top: 12px;
  }
  #view-photo .studio-grid > .card::-webkit-scrollbar,
  #view-interior .studio-grid > .card::-webkit-scrollbar,
  #view-blueprint .studio-grid > .card::-webkit-scrollbar {
    width: 8px;
  }
  #view-photo .studio-grid > .card::-webkit-scrollbar-track,
  #view-interior .studio-grid > .card::-webkit-scrollbar-track,
  #view-blueprint .studio-grid > .card::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.05);
    border-radius: 999px;
  }
  #view-photo .studio-grid > .card::-webkit-scrollbar-thumb,
  #view-interior .studio-grid > .card::-webkit-scrollbar-thumb,
  #view-blueprint .studio-grid > .card::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, 0.30);
    border-radius: 999px;
  }
  #view-photo .studio-grid > .card:first-child,
  #view-interior .studio-grid > .card:first-child,
  #view-blueprint .studio-grid > .card:first-child {
    padding: 12px 16px 18px;
  }
  #view-photo .studio-grid > .card:first-child .card-head,
  #view-interior .studio-grid > .card:first-child .card-head,
  #view-blueprint .studio-grid > .card:first-child .card-head {
    margin-bottom: 8px;
  }
  #photoStageWrap,
  #intStageWrap,
  #bpStageWrap {
    width: min(100%, calc(56vh * 4 / 3));
    max-width: 100%;
    aspect-ratio: 4 / 3;
    max-height: 56vh;
    margin-left: auto;
    margin-right: auto;
  }
  #view-photo .stage-actions,
  #view-interior .stage-actions,
  #view-blueprint .stage-actions {
    margin-top: 8px;
    gap: 8px;
  }
  #view-photo .upload-drop,
  #view-interior .upload-drop,
  #view-blueprint .upload-drop {
    margin-top: 8px;
    padding: 8px 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    text-align: left;
  }
  #view-photo .upload-drop .upload-title,
  #view-interior .upload-drop .upload-title,
  #view-blueprint .upload-drop .upload-title {
    margin: 0;
    font-size: 13px;
  }
  #view-photo .upload-drop .upload-actions,
  #view-interior .upload-drop .upload-actions,
  #view-blueprint .upload-drop .upload-actions {
    margin: 0;
    gap: 8px;
  }
  #view-photo .upload-drop .upload-hint,
  #view-interior .upload-drop .upload-hint,
  #view-blueprint .upload-drop .upload-hint {
    display: none;
  }
  #view-photo .studio-grid > .card:last-child,
  #view-interior .studio-grid > .card:last-child,
  #view-blueprint .studio-grid > .card:last-child {
    padding: 14px 18px 24px;
  }
}

/* === Desktop Website Only Contractor Features (Window Shutters, Window Trim & Casing, Stone & Brick Veneer, Highlight Area Brush) === */
@media (max-width: 1023px) {
  .desktop-only-feature {
    display: none !important;
  }
}
html.is-capacitor-app .desktop-only-feature,
body.is-capacitor-app .desktop-only-feature {
  display: none !important;
}

.card-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

#btnTogglePhotoBrush.active {
  background: #1B365D;
  color: #FFFFFF;
  border-color: #1B365D;
  box-shadow: 0 2px 8px rgba(27, 54, 93, 0.22);
}

.ba-slider.brush-paused {
  pointer-events: none;
  cursor: crosshair;
}
.ba-slider.brush-paused .ba-divider,
.ba-slider.brush-paused .ba-handle,
.ba-slider.brush-paused .ba-tag-after {
  opacity: 0;
  pointer-events: none;
}

.photo-brush-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 6;
  pointer-events: none;
  touch-action: none;
  display: block;
}
.photo-brush-canvas.active {
  pointer-events: auto;
  cursor: crosshair;
}

.photo-brush-locked-outline {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  border: 2px dashed rgba(219, 39, 119, 0.92);
  background: rgba(219, 39, 119, 0.10);
  border-radius: 6px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.65);
}

.photo-brush-locked-badge {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 8;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.88);
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.28);
  border: 1px dashed rgba(244, 114, 182, 0.85);
}

.photo-brush-badge-btn {
  appearance: none;
  border: none;
  background: rgba(255, 255, 255, 0.16);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  cursor: pointer;
}
.photo-brush-badge-btn:hover {
  background: rgba(255, 255, 255, 0.28);
}

.photo-brush-bar {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.photo-brush-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.photo-brush-row-apply {
  justify-content: flex-start;
}

.photo-brush-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.photo-brush-label {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  white-space: nowrap;
}

.photo-brush-size-pill {
  appearance: none;
  border: 1px solid #CBD5E1;
  background: #FFFFFF;
  color: #1E293B;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.photo-brush-size-pill:hover {
  border-color: #1B365D;
}
.photo-brush-size-pill.active {
  background: #1B365D;
  color: #FFFFFF;
  border-color: #1B365D;
}

.photo-brush-select {
  flex: 1;
  min-width: 220px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #CBD5E1;
  background: #FFFFFF;
  color: #0F172A;
  font-size: 12.5px;
  font-weight: 600;
}

.photo-brush-note {
  width: 100%;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid #CBD5E1;
  background: #FFFFFF;
  color: #0F172A;
  font-size: 12.5px;
  user-select: text !important;
  -webkit-user-select: text !important;
}
.photo-brush-note:focus,
.photo-brush-select:focus {
  outline: none;
  border-color: #1B365D;
  box-shadow: 0 0 0 2px rgba(27, 54, 93, 0.14);
}

/* === STAGING PREVIEW BUILD BADGE === */
.preview-build-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.16);
  color: #B45309;
  border: 1px solid rgba(245, 158, 11, 0.45);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  vertical-align: middle;
  line-height: 1.3;
  white-space: nowrap;
}

/* === ZOOMABLE MULTI-ZONE HIGHLIGHT BRUSH (MOBILE + DESKTOP) === */
.photo-zoom-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  transform-origin: 0 0;
  will-change: transform;
}

.photo-brush-canvas.active.pan-mode {
  cursor: grab;
}
.photo-brush-canvas.active.pan-mode.is-panning {
  cursor: grabbing;
}

.photo-brush-locked-outlines {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.photo-brush-locked-zone-box {
  position: absolute;
  border-radius: 6px;
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.photo-brush-locked-zone-tag {
  position: absolute;
  top: -10px;
  left: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.4;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.32);
}

.photo-brush-row-zoom {
  padding-bottom: 6px;
  border-bottom: 1px solid #E2E8F0;
}

.photo-zoom-controls {
  gap: 5px;
}

.photo-brush-tool-btn {
  appearance: none;
  border: 1px solid #CBD5E1;
  background: #FFFFFF;
  color: #0F172A;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 9px;
  border-radius: 8px;
  cursor: pointer;
  line-height: 1.2;
  min-height: 32px;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.photo-brush-tool-btn:hover {
  border-color: #1B365D;
  background: #F1F5F9;
}
.photo-brush-tool-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.photo-zoom-readout {
  font-size: 12px;
  font-weight: 800;
  color: #1B365D;
  min-width: 38px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.photo-mode-toggle {
  background: #E2E8F0;
  padding: 2px;
  border-radius: 9px;
  gap: 2px;
}

.photo-brush-mode-pill {
  appearance: none;
  border: none;
  background: transparent;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 7px;
  cursor: pointer;
  min-height: 28px;
  transition: background 0.15s ease, color 0.15s ease;
}
.photo-brush-mode-pill.active {
  background: #1B365D;
  color: #FFFFFF;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.18);
}

.photo-brush-zones-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.photo-zone-pill {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 6px;
  border-radius: 9px;
  border: 1.5px solid #CBD5E1;
  background: #FFFFFF;
  color: #1E293B;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  min-width: 0;
}
.photo-zone-pill:hover {
  border-color: #94A3B8;
}
.photo-zone-pill.active {
  background: #F8FAFC;
  box-shadow: 0 0 0 2px rgba(27, 54, 93, 0.14);
}

.photo-zone-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.15);
}

.photo-zone-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 800;
  color: #FFFFFF;
  flex-shrink: 0;
}

.zone-pill-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  margin-left: 1px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  color: #475569;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.14s ease, color 0.14s ease;
}
.zone-pill-clear:hover {
  background: #EF4444;
  color: #FFFFFF;
}

.photo-brush-zone-config {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 10px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
}

.photo-brush-color-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.photo-brush-swatch-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.photo-brush-swatch-chip {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid #CBD5E1;
  background: #F8FAFC;
  color: #1E293B;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.photo-brush-swatch-chip:hover {
  border-color: #1B365D;
}
.photo-brush-swatch-chip.active {
  background: #1B365D;
  color: #FFFFFF;
  border-color: #1B365D;
}
.photo-brush-swatch-chip .swatch-dot {
  width: 11px;
  height: 11px;
}
.photo-brush-more-chip {
  border-style: dashed;
  font-weight: 700;
  color: #1B365D;
  background: rgba(27, 54, 93, 0.05);
}
.photo-brush-more-chip:hover {
  background: rgba(27, 54, 93, 0.11);
}

.bp-columns-acc {
  margin-bottom: 12px;
}

@media (max-width: 640px) {
  .photo-brush-zones-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .photo-brush-select {
    min-width: 0;
    width: 100%;
  }
  .photo-brush-bar {
    padding: 9px;
  }
  .card-header-actions {
    gap: 6px;
  }
  .card-header-actions .btn-sm {
    padding: 6px 9px;
    font-size: 12px;
  }
}


/* === FIX 1, 2 & 4: COMPACT BRUSH STRIP + CUSTOM ZONES IN EXTERIOR FINISHES + SMOOTH PAN === */
.stage-wrap.brush-active {
  touch-action: none;
}

.photo-brush-canvas.active.is-panning {
  cursor: grabbing !important;
}

.photo-brush-strip {
  margin-top: 8px;
  padding: 7px 10px;
  gap: 5px;
  border-radius: 10px;
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
}

.photo-brush-strip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
}

.photo-brush-strip .photo-brush-group {
  gap: 4px;
  flex-wrap: nowrap;
}

.photo-brush-strip .photo-brush-tool-btn {
  padding: 4px 7px;
  font-size: 11.5px;
  min-height: 28px;
}

.photo-brush-strip .photo-zoom-readout {
  min-width: 34px;
  font-size: 11.5px;
}

.photo-brush-strip .photo-brush-mode-pill {
  padding: 4px 8px;
  font-size: 11.5px;
  min-height: 26px;
}

.photo-brush-strip .photo-brush-size-pill {
  padding: 3px 8px;
  font-size: 11.5px;
  min-height: 26px;
}

.photo-brush-strip .photo-brush-actions .btn-sm {
  padding: 4px 8px;
  font-size: 11.5px;
  min-height: 28px;
}

.photo-brush-pan-hint {
  font-size: 11.5px;
  font-weight: 600;
  color: #475569;
  line-height: 1.3;
  padding-top: 3px;
  border-top: 1px solid #E2E8F0;
}

/* Custom Zones accordion card at top of Exterior Finishes */
.custom-zones-card {
  margin-bottom: 14px;
  border: 1.5px solid rgba(27, 54, 93, 0.22);
  background: linear-gradient(180deg, #F8FAFC 0%, #FFFFFF 100%);
}

.custom-zones-card[open],
.custom-zones-card.active-painting {
  border-color: #1B365D;
  box-shadow: 0 3px 12px rgba(27, 54, 93, 0.08);
}

.custom-zones-body {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.custom-zones-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.custom-zones-desc {
  font-size: 12px;
  color: #475569;
  line-height: 1.35;
  flex: 1 1 160px;
}

.custom-zones-card .photo-brush-select {
  min-width: 0;
  width: 100%;
}

.custom-zones-card .photo-brush-zones-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.custom-zones-card .photo-zone-pill {
  padding: 6px 4px;
  font-size: 11.5px;
  gap: 4px;
}

@media (max-width: 640px) {
  .custom-zones-card .photo-brush-zones-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .photo-brush-strip-row {
    gap: 5px;
  }
  .photo-brush-strip .photo-brush-group {
    max-width: 100%;
    flex-wrap: wrap;
  }
}

select optgroup {
  font-weight: 800;
  color: #0f172a;
  background: #f1f5f9;
}
select option {
  font-weight: 500;
  color: #1e293b;
  background: #ffffff;
}

/* Continue with Google (Web-Only — hidden on native iOS/Android WebView) */
html.is-native-app:not(.has-apple-signin) .web-only-google,
html.is-capacitor-app:not(.has-apple-signin) .web-only-google {
  display: none !important;
}
.btn-google-auth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.btn-google-auth:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}
.auth-or-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}
.auth-or-divider::before,
.auth-or-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

/* PlanSwatch 1.1.0 — Sign in with Apple + Native IAP Paywall */
.btn-apple-auth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid #000000;
  background: #000000;
  color: #ffffff;
  font-size: 14.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.1s ease;
}
.btn-apple-auth:hover { opacity: 0.92; }
.btn-apple-auth:active { transform: scale(0.99); }

html.has-native-iap.is-native-ios .iap-web-only {
  display: none !important;
}
html.has-native-iap.is-native-ios .iap-monthly-only-ios .monthly-upsell-link,
html.has-native-iap.is-native-ios .iap-monthly-only-ios .annual-savings-pill {
  display: none !important;
}

.native-iap-legal {
  margin: 24px auto 8px;
  padding: 18px 16px;
  max-width: 680px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  text-align: center;
}
.native-iap-restore-row {
  margin-bottom: 12px;
}
.native-iap-disclosure {
  font-size: 11.5px;
  line-height: 1.5;
  color: #64748b;
  margin: 0 0 10px;
}
.native-iap-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 12.5px;
  font-weight: 600;
}
.native-iap-links a {
  color: #162e4e;
  text-decoration: underline;
}

/* === In-App Feature Request / Feedback Modal === */
.app-fb-form {
  display: flex;
  flex-direction: column;
  gap: 13px;
  margin-top: 12px;
}

.app-fb-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.app-fb-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
}

.app-fb-opt {
  font-weight: 500;
  color: var(--ink-muted);
}

.app-fb-select,
.app-fb-input,
.app-fb-textarea {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.app-fb-select:focus,
.app-fb-input:focus,
.app-fb-textarea:focus {
  background: var(--surface);
  border-color: var(--terracotta);
  box-shadow: 0 0 0 3px var(--terracotta-soft);
}

.app-fb-textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.5;
}

.app-fb-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.app-fb-success {
  display: none;
  text-align: center;
  padding: 14px 6px 4px;
}

.app-fb-success.show {
  display: block;
}

.app-fb-success-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--emerald-soft);
  color: var(--emerald);
  font-size: 22px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.app-fb-success-title {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 700;
  color: var(--navy);
}

.app-fb-success-desc {
  margin: 0 0 16px;
  font-size: 13.5px;
  color: var(--ink-secondary);
  line-height: 1.5;
}

.app-fb-success-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.ps-tour-feedback-link {
  background: none;
  border: none;
  padding: 4px 6px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--terracotta);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ps-tour-feedback-link:hover {
  color: var(--terracotta-hover);
}


/* === Settings Menu Toggle Switch & Floating Toast === */
.account-menu-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.account-menu-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ps-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: var(--border-strong);
  transition: background 0.18s ease;
  flex-shrink: 0;
}

.ps-switch-knob {
  position: absolute;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.18s ease;
}

.account-menu-toggle[aria-checked="true"] .ps-switch {
  background: var(--navy);
}

.account-menu-toggle[aria-checked="true"] .ps-switch-knob {
  transform: translateX(16px);
}

.ps-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(16px);
  z-index: 9999;
  background: #13293D;
  color: #FFFFFF;
  font-size: 13.5px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: calc(100vw - 32px);
  text-align: center;
  white-space: nowrap;
}

.ps-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 768px) {
  .ps-toast {
    bottom: calc(var(--bottom-nav-h, 68px) + 18px + env(safe-area-inset-bottom, 0px));
  }
}

/* === PlanSwatch Dark Mode (scoped strictly to data-theme="dark") === */
:root[data-theme="dark"] {
  --bg: #0E1318;
  --surface: #161D24;
  --surface-alt: #1E2732;
  --ink: #F1F5F9;
  --ink-secondary: #CBD5E1;
  --ink-muted: #94A3B8;
  --border: #2A3644;
  --border-strong: #3C4D61;
  --emerald: #34D399;
  --emerald-hover: #10B981;
  --emerald-soft: rgba(16, 185, 129, 0.16);
  --navy: #60A5FA;
  --navy-hover: #3B82F6;
  --navy-soft: rgba(59, 130, 246, 0.16);
  --terracotta: #E8876C;
  --terracotta-hover: #DC7155;
  --terracotta-soft: rgba(232, 135, 108, 0.16);
  --gold: #E5B567;
  --gold-soft: rgba(229, 181, 103, 0.16);
  --amber: #FBBF24;
  --amber-soft: rgba(251, 191, 36, 0.16);
  --danger: #F87171;
  --danger-soft: rgba(248, 113, 113, 0.16);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.38), 0 1px 2px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.48);
  --shadow-lg: 0 18px 42px rgba(0, 0, 0, 0.62);
}

html[data-theme="dark"] .app-header,
html[data-theme="dark"].is-native-android .app-header,
html[data-theme="dark"].is-native-ios .app-header {
  background: rgba(18, 24, 31, 0.96) !important;
  border-bottom-color: var(--border);
}

html[data-theme="dark"] .allowance-bar {
  background: #132234;
  color: #F1F5F9;
  border-bottom-color: #243548;
}

html[data-theme="dark"] .tier-select option,
html[data-theme="dark"] select option {
  background: #161D24;
  color: #F1F5F9;
}

html[data-theme="dark"] select optgroup {
  background: #1E2732;
  color: #CBD5E1;
}

html[data-theme="dark"] .btn-primary,
html[data-theme="dark"] .btn-navy,
html[data-theme="dark"] .choice-pill.active,
html[data-theme="dark"] .bp-view-tab.active,
html[data-theme="dark"] .room-focus-pill.active,
html[data-theme="dark"] .price-badge.navy,
html[data-theme="dark"] .account-avatar {
  background: #2563EB;
  color: #FFFFFF;
}

html[data-theme="dark"] .btn-primary:hover:not(:disabled),
html[data-theme="dark"] .btn-navy:hover:not(:disabled) {
  background: #1D4ED8;
}

html[data-theme="dark"] .btn-soft {
  background: rgba(16, 185, 129, 0.16);
  color: #34D399;
  border-color: rgba(52, 211, 153, 0.3);
}

html[data-theme="dark"] .btn-soft:hover:not(:disabled) {
  background: rgba(16, 185, 129, 0.25);
}

html[data-theme="dark"] .price-badge,
html[data-theme="dark"] .bp-file-pill,
html[data-theme="dark"] .bp-scan-badge,
html[data-theme="dark"] .bp-view-card.active .bp-view-card-label {
  background: #059669;
  color: #FFFFFF;
}

html[data-theme="dark"] .account-pill,
html[data-theme="dark"] .account-menu,
html[data-theme="dark"] .auth-tab.active,
html[data-theme="dark"] .webhook-url-box,
html[data-theme="dark"] .topup-card {
  background: var(--surface);
  border-color: var(--border);
  color: var(--ink);
}

html[data-theme="dark"] .account-menu {
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.65);
}

html[data-theme="dark"] .account-menu-item.danger {
  color: #F87171;
}

html[data-theme="dark"] .account-menu-toggle[aria-checked="true"] .ps-switch {
  background: #2563EB;
}

html[data-theme="dark"] .bottom-nav,
html[data-theme="dark"].is-native-android .bottom-nav,
html[data-theme="dark"].is-native-ios .bottom-nav {
  background: rgba(18, 24, 31, 0.97) !important;
  border-top-color: var(--border);
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background-color: var(--surface-alt);
  color: var(--ink);
  border-color: var(--border-strong);
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: var(--ink-muted);
}

html[data-theme="dark"] .modal-backdrop {
  background: rgba(4, 8, 14, 0.72);
}

html[data-theme="dark"] .modal-close {
  background: var(--surface-alt);
  color: var(--ink-secondary);
  border-color: var(--border);
}

html[data-theme="dark"] .modal-close:hover {
  background: var(--border);
  color: var(--ink);
}

html[data-theme="dark"] .status-banner.info {
  background: var(--navy-soft);
  color: #93C5FD;
  border-color: rgba(96, 165, 250, 0.3);
}

html[data-theme="dark"] .status-banner.success {
  background: var(--emerald-soft);
  color: #34D399;
  border-color: rgba(52, 211, 153, 0.3);
}

html[data-theme="dark"] .status-banner.error {
  background: var(--danger-soft);
  color: #FCA5A5;
  border-color: rgba(248, 113, 113, 0.3);
}

html[data-theme="dark"] .wl-lock-card {
  background: rgba(22, 29, 36, 0.94);
  border-color: var(--border);
}

html[data-theme="dark"] .bp-reset-btn:hover {
  background: var(--surface-alt);
}

html[data-theme="dark"] .low-renders-banner {
  background: rgba(245, 166, 35, 0.14);
  border-color: rgba(245, 166, 35, 0.35);
  color: #FDE68A;
}

html[data-theme="dark"] .bonus-credits-badge {
  background: rgba(16, 185, 129, 0.2);
  color: #6EE7B7;
  border-color: rgba(52, 211, 153, 0.35);
}

html[data-theme="dark"] .photo-brush-bar,
html[data-theme="dark"] .photo-brush-swatch-chip,
html[data-theme="dark"] .photo-brush-strip,
html[data-theme="dark"] .native-iap-legal {
  background: var(--surface-alt);
  border-color: var(--border);
  color: var(--ink);
}

html[data-theme="dark"] .photo-brush-size-pill,
html[data-theme="dark"] .photo-brush-select,
html[data-theme="dark"] .photo-brush-note,
html[data-theme="dark"] .photo-brush-tool-btn,
html[data-theme="dark"] .photo-zone-pill,
html[data-theme="dark"] .photo-brush-zone-config {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--ink);
}

html[data-theme="dark"] .photo-brush-tool-btn:hover,
html[data-theme="dark"] .photo-zone-pill.active {
  background: #253140;
}

html[data-theme="dark"] .photo-mode-toggle {
  background: #1B2430;
}

html[data-theme="dark"] .btn-google-auth {
  background: var(--surface-alt);
  color: var(--ink);
  border-color: var(--border-strong);
}

html[data-theme="dark"] .btn-google-auth:hover {
  background: #263241;
}

html[data-theme="dark"] .auth-or-divider::before,
html[data-theme="dark"] .auth-or-divider::after {
  background: var(--border);
}

html[data-theme="dark"] .ps-guide-btn {
  background: var(--surface-alt);
  color: var(--ink);
  border-color: var(--border-strong);
}

html[data-theme="dark"] .ps-guide-btn:hover {
  background: #263241;
  border-color: var(--navy);
}

html[data-theme="dark"] .ps-tour-card {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
}

html[data-theme="dark"] .ps-tour-title {
  color: var(--ink);
}

html[data-theme="dark"] .ps-tour-desc {
  color: var(--ink-secondary);
}

html[data-theme="dark"] .ps-tour-desc strong {
  color: var(--ink);
}

html[data-theme="dark"] .ps-tour-callout,
html[data-theme="dark"] .ps-tour-footer {
  background: var(--surface-alt);
  border-color: var(--border);
  color: var(--ink-secondary);
}

html[data-theme="dark"] .ps-tour-btn-back {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border-strong);
}

html[data-theme="dark"] .ps-tour-btn-back:hover:not(:disabled) {
  background: #263241;
}

html[data-theme="dark"] .ps-toast {
  background: #2563EB;
  color: #FFFFFF;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
}

html[data-theme="dark"] .custom-zones-card {
  background: linear-gradient(180deg, #1E2732 0%, #161D24 100%);
  border-color: var(--border-strong);
  color: var(--ink);
}

html[data-theme="dark"] .custom-zones-card[open],
html[data-theme="dark"] .custom-zones-card.active-painting {
  border-color: var(--navy);
  box-shadow: 0 3px 12px rgba(37, 99, 235, 0.22);
}

html[data-theme="dark"] .custom-zones-desc {
  color: var(--ink-secondary);
}

html[data-theme="dark"] .price-card.unlimited {
  background: linear-gradient(180deg, #1B2635 0%, #161D24 100%);
  border-color: var(--border-strong);
}

html[data-theme="dark"] .stage-empty {
  background: linear-gradient(160deg, #1A222B 0%, #121820 100%);
  color: var(--ink-secondary);
}

/* ==========================================================================
   Share PlanSwatch Modal (Light & Dark Mode)
   ========================================================================== */
.share-app-card {
  padding: 22px 22px 20px;
}

.share-app-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

.share-app-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  box-sizing: border-box;
  font-family: inherit;
  line-height: 1.2;
}

.share-app-btn:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
  background: var(--surface);
}

.share-app-btn:active {
  transform: translateY(0);
}

.share-app-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.share-app-whatsapp {
  background: #16A34A;
  border-color: #16A34A;
  color: #FFFFFF;
}

.share-app-whatsapp:hover {
  background: #15803D;
  border-color: #15803D;
  color: #FFFFFF;
}

.share-app-sms {
  background: #2563EB;
  border-color: #2563EB;
  color: #FFFFFF;
}

.share-app-sms:hover {
  background: #1D4ED8;
  border-color: #1D4ED8;
  color: #FFFFFF;
}

.share-app-email {
  background: var(--surface-alt);
  border-color: var(--border-strong);
  color: var(--ink);
}

.share-app-email:hover {
  background: #E2E8F0;
  border-color: var(--border-strong);
  color: var(--ink);
}

.share-app-copy {
  background: var(--surface-alt);
  border-color: var(--border-strong);
  color: var(--ink);
}

.share-app-copy:hover {
  background: #E2E8F0;
  border-color: var(--border-strong);
  color: var(--ink);
}

.share-app-copy.copied {
  background: #0F766E;
  border-color: #0F766E;
  color: #FFFFFF;
}

.share-app-url-box {
  margin-top: 14px;
}

.share-app-url-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface-alt);
  color: var(--ink-secondary);
  font-size: 13.5px;
  font-weight: 600;
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  outline: none;
}

.share-app-url-input:focus {
  border-color: var(--navy);
  color: var(--ink);
}

html[data-theme="dark"] .share-app-email,
html[data-theme="dark"] .share-app-copy {
  background: #1E293B;
  border-color: #334155;
  color: #F8FAFC;
}

html[data-theme="dark"] .share-app-email:hover,
html[data-theme="dark"] .share-app-copy:hover {
  background: #283548;
  border-color: #475569;
  color: #FFFFFF;
}

html[data-theme="dark"] .share-app-copy.copied {
  background: #0D9488;
  border-color: #0D9488;
  color: #FFFFFF;
}

html[data-theme="dark"] .share-app-url-input {
  background: #0F172A;
  border-color: #334155;
  color: #CBD5E1;
}

html[data-theme="dark"] .share-app-url-input:focus {
  border-color: #60A5FA;
  color: #F8FAFC;
}

/* Plan exclusion rows */
.price-features li.is-excluded { color: var(--ink-muted, #64748b); opacity: 0.85; }
.exclude-icon { color: #94a3b8; font-weight: 700; flex-shrink: 0; }

/* Start Over button & Any Space / Custom auto-detect bar */
.btn-start-over {
  background: var(--surface-alt, #f1f5f9);
  color: var(--ink, #0f172a);
  border: 1px solid var(--border-strong, #cbd5e1);
  font-weight: 600;
}
.btn-start-over:hover {
  background: var(--border, #e2e8f0);
}
.custom-detect-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  margin-bottom: 10px;
  border-radius: 10px;
  background: var(--emerald-soft, rgba(14,90,62,0.08));
  border: 1px solid rgba(14,90,62,0.18);
  font-size: 12.5px;
  color: var(--emerald, #0e5a3e);
  line-height: 1.35;
}
.detected-pill {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  background: var(--emerald-soft, rgba(14,90,62,0.12));
  color: var(--emerald, #0e5a3e);
  vertical-align: middle;
}
.custom-note-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-strong, #cbd5e1);
  background: var(--surface, #fff);
  color: var(--ink, #0f172a);
  font-size: 13.5px;
  font-family: inherit;
}
.custom-note-input:focus {
  outline: none;
  border-color: var(--navy, #1b365d);
}

.room-focus-pill-custom {
  grid-column: 1 / -1;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  margin-top: 2px;
}

/* --- Free / Trial Download Lock (Web Only) --- */
.is-download-locked {
  opacity: 0.92;
  border-style: dashed;
}
.ps-protected-img {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
}
.dl-upgrade-card {
  max-width: 460px;
  width: calc(100% - 28px);
}
.dl-upgrade-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: rgba(217, 119, 6, 0.12);
  color: #b45309;
  margin-bottom: 6px;
}
.dl-upgrade-banner {
  background: rgba(22, 46, 78, 0.06);
  border: 1px solid rgba(22, 46, 78, 0.12);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink, #0f172a);
  margin-bottom: 14px;
}
.dl-upgrade-plans {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.dl-upgrade-plan-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border-strong, #cbd5e1);
  background: var(--surface, #fff);
}
.dl-upgrade-plan-featured {
  border-color: var(--navy, #162e4e);
  background: rgba(22, 46, 78, 0.03);
}
.dl-upgrade-plan-row strong {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--ink, #0f172a);
}
.dl-upgrade-plan-meta {
  display: block;
  font-size: 12px;
  color: var(--muted, #64748b);
  margin-top: 2px;
}
.dl-upgrade-popular {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  background: var(--navy, #162e4e);
  color: #fff;
}
.dl-upgrade-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* __PS_PHOTO_PICKERS__ */
.pill-photo-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 8px !important;
  align-items: stretch;
}
.choice-pill.has-thumb {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 5px 5px 7px;
  border-radius: 11px;
  gap: 5px;
  text-align: center;
  min-height: 98px;
}
.choice-pill.has-thumb .choice-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 7px;
  display: block;
  background: rgba(15, 23, 42, 0.25);
}
.choice-pill.has-thumb .choice-thumb-lbl {
  font-size: 11px;
  line-height: 1.22;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.choice-pill.has-thumb.active {
  box-shadow: 0 0 0 2px #c9a252, 0 4px 12px rgba(201,162,82,0.28);
}
