/* =============================================================================
   SortedTrade — Global Design System
   =============================================================================
   Anchored to Docs/pages_inventory.md Part 1 and Docs/software_stack.md §10.
   No inline styles in HTML (CSP enforces this — see Security_Architecture §8).
   Every class here is documented to be reusable across all pages.
   ============================================================================= */

/* ---------- Reset ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}

img, svg, video {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-hover);
}

input, textarea, select {
  font: inherit;
  color: inherit;
}

ul, ol {
  list-style: none;
}

/* ---------- Design tokens ---------- */

:root {
  /* Colours */
  --bg:              #1a1a2e;
  --surface:         #16213e;
  --surface-deep:    #0a192f;
  --primary:         #ff6b00;
  --primary-hover:   #e55d00;
  --primary-tint:    rgba(255, 107, 0, 0.1);
  --text:            #ffffff;
  --text-muted:      rgba(255, 255, 255, 0.6);
  --text-faint:      rgba(255, 255, 255, 0.4);
  --border:          rgba(255, 255, 255, 0.12);
  --border-strong:   rgba(255, 255, 255, 0.2);
  --card-tint:       rgba(255, 255, 255, 0.06);
  --danger:          #f87171;
  --danger-bg:       rgba(248, 113, 113, 0.1);
  --success:         #4ade80;
  --success-bg:      rgba(74, 222, 128, 0.1);
  --warning:         #fbbf24;
  --warning-bg:      rgba(251, 191, 36, 0.1);

  /* Spacing scale (4-pt grid) */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Border-radius scale */
  --radius-sm: 4px;
  --radius:    8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow:     0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg:  0 12px 40px rgba(0, 0, 0, 0.4);
  --shadow-xl:  0 20px 60px rgba(0, 0, 0, 0.5);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition:      0.2s ease;
  --transition-slow: 0.3s ease;
}

/* ---------- Typography utility classes ---------- */

.h1, h1 { font-size: 2.5rem;   font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; }
.h2, h2 { font-size: 1.875rem; font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; }
.h3, h3 { font-size: 1.5rem;   font-weight: 600; line-height: 1.3; }
.h4, h4 { font-size: 1.25rem;  font-weight: 600; line-height: 1.4; }
.h5, h5 { font-size: 1rem;     font-weight: 600; line-height: 1.5; }

.text-lg     { font-size: 1.125rem; line-height: 1.6; }
.text-sm     { font-size: 0.875rem; line-height: 1.5; }
.text-xs     { font-size: 0.75rem;  line-height: 1.4; }

.text-muted  { color: var(--text-muted); }
.text-faint  { color: var(--text-faint); }
.text-primary{ color: var(--primary); }
.text-danger { color: var(--danger); }
.text-success{ color: var(--success); }
.text-warning{ color: var(--warning); }

.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-bold   { font-weight: 700; }
.text-mono   { font-family: 'SF Mono', Monaco, monospace; letter-spacing: 0.02em; }

/* ---------- Layout utilities ---------- */

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.container-narrow {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.stack > * + * { margin-top: var(--space-4); }
.stack-sm > * + * { margin-top: var(--space-2); }
.stack-lg > * + * { margin-top: var(--space-8); }

.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-gap-2 { gap: var(--space-2); }
.flex-gap-4 { gap: var(--space-4); }
.flex-gap-6 { gap: var(--space-6); }
.flex-wrap { flex-wrap: wrap; }

.grid { display: grid; gap: var(--space-6); }
.grid-2 { display: grid; gap: var(--space-6); grid-template-columns: repeat(2, 1fr); }
.grid-3 { display: grid; gap: var(--space-6); grid-template-columns: repeat(3, 1fr); }
.grid-4 { display: grid; gap: var(--space-6); grid-template-columns: repeat(4, 1fr); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 14px 24px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
  user-select: none;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: var(--primary);
  color: var(--text);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
  color: var(--text);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--card-tint);
  border-color: var(--primary);
  color: var(--text);
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(248, 113, 113, 0.3);
}

.btn-danger:hover:not(:disabled) {
  background: var(--danger-bg);
  color: var(--danger);
}

.btn-link {
  background: transparent;
  color: var(--primary);
  padding: var(--space-2) var(--space-3);
  font-weight: 600;
}

.btn-link:hover:not(:disabled) {
  color: var(--primary-hover);
  text-decoration: underline;
}

.btn-sm { padding: 8px 16px; font-size: 0.875rem; }
.btn-lg { padding: 18px 32px; font-size: 1.125rem; }
.btn-block { width: 100%; }

.btn-icon {
  padding: 0;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Form fields ---------- */

.form-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-field-row {
  display: flex;
  gap: var(--space-4);
}
.form-field-row > * { flex: 1; }

.label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
}

.input,
.textarea,
.select {
  display: block;
  width: 100%;
  padding: 14px 16px;
  background: var(--surface-deep);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color var(--transition);
}

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--primary);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--text-faint);
}

.input:disabled,
.textarea:disabled,
.select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.input-error,
.textarea-error {
  border-color: var(--danger);
}

.input-help {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: var(--space-1);
}

.input-error-msg {
  font-size: 0.8rem;
  color: var(--danger);
  margin-top: var(--space-1);
}

.textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.5;
}

.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='rgba(255,255,255,0.6)' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 12px;
  padding-right: 40px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.input-group {
  display: flex;
  align-items: stretch;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-deep);
  transition: border-color var(--transition);
}

.input-group:focus-within {
  border-color: var(--primary);
}

.input-group > .input {
  border: none;
  background: transparent;
  flex: 1;
}

.input-group > .input:focus { border: none; }

.input-group-prefix,
.input-group-suffix {
  display: flex;
  align-items: center;
  padding: 0 16px;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.2);
  font-size: 0.95rem;
}

/* Phone number formatted entry */
.phone-input {
  font-family: 'SF Mono', Monaco, monospace;
  letter-spacing: 0.05em;
}

/* OTP boxes — one per digit */
.otp-input-group {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
}

.otp-input {
  width: 56px;
  height: 64px;
  text-align: center;
  font-size: 1.75rem;
  font-weight: 700;
  font-family: 'SF Mono', Monaco, monospace;
  background: var(--surface-deep);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  transition: all var(--transition);
}

.otp-input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
  transform: scale(1.04);
}

.otp-input.error {
  border-color: var(--danger);
  animation: shake 0.4s ease;
}

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

@media (prefers-reduced-motion: reduce) {
  .otp-input.error { animation: none; }
  .otp-input:focus { transform: none; }
}

/* ---------- Cards ---------- */

.card {
  background: var(--card-tint);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  backdrop-filter: blur(8px);
}

.card-lg {
  padding: var(--space-8);
}

.card-elevated {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

.card-header {
  padding-bottom: var(--space-4);
  margin-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.card-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  box-shadow: var(--shadow-xl);
}

.auth-card-wide {
  max-width: 560px;
}

/* ---------- Pills / tags ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 4px 12px;
  background: var(--card-tint);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.pill-success { background: var(--success-bg); border-color: var(--success); color: var(--success); }
.pill-warning { background: var(--warning-bg); border-color: var(--warning); color: var(--warning); }
.pill-danger  { background: var(--danger-bg);  border-color: var(--danger);  color: var(--danger); }
.pill-primary { background: var(--primary-tint); border-color: var(--primary); color: var(--primary); }
.pill-neutral { background: var(--card-tint); border-color: var(--border); color: var(--text-muted); }

/* ---------- Alerts / banners ---------- */

.alert {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius);
  border-left: 4px solid;
  background: var(--card-tint);
}

.alert-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 2px;
}

.alert-body {
  flex: 1;
  font-size: 0.95rem;
  line-height: 1.5;
}

.alert-title {
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.alert-info    { border-left-color: #60a5fa; background: rgba(96, 165, 250, 0.08); }
.alert-success { border-left-color: var(--success); background: var(--success-bg); }
.alert-warning { border-left-color: var(--warning); background: var(--warning-bg); }
.alert-error   { border-left-color: var(--danger);  background: var(--danger-bg); }

/* ---------- Tables ---------- */

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.table th {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  background: var(--surface-deep);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.table td {
  padding: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.table tbody tr {
  transition: background var(--transition-fast);
  cursor: pointer;
}

.table tbody tr:hover {
  background: var(--card-tint);
}

.table tbody tr:last-child td { border-bottom: none; }

.table-active {
  background: var(--primary-tint);
}

/* ---------- Modal / dialog ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: var(--space-4);
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  position: relative;
}

.modal-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all var(--transition);
}

.modal-close:hover {
  background: var(--card-tint);
  color: var(--text);
}

.modal-header { margin-bottom: var(--space-4); padding-right: var(--space-12); }
.modal-body   { margin-bottom: var(--space-6); }
.modal-footer { display: flex; gap: var(--space-3); justify-content: flex-end; padding-top: var(--space-4); border-top: 1px solid var(--border); }

/* ---------- Spinner / loading ---------- */

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner-lg { width: 32px; height: 32px; border-width: 3px; }

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

@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2s; }
}

.btn .spinner { border-top-color: currentColor; }

/* ---------- Public-shell navigation ---------- */

.public-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 64px;
  background: rgba(26, 26, 46, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
}

.public-nav-inner {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text);
}

.brand:hover { color: var(--text); }

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  background: var(--primary);
  color: var(--text);
  font-weight: 800;
}

.public-nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 1;
  justify-content: center;
}

.nav-link {
  padding: var(--space-2) var(--space-4);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--radius);
  transition: all var(--transition);
}

.nav-link:hover {
  color: var(--text);
  background: var(--card-tint);
}

.nav-link-active {
  color: var(--primary);
  background: var(--primary-tint);
}

.public-nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* Mobile hamburger (hidden on desktop) */
.nav-menu-btn {
  display: none;
  padding: var(--space-2);
  border-radius: var(--radius);
  color: var(--text);
}

/* ---------- Public-shell footer ---------- */

.public-footer {
  background: var(--surface-deep);
  border-top: 1px solid var(--border);
  padding: var(--space-12) 0 var(--space-6);
  margin-top: var(--space-16);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: var(--space-8);
  margin-bottom: var(--space-8);
}

.footer-col-brand p {
  color: var(--text-muted);
  margin-top: var(--space-3);
  max-width: 320px;
}

.footer-col h6 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: var(--space-3);
}

.footer-col ul li { margin-bottom: var(--space-2); }
.footer-col a {
  color: var(--text-muted);
  font-size: 0.95rem;
}
.footer-col a:hover { color: var(--text); }

.footer-bottom {
  padding-top: var(--space-6);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.footer-copyright {
  font-size: 0.85rem;
  color: var(--text-faint);
}

.footer-social {
  display: flex;
  gap: var(--space-3);
}

.footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: all var(--transition);
}

.footer-social a:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ---------- Hero (landing page) ---------- */

.hero {
  position: relative;
  padding: var(--space-16) 0 var(--space-12);
  text-align: center;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 600px;
  background: radial-gradient(closest-side, var(--primary-tint), transparent);
  pointer-events: none;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 880px;
  margin: 0 auto;
}

.hero-eyebrow {
  display: inline-block;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--primary-tint);
  border: 1px solid rgba(255, 107, 0, 0.3);
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: var(--space-6);
  letter-spacing: 0.02em;
}

.hero h1 {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-6);
}

.hero h1 .accent {
  display: block;
  color: var(--primary);
  margin-top: var(--space-2);
}

.hero-sub {
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto var(--space-8);
}

.hero-cta {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  flex-wrap: wrap;
}

.hero-trust {
  margin-top: var(--space-12);
  font-size: 0.85rem;
  color: var(--text-faint);
}

/* ---------- Sections (landing page) ---------- */

.section {
  padding: var(--space-12) 0;
}

.section-narrow {
  padding: var(--space-8) 0;
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-12);
}

.section-title {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-3);
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* ---------- Feature cards ---------- */

.feature-card {
  background: var(--card-tint);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-8);
  transition: all var(--transition);
}

.feature-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: var(--primary-tint);
  color: var(--primary);
  margin-bottom: var(--space-4);
}

.feature-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.feature-card p {
  color: var(--text-muted);
  line-height: 1.6;
}

/* ---------- Pricing cards ---------- */

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  align-items: start;
}

.pricing-card {
  background: var(--card-tint);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  position: relative;
  transition: all var(--transition);
}

.pricing-card:hover {
  border-color: var(--border-strong);
}

.pricing-card-featured {
  border-color: var(--primary);
  background: var(--surface);
  transform: scale(1.03);
  box-shadow: var(--shadow-lg);
}

.pricing-card-featured:hover {
  border-color: var(--primary);
}

.pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 14px;
  background: var(--primary);
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: var(--radius-pill);
}

.pricing-name {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}

.pricing-price {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: var(--space-1);
}

.pricing-period {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-muted);
}

.pricing-setup {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: var(--space-6);
}

.pricing-features {
  margin-bottom: var(--space-8);
}

.pricing-features li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  font-size: 0.95rem;
  color: var(--text);
}

.pricing-features li::before {
  content: '✓';
  flex-shrink: 0;
  color: var(--success);
  font-weight: 700;
}

/* ---------- Multi-step progress indicator (signup) ---------- */

.steps {
  display: flex;
  gap: var(--space-1);
  padding: var(--space-4) 0;
}

.steps-dot {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: var(--radius-pill);
  transition: background var(--transition);
}

.steps-dot-done { background: var(--success); }
.steps-dot-current { background: var(--primary); }

.steps-label {
  margin-top: var(--space-2);
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}

/* ---------- Auth page layout ---------- */

.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.auth-page-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--space-4);
}

.auth-page-footer {
  padding: var(--space-4);
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-faint);
}

.auth-page-footer a { color: var(--text-muted); }

/* ---------- Skip link (a11y) ---------- */

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  padding: var(--space-2) var(--space-4);
  background: var(--primary);
  color: var(--text);
  z-index: 1000;
  border-radius: 0 0 var(--radius) 0;
}

.skip-link:focus {
  top: 0;
}

/* ---------- Visually-hidden (a11y) ---------- */

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

/* ---------- Focus rings ---------- */

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

button:focus-visible,
.btn:focus-visible {
  outline-offset: 4px;
}

/* ---------- Responsive (mobile-first breakpoint at 768px) ---------- */

@media (max-width: 768px) {
  body { font-size: 15px; }

  h1, .h1 { font-size: 2rem; }
  h2, .h2 { font-size: 1.5rem; }
  h3, .h3 { font-size: 1.25rem; }

  .container, .container-narrow { padding: 0 var(--space-4); }

  /* Public nav collapses */
  .public-nav-links { display: none; }
  .public-nav-actions .btn { padding: 10px 16px; font-size: 0.9rem; }
  .nav-menu-btn { display: inline-flex; }

  /* Layout grids stack */
  .grid-2,
  .grid-3,
  .grid-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-col-brand { grid-column: 1 / -1; }

  /* Pricing stacks */
  .pricing-grid { grid-template-columns: 1fr; }
  .pricing-card-featured { transform: none; }

  /* Hero scales down */
  .hero { padding: var(--space-12) 0 var(--space-8); }
  .hero-sub { font-size: 1rem; }
  .hero-cta .btn { width: 100%; max-width: 320px; }

  /* Form rows stack */
  .form-field-row { flex-direction: column; }

  /* Auth card full-width */
  .auth-card { padding: var(--space-6); }

  /* OTP boxes shrink */
  .otp-input { width: 44px; height: 52px; font-size: 1.4rem; }
  .otp-input-group { gap: var(--space-2); }

  /* Modal full-screen-ish */
  .modal { padding: var(--space-6); border-radius: var(--radius); }
}

/* ---------- Definition list (info-row) ---------- */

.info-list {
  margin: 0;
  display: flex; flex-direction: column;
}
.info-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
}
.info-row:last-child { border-bottom: none; }
.info-row dt { color: var(--text-muted); font-size: 0.9rem; }
.info-row dd { margin: 0; color: var(--text); font-size: 0.95rem; }
@media (max-width: 600px) {
  .info-row { grid-template-columns: 1fr; gap: var(--space-1); }
}

/* Usage progress bars (billing) */
.usage-row { margin-bottom: var(--space-3); }
.usage-bar {
  margin-top: var(--space-2);
  height: 8px;
  background: var(--bg-muted);
  border-radius: 4px;
  overflow: hidden;
}
.usage-bar-fill {
  height: 100%;
  background: var(--primary);
  transition: width 0.4s ease;
}

/* Aliases for pill variants used in newer pages */
.pill-info   { background: rgba(96, 165, 250, 0.12); border-color: #60a5fa; color: #2563eb; }
.pill-muted  { background: var(--card-tint, var(--bg-muted)); border-color: var(--border); color: var(--text-muted); }

/* ---------- Dealer dashboard chrome ---------- */

.dealer-nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(180%) blur(8px);
}
.dealer-nav-inner {
  max-width: var(--container-xl, 1280px);
  margin: 0 auto;
  padding: 0 var(--space-6);
  height: 64px;
  display: flex; align-items: center; gap: var(--space-6);
}
.dealer-nav-links {
  flex: 1;
  display: flex; align-items: center; gap: var(--space-2);
}
.dealer-nav-link {
  display: inline-flex; align-items: center;
  padding: 8px 12px;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.92rem;
  text-decoration: none;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.dealer-nav-link:hover { color: var(--text); background: var(--bg-muted); }
.dealer-nav-link-active { color: var(--primary); background: var(--primary-bg); }
.dealer-nav-actions { display: flex; align-items: center; gap: var(--space-3); }

.account-menu { position: relative; }
.account-menu-btn {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: 6px 10px 6px 6px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}
.account-menu-btn:hover { background: var(--bg-muted); border-color: var(--border-strong, var(--border)); }
.account-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--primary); color: #fff;
  font-weight: 600; font-size: 0.85rem;
  display: inline-flex; align-items: center; justify-content: center;
}
.account-meta { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.account-meta-name { font-size: 0.85rem; font-weight: 500; color: var(--text); }
.account-meta-dealer { font-size: 0.72rem; color: var(--text-muted); }

.account-menu-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 220px;
  background: var(--surface, #fff);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: var(--space-2);
  z-index: 100;
}
.account-menu-item {
  display: block;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.92rem;
  text-decoration: none;
}
.account-menu-item:hover { background: var(--bg-muted); }
.account-menu-item-danger { color: var(--danger); }
.account-menu-item-danger:hover { background: var(--danger-bg); }
.account-menu-divider { border: none; border-top: 1px solid var(--border); margin: var(--space-2) 0; }

.dealer-footer {
  background: var(--bg-muted);
  border-top: 1px solid var(--border);
  padding: var(--space-4) 0;
  margin-top: var(--space-12);
  font-size: 0.85rem;
}
.dealer-footer-inner {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  flex-wrap: wrap;
  color: var(--text-muted);
}
.dealer-footer-meta { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.dealer-footer-meta a { color: var(--text-muted); text-decoration: none; }
.dealer-footer-meta a:hover { color: var(--primary); }
.dealer-footer-status { display: inline-flex; align-items: center; gap: var(--space-2); }

.status-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-muted);
}
.status-dot-ok    { background: var(--success); }
.status-dot-warn  { background: var(--warning); }
.status-dot-error { background: var(--danger); }

/* Dealer page header (below nav) */
.dealer-page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--space-4); flex-wrap: wrap;
  margin-bottom: var(--space-6);
}
.dealer-page-title { margin: 0 0 var(--space-1) 0; }
.dealer-page-subtitle { margin: 0; color: var(--text-muted); }
.dealer-page-actions { display: flex; gap: var(--space-3); }

/* Metric cards (dashboard) */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}
.metric-card {
  background: var(--surface, #fff);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  text-decoration: none;
  color: inherit;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
  cursor: pointer;
  display: block;
}
.metric-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--primary); }
.metric-card-value { font-size: 2rem; font-weight: 700; line-height: 1; color: var(--text); }
.metric-card-label { font-size: 0.85rem; color: var(--text-muted); margin-top: var(--space-2); }
.metric-card-trend { font-size: 0.78rem; margin-top: var(--space-2); }
.metric-card-trend-up   { color: var(--success); }
.metric-card-trend-down { color: var(--danger); }

/* Toast container */
.toast-container {
  position: fixed; bottom: var(--space-4); right: var(--space-4);
  z-index: 200;
  display: flex; flex-direction: column; gap: var(--space-2);
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  background: var(--text);
  color: #fff;
  font-size: 0.92rem;
  max-width: 360px;
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
}
.toast-visible { opacity: 1; transform: translateY(0); }
.toast-success { background: var(--success); }
.toast-error   { background: var(--danger); }
.toast-warning { background: var(--warning); color: var(--text); }

/* Modal helpers (for dynamic confirm dialog) */
.modal-open { display: flex; align-items: center; justify-content: center; }
.modal-dialog {
  position: relative;
  background: var(--surface, #fff);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  max-width: 520px;
  width: calc(100% - var(--space-8));
  box-shadow: var(--shadow-lg);
  z-index: 1;
}
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 0;
}
.modal.modal-open {
  position: fixed; inset: 0;
  z-index: 300;
}

/* Sidebar layout (e.g. /my-business sub-pages) */
.dealer-layout-sidebar {
  display: grid; grid-template-columns: 220px 1fr;
  gap: var(--space-8);
}
.dealer-sidebar {
  position: sticky; top: 80px; align-self: start;
  display: flex; flex-direction: column; gap: 4px;
}
.dealer-sidebar-link {
  display: block;
  padding: 8px 12px;
  border-radius: var(--radius);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
}
.dealer-sidebar-link:hover { background: var(--bg-muted); color: var(--text); }
.dealer-sidebar-link-active { background: var(--primary-bg); color: var(--primary); }

/* Utility — hide elements on mobile (used by the nav) */
@media (max-width: 768px) {
  .hide-mobile { display: none !important; }
  .dealer-nav-links { display: none; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .dealer-layout-sidebar { grid-template-columns: 1fr; }
  .dealer-sidebar { position: static; flex-direction: row; overflow-x: auto; }
}

/* ---------- Tabs (used on vehicle detail, signup, etc.) ---------- */

.tabs {
  display: flex; gap: 2px;
  border-bottom: 1px solid var(--border);
  margin: 0 0 var(--space-4);
  overflow-x: auto;
}
.tab {
  appearance: none;
  background: transparent;
  border: none;
  padding: 10px 16px;
  font-size: 0.92rem;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab-active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

.tab-panel { padding: var(--space-2) 0; }

/* Drop zone (V5C, photos) */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  text-align: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}
.drop-zone:hover, .drop-zone:focus-visible, .drop-zone.is-dragover {
  border-color: var(--primary);
  background: var(--primary-bg);
  outline: none;
}
.drop-zone svg { color: var(--text-muted); margin-bottom: var(--space-3); }

/* Photo grid */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-3);
}
.photo-tile {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--bg-muted);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: grab;
}
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-tile-remove {
  position: absolute; top: 6px; right: 6px;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(0, 0, 0, 0.6); color: #fff;
  border: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px;
}

/* Chat bubble (used on enquiry detail + customer chat) */
.chat-window {
  display: flex; flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  height: 540px;
  overflow: hidden;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4);
  display: flex; flex-direction: column; gap: var(--space-3);
  background: var(--bg-muted);
}
.chat-bubble {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.92rem;
  line-height: 1.45;
  word-wrap: break-word;
}
.chat-bubble-customer {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.chat-bubble-dealer {
  align-self: flex-end;
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-bubble-ai {
  align-self: flex-end;
  background: var(--primary-bg);
  color: var(--primary);
  border: 1px dashed var(--primary);
  border-bottom-right-radius: 4px;
  font-style: italic;
}
.chat-bubble-meta { font-size: 0.7rem; opacity: 0.7; margin-top: 4px; display: block; }

.chat-input-row {
  display: flex; gap: var(--space-2);
  padding: var(--space-3);
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.chat-input-row textarea {
  flex: 1; resize: none;
  min-height: 40px; max-height: 120px;
}

/* PDI checklist + signature pad */
.checklist-section {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
}
.checklist-section h4 {
  margin: 0 0 var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border);
}
.checklist-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-3);
  align-items: start;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
}
.checklist-item:last-child { border-bottom: none; }
.checklist-item-label { font-weight: 500; }
.checklist-item-controls { display: flex; gap: 4px; }
.checklist-item-controls input[type="radio"] { display: none; }
.checklist-item-controls label {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
  cursor: pointer;
  font-weight: 500;
}
.checklist-item-controls input[type="radio"]:checked + label.ok      { background: var(--success-bg); color: var(--success); border-color: var(--success); }
.checklist-item-controls input[type="radio"]:checked + label.issue   { background: var(--danger-bg);  color: var(--danger);  border-color: var(--danger); }
.checklist-item-detail { grid-column: 1 / -1; margin-top: var(--space-2); }
.checklist-item-detail textarea { width: 100%; min-height: 60px; resize: vertical; }

.signature-pad-wrap {
  display: inline-block;
}
#signature-pad {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: #fff;
  width: 100%;
  max-width: 600px;
  touch-action: none;
  cursor: crosshair;
}

/* Workflow timeline (complaints) */
.workflow-timeline {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: var(--space-2);
}
.workflow-timeline li {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
}
.workflow-step-dot {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px;
}
.workflow-step-done .workflow-step-dot { background: var(--success); border-color: var(--success); color: #fff; }
.workflow-step-current .workflow-step-dot { background: var(--primary); border-color: var(--primary); color: #fff; }
.workflow-step-label { font-weight: 500; }
.workflow-step-meta  { color: var(--text-muted); font-size: 0.85rem; }

/* Letter editor (acknowledge / final response) */
.letter-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}
@media (max-width: 1024px) { .letter-layout { grid-template-columns: 1fr; } }
.letter-preview {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-6);
  min-height: 600px;
  white-space: pre-wrap;
  font-family: 'Inter', system-ui, sans-serif;
  line-height: 1.6;
}

/* DISP clock (complaints) */
.disp-clock {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600; font-size: 0.85rem;
}
.disp-clock-ok       { background: var(--success-bg);  color: var(--success); }
.disp-clock-warning  { background: var(--warning-bg);  color: var(--warning); }
.disp-clock-danger   { background: var(--danger-bg);   color: var(--danger); }

/* ---------- Platform admin chrome ---------- */

.admin-nav {
  position: sticky; top: 0; z-index: 50;
  background: #0f172a;
  color: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.admin-nav-inner {
  max-width: var(--container-xl, 1280px);
  margin: 0 auto;
  padding: 0 var(--space-6);
  height: 56px;
  display: flex; align-items: center; gap: var(--space-6);
}
.admin-brand {
  display: inline-flex; align-items: center; gap: var(--space-2);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}
.admin-brand-mark {
  background: #f59e0b !important;
  color: #0f172a !important;
}
.admin-tag {
  padding: 2px 6px;
  border-radius: 4px;
  background: #f59e0b;
  color: #0f172a;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.admin-nav-links { flex: 1; display: flex; gap: var(--space-2); }
.admin-nav-link {
  display: inline-flex; align-items: center;
  padding: 8px 12px;
  border-radius: var(--radius);
  color: rgba(255, 255, 255, 0.65);
  font-weight: 500; font-size: 0.92rem;
  text-decoration: none;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.admin-nav-link:hover         { color: #fff; background: rgba(255, 255, 255, 0.08); }
.admin-nav-link-active        { color: #fff; background: rgba(245, 158, 11, 0.18); }

.admin-nav-actions {
  display: flex; align-items: center; gap: var(--space-3);
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.85rem;
}
.admin-user-email { color: rgba(255, 255, 255, 0.7); font-family: 'SF Mono', Monaco, monospace; }

.admin-footer {
  background: #0f172a;
  color: rgba(255, 255, 255, 0.6);
  padding: var(--space-4) 0;
  text-align: center;
  font-size: 0.78rem;
  margin-top: var(--space-12);
}
.admin-footer .text-muted { color: rgba(255, 255, 255, 0.35); }

/* Admin filter bar */
.filter-bar {
  display: flex; gap: var(--space-3); flex-wrap: wrap;
  padding: var(--space-3); background: var(--bg-muted); border-radius: var(--radius);
  margin-bottom: var(--space-4);
}
.filter-bar .form-field { margin: 0; }

/* ---------- Print styles (legal pages) ---------- */

@media print {
  .public-nav, .public-footer, .dealer-nav, .dealer-footer, .btn { display: none; }
  body { color: #000; background: #fff; }
}

/* =============================================================================
   Homepage chat (hc-*) — chat-first landing page
   No conflicts with existing .chat-* dealer-dashboard classes.
   ============================================================================= */

.hc-body { overflow: hidden; }

.hc-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 60% at 10% 20%, rgba(255, 107, 0, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse 70% 70% at 90% 85%, rgba(37, 99, 235, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse 50% 50% at 70% 30%, rgba(139, 92, 246, 0.08) 0%, transparent 40%),
    linear-gradient(160deg, #1a1f2e 0%, #1a1a2e 50%, #0c1015 100%);
  animation: hcBgShift 20s ease-in-out infinite alternate;
}

@keyframes hcBgShift {
  0%   { opacity: 1; }
  100% { opacity: 0.82; }
}

.hc-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(26, 26, 46, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.hc-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.hc-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hc-nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all var(--transition);
}
.hc-nav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.12);
}
.hc-nav-link.hc-nav-primary {
  background: linear-gradient(180deg, #ff7a1a 0%, #ff6b00 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(255, 107, 0, 0.3);
}
.hc-nav-link.hc-nav-primary:hover {
  filter: brightness(1.08);
  color: #fff;
}

.hc-main {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  padding: 5rem 1.5rem 1.5rem;
}

/* Glass morphism chat window */
.hc-window {
  width: 100%;
  max-width: 640px;
  height: calc(100vh - 6.5rem);
  max-height: 680px;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg,
    rgba(255, 255, 255, 0.12) 0%,
    rgba(255, 255, 255, 0.06) 50%,
    rgba(255, 255, 255, 0.10) 100%);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-bottom-color: rgba(255, 255, 255, 0.1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 20px 60px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

/* Messages scroll area */
.hc-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  scroll-behavior: smooth;
}
.hc-messages::-webkit-scrollbar { width: 4px; }
.hc-messages::-webkit-scrollbar-track { background: transparent; }
.hc-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 2px;
}

/* Message rows */
.hc-msg {
  display: flex;
  max-width: 85%;
}
.hc-msg-bot  { align-self: flex-start; flex-direction: column; gap: 0.4rem; }
.hc-msg-user { align-self: flex-end; }

.hc-bubble {
  padding: 0.75rem 1rem;
  border-radius: 16px;
  font-size: 0.93rem;
  line-height: 1.55;
  word-break: break-word;
}
.hc-bubble-bot {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-bottom-left-radius: 4px;
  color: var(--text);
}
.hc-bubble-user {
  background: linear-gradient(180deg, #ff7a1a 0%, #ff6b00 100%);
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 8px rgba(255, 107, 0, 0.3);
}

/* Typing indicator */
.hc-typing {
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  width: fit-content;
}
.hc-typing-dot {
  width: 6px;
  height: 6px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: hcTyping 1.3s ease-in-out infinite;
}
.hc-typing-dot:nth-child(2) { animation-delay: 0.18s; }
.hc-typing-dot:nth-child(3) { animation-delay: 0.36s; }
@keyframes hcTyping {
  0%, 60%, 100% { opacity: 0.25; transform: translateY(0); }
  30%           { opacity: 1;    transform: translateY(-3px); }
}

/* Quick-reply chips (shown under bot messages) */
.hc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.hc-chip {
  padding: 0.38rem 0.85rem;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.hc-chip:hover {
  background: rgba(255, 107, 0, 0.12);
  border-color: rgba(255, 107, 0, 0.4);
  color: #ff6b00;
}

/* Dealer result cards */
.hc-dealer-cards {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  max-width: 100%;
}
.hc-dealer-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1rem;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  transition: all 0.18s;
  font-size: 0.875rem;
}
.hc-dealer-card:hover {
  background: rgba(255, 107, 0, 0.1);
  border-color: rgba(255, 107, 0, 0.35);
  color: var(--text);
  transform: translateX(2px);
}
.hc-dealer-info  { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hc-dealer-name  { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hc-dealer-meta  { color: var(--text-muted); font-size: 0.78rem; }
.hc-dealer-dist  { color: var(--primary); font-size: 0.8rem; font-weight: 600; white-space: nowrap; padding-left: 0.75rem; }

/* Input bar */
.hc-input-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.18);
}
.hc-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-full);
  padding: 0.6rem 1rem;
  color: var(--text);
  font-size: 0.93rem;
  outline: none;
  transition: border-color var(--transition);
  min-width: 0;
}
.hc-input:focus         { border-color: rgba(255, 107, 0, 0.5); }
.hc-input::placeholder  { color: var(--text-faint); }
.hc-input:disabled      { opacity: 0.4; cursor: not-allowed; }
.hc-send {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hc-send:disabled { opacity: 0.4; cursor: not-allowed; }

/* Sell form page */
.sell-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 7rem 1.5rem 4rem;
}
.sell-card {
  width: 100%;
  max-width: 600px;
  background: linear-gradient(135deg,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0.05) 100%);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 24px;
  padding: 2.5rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), 0 20px 60px rgba(0,0,0,0.4);
}
.sell-card h1 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
}
.sell-card .sell-sub {
  color: var(--text-muted);
  font-size: 0.93rem;
  margin-bottom: 2rem;
}
.sell-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
}
.sell-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
.sell-input, .sell-select, .sell-textarea {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  padding: 0.65rem 0.9rem;
  color: var(--text);
  font-size: 0.93rem;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition);
  width: 100%;
}
.sell-input:focus, .sell-select:focus, .sell-textarea:focus {
  border-color: rgba(255, 107, 0, 0.5);
}
.sell-input::placeholder, .sell-textarea::placeholder { color: var(--text-faint); }
.sell-select option { background: #1a1a2e; }
.sell-textarea { resize: vertical; min-height: 90px; }
.sell-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.sell-success {
  text-align: center;
  padding: 2rem 0;
  display: none;
}
.sell-success-icon { font-size: 3rem; margin-bottom: 1rem; }
.sell-success h2   { font-size: 1.5rem; margin-bottom: 0.5rem; }
.sell-success p    { color: var(--text-muted); }

/* Mobile */
@media (max-width: 640px) {
  .hc-window {
    border-radius: 16px;
    max-height: none;
    height: calc(100dvh - 5.5rem);
  }
  .hc-main {
    padding: 4.5rem 0.5rem 0.5rem;
  }
  .hc-msg { max-width: 95%; }
  .sell-card { padding: 1.75rem 1.25rem; border-radius: 16px; }
  .sell-row  { grid-template-columns: 1fr; }
}
