/* web/css/style.css — 나에게 어울리는 집 (MyHome) UI/UX Stylesheet (Clean Light Theme) */
/* Premium clean light appraisal certificate with BAD (0~9999) vs GOOD (10000~20000) aura */

/* ==========================================================================
   1. CSS Variables & Reset
   ========================================================================== */
:root {
  /* Core Typography */
  --font-sans: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', 'Segoe UI', 'Apple SD Gothic Neo', sans-serif;
  --font-serif: 'Noto Serif KR', serif;

  /* Theme Canvas — Bright, Warm, Modern Light Palette */
  --bg-primary: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f1f5f9;
  --bg-surface-glass: rgba(255, 255, 255, 0.9);

  /* Text Colors */
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  --text-gold: #b45309;

  /* Accent BAD Zone: 0 ~ 9,999 (폭망 하우스 — Crimson / Hazard Amber / Rust) */
  --bad-primary: #dc2626;
  --bad-secondary: #ea580c;
  --bad-border: #fecaca;
  --bad-glow: rgba(239, 68, 68, 0.12);
  --bad-surface: #fff5f5;
  --bad-stamp: #dc2626;

  /* Accent GOOD Zone: 10,000 ~ 20,000 (대박 하우스 — Celestial Gold / Emerald / Royal Violet) */
  --good-primary: #d97706;
  --good-secondary: #059669;
  --good-border: #fde68a;
  --good-glow: rgba(234, 179, 8, 0.15);
  --good-surface: #fefce8;
  --good-stamp: #b45309;

  /* Reality Badges */
  --real-color: #0284c7;
  --real-bg: rgba(2, 132, 199, 0.08);
  --real-border: rgba(2, 132, 199, 0.25);
  --fiction-color: #9333ea;
  --fiction-bg: rgba(147, 51, 234, 0.08);
  --fiction-border: rgba(147, 51, 234, 0.25);

  /* Layout Constants */
  --max-content-width: 540px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 9999px;
  --transition-fast: 0.18s ease;
  --transition-normal: 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  background: linear-gradient(180deg, #f0f7ff 0%, #f8fafc 45%, #ffffff 100%);
  background-attachment: fixed;
  line-height: 1.6;
  padding-bottom: 32px; /* Clean bottom spacing without sticky dock */
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  color: inherit;
  transition: transform var(--transition-fast), filter var(--transition-fast), background-color var(--transition-fast);
}

button:active {
  transform: scale(0.97);
}

input {
  font-family: inherit;
  border: none;
  outline: none;
  color: inherit;
}

/* ==========================================================================
   2. Layout Container
   ========================================================================== */
.app-layout {
  max-width: var(--max-content-width);
  margin: 0 auto;
  padding: 0 16px;
}

/* ==========================================================================
   3. Header & Sticky Search Bar
   ========================================================================== */
.app-header {
  padding: 12px 0 8px;
  text-align: center;
}

.header-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.brand-badge {
  display: inline-block;
  padding: 2px 10px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #b45309;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-pill);
  margin-bottom: 4px;
  text-transform: uppercase;
}

.brand-title {
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
}

.brand-sub {
  font-size: 1rem;
  font-weight: 600;
  color: #2563eb;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  margin-top: 2px;
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 480px;
  line-height: 1.45;
}

/* Search Form */
.search-section {
  width: 100%;
  margin-top: 10px;
}

.search-form {
  width: 100%;
}

.search-input-wrapper {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-pill);
  padding: 4px 6px 4px 14px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-input-wrapper:focus-within {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15), 0 4px 16px rgba(15, 23, 42, 0.08);
}

.search-icon {
  font-size: 1.1rem;
  margin-right: 8px;
  opacity: 0.8;
}

.name-input {
  flex: 1;
  background: transparent;
  font-size: 1.05rem;
  font-weight: 600;
  color: #0f172a;
}

.name-input::placeholder {
  color: var(--text-dim);
  font-size: 0.95rem;
  font-weight: 400;
}

.search-btn {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
  white-space: nowrap;
}

.search-btn:hover {
  filter: brightness(1.08);
}

/* Sample Chips */
.sample-chips-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.sample-chips-container::-webkit-scrollbar {
  display: none;
}

.chips-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-dim);
  white-space: nowrap;
}

.sample-chips {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
}

.sample-chip {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-pill);
  color: #475569;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.sample-chip:hover {
  background: #e0f2fe;
  border-color: #7dd3fc;
  color: #0284c7;
}

/* ==========================================================================
   4. Floating Return Banner
   ========================================================================== */
.return-my-house-bar {
  position: sticky;
  top: 12px;
  z-index: 40;
  margin: 12px 0 16px;
  display: flex;
  justify-content: center;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.return-my-house-bar.hidden {
  display: none;
  opacity: 0;
  pointer-events: none;
}

.return-house-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
  animation: pulseReturn 2.5s infinite;
}

.return-house-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

@keyframes pulseReturn {
  0%, 100% { box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3); }
  50% { box-shadow: 0 4px 22px rgba(16, 185, 129, 0.5); }
}

/* ==========================================================================
   5. Appraisal Certificate Card (#card-root)
   ========================================================================== */
.main-content {
  width: 100%;
  margin-top: 12px;
}

#card-root {
  width: 100%;
}

.appraisal-card {
  position: relative;
  border-radius: 16px;
  padding: 14px 14px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
  overflow: hidden;
}

@media (max-width: 480px) {
  .appraisal-card {
    padding: 12px;
  }
}

/* BAD Zone Styling (0 ~ 9,999) — Clean Crimson/Alert */
.appraisal-card.zone-bad {
  background: linear-gradient(180deg, #fff5f5 0%, #ffffff 100%);
  border-color: #fecaca;
  box-shadow: 0 12px 32px rgba(239, 68, 68, 0.10);
}

.appraisal-card.zone-bad .engraving-border-top {
  background: repeating-linear-gradient(
    45deg,
    #ef4444,
    #ef4444 10px,
    #dc2626 10px,
    #dc2626 20px
  );
}

/* GOOD Zone Styling (10,000 ~ 20,000) — Clean Warm Gold */
.appraisal-card.zone-good {
  background: linear-gradient(180deg, #fefce8 0%, #ffffff 100%);
  border-color: #fde68a;
  box-shadow: 0 12px 32px rgba(234, 179, 8, 0.12);
}

.appraisal-card.zone-good .engraving-border-top {
  background: linear-gradient(
    90deg,
    #f59e0b 0%,
    #fbbf24 25%,
    #10b981 50%,
    #3b82f6 75%,
    #f59e0b 100%
  );
}

.engraving-border-top {
  height: 4px;
  width: 100%;
  border-radius: 2px;
  margin-bottom: 16px;
}

/* Certificate Meta */
.card-certificate-header {
  text-align: center;
  border-bottom: 1px dashed #cbd5e1;
  padding-bottom: 6px;
  margin-bottom: 8px;
}

.certificate-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: var(--font-sans);
  margin-bottom: 6px;
}

.doc-serial {
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.doc-badge-authority {
  font-weight: 600;
  color: #2563eb;
}

.certificate-main-title {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #0f172a;
  margin: 4px 0 10px;
}

.owner-headline-label {
  font-size: 0.95rem;
  font-weight: 800;
  color: #2563eb;
  letter-spacing: -0.02em;
  margin-bottom: 2px;
}

.preview-enter-arrow {
  font-size: 0.82rem;
  font-weight: 700;
  color: #2563eb;
  white-space: nowrap;
}

/* Stroke Breakdown Pill */
.stroke-breakdown-pill {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-size: 0.82rem;
  color: #1e293b;
  margin-top: 4px;
}

.stroke-tag {
  background: #2563eb;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
}

.stroke-arrow {
  color: #3b82f6;
  font-weight: 700;
}

.stroke-result {
  color: #b45309;
}

/* Badge Matrix (Level, Zone, Reality, Category) */
.badge-matrix {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: 10px;
}

.matrix-badge {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 9999px;
  padding: 4px 10px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  text-align: center;
  transition: transform var(--transition-fast);
}

.badge-sub {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  margin-bottom: 2px;
}

.badge-val {
  font-size: 0.76rem;
  font-weight: 700;
  color: #0f172a;
}

.badge-total {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-weight: 500;
}

.badge-caption {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Zone Badge Accents */
.matrix-badge.badge-zone.zone-bad {
  background: #fef2f2;
  border-color: #fca5a5;
}

.matrix-badge.badge-zone.zone-bad .badge-val {
  color: #b91c1c;
}

.matrix-badge.badge-zone.zone-good {
  background: #fffbeb;
  border-color: #fcd34d;
}

.matrix-badge.badge-zone.zone-good .badge-val {
  color: #b45309;
}

/* Reality Badge Accents */
.matrix-badge.badge-reality.reality-real {
  background: var(--real-bg);
  border-color: var(--real-border);
}

.matrix-badge.badge-reality.reality-real .badge-val {
  color: var(--real-color);
}

.matrix-badge.badge-reality.reality-fiction {
  background: var(--fiction-bg);
  border-color: var(--fiction-border);
}

.matrix-badge.badge-reality.reality-fiction .badge-val {
  color: var(--fiction-color);
}

/* House Title */
.house-title-container {
  text-align: center;
  margin: 4px 0 10px;
}

.house-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 1.3;
  color: #0f172a;
  word-break: keep-all;
}

/* House Visual Media Frame */
.house-media-wrapper {
  margin: 0 auto 12px;
  max-width: 240px;
}

.media-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 240px;
  margin: 0 auto;
  border-radius: 14px;
  overflow: hidden;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

@media (max-width: 480px) {
  .house-media-wrapper {
    max-width: 200px;
  }
  .media-frame {
    max-height: 200px;
  }
}

.house-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease, opacity 0.3s ease;
}

.house-image:hover {
  transform: scale(1.02);
}

.house-image.img-fallback {
  background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.official-watermark-stamp,
.media-overlay-gradient {
  display: none !important;
}

.media-overlay-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.02) 0%, rgba(0, 0, 0, 0.25) 100%);
  pointer-events: none;
}

/* Official Watermark Stamp */
.official-watermark-stamp {
  position: absolute;
  bottom: 10px;
  right: 10px;
  transform: rotate(-12deg);
  pointer-events: none;
  z-index: 10;
  user-select: none;
}

.stamp-circle {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2.5px dashed;
  text-align: center;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
  backdrop-filter: blur(4px);
  background: rgba(255, 255, 255, 0.85);
}

.stamp-crimson .stamp-circle {
  border-color: #dc2626;
  color: #dc2626;
}

.stamp-gold .stamp-circle {
  border-color: #d97706;
  color: #d97706;
}

.stamp-inner-text {
  font-family: var(--font-serif);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.stamp-sub-text {
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-top: 1px;
}

.stamp-stars {
  font-size: 0.52rem;
  margin-top: 1px;
}

.image-sub-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  font-size: 0.72rem;
  color: var(--text-dim);
  padding: 0 4px;
}

.reality-hint {
  color: #0284c7;
  font-weight: 600;
}

/* ==========================================================================
   6. 3 Mandatory Appraisal Spec Boxes (요구사항 1)
   ========================================================================== */
.appraisal-spec-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.spec-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.spec-card:hover {
  border-color: #cbd5e1;
}

/* Specific Accent Rules for 3 Mandatory Specs */
.spec-card.spec-built-year {
  border-left: 3px solid #0284c7;
}

.spec-card.spec-estimated-value {
  border-left: 3px solid #d97706;
}

.spec-card.spec-special-feature {
  border-left: 3px solid #9333ea;
  grid-column: 1 / -1;
}

.spec-card-header {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 2px;
}

.spec-icon {
  font-size: 0.9rem;
}

.spec-title {
  font-size: 0.74rem;
  font-weight: 700;
  color: #475569;
}

.spec-card-body {
  padding-left: 0;
}

.spec-value {
  font-size: 0.84rem;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.35;
}

.spec-value.price-highlight {
  font-size: 0.88rem;
  font-weight: 800;
  color: #b45309;
}

.spec-value.feature-text {
  font-size: 0.82rem;
  color: #334155;
}

/* ==========================================================================
   7. AI Chief Appraiser Verdict Box
   ========================================================================== */
.ai-verdict-section {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 12px;
  text-align: center;
}

.verdict-banner {
  display: none;
}

.verdict-badge {
  font-size: 0.82rem;
  font-weight: 700;
  color: #1d4ed8;
}

.verdict-ai-model {
  font-size: 0.68rem;
  color: #64748b;
}

.verdict-quote {
  font-family: var(--font-sans);
  font-size: 1.02rem;
  font-weight: 800;
  font-style: normal;
  line-height: 1.45;
  color: #0f172a;
  letter-spacing: -0.02em;
  word-break: keep-all;
}

/* ==========================================================================
   8. Action Buttons (Feature #8 Shared Interface)
   ========================================================================== */
.card-action-bar {
  display: flex;
  flex-direction: row;
  gap: 8px;
  margin-bottom: 4px;
}

.btn-action {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 10px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
  transition: all var(--transition-fast);
}

.btn-share-modal {
  background: linear-gradient(135deg, #d97706 0%, #db2777 50%, #7c3aed 100%);
  color: #ffffff;
}

.btn-share-modal:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
}

.btn-copy-address {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #0f172a;
}

.btn-copy-address:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
}

.certificate-footer-seal {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-dim);
  border-top: 1px dashed #e2e8f0;
  padding-top: 10px;
}

/* ==========================================================================
   9. Sticky Bottom 3-Button Explorer Dock (요구사항 4)
   ========================================================================== */
.explorer-dock {
  display: none !important;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid #e2e8f0;
  padding: 10px 16px 14px;
  box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
}

.dock-container {
  max-width: var(--max-content-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dock-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.88rem;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #0f172a;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.dock-btn:hover:not(:disabled) {
  background: #f1f5f9;
  border-color: #93c5fd;
  color: #1d4ed8;
  transform: translateY(-2px);
}

.dock-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

.dock-btn.btn-prev,
#btn-prev-level {
  flex: 1.2;
}

.dock-btn.btn-random,
#btn-random-level {
  flex: 0.9;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  border-color: #6366f1;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.25);
}

.dock-btn.btn-random:hover,
#btn-random-level:hover {
  filter: brightness(1.12);
}

.dock-btn.btn-next,
#btn-next-level {
  flex: 1.2;
}

.dock-btn-icon {
  font-size: 0.85rem;
}

.dock-keyboard-hint {
  max-width: var(--max-content-width);
  margin: 6px auto 0;
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-dim);
}

@media (max-width: 480px) {
  .dock-btn {
    padding: 10px 8px;
    font-size: 0.78rem;
  }
  .dock-keyboard-hint {
    display: none;
  }
}

/* ==========================================================================
   10. System Story & Service Guide Section
   ========================================================================== */
.service-guide-section {
  margin: 36px 0 24px;
}

.guide-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 14px;
  text-align: center;
}

.guide-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 600px) {
  .guide-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.guide-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.guide-card-header {
  margin-bottom: 8px;
}

.guide-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  margin-bottom: 6px;
}

.bad-guide .guide-badge {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.good-guide .guide-badge {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.rule-guide .guide-badge {
  background: #f0f9ff;
  color: #0284c7;
  border: 1px solid #bae6fd;
}

.guide-card h3 {
  font-size: 0.98rem;
  font-weight: 800;
  color: #0f172a;
}

.guide-card p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ==========================================================================
   11. Footer
   ========================================================================== */
.app-footer {
  text-align: center;
  padding: 24px 0 32px;
  border-top: 1px solid #e2e8f0;
  color: var(--text-dim);
  font-size: 0.78rem;
}

.footer-brand {
  color: var(--text-muted);
  margin-bottom: 6px;
}

.footer-brand a {
  color: #2563eb;
}

.footer-desc {
  max-width: 500px;
  margin: 0 auto 6px;
  line-height: 1.4;
}

/* ==========================================================================
   12. Loading Overlay & Appraisal Stamp Animation
   ========================================================================== */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.25s ease;
}

.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px;
}

.loading-seal-spinner {
  position: relative;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.seal-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: #f59e0b;
  border-bottom-color: #3b82f6;
  animation: spinSeal 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.seal-icon {
  font-size: 2rem;
  animation: pulseIcon 1.2s ease-in-out infinite alternate;
}

@keyframes spinSeal {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes pulseIcon {
  0% { transform: scale(0.85); opacity: 0.7; }
  100% { transform: scale(1.15); opacity: 1; }
}

.loading-text {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  max-width: 320px;
}

/* ==========================================================================
   13. Toast Notifications
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast-item {
  background: rgba(15, 23, 42, 0.92);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.2);
  opacity: 0;
  transform: translateY(12px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

.toast-item.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   14. 14-Language Selector & Quick Pills (Requirement 2)
   ========================================================================== */
.lang-selector-bar {
  display: flex;
  flex-direction: row;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
  margin-bottom: 8px;
}

.lang-selector-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-pill);
  padding: 4px 14px 4px 10px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.lang-icon {
  font-size: 1rem;
}

.lang-select {
  background: transparent;
  border: none;
  color: #0f172a;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  padding: 4px 0;
}

.lang-select option {
  background: #ffffff;
  color: #0f172a;
}

.lang-quick-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  max-width: 580px;
}

.lang-pill {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #475569;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.lang-pill:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.lang-pill.active {
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  border-color: #6366f1;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(124, 58, 237, 0.3);
}

/* ==========================================================================
   15. Google AdSense Responsive Display Units (CLS=0 Guarantee)
   ========================================================================== */
.adsense-slot {
  width: 100%;
  max-width: var(--max-content-width);
  margin: 10px auto;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1.5px dashed #cbd5e1;
  border-radius: 12px;
  overflow: hidden;
  contain: content;
}

.adsense-slot-top {
  min-height: 68px;
  margin: 6px auto 10px;
}

.adsense-slot-main {
  min-height: 100px;
  margin: 12px auto 16px;
}

.adsense-slot-footer {
  min-height: 100px;
  margin: 16px auto 20px;
}

.adsense-slot-inner {
  width: 100%;
  text-align: center;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.adsense-slot .ad-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #64748b;
  background: #e2e8f0;
  padding: 2px 8px;
  border-radius: 9999px;
  margin-bottom: 4px;
}

/* ==========================================================================
   16. Dedicated Compact Title-Only House Explorer (Requirement 4)
   ========================================================================== */
.scroll-preview-section {
  width: 100%;
  margin: 36px 0 20px;
  padding: 24px 20px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
}

.scroll-preview-header {
  margin-bottom: 20px;
  text-align: center;
}

.scroll-preview-title-box {
  margin-bottom: 14px;
}

.scroll-preview-section .preview-badge {
  display: inline-block;
  padding: 3px 10px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #0284c7;
  background: rgba(2, 132, 199, 0.08);
  border: 1px solid rgba(2, 132, 199, 0.25);
  border-radius: var(--radius-pill);
  margin-bottom: 6px;
}

.scroll-preview-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 6px;
}

.scroll-preview-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto;
}

.scroll-tier-filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}

.tier-filter-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tier-filter-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.tier-filter-btn.active {
  background: #2563eb;
  border-color: #1d4ed8;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

/* Compact Title-Only Scroll Preview List */
.scroll-preview-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.scroll-preview-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.scroll-preview-card:hover {
  background: #f8fafc;
  border-color: #93c5fd;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.scroll-preview-card.active-current-card {
  border-color: #f59e0b;
  background: #fffbeb;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.2);
}

/* In-Feed Google AdSense Slot (Every 8 Cards) */
.scroll-infeed-ad {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1.5px dashed #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin: 4px 0;
  min-height: 76px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  contain: content;
}

.infeed-ad-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.infeed-ad-badge {
  font-size: 0.65rem;
  font-weight: 800;
  color: #475569;
  background: #e2e8f0;
  padding: 2px 8px;
  border-radius: 9999px;
  letter-spacing: 0.04em;
}

.infeed-ad-hint {
  font-size: 0.68rem;
  color: #94a3b8;
  font-weight: 600;
}

.infinite-scroll-sentinel {
  height: 20px;
  width: 100%;
}

.preview-card-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.preview-badge-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.preview-badge-lv {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #b45309;
  font-weight: 800;
  font-size: 0.78rem;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

.preview-badge-tier {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #334155;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

.preview-badge-zone,
.preview-badge-reality {
  font-size: 0.74rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
}

.preview-resident-pill {
  font-size: 0.76rem;
  font-weight: 700;
  color: #0284c7;
  background: rgba(2, 132, 199, 0.08);
  border: 1px solid rgba(2, 132, 199, 0.25);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}

.preview-title-box {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.preview-category-tag {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.preview-house-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  flex: 1;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-specs-grid {
  display: none;
}

.preview-spec-item {
  display: flex;
  gap: 6px;
  align-items: baseline;
}

.preview-spec-item.full-width {
  grid-column: 1 / -1;
}

.preview-spec-item .spec-k {
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

.preview-spec-item .spec-v {
  color: #1e293b;
}

.preview-spec-item .preview-price {
  color: #b45309;
  font-weight: 700;
}

/* Locked Photo Box / Enter button */
.preview-locked-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.locked-info-line {
  display: none;
}

.locked-icon {
  font-size: 1.1rem;
}

.locked-text {
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 500;
}

.btn-enter-house {
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  color: #ffffff;
  border: none;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.btn-enter-house:hover {
  filter: brightness(1.12);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
  transform: translateY(-1px);
}

.scroll-preview-pagination {
  text-align: center;
  margin-top: 20px;
}

.btn-load-more {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #1e293b;
  padding: 10px 24px;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-load-more:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
  color: #0f172a;
}

/* Sitemap resident badge on card */
.sitemap-badge-pill {
  border-color: rgba(2, 132, 199, 0.35) !important;
  background: rgba(2, 132, 199, 0.08) !important;
}

.footer-links {
  margin-top: 8px;
  font-size: 0.82rem;
}

.footer-links a {
  color: #2563eb;
  text-decoration: underline;
}

.footer-links a:hover {
  color: #1d4ed8;
}

@media (max-width: 600px) {
  .scroll-preview-card {
    flex-wrap: wrap;
    gap: 8px;
  }
  .preview-title-box {
    width: 100%;
    order: 2;
  }
  .preview-card-header {
    width: 100%;
    order: 1;
  }
  .preview-locked-box {
    width: 100%;
    order: 3;
    justify-content: flex-end;
  }
}

/* ==========================================================================
   Cross Family Services Top Bar & Compact Language Selector
   ========================================================================== */
.family-service-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-pill);
  margin: 0 auto 10px;
  max-width: 540px;
  font-size: 0.8125rem;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.family-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #64748b;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s ease;
}

.family-link:hover {
  color: #2563eb;
}

.family-link.current {
  color: #0f172a;
}

.family-dot {
  color: #cbd5e1;
}

.lang-compact-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  padding: 2px 8px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-pill);
}

.lang-compact-wrapper .lang-icon {
  font-size: 0.85rem;
}

.lang-select-compact {
  background: transparent;
  border: none;
  color: #0f172a;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  outline: none;
}
