/* ================================================================
   NEXIS Design System — Global visual polish layer
   Loads AFTER inline <style> blocks so it can refine without breaking.
   Covers: typography, spacing, colors, animations, responsive,
   components, landing page, dashboard, and micro-details.
   ================================================================ */

/* ── 1. Extended Color Palette (items 11-15) ──────────────────── */
:root {
  /* Core brand (already declared inline, repeated for completeness) */
  --ink:     #0a0f1a;
  --sand:    #f5f0e8;
  --ocean:   #0066ff;
  --foam:    #e8f0fe;
  --coral:   #ff6b4a;
  --slate:   #5a6478;
  --deep:    #1a2744;

  /* Extended palette */
  --success: #16a34a;
  --success-light: #f0fdf4;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --error:   #dc2626;
  --error-light: #fef2f2;

  /* Neutral grays */
  --gray-50:  #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  /* Text hierarchy for dark sections */
  --text-primary:   rgba(255,255,255,0.95);
  --text-secondary: rgba(255,255,255,0.7);
  --text-disabled:  rgba(255,255,255,0.4);

  /* Elevation shadows (item 24) */
  --shadow-sm:  0 1px 3px rgba(10,15,26,0.06), 0 1px 2px rgba(10,15,26,0.04);
  --shadow-md:  0 4px 16px rgba(10,15,26,0.08), 0 2px 6px rgba(10,15,26,0.04);
  --shadow-lg:  0 12px 48px rgba(10,15,26,0.12), 0 4px 16px rgba(10,15,26,0.06);

  /* Border radius system (item 23) */
  --radius-sm:    6px;
  --radius-btn:   8px;
  --radius-card:  12px;
  --radius-modal: 16px;
  --radius-pill:  999px;

  /* Transition defaults */
  --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration-base: 200ms;
  --duration-slow: 300ms;
}


/* ── 2. Typography System (items 1-5) ─────────────────────────── */

/* Scale ratio 1.25 (Major Third) — fluid between 375px and 1440px */
h1 { font-size: clamp(2rem, 5vw + 0.5rem, 3.5rem) !important; line-height: 1.1 !important; font-weight: 700 !important; letter-spacing: -0.025em !important; }
h2 { font-size: clamp(1.6rem, 3.5vw + 0.3rem, 2.5rem) !important; line-height: 1.15 !important; font-weight: 700 !important; letter-spacing: -0.02em !important; }
h3 { font-size: clamp(1.2rem, 2vw + 0.2rem, 1.6rem) !important; line-height: 1.2 !important; font-weight: 600 !important; letter-spacing: -0.01em !important; }
h4 { font-size: clamp(1rem, 1.2vw + 0.2rem, 1.25rem) !important; line-height: 1.3 !important; font-weight: 600 !important; }

body { line-height: 1.6; }
p, li, td, th, label, span { line-height: 1.6; }

/* Caption sizing */
.caption, figcaption, small, .meta-label, .stat-label,
.hero-label, .section-label, .section-label-light,
.tier-name, .analytics-card-title, .briefing-section-title,
.category-bar-name, .feedback-role, .convo-time {
  line-height: 1.4;
  font-weight: 400;
}

/* Letter spacing on uppercase labels (item 4) */
[style*="text-transform: uppercase"],
.badge, .tier-badge, .tier-name, .hero-label, .section-label,
.section-label-light, .card-label, .settings-section-title,
.analytics-card-title, .briefing-section-title, .ai-badge,
.guest-link-label {
  letter-spacing: 0.05em;
}

/* Font weight consistency (item 2) */
h1, h2, .hero h1, .pricing-title, .briefing-greeting { font-weight: 700; }
h3, h4, .section-title, .property-name, .tier-cta { font-weight: 600; }
.caption, .hero-sub, .stat-label { font-weight: 400; }


/* ── 3. Spacing Scale (items 6-10) ────────────────────────────── */

/* Fluid section spacing (item 7): 64px desktop, ~48px mobile */
.how-section, .contrast-section, .pricing-section, .why-section,
.closing, .reassurance-section {
  padding-top: clamp(48px, 8vw, 120px);
  padding-bottom: clamp(48px, 8vw, 120px);
}

/* Container max-width (item 9) */
.hero-inner, .content, .how-section, .contrast-inner, .pricing-inner,
.why-inner, .closing, .reassurance-inner {
  max-width: 1200px;
}


/* ── 4. Global Animations & Micro-interactions (items 16-22) ──── */

/* Page fade-in (item 16) */
@keyframes wf-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

body {
  animation: wf-fade-in 0.4s var(--ease-out) both;
}

/* Card hover effects (item 17) — enhance existing */
.property-card, .convo-card, .analytics-stat-card, .analytics-card,
.feedback-card, .pricing-card, .briefing-stat {
  transition: transform var(--duration-base) var(--ease-out),
              box-shadow var(--duration-base) var(--ease-out),
              border-color var(--duration-base) var(--ease-out);
}
.property-card:hover, .convo-card:hover, .analytics-card:hover,
.feedback-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.analytics-stat-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Button press feedback (item 18) */
button:active:not(:disabled), .btn:active:not(:disabled),
.tier-cta:active, .btn-add:active, .btn-save:active,
.btn-copy:active, .btn-start:active, .btn-confirm:active,
.chat-send:active:not(:disabled), .chat-quick-btn:active {
  transform: scale(0.97);
  transition-duration: 80ms;
}

/* Toast entry animation (item 20) */
@keyframes wf-toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-16px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.chat-toast.show {
  animation: wf-toast-in 0.3s var(--ease-out) both;
}

/* Modal backdrop blur (item 21) */
.modal-overlay, .clear-confirm-overlay, .briefing-overlay {
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

@keyframes wf-modal-up {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.modal-overlay.open .modal,
.clear-confirm-overlay.open .clear-confirm-box {
  animation: wf-modal-up 0.3s var(--ease-out) both;
}

/* Scroll-triggered reveals (item 22) */
.wf-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}
.wf-reveal.wf-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Loading shimmer (item 69) */
@keyframes wf-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton, [class*="skeleton"] {
  background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%) !important;
  background-size: 200% 100% !important;
  animation: wf-shimmer 1.5s ease-in-out infinite !important;
  border-radius: var(--radius-btn) !important;
}

/* Success checkmark draw-in (item 70) */
@keyframes wf-check-draw {
  from { stroke-dashoffset: 24; }
  to   { stroke-dashoffset: 0; }
}
/* Error shake (item 70) */
@keyframes wf-shake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); }
  40%      { transform: translateX(6px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}
.wf-shake { animation: wf-shake 0.4s ease-in-out; }


/* ── 5. Polish Details (items 23-26) ──────────────────────────── */

/* Consistent dividers (item 25) */
.settings-section { border-bottom-color: rgba(10,15,26,0.06) !important; }
.contrast-list li { border-bottom-color: rgba(255,255,255,0.06) !important; }
.tier-features li { border-bottom-color: rgba(255,255,255,0.05) !important; }

/* Icon sizing consistency (item 26) */
.empty-icon, .chat-welcome-icon, .briefing-empty-hint-icon { font-size: 48px; }
.ai-insight-icon, .briefing-quiet-icon, .briefing-allclear-icon { font-size: 24px; }


/* ── 6. Responsive Design Deep Pass (items 27-38) ────────────── */

/* Viewport height fix — use dvh for full-screen (item 31) */
@supports (height: 100dvh) {
  .hero { min-height: 100dvh; }
  body.guest-chat-body { height: 100dvh; }
}

/* Safe area insets for notched devices (item 30) */
@supports (padding: env(safe-area-inset-bottom)) {
  nav { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .chat-input-area { padding-bottom: max(18px, env(safe-area-inset-bottom)); }
  .content { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
}

/* Fluid typography clamp (item 37) */
body {
  font-size: clamp(14px, 0.5vw + 13px, 16px);
}

/* Fluid spacing clamp (item 38) */
.content, .how-section, .closing, .reassurance-inner {
  padding-left: clamp(16px, 4vw, 40px);
  padding-right: clamp(16px, 4vw, 40px);
}

/* Ultra-wide support (item 28) — center content, don't stretch */
@media (min-width: 2560px) {
  .hero-inner, .content, .how-section, .contrast-inner, .pricing-inner,
  .why-inner, .closing, .reassurance-inner {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* Tablet layout optimization (item 27) */
@media (min-width: 769px) and (max-width: 1024px) {
  .capabilities { grid-template-columns: 1fr 1fr; gap: 0; }
  .pricing-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .pricing-card { padding: 28px 20px; }
  .analytics-stats-row { grid-template-columns: repeat(2, 1fr); }
  .contrast-inner { grid-template-columns: 1fr; gap: 48px; }
}

/* Mobile table scroll (item 36) */
.wf-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
}
.wf-table-scroll::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0; right: 0;
  width: 24px;
  background: linear-gradient(to right, transparent, rgba(245,240,232,0.8));
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}
.wf-table-scroll.has-overflow::after { opacity: 1; }

/* Touch target audit (item 32) — minimum 44x44 on mobile */
@media (max-width: 768px) {
  button, a, .tab, input[type="checkbox"], input[type="radio"], select,
  .nav-link, .btn-logout, .chat-quick-btn, .chat-send, .btn-back-convo,
  .briefing-disable-link {
    min-height: 44px;
    min-width: 44px;
  }
  /* Prevent tiny tap targets for inline links */
  a { padding: 2px 0; }
  .tab { padding: 14px 16px; }
}

/* Landscape mobile (item 29) */
@media (max-height: 500px) and (orientation: landscape) {
  .hero { min-height: auto; padding: 32px 24px; }
  .name-screen { padding: 16px 24px; }
  .name-card { padding: 24px; }
  .modal { max-height: 95vh; }
}

/* Pinch-to-zoom prevention for app views (item 33) */
.guest-chat-body {
  touch-action: manipulation;
}


/* ── 7. Component Visual Polish (items 39-50) ─────────────────── */

/* Button system (item 39) */
.wf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-btn);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-fast) ease;
  text-decoration: none;
  line-height: 1.4;
}
.wf-btn-primary {
  background: var(--ocean);
  color: white;
}
.wf-btn-primary:hover { background: #0052cc; }
.wf-btn-secondary {
  background: transparent;
  border: 1.5px solid rgba(10,15,26,0.15);
  color: var(--ink);
}
.wf-btn-secondary:hover { border-color: rgba(10,15,26,0.3); color: var(--ink); }
.wf-btn-ghost {
  background: transparent;
  color: var(--ocean);
  border: none;
}
.wf-btn-ghost:hover { background: var(--foam); }
.wf-btn-danger {
  background: var(--error);
  color: white;
}
.wf-btn-danger:hover { background: #b91c1c; }
.wf-btn:disabled, .wf-btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Input field styling polish (item 40) */
input:not([type="checkbox"]):not([type="radio"]),
textarea,
select {
  transition: border-color var(--duration-fast) ease,
              box-shadow var(--duration-fast) ease;
}
input:not([type="checkbox"]):not([type="radio"]):focus,
textarea:focus,
select:focus {
  box-shadow: 0 0 0 3px rgba(0,102,255,0.1);
}
input.error-input, textarea.error-input {
  border-color: var(--error) !important;
  box-shadow: 0 0 0 3px rgba(220,38,38,0.08);
}
input:disabled, textarea:disabled, select:disabled {
  background: var(--gray-100);
  color: var(--gray-400);
  cursor: not-allowed;
}

/* Select dropdown styling (item 41) */
select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%235a6478' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}

/* Checkbox + radio styling (item 42) */
input[type="checkbox"],
input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 1.5px solid rgba(10,15,26,0.2);
  background: white;
  cursor: pointer;
  transition: all var(--duration-fast) ease;
  flex-shrink: 0;
  position: relative;
}
input[type="checkbox"] { border-radius: 4px; }
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"]:checked {
  background: var(--ocean);
  border-color: var(--ocean);
}
input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 2px; left: 5px;
  width: 5px; height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
input[type="radio"]:checked {
  border-color: var(--ocean);
  background: white;
}
input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 10px; height: 10px;
  background: var(--ocean);
  border-radius: 50%;
}

/* Badge system (item 44) */
.wf-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.4;
}
.wf-badge-success { background: var(--success-light); color: var(--success); }
.wf-badge-warning { background: var(--warning-light); color: #92400e; }
.wf-badge-error   { background: var(--error-light); color: var(--error); }
.wf-badge-info    { background: var(--foam); color: var(--ocean); }
.wf-badge-neutral { background: var(--gray-100); color: var(--gray-600); }

/* Avatar component (item 45) */
.wf-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, var(--ocean), #38bdf8);
  flex-shrink: 0;
}
.wf-avatar-sm { width: 24px; height: 24px; font-size: 10px; }
.wf-avatar-md { width: 32px; height: 32px; font-size: 13px; }
.wf-avatar-lg { width: 48px; height: 48px; font-size: 18px; }

/* Tooltip styling (item 47) */
[data-tooltip] {
  position: relative;
}
[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 6px 12px;
  background: var(--ink);
  color: rgba(255,255,255,0.95);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  border-radius: 6px;
  white-space: nowrap;
  max-width: 200px;
  white-space: normal;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-base) ease, transform var(--duration-base) ease;
  z-index: 1000;
  box-shadow: var(--shadow-md);
}
[data-tooltip]::after {
  content: '';
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--ink);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-base) ease;
  z-index: 1000;
}
[data-tooltip]:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  transition-delay: 200ms;
}
[data-tooltip]:hover::after {
  opacity: 1;
  transition-delay: 200ms;
}

/* Progress bar (item 48) */
.wf-progress {
  height: 6px;
  background: var(--gray-200);
  border-radius: 3px;
  overflow: hidden;
}
.wf-progress-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--ocean);
  transition: width 0.5s var(--ease-out);
}
.wf-progress-fill.success { background: var(--success); }
.wf-progress-fill.warning { background: var(--warning); }
.wf-progress-fill.error   { background: var(--error); }

/* Tag/chip component (item 49) */
.wf-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--foam);
  color: var(--ocean);
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}
.wf-tag-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(0,102,255,0.15);
  border: none;
  cursor: pointer;
  font-size: 10px;
  color: var(--ocean);
  transition: background var(--duration-fast) ease;
  padding: 0;
  line-height: 1;
}
.wf-tag-remove:hover { background: rgba(0,102,255,0.25); }

/* Notification dot (item 50) */
.wf-notif-dot {
  position: relative;
}
.wf-notif-dot::after {
  content: '';
  position: absolute;
  top: -2px; right: -2px;
  width: 8px; height: 8px;
  background: var(--error);
  border-radius: 50%;
  border: 2px solid var(--ink);
  animation: wf-pulse 2s ease-in-out infinite;
}
@keyframes wf-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.7; transform: scale(1.2); }
}


/* ── 8. Landing Page Visual Polish (items 51-60) ──────────────── */

/* Hero gradient enhancement (item 51) */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 20%, rgba(0,102,255,0.08) 0%, transparent 60%);
  pointer-events: none;
  z-index: 1;
}

/* CTA button gradient (item 56) */
.tier-cta--featured,
a.btn-cta-gradient {
  background: linear-gradient(135deg, var(--coral) 0%, #ff8a6a 100%) !important;
  border-color: transparent !important;
  position: relative;
  overflow: hidden;
}
.tier-cta--featured:hover,
a.btn-cta-gradient:hover {
  background: linear-gradient(135deg, #f55c3a 0%, var(--coral) 100%) !important;
}

/* Pricing card active state (item 57) */
.pricing-card--featured {
  box-shadow: 0 0 0 1px var(--coral), 0 8px 32px rgba(255,107,74,0.15);
  transform: translateY(-4px);
}
.pricing-card--featured:hover {
  transform: translateY(-6px);
  box-shadow: 0 0 0 1px var(--coral), 0 12px 48px rgba(255,107,74,0.2);
}

/* Social proof ticker (item 60) */
@keyframes wf-marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.wf-ticker {
  overflow: hidden;
  white-space: nowrap;
  padding: 12px 0;
  background: rgba(255,255,255,0.03);
  border-top: 1px solid rgba(255,255,255,0.06);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.wf-ticker-track {
  display: inline-flex;
  animation: wf-marquee 30s linear infinite;
}
.wf-ticker-item {
  padding: 0 32px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  color: rgba(255,255,255,0.35);
  white-space: nowrap;
}

/* Stats counter animation on scroll (item 54) */
@keyframes wf-count-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.wf-count-up.wf-visible {
  animation: wf-count-in 0.5s var(--ease-out) both;
}

/* Section wave dividers (item 55) */
.wf-wave-divider {
  height: 48px;
  width: 100%;
  overflow: hidden;
  position: relative;
}
.wf-wave-divider svg {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 100%;
}

/* Floating parallax placeholder (item 59) */
@keyframes wf-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}
.wf-float { animation: wf-float 6s ease-in-out infinite; }
.wf-float-delay { animation: wf-float 6s ease-in-out 2s infinite; }


/* ── 9. Dashboard Visual Polish (items 61-70) ─────────────────── */

/* Dashboard card headers (item 62) */
.section-header {
  border-bottom: 1px solid rgba(10,15,26,0.06);
  padding-bottom: 16px;
}

/* Data table styling (item 63) */
table.wf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.wf-table th {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--slate);
  text-align: left;
  padding: 12px 16px;
  border-bottom: 2px solid rgba(10,15,26,0.08);
  position: sticky;
  top: 0;
  background: white;
  z-index: 2;
}
table.wf-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(10,15,26,0.04);
  color: var(--ink);
}
table.wf-table tbody tr:nth-child(even) {
  background: rgba(245,240,232,0.4);
}
table.wf-table tbody tr:hover {
  background: var(--foam);
}

/* Sidebar visual hierarchy (item 64) */
.wf-sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: var(--radius-btn);
  color: var(--slate);
  text-decoration: none;
  font-size: 14px;
  transition: all var(--duration-fast) ease;
  position: relative;
}
.wf-sidebar-link:hover {
  background: var(--foam);
  color: var(--ocean);
}
.wf-sidebar-link.active {
  background: var(--foam);
  color: var(--ocean);
  font-weight: 600;
}
.wf-sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px; bottom: 6px;
  width: 3px;
  background: var(--ocean);
  border-radius: 0 2px 2px 0;
}

/* Metric card layout (item 65) */
.analytics-stat-card .analytics-stat-value {
  font-size: clamp(24px, 3vw, 32px);
}

/* Timeline/activity feed (item 67) */
.wf-timeline {
  position: relative;
  padding-left: 24px;
}
.wf-timeline::before {
  content: '';
  position: absolute;
  left: 8px; top: 0; bottom: 0;
  width: 2px;
  background: var(--gray-200);
}
.wf-timeline-item {
  position: relative;
  padding-bottom: 24px;
}
.wf-timeline-item::before {
  content: '';
  position: absolute;
  left: -20px; top: 4px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--ocean);
  border: 2px solid white;
  box-shadow: 0 0 0 2px var(--gray-200);
}

/* Mobile dashboard cards (item 68) */
@media (max-width: 768px) {
  .analytics-stats-row {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 12px;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
  }
  .analytics-stat-card {
    scroll-snap-align: start;
    flex: 0 0 calc(50% - 6px);
    min-width: 0;
  }
}


/* ── 10. Micro-Detail Polish (items 71-75) ────────────────────── */

/* Cursor states (item 71) */
button, .btn, a, .tab, .tier-cta, .property-card, .convo-card,
.feedback-card, .chat-quick-btn, .nav-link, .btn-logout,
input[type="checkbox"], input[type="radio"], select {
  cursor: pointer;
}
button:disabled, .btn:disabled, input:disabled, textarea:disabled {
  cursor: not-allowed !important;
}

/* Selection color (item 72) */
::selection {
  background: rgba(0,102,255,0.2);
  color: var(--ink);
}
::-moz-selection {
  background: rgba(0,102,255,0.2);
  color: var(--ink);
}

/* Custom scrollbar (item 73) */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(10,15,26,0.15);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(10,15,26,0.25);
}
/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(10,15,26,0.15) transparent;
}

/* Placeholder text styling (item 74) */
::placeholder {
  color: rgba(10,15,26,0.35);
  font-style: italic;
}
::-webkit-input-placeholder {
  color: rgba(10,15,26,0.35);
  font-style: italic;
}

/* Link styling (item 75) */
a {
  color: var(--ocean);
  text-decoration: none;
  transition: color var(--duration-fast) ease;
}
a:hover {
  text-decoration: underline;
}
a:visited {
  color: #004db3;
}
/* Exempt nav/logo/card links from visited color */
.property-card, .property-card:visited,
.tier-cta, .tier-cta:visited,
.nav-link, .nav-link:visited,
.nav-back, .nav-back:visited,
button, button a, button a:visited {
  color: inherit;
}
/* Logo: always white on dark nav — never let :visited override */
.logo { color: white !important; white-space: nowrap; }
.logo:visited { color: white !important; }
a:hover { text-decoration-thickness: 1.5px; text-underline-offset: 2px; }

/* Focus ring for accessibility (item 14) */
:focus-visible {
  outline: 2px solid var(--ocean) !important;
  outline-offset: 2px !important;
}

/* Hover/focus states for interactive elements (item 14) */
.nav-link:focus-visible,
.btn-logout:focus-visible,
.tab:focus-visible,
.chat-quick-btn:focus-visible {
  outline: 2px solid var(--ocean);
  outline-offset: 2px;
  border-radius: var(--radius-btn);
}


/* ── 11. Scroll-Reveal Observer Script (included as CSS comment) ──
   The JS for IntersectionObserver is in design-system.js
   ─────────────────────────────────────────────────────────────── */

/* ── 12. Empty States (item 46) — SVG illustration placeholder ── */
.wf-empty-state {
  text-align: center;
  padding: 48px 24px;
}
.wf-empty-illustration {
  width: 120px;
  height: 120px;
  margin: 0 auto 24px;
  opacity: 0.5;
}

/* ── 13. Toggle Switch (item 43) ──────────────────────────────── */
.wf-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  display: inline-block;
  cursor: pointer;
}
.wf-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.wf-toggle-track {
  position: absolute;
  inset: 0;
  background: var(--gray-300);
  border-radius: 12px;
  transition: background var(--duration-fast) ease;
}
.wf-toggle input:checked + .wf-toggle-track {
  background: var(--ocean);
}
.wf-toggle-thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 20px; height: 20px;
  background: white;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  transition: transform var(--duration-base) var(--ease-spring);
}
.wf-toggle input:checked ~ .wf-toggle-thumb {
  transform: translateX(20px);
}

/* ── 14. Testimonial Card (item 53) ───────────────────────────── */
.wf-testimonial {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-card);
  padding: 28px;
  position: relative;
}
.wf-testimonial::before {
  content: '\201C';
  font-family: Georgia, serif;
  font-size: 48px;
  color: rgba(255,255,255,0.12);
  position: absolute;
  top: 12px; left: 20px;
  line-height: 1;
}
.wf-testimonial-text {
  font-size: 15px;
  line-height: 1.7;
  color: rgba(255,255,255,0.75);
  margin-bottom: 20px;
  padding-top: 8px;
}
.wf-testimonial-author {
  display: flex;
  align-items: center;
  gap: 12px;
}
.wf-testimonial-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
}
.wf-testimonial-role {
  font-size: 13px;
  color: rgba(255,255,255,0.45);
}

/* ── 15. Logo Cloud (item 58) ─────────────────────────────────── */
.wf-logo-cloud {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
  padding: 32px 0;
}
.wf-logo-cloud img {
  height: 28px;
  filter: grayscale(1) brightness(0.7);
  opacity: 0.5;
  transition: all var(--duration-base) ease;
}
.wf-logo-cloud img:hover {
  filter: none;
  opacity: 1;
}

/* ── 16. Chart Colors — colorblind-safe (item 61) ─────────────── */
:root {
  --chart-1: #0066ff;
  --chart-2: #ff6b4a;
  --chart-3: #16a34a;
  --chart-4: #f59e0b;
  --chart-5: #8b5cf6;
  --chart-6: #06b6d4;
  --chart-7: #ec4899;
}

/* ── Print-safe: disable animations for reduced-motion ────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .wf-reveal { opacity: 1; transform: none; }
  body { animation: none; }
}
