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

:root {
  --primary: #2563eb;
  --primary-light: #eff6ff;
  --primary-hover: #1d4ed8;
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --text-secondary: #64748b;
  --text-tertiary: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --red: #ef4444;
  --red-bg: #fef2f2;
  --green: #22c55e;
  --green-bg: #f0fdf4;
  --yellow: #f59e0b;
  --yellow-bg: #fffbeb;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* User bar */
.user-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

.user-name {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Login page */
.login-card {
  max-width: 400px;
  margin: 3rem auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  text-align: center;
  box-shadow: var(--shadow);
}

.login-card h2 {
  margin-bottom: 1.5rem;
  font-size: 1.3rem;
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 1rem;
  background: white;
  color: #3c4043;
  border: 1px solid #dadce0;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
  text-decoration: none;
  margin-bottom: 0.75rem;
}

.btn-google:hover {
  background: #f7f8f8;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.btn-apple {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 1rem;
  background: #000;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: not-allowed;
  opacity: 0.4;
  margin-bottom: 1.5rem;
}

.divider {
  display: flex;
  align-items: center;
  margin: 1.25rem 0;
  color: var(--text-tertiary);
  font-size: 0.82rem;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.divider span {
  padding: 0 0.75rem;
}

.form-input {
  display: block;
  width: 100%;
  padding: 0.7rem 0.9rem;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.error-msg {
  background: var(--red-bg);
  color: var(--red);
  padding: 0.6rem 0.9rem;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
  text-align: left;
}

.toggle-text {
  margin-top: 1rem;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.toggle-text a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.toggle-text a:hover {
  text-decoration: underline;
}

.login-note {
  font-size: 0.78rem;
  color: var(--text-tertiary);
}

/* Plan badges */
.plan-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.plan-badge.free {
  background: var(--border-light);
  color: var(--text-tertiary);
}

.plan-badge.pro {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
}

/* Usage bar */
.usage-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.usage-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.btn-upgrade {
  padding: 0.3rem 0.75rem;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-upgrade:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.usage-meter {
  height: 6px;
  background: var(--border-light);
  border-radius: 3px;
  overflow: hidden;
}

.usage-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.usage-fill.full {
  background: var(--red);
}

/* Upgrade modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  max-width: 800px;
  width: 95%;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.modal-card h2 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

.modal-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

/* Pricing options side-by-side */
.pricing-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

@media (max-width: 500px) {
  .pricing-options {
    grid-template-columns: 1fr;
  }
  .modal-card {
    max-width: 95% !important;
    padding: 1.5rem 1rem !important;
  }
}

.pricing-card {
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 0.5rem;
  position: relative;
}

.pricing-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  margin-bottom: 0.5rem;
}

.pricing-card-pro .pricing-label {
  color: var(--primary);
}

.pricing-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.pricing-legal {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  margin-top: 0.75rem;
  line-height: 1.4;
}

.pricing-savings {
  font-size: 0.75rem;
  color: var(--green);
  font-weight: 600;
  margin-top: 0.75rem;
}

.btn-single {
  background: #6366f1;
}

.btn-single:hover {
  background: #4f46e5;
}

/* Single payment form */
.single-payment-form {
  text-align: left;
  margin-bottom: 0.5rem;
}

.single-payment-form h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
  text-align: center;
}

.card-element {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  background: white;
  margin-bottom: 0.5rem;
}

.card-errors {
  color: var(--red);
  font-size: 0.82rem;
  min-height: 1.25rem;
  margin-bottom: 0.25rem;
}

.price {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 1rem;
}

.price span {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-secondary);
}

.features-list {
  list-style: none;
  text-align: left;
  margin-bottom: 1.25rem;
}

.features-list li {
  padding: 0.35rem 0;
  padding-left: 1.5rem;
  position: relative;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.features-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6rem;
  width: 16px;
  height: 16px;
  background: var(--green);
  border-radius: 50%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-size: 10px;
  background-repeat: no-repeat;
  background-position: center;
}

/* Ad slots */
.ad-slot {
  margin: 1rem 0;
  min-height: 50px;
  text-align: center;
}

.ad-banner {
  min-height: 90px;
}

.ad-inline {
  padding: 0.5rem 2rem;
  border-top: 1px solid var(--border-light);
}

/* Header */
header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: var(--primary);
  color: white;
  border-radius: 10px;
  font-weight: 800;
  font-size: 1.4rem;
}

h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
}

.tagline {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 0.75rem;
}

.trust-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: var(--text-tertiary);
}

.dot {
  width: 3px;
  height: 3px;
  background: var(--text-tertiary);
  border-radius: 50%;
}

/* Upload Area */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 3.5rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: var(--shadow);
}

.upload-icon {
  color: var(--text-tertiary);
  margin-bottom: 1rem;
}

.drop-zone:hover .upload-icon,
.drop-zone.drag-over .upload-icon {
  color: var(--primary);
}

.upload-text {
  font-size: 1.05rem;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.browse-link {
  color: var(--primary);
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.browse-link:hover {
  border-bottom-color: var(--primary);
}

.file-types {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.82rem;
  color: var(--text-tertiary);
}

/* Preview */
.preview-section {
  margin-top: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
}

.image-preview {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  border-radius: 8px;
  background: var(--border-light);
}

.preview-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
}

.file-name {
  font-size: 0.85rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Buttons */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  margin-top: 1rem;
  padding: 0.9rem 1.5rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow);
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-outline {
  padding: 0.5rem 1rem;
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-outline:hover {
  background: var(--primary-light);
}

.btn-text {
  background: none;
  border: none;
  color: var(--red);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.btn-text:hover {
  background: var(--red-bg);
}

/* Loading */
.loading-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  text-align: center;
  box-shadow: var(--shadow);
}

.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1.25rem;
}

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

.loading-card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.25rem;
}

.loading-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.progress-steps {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  font-size: 0.82rem;
  color: var(--text-tertiary);
}

.progress-steps .step {
  position: relative;
  padding-left: 1.25rem;
}

.progress-steps .step::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
}

.progress-steps .step.active::before {
  border-color: var(--primary);
  background: var(--primary);
  animation: pulse 1.5s infinite;
}

.progress-steps .step.done::before {
  border-color: var(--green);
  background: var(--green);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Results */
.results {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.results-header h2 {
  font-size: 1.25rem;
}

.analysis-content {
  padding: 1.5rem 2rem;
  line-height: 1.75;
}

.analysis-content h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
}

.analysis-content h2:first-child {
  margin-top: 0;
}

.analysis-content h3 {
  font-size: 1rem;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.analysis-content p {
  margin-bottom: 0.75rem;
  color: var(--text);
}

.analysis-content ul, .analysis-content ol {
  margin-left: 1.25rem;
  margin-bottom: 0.75rem;
}

.analysis-content li {
  margin-bottom: 0.35rem;
}

.analysis-content strong {
  color: var(--text);
  font-weight: 600;
}

.analysis-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.88rem;
}

.analysis-content th {
  background: var(--border-light);
  text-align: left;
  padding: 0.6rem 0.75rem;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border);
}

.analysis-content td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border-light);
}

.analysis-content tr:hover td {
  background: var(--bg);
}

.analysis-content code {
  background: var(--border-light);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.88em;
}

.analysis-content blockquote {
  border-left: 3px solid var(--primary);
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  background: var(--primary-light);
  border-radius: 0 8px 8px 0;
  color: var(--text-secondary);
}

.results-footer {
  padding: 1rem 2rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.results-footer p {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  text-align: center;
}

/* Dispute Letter */
.dispute-btn-container {
  padding: 1rem 2rem;
  border-top: 1px solid var(--border-light);
}

.btn-dispute {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.9rem 1.5rem;
  background: var(--red);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow);
}

.btn-dispute:hover {
  background: #dc2626;
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}

.btn-dispute:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.dispute-section {
  border-top: 2px solid var(--red);
  margin: 0 2rem;
  padding-top: 1.5rem;
}

.dispute-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.dispute-header h3 {
  font-size: 1.15rem;
  color: var(--red);
  font-weight: 700;
}

/* Letter type selector */
.letter-type-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.letter-type-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

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

.btn-dispute-type {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  background: var(--red);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow);
}

.btn-dispute-type:hover {
  background: #dc2626;
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}

.btn-dispute-type:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Dispute actions bar */
.dispute-actions {
  display: flex;
  gap: 0.4rem;
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
}

/* Dispute content wrapper with blur */
.dispute-content-wrapper {
  position: relative;
}

.dispute-content-wrapper.free-preview .dispute-content {
  max-height: 180px;
  overflow: hidden;
  mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
}

.dispute-blur-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2.5rem 1.5rem 1.5rem;
  text-align: center;
  background: linear-gradient(to bottom, transparent, var(--bg) 30%);
}

.blur-cta p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.dispute-content {
  padding: 1.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  line-height: 1.75;
  margin-bottom: 1.5rem;
}

.dispute-content p {
  margin-bottom: 0.75rem;
}

.dispute-content strong {
  font-weight: 600;
}

/* Expert Dispute CTA */
.expert-dispute-cta {
  margin: 0 2rem 1.5rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
  border: 2px solid var(--green);
  border-radius: var(--radius);
  text-align: center;
  position: relative;
}

.expert-cta-badge {
  display: inline-block;
  background: var(--green);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  margin-bottom: 0.75rem;
}

.expert-dispute-cta h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.expert-cta-savings {
  font-size: 1.25rem;
  color: var(--green);
  margin-bottom: 0.5rem;
}

.expert-cta-savings strong {
  font-size: 1.5rem;
}

.expert-cta-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.btn-expert-dispute {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 1.5rem;
  background: var(--green);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow);
}

.btn-expert-dispute:hover {
  background: #16a34a;
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}

.expert-cta-legal {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  margin-top: 0.75rem;
  line-height: 1.4;
}

/* Expert Dispute Modal */
.expert-modal-card {
  max-width: 480px !important;
}

.form-group {
  margin-bottom: 1rem;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.3rem;
}

.form-group input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group input[readonly] {
  background: var(--bg);
  color: var(--text-secondary);
}

.expert-form-fee {
  font-size: 0.9rem;
  color: var(--green);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.expert-form-legal {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  line-height: 1.4;
  margin-bottom: 1rem;
}

.dispute-success {
  text-align: center;
  padding: 2rem 0;
}

.success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: var(--green-bg);
  color: var(--green);
  border-radius: 50%;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.dispute-success h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.dispute-success p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Pricing 4-column layout */
.pricing-options-4 {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 700px) {
  .pricing-options-4 {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 500px) {
  .pricing-options-4 {
    grid-template-columns: 1fr;
  }
}

.pricing-card-expert {
  border-color: var(--green);
  background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
}

.pricing-card-expert .pricing-label {
  color: var(--green);
}

.btn-expert {
  background: var(--green);
}

.btn-expert:hover {
  background: #16a34a;
}

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

.pricing-card-current {
  opacity: 0.6;
}

.pricing-current-note {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  font-style: italic;
  margin-top: 0.75rem;
}

.pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.75rem;
  border-radius: 999px;
  white-space: nowrap;
}

.pricing-card-pro {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

/* How It Works */
.how-it-works {
  margin-top: 3rem;
  text-align: center;
}

.how-it-works h2 {
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1rem;
  box-shadow: var(--shadow-sm);
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.step-card h3 {
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.step-card p {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* HIPAA Notice */
.hipaa-notice {
  text-align: center;
  font-size: 0.78rem;
  color: var(--green);
  background: var(--green-bg);
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  margin-top: 0.75rem;
}

/* Legal Pages */
.legal-page .legal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow);
  line-height: 1.75;
}

.legal-page .legal-content h2 {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.legal-page .legal-content h3 {
  font-size: 1.05rem;
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}

.legal-page .legal-content p {
  margin-bottom: 0.75rem;
  color: var(--text-secondary);
}

.legal-page .legal-content ul {
  margin-left: 1.25rem;
  margin-bottom: 0.75rem;
  color: var(--text-secondary);
}

.legal-page .legal-content li {
  margin-bottom: 0.35rem;
}

.legal-page .legal-content a {
  color: var(--primary);
}

.legal-updated {
  font-size: 0.85rem;
  color: var(--text-tertiary) !important;
  margin-bottom: 1.5rem !important;
}

/* Footer */
footer {
  text-align: center;
  margin-top: 3rem;
  font-size: 0.82rem;
  color: var(--text-tertiary);
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: var(--text-tertiary);
  text-decoration: none;
  font-size: 0.82rem;
}

.footer-links a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.footer-note {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-bottom: 0.35rem;
}

.footer-social {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.75rem;
}

.footer-social a {
  color: var(--text-secondary);
  transition: color 0.2s;
}

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

.footer-brand {
  margin-top: 0.5rem;
}

.disclaimer {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  line-height: 1.5;
}

.homepage-disclaimer {
  margin-top: 2rem;
  padding: 0.75rem 1rem;
  background: var(--border-light);
  border-radius: var(--radius);
  text-align: center;
}

/* Utility */
.hidden {
  display: none !important;
}

/* Responsive */
@media (max-width: 600px) {
  .container { padding: 1rem; }
  h1 { font-size: 1.6rem; }
  .drop-zone { padding: 2.5rem 1rem; }
  .analysis-content { padding: 1rem; }
  .results-header { padding: 1rem; }
  .steps-grid { grid-template-columns: 1fr; }
  .trust-bar { flex-wrap: wrap; justify-content: center; }
  .analysis-content table { font-size: 0.8rem; }
  .analysis-content th,
  .analysis-content td { padding: 0.4rem 0.5rem; }
}

/* 404 Page */
.not-found-card {
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  margin: 2rem 0;
  box-shadow: var(--shadow);
}

.not-found-icon {
  font-size: 4rem;
  font-weight: 800;
  color: var(--text-tertiary);
  margin-bottom: 1rem;
}

.not-found-card h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.not-found-card p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

/* Mobile: make tables horizontally scrollable */
.analysis-content {
  overflow-x: auto;
}


/* Chat Widget */
.chat-widget {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 999;
}

.chat-toggle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
  transition: all 0.2s;
}

.chat-toggle:hover {
  background: var(--primary-hover);
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.5);
}

.chat-window {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 360px;
  max-height: 480px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--primary-light);
}

.chat-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}

.chat-usage-badge {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  background: var(--bg);
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  max-height: 320px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chat-msg {
  max-width: 85%;
  padding: 0.6rem 0.85rem;
  border-radius: 12px;
  font-size: 0.85rem;
  line-height: 1.5;
  word-wrap: break-word;
}

.chat-msg.user {
  align-self: flex-end;
  background: var(--primary);
  color: white;
  border-bottom-right-radius: 4px;
}

.chat-msg.assistant {
  align-self: flex-start;
  background: var(--border-light);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.chat-msg.system {
  align-self: center;
  background: var(--yellow-bg);
  color: var(--text-secondary);
  font-size: 0.78rem;
  text-align: center;
  max-width: 95%;
  border-radius: 8px;
}

.chat-typing {
  align-self: flex-start;
  padding: 0.6rem 0.85rem;
  background: var(--border-light);
  border-radius: 12px;
  border-bottom-left-radius: 4px;
  display: flex;
  gap: 4px;
  align-items: center;
}

.chat-typing span {
  width: 6px;
  height: 6px;
  background: var(--text-tertiary);
  border-radius: 50%;
  animation: typingDot 1.4s infinite;
}

.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDot {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

.chat-input-area {
  display: flex;
  padding: 0.6rem;
  border-top: 1px solid var(--border);
  gap: 0.4rem;
}

.chat-input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

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

.chat-send {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--primary);
  color: white;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
}

.chat-send:hover {
  background: var(--primary-hover);
}

.chat-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Bill Q&A Panel */
.bill-qa-section {
  border-top: 2px solid var(--primary);
  margin: 0 2rem;
  padding: 1.5rem 0;
}

.bill-qa-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.bill-qa-header h3 {
  font-size: 1.1rem;
  color: var(--primary);
}

.bill-qa-messages {
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.bill-qa-input-area {
  display: flex;
  gap: 0.5rem;
}

.bill-qa-input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.85rem;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.bill-qa-input:focus {
  border-color: var(--primary);
}

.bill-qa-send {
  padding: 0.6rem 1rem;
  border: none;
  background: var(--primary);
  color: white;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.2s;
}

.bill-qa-send:hover {
  background: var(--primary-hover);
}

.bill-qa-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 600px) {
  .chat-window {
    width: calc(100vw - 2rem);
    right: -0.5rem;
  }
  .bill-qa-section {
    margin: 0 1rem;
  }
}

/* Hero Section */
.hero-section {
  text-align: center;
  padding: 2.5rem 0 1.5rem;
}

.hero-headline {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 1rem;
}

.hero-subheadline {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 1.5rem;
  line-height: 1.6;
}

.hero-cta {
  display: inline-block;
  padding: 0.85rem 2rem;
  font-size: 1.05rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 10px;
}

.hero-trust {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-tertiary);
  font-style: italic;
}

/* Social Proof Bar */
.social-proof-bar {
  display: flex;
  justify-content: center;
  gap: 0;
  padding: 0;
  background: rgba(255, 255, 255, 0.85);
  border-radius: var(--radius);
  margin-bottom: 2rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06), 0 0 0 1px var(--border);
  overflow: hidden;
}

.proof-stat {
  text-align: center;
  flex: 1;
  padding: 1.25rem 1rem;
}

.proof-stat + .proof-stat {
  border-left: 1px solid var(--border);
}

.proof-number {
  display: block;
  font-size: 1.625rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 0.2rem;
}

.proof-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Newsletter Signup */
.newsletter-section {
  text-align: center;
  background: var(--primary-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  margin-bottom: 2rem;
}

.newsletter-headline {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.newsletter-subtext {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.newsletter-form {
  display: flex;
  gap: 0.5rem;
  max-width: 460px;
  margin: 0 auto;
}

.newsletter-input {
  flex: 1;
  padding: 0.7rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  outline: none;
}

.newsletter-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.newsletter-btn {
  white-space: nowrap;
  padding: 0.7rem 1.25rem;
}

.newsletter-success {
  color: var(--green);
  font-weight: 600;
  margin-top: 0.75rem;
}

.newsletter-error {
  color: var(--red);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

/* Feature Highlights */
.feature-highlights {
  padding: 2rem 0;
}

.feature-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
}

.feature-icon {
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.feature-card h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.feature-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Bill Type Badges */
.bill-type-badges {
  text-align: center;
  padding: 1.5rem 0 2rem;
}

.bill-badges-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  font-weight: 500;
}

.bill-badges-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.bill-badge {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid #dbeafe;
  border-radius: 999px;
}

/* Sample Letter Preview */
.sample-letter-section {
  padding: 2.5rem 0;
  text-align: center;
}

.sample-letter-section h2 {
  margin-bottom: 1.25rem;
  font-size: 1.3rem;
}

.sample-letter {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  text-align: left;
  position: relative;
  max-width: 600px;
  margin: 0 auto 1.5rem;
  overflow: hidden;
}

.letter-content {
  position: relative;
}

.letter-content p {
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text);
}

.letter-date {
  color: var(--text-secondary) !important;
  font-size: 0.85rem !important;
}

.letter-fade {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(transparent, var(--surface));
}

/* Homepage Pricing */
.homepage-pricing {
  padding: 2.5rem 0;
  text-align: center;
}

.homepage-pricing h2 {
  margin-bottom: 1.5rem;
  font-size: 1.3rem;
}

/* Why BillSight */
.why-billsight {
  padding: 2.5rem 0;
  text-align: center;
}

.why-billsight h2 {
  margin-bottom: 1.5rem;
  font-size: 1.3rem;
}

.why-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.why-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.why-stat {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.why-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

@media (max-width: 600px) {
  .hero-headline {
    font-size: 1.5rem;
  }
  .hero-subheadline {
    font-size: 0.95rem;
  }
  .social-proof-bar {
    flex-direction: column;
  }
  .proof-stat + .proof-stat {
    border-left: none;
    border-top: 1px solid var(--border);
  }
  .feature-cards,
  .why-cards {
    grid-template-columns: 1fr;
  }
  .sample-letter {
    padding: 1rem 1.25rem;
  }
  .newsletter-form {
    flex-direction: column;
  }
}

/* Language Switcher */
.lang-switcher {
  position: relative;
  display: inline-block;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text);
  transition: background 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.lang-toggle:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  min-width: 160px;
  overflow: hidden;
}

.lang-option {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text);
  text-align: left;
  transition: background 0.15s;
}

.lang-option:hover {
  background: var(--primary-light);
}

.lang-option.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}
