:root {
  --color-primary: #1B2A3D;
  --color-secondary: #F5F0EB;
  --color-accent: #B8956A;
  --color-surface: #FAFAF8;
  --color-border: #E2DDD6;
  --color-error: #C4553A;
  --color-warning: #D4A843;
  --color-success: #5B8A6E;
  --color-info: #5A7FA0;
  --text-primary: #1B2A3D;
  --text-secondary: #6B6560;
  --text-muted: #9B9590;
  --text-inverse: #FAFAF8;
  --font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --banner-height: 42px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-family);
  color: var(--text-primary);
  background: var(--color-secondary);
}

.shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.compliance-banner {
  position: sticky;
  top: 0;
  z-index: 120;
  background: rgba(212, 168, 67, 0.12);
  border-bottom: 1px solid rgba(212, 168, 67, 0.25);
}

.compliance-banner-inner {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 9px;
  padding-bottom: 9px;
}

.compliance-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
  font-size: 13px;
  line-height: 1.35;
  color: var(--text-primary);
}

.compliance-copy-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.amber-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--color-warning);
  flex-shrink: 0;
}

.compliance-label {
  font-weight: 600;
  flex-shrink: 0;
}

#disclosure-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compliance-helper {
  margin: 0;
  padding-left: 14px;
  color: var(--text-secondary);
  font-size: 12px;
}

.verify-link {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  flex-shrink: 0;
}

.verify-link:hover {
  text-decoration: underline;
}

.verify-link:focus-visible {
  outline: 2px solid var(--color-info);
  outline-offset: 2px;
  border-radius: 4px;
}

.viewer-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.viewer-header-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  padding-top: 24px;
  padding-bottom: 24px;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#property-address {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.property-meta {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--text-secondary);
}

.viewer-header-side {
  text-align: right;
}

.meta-mono {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.meta-secondary {
  margin: 4px 0 0;
  font-size: 11px;
  color: var(--text-muted);
}

.room-nav {
  position: sticky;
  top: var(--banner-height);
  z-index: 100;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.room-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding-top: 2px;
}

.room-tab {
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 11px 12px;
  cursor: pointer;
  white-space: nowrap;
}

.room-tab:hover {
  color: var(--text-primary);
  border-bottom-color: rgba(184, 149, 106, 0.45);
}

.room-tab.active {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

.room-tab:focus-visible {
  outline: 2px solid var(--color-info);
  outline-offset: -1px;
}

.tab-count {
  opacity: 0.6;
  margin-left: 3px;
}

.viewer-main {
  padding-top: 26px;
  padding-bottom: 40px;
}

.status-panel {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  padding: 26px;
}

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

.status-panel.loading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-panel.loading .status-title,
.status-panel.loading .status-message {
  margin: 0;
}

.status-panel.error {
  border-color: rgba(196, 85, 58, 0.35);
  background: rgba(196, 85, 58, 0.06);
}

.status-panel.warn {
  border-color: rgba(212, 168, 67, 0.35);
  background: rgba(212, 168, 67, 0.08);
}

.status-panel.ok {
  border-color: rgba(91, 138, 110, 0.35);
}

.no-original {
  margin-top: 10px;
  margin-bottom: 12px;
  font-size: 13px;
  color: rgba(27, 42, 61, 0.7);
  background: rgba(184, 149, 106, 0.12);
  border: 1px solid rgba(184, 149, 106, 0.35);
  border-radius: 8px;
  padding: 10px 12px;
}

.status-title {
  font-size: 20px;
  line-height: 1.3;
  margin: 0 0 8px;
}

.status-message {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary);
}

.spinner {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid rgba(27, 42, 61, 0.2);
  border-top-color: var(--text-primary);
  animation: viewer-spin 0.8s linear infinite;
}

@keyframes viewer-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(480px, 1fr));
  gap: 24px;
}

.photo-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(27, 42, 61, 0.05);
}

.photo-media {
  position: relative;
  aspect-ratio: 16 / 10.5;
  background: #e7e2dc;
}

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

.room-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-inverse);
  background: rgba(27, 42, 61, 0.66);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.staged-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-inverse);
  background: rgba(184, 149, 106, 0.9);
}

.photo-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}

.before-after {
  display: inline-flex;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  overflow: hidden;
}

.before-after button {
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 14px;
  cursor: pointer;
}

.before-after button:hover:not(.active):not(:disabled) {
  color: var(--text-primary);
  background: rgba(27, 42, 61, 0.06);
}

.before-after button.active {
  background: var(--color-primary);
  color: var(--text-inverse);
}

.before-after button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.before-after button:focus-visible {
  outline: 2px solid var(--color-info);
  outline-offset: -2px;
}

.download-link {
  display: inline-block;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--text-secondary);
  text-decoration: none;
}

.download-link:hover {
  color: var(--text-primary);
  background: rgba(27, 42, 61, 0.04);
  border-color: var(--text-secondary);
}

.download-link:focus-visible {
  outline: 2px solid var(--color-info);
  outline-offset: 2px;
}

.viewer-footer {
  background: var(--color-primary);
}

.viewer-footer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 26px;
  padding-bottom: 18px;
}

.wordmark {
  display: block;
  width: auto;
  height: 16px;
  max-width: 180px;
  opacity: 0.72;
}

/* Make the buyer viewer wordmark white without affecting other images. */
.searei-wordmark {
  filter: brightness(0) invert(1) contrast(1.05);
  opacity: 0.95;
}

.viewer-footer-links {
  display: flex;
  gap: 18px;
}

.viewer-footer-links a {
  color: rgba(250, 250, 248, 0.4);
  font-size: 12px;
  text-decoration: none;
}

.viewer-footer-links a:hover {
  color: rgba(250, 250, 248, 0.75);
}

.viewer-footer-bottom {
  border-top: 1px solid rgba(250, 250, 248, 0.08);
  padding-top: 14px;
  padding-bottom: 20px;
}

#footer-meta {
  margin: 0;
  text-align: center;
  color: rgba(250, 250, 248, 0.36);
  font-size: 11px;
  font-family: var(--font-mono);
}

@media (max-width: 980px) {
  .gallery {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .shell {
    padding: 0 16px;
  }

  .viewer-header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .viewer-header-side {
    text-align: left;
  }

  #property-address {
    font-size: 24px;
  }
}

@media (max-width: 480px) {
  .compliance-banner-inner {
    gap: 8px;
    align-items: flex-start;
    flex-direction: column;
  }

  .compliance-copy {
    width: 100%;
  }

  #disclosure-text {
    white-space: normal;
    overflow: visible;
    text-overflow: initial;
  }

  .property-meta {
    font-size: 13px;
  }

  .viewer-footer-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .photo-body {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Phase 4 — enhanced viewer sections (PLAN_FOR_AI_CONTENT_ROLLOUT.md §3.4).
   All styles are scoped to .enhanced-* prefixes so the existing minimal
   viewer is unaffected. */
.enhanced-hero {
  margin: 24px auto;
  max-width: 960px;
  text-align: center;
}
.enhanced-hero-img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  border-radius: 12px;
}
.enhanced-hero-toggle {
  margin-top: 12px;
  padding: 8px 16px;
  border: 1px solid #cfd6dd;
  background: #fff;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
}
.enhanced-meta {
  margin: 16px auto;
  max-width: 960px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.enhanced-chip {
  display: inline-block;
  padding: 6px 12px;
  background: #f3f5f7;
  border-radius: 999px;
  font-size: 13px;
  color: #333;
}
.enhanced-highlights {
  flex-basis: 100%;
  margin: 8px 0 0;
  color: #444;
  font-size: 14px;
  line-height: 1.5;
}
.enhanced-content {
  margin: 24px auto;
  max-width: 960px;
  border: 1px solid #e1e6ea;
  border-radius: 12px;
  padding: 16px;
  background: #fff;
}
.enhanced-tabbar {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid #e1e6ea;
  padding-bottom: 8px;
  margin-bottom: 12px;
}
.enhanced-tab {
  padding: 6px 12px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  color: #555;
}
.enhanced-tab.active {
  background: #f3f5f7;
  color: #111;
  border-color: #d1d6dc;
}
.enhanced-copy {
  margin-left: auto;
  padding: 6px 12px;
  border: 1px solid #cfd6dd;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
.enhanced-tabpanel {
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.6;
  color: #222;
  padding: 8px 4px;
}
.enhanced-agent-map {
  margin: 16px auto;
  max-width: 960px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}
.enhanced-agent-name {
  font-weight: 600;
  margin: 0;
}
.enhanced-agent-link {
  display: block;
  font-size: 14px;
  color: #356dc7;
  margin-top: 4px;
}
.enhanced-map-btn {
  margin-left: auto;
  padding: 8px 16px;
  background: #356dc7;
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
}
.enhanced-map-btn:hover {
  background: #2b59a8;
}

/* Mobile breakpoint for enhanced sections — buyer viewer links are
   predominantly opened on phones (audit 2026-04-27 G4). Matches the
   minimal-mode mobile rules earlier in this file. */
@media (max-width: 600px) {
  .enhanced-hero { margin: 16px 12px; }
  .enhanced-hero-img { max-height: 240px; }
  .enhanced-meta { margin: 12px 12px; gap: 6px; }
  .enhanced-meta .enhanced-chip { padding: 5px 10px; font-size: 12px; }
  .enhanced-content { margin: 16px 12px; padding: 12px; }
  .enhanced-tabbar { gap: 4px; padding-bottom: 6px; margin-bottom: 8px; overflow-x: auto; flex-wrap: nowrap; }
  .enhanced-tab { padding: 5px 10px; font-size: 13px; flex-shrink: 0; }
  .enhanced-copy { padding: 5px 10px; font-size: 12px; flex-shrink: 0; }
  .enhanced-tabpanel { font-size: 13px; }
  .enhanced-agent-map { margin: 12px 12px; flex-direction: column; align-items: stretch; gap: 12px; }
  .enhanced-map-btn { margin-left: 0; text-align: center; }
}
