:root {
  --bg: #f8fafc;
  --bg-gradient: radial-gradient(circle at 50% 0%, #ffffff 0%, #f8fafc 100%);
  --surface: #ffffff;
  --surface-subtle: #f8fafc;
  --surface-hover: #f1f5f9;
  --border: #e2e8f0;
  --border-subtle: #f1f5f9;
  --border-focus: #2563eb;
  --text: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  
  --primary: #0f172a;
  --primary-hover: #1e293b;
  --accent-blue: #2563eb;
  --accent-blue-hover: #1d4ed8;
  --accent-indigo: #4f46e5;
  
  --radius-lg: 14px;
  --radius: 10px;
  --radius-sm: 7px;
  
  --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.08), 0 1px 2px -1px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 4px 12px -1px rgba(15, 23, 42, 0.08), 0 2px 6px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 28px -4px rgba(15, 23, 42, 0.12), 0 6px 12px -4px rgba(15, 23, 42, 0.06);
  --shadow-focus: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

[data-theme="dark"] {
  --bg: #090d16;
  --bg-gradient: radial-gradient(circle at 50% 0%, #131b2e 0%, #090d16 100%);
  --surface: #111827;
  --surface-subtle: #162032;
  --surface-hover: #1e293b;
  --border: #243046;
  --border-subtle: #1a2436;
  --border-focus: #3b82f6;
  --text: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-light: #64748b;
  
  --primary: #f8fafc;
  --primary-hover: #e2e8f0;
  --accent-blue: #3b82f6;
  --accent-blue-hover: #2563eb;
  --accent-indigo: #6366f1;
  
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.5), 0 1px 2px -1px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 14px -1px rgba(0, 0, 0, 0.6), 0 2px 6px -2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 32px -4px rgba(0, 0, 0, 0.7);
  --shadow-focus: 0 0 0 3px rgba(59, 130, 246, 0.35);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Page Container (Centered Content Area) */
.page-container {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 1.75rem 1.5rem 3rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  box-sizing: border-box;
}

/* Header - Full Screen Width */
.top-bar {
  position: relative;
  z-index: 100;
  width: 100%;
  padding: 1.15rem 0 1rem;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  box-sizing: border-box;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

[data-theme="dark"] .top-bar {
  background: rgba(15, 23, 42, 0.92);
  border-color: var(--border);
}

.header-inner {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  box-sizing: border-box;
}

.top-bar-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  width: 100%;
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 3px 8px rgba(15, 23, 42, 0.12));
  flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.brand-logo:hover {
  transform: scale(1.08) rotate(-1deg);
}

.top-bar h1 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
  line-height: 1.2;
}

.subtitle {
  font-size: 0.825rem;
  font-weight: 450;
  color: var(--text-muted);
  margin-top: 0.15rem;
  letter-spacing: -0.01em;
}

/* Site Navigation (Home, About, Contact) */
.main-nav-menu {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--surface-subtle);
  padding: 0.25rem 0.35rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-left: auto;
}

.nav-menu-btn {
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.nav-menu-btn:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.nav-menu-btn.active {
  background: var(--surface);
  color: var(--accent-blue);
  box-shadow: var(--shadow-xs);
}

[data-theme="dark"] .nav-menu-btn.active {
  background: var(--surface-hover);
  color: #60a5fa;
}

/* Bottom line: Dark/Light, API Key, Clear, and Contextual Action Buttons */
.header-bottom-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  width: 100%;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
}

.header-persistent-tools {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.header-action-group {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.header-action-group.hidden {
  display: none !important;
}

/* Buttons */
.btn {
  font-family: inherit;
  font-size: 0.825rem;
  font-weight: 600;
  padding: 0.55rem 0.95rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  text-decoration: none;
  user-select: none;
  white-space: nowrap;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn-primary {
  background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
  background: #94a3b8;
}

.btn-dark {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.2);
}

.btn-dark:hover:not(:disabled) {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.25);
  transform: translateY(-1px);
}

.btn-dark:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
  background: #94a3b8;
}

.btn-outline {
  background-color: var(--surface);
  color: var(--text-secondary);
  border-color: var(--border);
  box-shadow: var(--shadow-xs);
}

.btn-outline:hover {
  background-color: var(--surface-hover);
  color: var(--text);
  border-color: #cbd5e1;
}

/* Disabled appearance with circle-with-line cursor (🚫 not-allowed) */
.btn.btn-disabled-state,
.btn.btn-disabled-state * {
  opacity: 0.45 !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
  transform: none !important;
  filter: grayscale(20%);
}

.btn.btn-disabled-state:hover,
.btn.btn-disabled-state:active {
  cursor: not-allowed !important;
  transform: none !important;
  box-shadow: none !important;
}

/* Main Options Grid */
.mode-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 768px) {
  .mode-options-grid {
    grid-template-columns: 1fr;
  }
}

.mode-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-lg);
  padding: 2.25rem 1.5rem 1.6rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
  user-select: none;
}

.mode-card:hover {
  border-color: var(--border-focus);
  background: linear-gradient(180deg, #f0f7ff 0%, #ffffff 100%);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.manual-entry-card {
  border: 2px solid #e2e8f0;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.manual-entry-card:hover {
  border-color: #3b82f6;
  background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
}

.mode-badge {
  position: absolute;
  top: 0.85rem;
  left: 0.85rem;
  font-size: 0.685rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  background: #eff6ff;
  color: #2563eb;
  padding: 0.22rem 0.6rem;
  border-radius: 9999px;
  border: 1px solid #bfdbfe;
}

.manual-badge {
  background: #fef3c7;
  color: #b45309;
  border-color: #fde68a;
}

.drop-icon {
  font-size: 2.35rem;
  margin-bottom: 0.4rem;
  transition: transform 0.2s ease;
}

.mode-card:hover .drop-icon {
  transform: scale(1.1);
}

.drop-title {
  font-size: 1.025rem;
  font-weight: 650;
  color: var(--text);
  letter-spacing: -0.015em;
}

.drop-sub {
  font-size: 0.815rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  line-height: 1.4;
}

.drop-zone input {
  display: none;
}

.drop-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  margin-top: 0.6rem;
}

.drop-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.22rem 0.65rem;
  border-radius: 9999px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  color: var(--text-muted);
  box-shadow: var(--shadow-xs);
}

.drop-zone.drag-over {
  border-color: #2563eb !important;
  background: #eff6ff !important;
  transform: scale(1.01);
}

/* Status Bar */
.status-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  animation: pulseLight 2s infinite ease-in-out;
}

@keyframes pulseLight {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.88; }
}

.spinner {
  width: 17px;
  height: 17px;
  border: 2.5px solid rgba(37, 99, 235, 0.25);
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  flex-shrink: 0;
}

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

/* Results Grid */
.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.35rem;
  animation: fadeInGrid 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInGrid {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

.data-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.4rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.data-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
}

.data-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.015em;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.field-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.sub-section-divider {
  border-top: 1px dashed var(--border);
  margin: 0.75rem 0 0.25rem 0;
  padding-top: 0.55rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.co-party-toggle-row {
  margin-top: 0.5rem;
  display: flex;
  justify-content: flex-start;
}

.btn-toggle-co {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--accent-blue);
  color: var(--accent-blue);
  background: var(--surface-subtle);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-toggle-co:hover {
  background: rgba(37, 99, 235, 0.08);
  border-style: solid;
}

.co-party-wrapper {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.co-party-wrapper.hidden {
  display: none !important;
}

.property-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.95rem;
}

.field-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.lbl {
  font-size: 0.875rem;
  font-weight: 650;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.035em;
}

input[type="text"],
input[type="password"] {
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.58rem 0.8rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  outline: none;
  transition: all 0.18s ease;
  box-shadow: var(--shadow-xs);
}

input[type="text"]:focus,
input[type="password"]:focus {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-focus);
  background: #ffffff;
}

input[type="text"]::placeholder,
input[type="password"]::placeholder {
  color: var(--text-light);
  font-weight: 400;
}

.highlight {
  animation: flash 0.8s ease;
}

@keyframes flash {
  0% { background-color: #dcfce7; border-color: #86efac; }
  100% { background-color: #ffffff; border-color: var(--border); }
}

/* Lock background scrolling when any modal is open */
body.modal-open {
  overflow: hidden !important;
  overscroll-behavior: none !important;
  height: 100vh !important;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.25rem;
  animation: modalFadeIn 0.2s ease;
  overscroll-behavior: contain;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  touch-action: none;
  overscroll-behavior: contain;
}

.modal-card {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-lg);
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  width: 100%;
  box-shadow: var(--shadow-lg);
  overscroll-behavior: contain;
  border: 1px solid rgba(226, 232, 240, 0.9);
  animation: modalSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
  from { transform: translateY(12px) scale(0.98); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-header {
  padding: 1.1rem 1.35rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
}

.modal-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.btn-close {
  background: transparent;
  border: none;
  font-size: 1.35rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  padding: 0.2rem 0.4rem;
  transition: all 0.15s ease;
}

.btn-close:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.modal-body {
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.modal-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field-help {
  font-size: 0.775rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.test-feedback {
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.815rem;
  font-weight: 550;
  line-height: 1.4;
}

.test-feedback.success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.test-feedback.error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.test-feedback.info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
}

.modal-footer {
  padding: 0.95rem 1.35rem;
  background: var(--surface-subtle);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.link-btn {
  font-size: 0.815rem;
  color: var(--accent-blue);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s ease;
}

.link-btn:hover {
  color: var(--accent-blue-hover);
  text-decoration: underline;
}

.modal-actions {
  display: flex;
  gap: 0.55rem;
}

/* Large Preview Modal */
.modal-large {
  max-width: 1050px;
  width: 96%;
  height: 90vh;
  display: flex;
  flex-direction: column;
}

.preview-modal-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.preview-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.55rem;
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
  border-radius: 9999px;
}

[data-theme="dark"] .preview-badge {
  background: rgba(37, 99, 235, 0.18);
  border-color: rgba(37, 99, 235, 0.4);
  color: #93c5fd;
}

.preview-modal-body {
  flex: 1;
  position: relative;
  padding: 0;
  overflow: hidden;
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  color: #e2e8f0;
  font-size: 0.95rem;
  font-weight: 500;
}

.preview-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #ffffff;
  overscroll-behavior: contain;
}

.preview-note {
  font-size: 0.775rem;
  color: var(--text-muted);
  font-weight: 500;
}

.full-width-field {
  grid-column: 1 / -1;
}

.card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.95rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.65rem;
}

.card-title-row h3 {
  margin-bottom: 0 !important;
  border-bottom: none !important;
  padding-bottom: 0 !important;
}

.badge-tag {
  font-size: 0.8rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.18rem 0.55rem;
  background: var(--surface-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 4px;
}

/* Notice Banner */
.notice-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #fde68a;
  color: #92400e;
  padding: 0.95rem 1.15rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  line-height: 1.45;
  box-shadow: var(--shadow-sm);
  animation: fadeInBanner 0.25s ease;
}

@keyframes fadeInBanner {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.notice-icon {
  font-size: 1.35rem;
  flex-shrink: 0;
  line-height: 1;
}

.notice-body {
  flex: 1;
}

.notice-body strong {
  display: block;
  font-weight: 700;
  margin-bottom: 0.2rem;
  color: #78350f;
}

.notice-close {
  background: transparent;
  border: none;
  font-size: 1.35rem;
  line-height: 1;
  color: #b45309;
  cursor: pointer;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  transition: all 0.15s;
}

.notice-close:hover {
  color: #451a03;
  background: rgba(180, 83, 9, 0.1);
}

.btn-theme {
  padding: 0.55rem 0.75rem;
  font-size: 1.05rem;
  line-height: 1;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-theme:hover {
  background-color: var(--surface-hover);
  color: var(--text);
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

[data-theme="dark"] .top-bar {
  background: rgba(17, 24, 39, 0.85);
  border-color: rgba(36, 48, 70, 0.85);
}

[data-theme="dark"] .mode-card {
  background: var(--surface);
  border-color: #334155;
}

[data-theme="dark"] .mode-card:hover {
  border-color: var(--border-focus);
  background: linear-gradient(180deg, #162238 0%, #111827 100%);
}

[data-theme="dark"] .manual-entry-card {
  border-color: #334155;
  background: linear-gradient(180deg, #172033 0%, #111827 100%);
}

[data-theme="dark"] .manual-entry-card:hover {
  border-color: #60a5fa;
  background: linear-gradient(180deg, #1e2c47 0%, #111827 100%);
}

[data-theme="dark"] .mode-badge {
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.35);
}

[data-theme="dark"] .manual-badge {
  background: rgba(245, 158, 11, 0.18);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.35);
}

[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="password"] {
  background: var(--surface-subtle);
  color: var(--text);
  border-color: var(--border);
}

[data-theme="dark"] input[type="text"]:focus,
[data-theme="dark"] input[type="password"]:focus {
  background: var(--surface);
  border-color: var(--border-focus);
}

[data-theme="dark"] .modal-card {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme="dark"] .modal-header {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme="dark"] .modal-footer {
  background: var(--surface-subtle);
  border-color: var(--border);
}

[data-theme="dark"] .status-bar {
  background: linear-gradient(135deg, #172554 0%, #1e3a8a 100%);
  border-color: #2563eb;
  color: #bfdbfe;
}

[data-theme="dark"] .status-bar .spinner {
  border-color: rgba(147, 197, 253, 0.25);
  border-top-color: #60a5fa;
}

[data-theme="dark"] .notice-banner {
  background: linear-gradient(135deg, #381a04 0%, #451a03 100%);
  border-color: #92400e;
  color: #fef3c7;
}

[data-theme="dark"] .notice-body strong {
  color: #fde68a;
}

[data-theme="dark"] .notice-close {
  color: #fde68a;
}

[data-theme="dark"] .notice-close:hover {
  background: rgba(254, 243, 199, 0.12);
  color: #ffffff;
}

/* Professional unfilled field focus (Clean crisp red border only - no shaded red glow) */
input.field-error {
  border-color: #dc2626 !important;
  box-shadow: none !important;
  background-color: var(--surface) !important;
  transition: border-color 0.2s ease !important;
}

input.field-error:focus {
  outline: none !important;
  border-color: #dc2626 !important;
  box-shadow: none !important;
  background-color: var(--surface) !important;
}

[data-theme="dark"] input.field-error {
  border-color: #f87171 !important;
  box-shadow: none !important;
  background-color: var(--surface) !important;
  transition: border-color 0.2s ease !important;
}

[data-theme="dark"] input.field-error:focus {
  outline: none !important;
  border-color: #f87171 !important;
  box-shadow: none !important;
  background-color: var(--surface) !important;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   💎 PROFESSIONAL FLOATING VERSION BADGE
   ========================================================================== */
.version-badge {
  position: fixed;
  bottom: 14px;
  right: 16px;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 0.28rem 0.68rem;
  border-radius: 9999px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  z-index: 50;
  user-select: none;
  transition: all 0.2s ease;
  cursor: default;
}

[data-theme="dark"] .version-badge {
  background: rgba(17, 24, 39, 0.88);
  border-color: var(--border);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  color: var(--text-light);
}

.version-badge:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  border-color: var(--border-focus);
}

.version-dot {
  width: 6px;
  height: 6px;
  background-color: #10b981;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
}

.version-dot::after {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: 50%;
  border: 1.5px solid rgba(16, 185, 129, 0.5);
  animation: beaconPulse 2.2s infinite ease-out;
}

@keyframes beaconPulse {
  0% { transform: scale(0.8); opacity: 0.9; }
  100% { transform: scale(2.4); opacity: 0; }
}

.version-label {
  letter-spacing: 0.025em;
  font-weight: 650;
  color: var(--text-secondary);
}

[data-theme="dark"] .version-label {
  color: var(--text-secondary);
}

/* ==========================================================================
   🧭 MODULE SWITCHER (CVT-1 & IT-5 VS DEALER PERFORMA)
   ========================================================================== */
.module-nav-bar {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  padding: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-top: 0.25rem;
}

.module-tab-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.85rem 1.4rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 650;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-hover);
  color: var(--text);
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  box-shadow: var(--shadow-xs);
}

.module-tab-btn .tab-icon {
  font-size: 1.15rem;
  line-height: 1;
  transition: transform 0.2s ease;
}

.module-tab-btn:hover:not(.active) {
  color: var(--text);
  background: #e2e8f0;
  border-color: #cbd5e1;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.module-tab-btn:hover:not(.active) .tab-icon {
  transform: scale(1.12);
}

[data-theme="dark"] .module-tab-btn {
  background: #1e293b;
  border-color: #334155;
  color: #f1f5f9;
}

[data-theme="dark"] .module-tab-btn:hover:not(.active) {
  background: #334155;
  border-color: #475569;
}

.module-tab-btn.active {
  background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28);
  border-color: transparent;
}

.module-tab-btn.active .tab-icon {
  transform: scale(1.08);
}

[data-theme="dark"] .module-tab-btn.active {
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.45);
}

.module-view {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.module-view.hidden {
  display: none !important;
}

/* ==========================================================================
   🏢 DEALER PERFORMA WORKSPACE
   ========================================================================== */
.dealer-results-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.dealer-results-container.hidden {
  display: none !important;
}

.dealer-header-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
}

.dealer-header-info h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.dealer-header-info p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.dealer-header-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}

.dealer-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.dealer-grid .full-width {
  grid-column: 1 / -1;
}

.dealer-grid input[type="text"] {
  font-size: 1.05rem;
  font-weight: 550;
  padding: 0.65rem 0.85rem;
}

/* ==========================================================================
   🏢 DEALER EA CONTACT NOTIFICATION (RED FIRST -> GREEN -> GENTLY DISAPPEAR)
   ========================================================================== */
.dealer-ea-notification {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem;
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border: 1px solid #fca5a5;
  border-left: 5px solid #ef4444;
  padding: 1.1rem 1.35rem;
  border-radius: var(--radius);
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.12);
  flex-wrap: wrap;
  max-height: 250px;
  opacity: 1;
  transition: opacity 0.85s cubic-bezier(0.4, 0, 0.2, 1),
              max-height 0.85s cubic-bezier(0.4, 0, 0.2, 1),
              margin 0.85s cubic-bezier(0.4, 0, 0.2, 1),
              padding 0.85s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.85s cubic-bezier(0.4, 0, 0.2, 1),
              background 0.35s ease,
              border-color 0.35s ease;
  overflow: hidden;
}

.dealer-ea-notification.confirmed {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-color: #86efac;
  border-left-color: #16a34a;
  box-shadow: 0 2px 10px rgba(22, 163, 74, 0.15);
}

.dealer-ea-notification.gently-disappear {
  opacity: 0;
  max-height: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  border-width: 0 !important;
  pointer-events: none;
  transform: translateY(-8px);
}

@keyframes shakeNotification {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

.dealer-ea-notification.shake-attention {
  animation: shakeNotification 0.45s ease;
}

.ea-notif-main {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  flex: 1;
  min-width: 280px;
}

.ea-notif-icon {
  font-size: 1.6rem;
  line-height: 1;
  flex-shrink: 0;
}

.ea-notif-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.ea-notif-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.ea-notif-heading {
  font-size: 0.925rem;
  font-weight: 700;
  color: #991b1b;
}

.dealer-ea-notification.confirmed .ea-notif-heading {
  color: #14532d;
}

.ea-phone-pill {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.925rem;
  font-weight: 700;
  background: #ffffff;
  color: #b91c1c;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  border: 1px solid #fca5a5;
  letter-spacing: 0.03em;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.dealer-ea-notification.confirmed .ea-phone-pill {
  color: #15803d;
  border-color: #86efac;
}

.ea-status-pill {
  font-size: 0.8rem;
  font-weight: 650;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ea-status-pill.default-status,
.ea-status-pill.pending-status {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.ea-status-pill.custom-status {
  background: #fef3c7;
  color: #92400e;
}

.ea-status-pill.confirmed-status {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.ea-notif-text {
  font-size: 0.84rem;
  color: #b91c1c;
  line-height: 1.4;
  margin: 0;
}

.dealer-ea-notification.confirmed .ea-notif-text {
  color: #15803d;
}

.ea-notif-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-shrink: 0;
}

/* Quick Edit Panel for EA Number */
.ea-quick-edit-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.35rem;
  box-shadow: var(--shadow-sm);
  animation: fadeInBanner 0.2s ease;
}

.ea-quick-edit-box.hidden {
  display: none !important;
}

.ea-quick-edit-inner {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ea-quick-edit-controls {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}

.ea-quick-edit-controls input {
  max-width: 240px;
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* Property Grid Dealer */
.property-grid-dealer {
  display: grid;
  grid-template-columns: repeat(3, 1fr) 2fr 1fr;
  gap: 0.95rem;
}

@media (max-width: 900px) {
  .property-grid-dealer {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .property-grid-dealer {
    grid-template-columns: 1fr;
  }
}

.field-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.field-badge {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-blue);
  background: rgba(37,99,235,0.08);
  padding: 0.12rem 0.5rem;
  border-radius: var(--radius-sm);
  text-transform: none;
}

.field-action-link {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  text-decoration: underline;
  transition: color 0.15s ease;
}

.field-help {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 0.25rem;
  display: block;
}

.field-action-link:hover {
  color: #1d4ed8;
}

.btn-outline-success {
  background: #ffffff;
  color: #15803d;
  border: 1px solid #86efac;
}

.btn-outline-success:hover {
  background: #f0fdf4;
  border-color: #4ade80;
  color: #166534;
}

/* Dark mode for EA notification */
[data-theme="dark"] .dealer-ea-notification {
  background: linear-gradient(135deg, rgba(127, 29, 29, 0.48) 0%, rgba(153, 27, 27, 0.38) 100%);
  border-color: rgba(239, 68, 68, 0.45);
  border-left-color: #ef4444;
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.2);
}

[data-theme="dark"] .dealer-ea-notification .ea-notif-heading {
  color: #fca5a5;
}

[data-theme="dark"] .dealer-ea-notification .ea-notif-text {
  color: #fecaca;
}

[data-theme="dark"] .ea-phone-pill {
  background: #1e293b;
  color: #f87171;
  border-color: #ef4444;
}

[data-theme="dark"] .ea-status-pill.default-status,
[data-theme="dark"] .ea-status-pill.pending-status {
  background: rgba(127, 29, 29, 0.6);
  color: #fca5a5;
  border-color: #ef4444;
}

[data-theme="dark"] .dealer-ea-notification.confirmed {
  background: linear-gradient(135deg, rgba(20, 83, 45, 0.55) 0%, rgba(21, 128, 61, 0.42) 100%);
  border-color: rgba(34, 197, 94, 0.45);
  border-left-color: #4ade80;
  box-shadow: 0 2px 10px rgba(34, 197, 94, 0.2);
}

[data-theme="dark"] .dealer-ea-notification.confirmed .ea-notif-heading {
  color: #86efac;
}

[data-theme="dark"] .dealer-ea-notification.confirmed .ea-notif-text {
  color: #bbf7d0;
}

[data-theme="dark"] .dealer-ea-notification.confirmed .ea-phone-pill {
  background: #1e293b;
  color: #86efac;
  border-color: #22c55e;
}

[data-theme="dark"] .ea-status-pill.confirmed-status {
  background: rgba(20, 83, 45, 0.6);
  color: #86efac;
  border-color: #22c55e;
}

[data-theme="dark"] .btn-outline-success {
  background: #1e293b;
  color: #86efac;
  border-color: #22c55e;
}

[data-theme="dark"] .btn-outline-success:hover {
  background: #14532d;
  color: #ffffff;
}


/* Welcome Card (Displayed when no module button is selected - sized to match Option 1 & 2 grid) */
.welcome-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  min-height: 168px; /* equal to envelope of option 1 and 2 */
  padding: 1.5rem 1.75rem;
  background: var(--surface);
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-top: 0.25rem;
  box-sizing: border-box;
  transition: all 0.25s ease;
}

[data-theme="dark"] .welcome-card {
  border-color: var(--border);
  background: var(--surface);
}

.welcome-icon {
  font-size: 1.75rem;
  margin-bottom: 0.35rem;
  animation: floatIcon 3s ease-in-out infinite;
}

@keyframes floatIcon {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.welcome-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
  letter-spacing: -0.015em;
}

.welcome-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 540px;
  line-height: 1.5;
}

.welcome-sub strong {
  color: var(--text);
  font-weight: 650;
}

/* ==========================================================================
   ⚓ SITE FOOTER (FULL SCREEN WIDTH)
   ========================================================================== */
.site-footer {
  width: 100%;
  margin-top: auto;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 2.5rem 0 1.25rem;
  box-shadow: var(--shadow-sm);
  box-sizing: border-box;
}

.footer-inner {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto 1.75rem;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 2fr 1fr 1.5fr;
  gap: 2rem;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

.footer-logo-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
}

.footer-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.footer-brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.footer-tagline {
  font-size: 0.825rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.footer-privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.725rem;
  font-weight: 650;
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.footer-col h4 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text);
  margin-bottom: 0.85rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-link-btn {
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  text-align: left;
  transition: color 0.18s ease;
  text-decoration: none;
  display: inline-block;
}

.footer-link-btn:hover {
  color: var(--accent-blue);
}

.footer-contact-desc {
  font-size: 0.825rem;
  color: var(--text-muted);
  margin-bottom: 0.65rem;
  line-height: 1.45;
}

.footer-email-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.875rem;
  font-weight: 650;
  color: var(--accent-blue);
  text-decoration: none;
  padding: 0.45rem 0.75rem;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  word-break: break-all;
}

.footer-email-link:hover {
  background: var(--surface-hover);
  border-color: var(--accent-blue);
  transform: translateY(-1px);
}

.footer-bottom-bar {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 1.15rem 1.5rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.775rem;
  color: var(--text-light);
  box-sizing: border-box;
}

/* ==========================================================================
   📄 SPA PAGES (HOME, ABOUT, CONTACT)
   ========================================================================== */
.spa-page {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
  animation: pageFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.spa-page.hidden {
  display: none !important;
}

@keyframes pageFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* About & Contact Page Hero */
.page-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2rem;
  box-shadow: var(--shadow-sm);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #1e40af 0%, #3b82f6 50%, #60a5fa 100%);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #2563eb;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  margin-bottom: 0.85rem;
}

[data-theme="dark"] .hero-badge {
  background: rgba(37, 99, 235, 0.15);
  border-color: rgba(37, 99, 235, 0.3);
  color: #93c5fd;
}

.page-hero h2 {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.page-hero p {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 650px;
  line-height: 1.6;
}

/* About Page Features Grid */
.about-features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

@media (max-width: 768px) {
  .about-features-grid {
    grid-template-columns: 1fr;
  }
}

.about-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.6rem 1.6rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.about-card-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.about-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.45rem;
}

.about-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.about-workflow-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  box-shadow: var(--shadow-sm);
}

.about-workflow-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1.25rem;
  text-align: center;
}

.workflow-steps-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  text-align: center;
}

@media (max-width: 768px) {
  .workflow-steps-row {
    grid-template-columns: 1fr;
  }
}

.workflow-step-box {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
}

.workflow-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-blue);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.6rem;
}

.workflow-step-box h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.workflow-step-box p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Contact Page Grid */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 1.5rem;
}

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

.contact-info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.6rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.contact-email-box {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem;
  text-align: center;
}

.contact-email-addr {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent-blue);
  word-break: break-all;
  display: block;
  margin: 0.4rem 0 0.85rem;
  text-decoration: none;
}

.contact-email-actions {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

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

.contact-form-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--text);
}

.contact-form-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.contact-form-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-form-grid textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 0.75rem 0.95rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.875rem;
  resize: vertical;
  min-height: 100px;
}

.contact-form-grid textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Terms of Service Card & Typography */
.terms-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.2rem 2.4rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}

.terms-section h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.45rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.terms-section p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin: 0;
}

@media (max-width: 768px) {
  .top-bar-top-row {
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.75rem;
  }
  .main-nav-menu {
    margin-left: auto !important;
    align-self: center !important;
    flex-wrap: wrap;
    gap: 0.35rem;
  }
  .header-actions-row {
    flex-wrap: wrap;
    gap: 0.5rem;
    width: 100%;
  }
  .header-action-group {
    flex-wrap: wrap;
    gap: 0.4rem;
  }
  .dealer-grid {
    grid-template-columns: 1fr;
  }
  .dealer-header-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .dealer-header-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .module-nav-bar {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    padding: 0.4rem;
  }
  .module-tab-btn {
    padding: 0.75rem 0.65rem;
    font-size: 0.88rem;
    gap: 0.45rem;
    min-height: 48px;
  }
  .module-tab-btn .tab-icon {
    font-size: 1.15rem;
  }
}

@media (max-width: 480px) {
  .top-bar-top-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .brand-header {
    width: 100%;
  }
  .main-nav-menu {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 0.25rem;
  }
  .module-nav-bar {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.35rem;
    padding: 0.3rem;
  }
  .module-tab-btn {
    padding: 0.6rem 0.35rem;
    font-size: 0.78rem;
    gap: 0.3rem;
    min-height: 44px;
    flex-direction: column;
    text-align: center;
  }
  .module-tab-btn .tab-icon {
    font-size: 1.1rem;
  }
  .module-tab-btn .tab-title {
    font-size: 0.78rem;
    line-height: 1.15;
  }
  .property-grid {
    grid-template-columns: 1fr !important;
  }
  .modal-card.modal-large {
    width: 96vw;
    margin: 0.5rem;
    max-height: 94vh;
  }
  .modal-actions {
    flex-direction: column;
    width: 100%;
  }
  .modal-actions .btn {
    width: 100%;
  }
}

/* ==========================================================================
   🖨️ PRINT MEDIA STYLING
   ========================================================================== */
@media print {
  :root {
    color-scheme: light !important;
  }
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
}

/* ==========================================================================
   ♿ ACCESSIBILITY: PREFERS-REDUCED-MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Prevent layout breaking overflow on long strings */
body {
  overflow-wrap: break-word;
}

/* ==========================================================================
   📖 HOME FAQ & DOCUMENT INFORMATION SECTION (SEO & USER GUIDE)
   ========================================================================== */
.home-faq-section {
  margin-top: 3.5rem;
  margin-bottom: 2rem;
  padding: 2.25rem 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.faq-section-header {
  text-align: center;
  max-width: 780px;
  margin: 0 auto 2.5rem;
}

.faq-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-blue);
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.2);
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  margin-bottom: 0.85rem;
}

.faq-section-header h2 {
  font-size: 1.85rem;
  font-weight: 750;
  color: var(--text);
  margin-bottom: 0.65rem;
  letter-spacing: -0.02em;
}

.faq-section-header p {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.faq-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.faq-card {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.65rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.faq-card:hover {
  transform: translateY(-2px);
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: var(--shadow-md);
}

.faq-card-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.faq-card-icon {
  font-size: 1.75rem;
  line-height: 1;
  padding: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.faq-card-header h3 {
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
  line-height: 1.35;
}

.faq-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-blue);
  background: rgba(37, 99, 235, 0.08);
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
}

.faq-card-body p {
  font-size: 0.885rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.faq-card-body p:last-child {
  margin-bottom: 0;
}

.faq-card-body strong {
  color: var(--text);
}

.faq-card-body code {
  font-family: monospace;
  background: rgba(37, 99, 235, 0.1);
  color: var(--accent-blue);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.85em;
  font-weight: 600;
}

@media (max-width: 900px) {
  .faq-cards-grid {
    grid-template-columns: 1fr;
  }
  .home-faq-section {
    padding: 1.75rem 1.25rem;
  }
}

/* Speed Optimization: Defer layout and rendering of offscreen sections */
.home-faq-section,
.dealer-how-it-works-section,
.site-footer {
  content-visibility: auto;
  contain-intrinsic-size: 1px 500px;
}



