/* ============================= */
/* 🎨 Base (Light Mode Defaults) */
/* ============================= */

:root {
  --madison-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

html {
  font-family: var(--madison-font-family);
}

body {
  font-family: inherit;
  background: #f7f7f7;
  color: #333;
  margin: 0;
  padding: 12px;
}

.container {
  max-width: 1000px;
  margin: auto;
  background: white;
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 0 12px rgba(0,0,0,0.1);
  box-sizing: border-box;
}

@media (max-width: 600px) {
  .container {
    padding: 1rem;
  }
}

h1 {
  margin-top: 0;
  font-size: 2rem;
}

h2 {
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  color: #444;
}

form {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  align-items: flex-start;
}

.search-box {
  position: relative;
  width: 100%;
  flex: 1;
}

input[type="text"],
#bill-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  background: transparent;
  border: none;
  border-radius: 8px 0 0 8px;
  outline: none;
  color: inherit;
}

button {
  padding: 0.6rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  background: black;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

input,
textarea,
select {
  font-family: inherit;
}

.error {
  color: red;
}

.table {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.row {
  display: grid;
  grid-template-columns: 150px 1fr 1fr;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid #eee;
  background: #fff;
  border-radius: 6px;
}

.header {
  font-weight: bold;
  background: #f0f0f0;
}

/* Title link styling */
.title-link a {
  color: #0066cc;
  text-decoration: none;
  font-weight: 600;
}

.title-link a:hover {
  text-decoration: underline;
}

.title-name {
  font-size: 0.85rem;
  color: #666;
  margin-top: 0.2rem;
}

.original-text {
  font-size: 0.9rem;
  line-height: 1.4;
}

/* Title detail page styles */
.nav {
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.back-link {
  color: #0066cc;
  text-decoration: none;
  font-size: 0.9rem;
}

.back-link:hover {
  text-decoration: underline;
}

/* Madison Flow style button */
.back-link.madison-style-btn {
  text-decoration: none;
  font-weight: 600;
  color: #007bff;
  border: 1px solid rgba(0, 123, 255, 0.3);
  padding: 6px 12px;
  border-radius: 999px;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.95rem;
}

.back-link.madison-style-btn:hover {
  background: #007bff;
  color: #fff;
  box-shadow: 0 6px 16px rgba(0, 123, 255, 0.25);
  text-decoration: none;
}

.detail-section {
  margin: 2rem 0;
  padding: 1.5rem;
  background: #f9f9f9;
  border-radius: 8px;
  border: 1px solid #eee;
}

.full-text {
  line-height: 1.7;
  font-size: 1rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  max-width: 800px;
  color: #333;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.full-text p {
  margin-bottom: 1.2rem;
  text-indent: 1.5em;
}

.full-text p:first-child {
  text-indent: 0;
}

.full-text strong {
  font-weight: 600;
  color: #000;
}

.full-text h1, .full-text h2, .full-text h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
  text-indent: 0;
}

/* Legal document specific formatting */
.full-text {
  /* Add proper spacing for numbered lists and subsections */
  counter-reset: section-counter;
}

.full-text::before {
  content: "";
  display: block;
  margin-bottom: 1rem;
}

/* Style for section numbers and headings */
.full-text > *:first-child {
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  text-indent: 0;
  border-bottom: 1px solid #ddd;
  padding-bottom: 0.5rem;
}

/* Better spacing for legal text blocks */
.full-text {
  padding: 1.5rem;
  background: #fafafa;
  border-left: 4px solid #e0e0e0;
  border-radius: 4px;
  margin: 1rem 0;
}
.full-text pre {
  margin: 0;
  padding: 20px 24px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: 1.9;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  color: inherit;
  letter-spacing: 0.01em;
}

/* Additional legal document formatting */
.full-text {
  /* Ensure proper spacing between sections */
  font-variant-numeric: oldstyle-nums;
  letter-spacing: 0.01em;
}

/* Style for section headers within the text */
.full-text h1, .full-text h2, .full-text h3, .full-text h4 {
  color: #2c3e50;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 1rem;
  text-transform: uppercase;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
}

/* Style for numbered lists and subsections */
.full-text ol, .full-text ul {
  margin: 1rem 0;
  padding-left: 2rem;
}

.full-text li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

/* Style for emphasized text */
.full-text em, .full-text i {
  font-style: italic;
  color: #34495e;
}

/* Better line spacing for readability */
.full-text {
  line-height: 1.8;
}

.summary-detail,
.cost-detail {
  line-height: 1.6;
}

.title-detail-page .detail-section {
  max-width: 980px;
  margin: 1.5rem auto;
  padding: 1.75rem;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.title-detail-page .detail-section h2 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: #1f2937;
}

.title-detail-page .summary-detail {
  color: #1f2937;
  font-size: 0.98rem;
  line-height: 1.7;
}

.title-detail-page .summary-detail > *:first-child {
  margin-top: 0;
}

.title-detail-page .summary-detail > *:last-child {
  margin-bottom: 0;
}

.title-detail-page .summary-detail p {
  margin: 0 0 0.9rem;
}

.title-detail-page .summary-detail ul,
.title-detail-page .summary-detail ol {
  margin: 0 0 1rem;
  padding-left: 1.4rem;
}

.title-detail-page .summary-detail li + li {
  margin-top: 0.45rem;
}

.title-detail-page .summary-detail .section-summary-main-copy {
  margin-bottom: 1rem;
}

.title-detail-page .summary-detail .analysis-speculation-block,
.title-detail-page .summary-detail .analysis-checklist {
  margin-top: 1rem;
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  background: #ffffff;
  padding: 1rem 1.1rem;
}

.title-detail-page .summary-detail .analysis-speculation-label {
  margin: 0 0 0.65rem;
  color: #1f2937;
}

.title-detail-page .summary-detail .analysis-bucket-grid {
  display: grid;
  gap: 0.85rem;
  margin-top: 0.85rem;
}

.title-detail-page .summary-detail .section-summary-impact-card {
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  background: #ffffff;
  padding: 0.95rem 1rem;
}

.title-detail-page .summary-detail .section-summary-impact-card h6 {
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6b7280;
}

.title-detail-page .summary-detail .section-summary-impact-card ul {
  margin: 0;
  padding-left: 1.2rem;
}

.title-detail-page .summary-detail .section-summary-impact-card li + li {
  margin-top: 0.45rem;
}

.title-detail-page .summary-detail .analysis-checklist summary {
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #4b5563;
}

.title-detail-page .summary-detail .analysis-checklist[open] summary {
  margin-bottom: 0.85rem;
}

.title-detail-page .summary-detail .analysis-checklist-block + .analysis-checklist-block {
  margin-top: 1rem;
}

.title-detail-page .summary-detail .analysis-checklist-block h6 {
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6b7280;
}

.title-detail-page .summary-detail .analysis-checklist-block p:last-child,
.title-detail-page .summary-detail .analysis-speculation-block p:last-child,
.title-detail-page .summary-detail .analysis-speculation-block ul:last-child {
  margin-bottom: 0;
}

.summarize-btn {
  padding: 10px 20px;
  background: #2196F3;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1em;
}

.summarize-btn:hover {
  background: #0b7dda;
}

.summarize-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* Streaming summary styles */
.streaming-summary {
  min-height: 50px;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: #f9f9f9;
  font-family: inherit;
  line-height: 1.4;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.streaming-complete {
  border-color: #4CAF50;
  background-color: #f0f8f0;
}

.loading {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 8px;
}

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

.loading-text {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: #666;
  font-style: italic;
  gap: 10px;
  border-radius: 5px;
}

.error-text {
  color: #d32f2f;
  padding: 10px;
  background-color: #ffebee;
  border: 1px solid #ffcdd2;
  border-radius: 4px;
  font-style: italic;
}

.retry-btn {
  background-color: #f44336;
  color: white;
  border: none;
  padding: 4px 8px;
  margin-left: 8px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.9em;
}

.retry-btn:hover {
  background-color: #d32f2f;
}

#autocomplete-results {
  background: white;
  border: 1px solid #ccc;
  max-height: 200px;
  overflow-y: auto;
  position: absolute;
  z-index: 1000;
  width: 100%;
  font-size: 0.9rem;
  border-radius: 4px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.autocomplete-item {
  padding: 0.5rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.autocomplete-item:hover {
  background-color: #f0f0f0;
}

.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #444;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  animation: spin 1s linear infinite;
  margin: 1rem auto;
}

/* ---------- 🔍  Section search styles ---------- */
.filter-search {
  margin: 1rem 0;
}

.filter-search input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-sizing: border-box;
}

/* SVG Magnifying glass styling */
.filter-search.with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.filter-search .search-icon {
  position: absolute;
  left: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #888;
  pointer-events: none;
}

.filter-search.with-icon input {
  padding-left: 2.25rem; /* Leave space for SVG */
}

/* Match highlighting */
.highlight-match {
  background-color: #ffff00;
  padding: 0 2px;
  border-radius: 2px;
}

/* Chips for Titles/Subtitles */
.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.chip {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  padding: 0.5rem 0.75rem;
  border: 1px solid #e5e5e5;
  background: #fafafa;
  border-radius: 999px;
}

.chip .chip-main {
  font-weight: 600;
  font-size: 0.95rem;
}

.chip .chip-sub {
  font-size: 0.85rem;
  color: #666;
}

.muted {
  color: #777;
  font-style: italic;
}

/* Dark mode tweaks */
@media (prefers-color-scheme: dark) {
  .chip {
    background: #2a2a2a;
    border-color: #444;
  }
  .chip .chip-sub {
    color: #bbb;
  }
  .muted {
    color: #aaa;
  }
}

/* ======================= */
/* 🌙 Dark Mode Overrides  */
/* ======================= */

/* Manual dark theme override */
body[data-theme="dark"] {
  background: #1e1e1e;
  color: #e5e7eb;
}

body[data-theme="dark"] .container {
  background: #262626;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.7);
}

body[data-theme="dark"] h1,
body[data-theme="dark"] h2,
body[data-theme="dark"] h3 {
  color: #e5e7eb;
}

body[data-theme="dark"] form {
  background: #2c2c2c;
  border-radius: 8px;
  overflow: hidden;
}

body[data-theme="dark"] input[type="text"],
body[data-theme="dark"] #bill-input {
  background: #333;
  border: 1px solid #555;
  color: #f0f0f0;
}

body[data-theme="dark"] input[type="text"]::placeholder,
body[data-theme="dark"] #bill-input::placeholder {
  color: #aaa;
}

body[data-theme="dark"] button {
  background: #f0f0f0;
  color: #111;
  transition: background 0.3s;
}

body[data-theme="dark"] button:hover {
  background: #ddd;
}

body[data-theme="dark"] .error {
  color: #ff6b6b;
}

body[data-theme="dark"] .table .row {
  background: #2a2a2a;
  border: 1px solid #444;
}

body[data-theme="dark"] .header {
  background: #333;
  color: #fff;
}

body[data-theme="dark"] .title-link a {
  color: #66b3ff;
}

body[data-theme="dark"] .title-link a:hover {
  text-decoration: underline;
  color: #8ecfff;
}

body[data-theme="dark"] .back-link.madison-style-btn {
  color: #8ecfff;
  border-color: rgba(102, 179, 255, 0.4);
}

body[data-theme="dark"] .back-link.madison-style-btn:hover {
  background: #66b3ff;
  color: #0b1a2a;
  box-shadow: 0 6px 16px rgba(102, 179, 255, 0.25);
  text-decoration: none;
}

body[data-theme="dark"] .title-name {
  color: #aaa;
}

body[data-theme="dark"] .original-text {
  color: #ccc;
}

body[data-theme="dark"] .detail-section {
  background: #050505;
  border-color: #1a1a1a;
}

body[data-theme="dark"] .full-text {
  color: #e5e7eb;
  background: #000000;
  border-left-color: #1a1a1a;
}

body[data-theme="dark"] .full-text pre {
  background: #000000;
  border-color: #1a1a1a;
  color: #e5e7eb;
}

body[data-theme="dark"] .full-text strong {
  color: #e5e7eb;
}

body[data-theme="dark"] .full-text > *:first-child {
  border-bottom-color: #1a1a1a;
}

body[data-theme="dark"] .full-text h1,
body[data-theme="dark"] .full-text h2,
body[data-theme="dark"] .full-text h3,
body[data-theme="dark"] .full-text h4 {
  color: #e5e7eb;
}

body[data-theme="dark"] .full-text em,
body[data-theme="dark"] .full-text i {
  color: #9ca3af;
}

body[data-theme="dark"] .summarize-btn {
  background: #2196F3;
}

body[data-theme="dark"] .summarize-btn:hover {
  background: #0b7dda;
}

body[data-theme="dark"] .summarize-btn:disabled {
  background: #555;
}

body[data-theme="dark"] .streaming-summary {
  background-color: #050505;
  border-color: #1a1a1a;
  color: #e5e7eb;
}

body[data-theme="dark"] .summary-detail {
  color: #e5e7eb;
}

body[data-theme="dark"].title-detail-page .detail-section {
  background: #050505;
  border-color: #171717;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

body[data-theme="dark"].title-detail-page .detail-section h2,
body[data-theme="dark"].title-detail-page .summary-detail,
body[data-theme="dark"].title-detail-page .summary-detail .analysis-speculation-label {
  color: #f3f4f6;
}

body[data-theme="dark"].title-detail-page .summary-detail .analysis-speculation-block,
body[data-theme="dark"].title-detail-page .summary-detail .analysis-checklist,
body[data-theme="dark"].title-detail-page .summary-detail .section-summary-impact-card {
  background: #0a0a0a;
  border-color: #1f1f1f;
}

body[data-theme="dark"].title-detail-page .summary-detail .analysis-checklist summary {
  color: #d1d5db;
}

body[data-theme="dark"].title-detail-page .summary-detail .analysis-checklist-block h6,
body[data-theme="dark"].title-detail-page .summary-detail .section-summary-impact-card h6 {
  color: #9ca3af;
}

/* System preference-based dark mode (for auto mode) */
@media (prefers-color-scheme: dark) {
  body:not([data-theme="light"]) {
    background: #1e1e1e;
    color: #e5e7eb;
  }

  body:not([data-theme="light"]) .container {
    background: #262626;
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.7);
  }

  body:not([data-theme="light"]) h1,
  body:not([data-theme="light"]) h2,
  body:not([data-theme="light"]) h3 {
    color: #e5e7eb;
  }

  body:not([data-theme="light"]) form {
    background: #2c2c2c;
    border-radius: 8px;
    overflow: hidden;
  }

  body:not([data-theme="light"]) input[type="text"],
  body:not([data-theme="light"]) #bill-input {
    background: #333;
    border: 1px solid #555;
    color: #f0f0f0;
  }

  body:not([data-theme="light"]) input[type="text"]::placeholder,
  body:not([data-theme="light"]) #bill-input::placeholder {
    color: #aaa;
  }

  body:not([data-theme="light"]) button {
    background: #f0f0f0;
    color: #111;
    transition: background 0.3s;
  }

  body:not([data-theme="light"]) button:hover {
    background: #ddd;
  }

  body:not([data-theme="light"]) .error {
    color: #ff6b6b;
  }

  body:not([data-theme="light"]) .table .row {
    background: #2a2a2a;
    border: 1px solid #444;
  }

  body:not([data-theme="light"]) .header {
    background: #333;
    color: #fff;
  }

  body:not([data-theme="light"]) .title-link a {
    color: #66b3ff;
  }

  body:not([data-theme="light"]) .title-link a:hover {
    text-decoration: underline;
    color: #8ecfff;
  }

  body:not([data-theme="light"]) .back-link.madison-style-btn {
    color: #8ecfff;
    border-color: rgba(102, 179, 255, 0.4);
  }

  body:not([data-theme="light"]) .back-link.madison-style-btn:hover {
    background: #66b3ff;
    color: #0b1a2a;
    box-shadow: 0 6px 16px rgba(102, 179, 255, 0.25);
    text-decoration: none;
  }

  body:not([data-theme="light"]) .title-name {
    color: #aaa;
  }

  body:not([data-theme="light"]) .original-text {
    color: #ccc;
  }

  body:not([data-theme="light"]) .detail-section {
    background: #050505;
    border-color: #1a1a1a;
  }

  body:not([data-theme="light"]) .full-text {
    color: #e5e7eb;
    background: #000000;
    border-left-color: #1a1a1a;
  }

  body:not([data-theme="light"]) .full-text pre {
    background: #000000;
    border-color: #1a1a1a;
    color: #e5e7eb;
  }

  body:not([data-theme="light"]) .full-text strong {
    color: #e5e7eb;
  }

  body:not([data-theme="light"]) .full-text > *:first-child {
    border-bottom-color: #1a1a1a;
  }

  body:not([data-theme="light"]) .full-text h1,
  body:not([data-theme="light"]) .full-text h2,
  body:not([data-theme="light"]) .full-text h3,
  body:not([data-theme="light"]) .full-text h4 {
    color: #e5e7eb;
  }

  body:not([data-theme="light"]) .full-text em,
  body:not([data-theme="light"]) .full-text i {
    color: #9ca3af;
  }

  body:not([data-theme="light"]) .summarize-btn {
    background: #2196F3;
  }

  body:not([data-theme="light"]) .summarize-btn:hover {
    background: #0b7dda;
  }

  body:not([data-theme="light"]) .summarize-btn:disabled {
    background: #555;
  }

  body:not([data-theme="light"]) .streaming-summary {
    background-color: #050505;
    border-color: #1a1a1a;
    color: #e5e7eb;
  }

  body:not([data-theme="light"]) .summary-detail {
    color: #e5e7eb;
  }

  body:not([data-theme="light"]).title-detail-page .detail-section {
    background: #050505;
    border-color: #171717;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  }

  body:not([data-theme="light"]).title-detail-page .detail-section h2,
  body:not([data-theme="light"]).title-detail-page .summary-detail,
  body:not([data-theme="light"]).title-detail-page .summary-detail .analysis-speculation-label {
    color: #f3f4f6;
  }

  body:not([data-theme="light"]).title-detail-page .summary-detail .analysis-speculation-block,
  body:not([data-theme="light"]).title-detail-page .summary-detail .analysis-checklist,
  body:not([data-theme="light"]).title-detail-page .summary-detail .section-summary-impact-card {
    background: #0a0a0a;
    border-color: #1f1f1f;
  }

  body:not([data-theme="light"]).title-detail-page .summary-detail .analysis-checklist summary {
    color: #d1d5db;
  }

  body:not([data-theme="light"]).title-detail-page .summary-detail .analysis-checklist-block h6,
  body:not([data-theme="light"]).title-detail-page .summary-detail .section-summary-impact-card h6 {
    color: #9ca3af;
  }

  .streaming-complete {
    border-color: #4CAF50;
    background-color: #1e3a1e;
  }

  .loading {
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top: 2px solid #5dade2;
  }

  .error-text {
    color: #ff6b6b;
    background-color: #3a1e1e;
    border-color: #662626;
  }

  .retry-btn {
    background-color: #f44336;
  }

  .retry-btn:hover {
    background-color: #d32f2f;
  }

  #autocomplete-results {
    background: #262626;
    border: 1px solid #555;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  }

  .autocomplete-item {
    color: #eee;
  }

  .autocomplete-item:hover {
    background-color: #3a3a3a;
  }

  .spinner {
    border: 4px solid #444;
    border-top: 4px solid #aaa;
  }

  a {
    color: #66b3ff;
  }

  a:visited {
    color: #b389ff;
  }

  a:hover,
  a:focus {
    color: #8ecfff;
    text-decoration: underline;
  }

  .loading-text {
    color: #ccc;
  }

  .highlight-match {
    background-color: #665500;
  }

  .filter-search .search-icon {
    color: #aaa;
  }
}

@media (max-width: 768px) {
  .row {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  .original-text,
  .summary-container,
  .title-link {
    width: 100%;
  }

  .summarize-btn {
    width: 100%;
  }

  .header {
    display: none;
  }
}

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

  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.25rem;
  }
}

/* Floating Chat Widget */
.floating-chat-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 350px;
  height: 500px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  border: 1px solid #e5e5e5;
  display: flex;
  flex-direction: column;
  z-index: 9999;
  transition: all 0.3s ease;
  overflow: hidden;
}

.floating-chat-widget.collapsed {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
}

.floating-chat-widget.collapsed:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.floating-chat-widget.collapsed .chat-content {
  display: none;
}

.floating-chat-widget.collapsed .chat-header h3 {
  display: none;
}

.chat-header {
  background: #f8f9fa;
  padding: 12px 16px;
  border-bottom: 1px solid #e5e5e5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.chat-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

.chat-toggle-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.chat-toggle-btn:hover {
  background-color: #e9ecef;
}

.chat-toggle-btn svg {
  width: 16px;
  height: 16px;
  fill: #666;
  transition: transform 0.3s ease;
}

.floating-chat-widget.collapsed .chat-toggle-btn svg {
  width: 24px;
  height: 24px;
  fill: #007bff;
  transform: none;
}

.chat-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: white;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 350px;
}

.chat-message {
  max-width: 100%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.4;
  word-wrap: break-word;
}

.chat-message.user {
  align-self: flex-end;
  background: #007bff;
  color: white;
  margin-left: 20px;
}

.chat-message.bot {
  align-self: flex-start;
  background: #f1f3f4;
  color: #333;
  margin-right: 20px;
}

.chat-input-container {
  padding: 12px;
  border-top: 1px solid #e5e5e5;
  background: white;
}

.chat-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.chat-input {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 20px;
  padding: 8px 12px;
  font-size: 13px;
  resize: none;
  max-height: 80px;
  min-height: 36px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease;
}

.chat-input:focus {
  border-color: #007bff;
}

.chat-send-btn {
  width: 32px;
  height: 32px;
  background: #007bff;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease;
  flex-shrink: 0;
}

.chat-send-btn:hover {
  background: #0056b3;
}

.chat-send-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.chat-send-btn svg {
  width: 16px;
  height: 16px;
  fill: white;
}

.chat-typing {
  font-size: 12px;
  color: #666;
  font-style: italic;
  padding: 4px 12px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .floating-chat-widget {
    background: #2a2a2a;
    border-color: #444;
  }
  
  .chat-header {
    background: #333;
    border-color: #444;
  }
  
  .chat-header h3 {
    color: #fff;
  }
  
  .chat-toggle-btn:hover {
    background-color: #444;
  }
  
  .chat-toggle-btn svg {
    fill: #ccc;
  }
  
  .chat-message.bot {
    background: #444;
    color: #fff;
  }
  
  .chat-input {
    background: #333;
    border-color: #555;
    color: #fff;
  }
  
  .chat-input:focus {
    border-color: #007bff;
  }
  
  .chat-input-container {
    background: #2a2a2a;
    border-color: #444;
  }
}

/* Footer styles */
.footer-disclaimer {
  margin: 24px auto;
  max-width: 1000px;
  padding: 0 24px;
  color: #666;
  font-size: 0.85rem;
  letter-spacing: 0.01em;
  text-align: center;
}
.footer-disclaimer p {
  margin: 8px 0;
}
.footer-disclaimer a {
  color: #2563eb;
  text-decoration: none;
  transition: opacity 0.2s ease;
}
.footer-disclaimer a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* Dark mode footer */
body[data-theme="dark"] .footer-disclaimer,
html[data-theme="dark"] .footer-disclaimer {
  color: #9ca3af;
}
body[data-theme="dark"] .footer-disclaimer a,
html[data-theme="dark"] .footer-disclaimer a {
  color: #60a5fa;
}
@media (prefers-color-scheme: dark) {
  body:not([data-theme="light"]) .footer-disclaimer,
  html:not([data-theme="light"]) .footer-disclaimer {
    color: #9ca3af;
  }
  body:not([data-theme="light"]) .footer-disclaimer a,
  html:not([data-theme="light"]) .footer-disclaimer a {
    color: #60a5fa;
  }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .floating-chat-widget {
    width: calc(100vw - 40px);
    height: 400px;
    bottom: 10px;
    right: 20px;
    left: 20px;
  }
  
  .floating-chat-widget.collapsed {
    width: 50px;
    height: 50px;
  }
  
  .footer-disclaimer {
    padding: 0 16px;
  }
}