@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;600&family=Space+Grotesk:wght@400;500;600;700&display=swap");

:root {
  --ink: #0d1b1e;
  --muted: #4b5b5f;
  --surface: #ffffff;
  --surface-alt: #f6f4ef;
  --input-bg: #fffaf2;
  --page-bg: linear-gradient(130deg, #f3efe6 0%, #f7faf8 45%, #e8f1f3 100%);
  --table-row-even: #fbf9f4;
  --table-row-hover: #eef6f4;
  --line: #d8d3c7;
  --accent: #0f7a6b;
  --accent-strong: #0b5e52;
  --accent-soft: #cfe9e3;
  --glow: rgba(15, 122, 107, 0.12);
  --shadow: 0 18px 45px rgba(13, 27, 30, 0.12);
}

html[data-theme="dark"] {
  --ink: #e9f2f5;
  --muted: #a5bbc2;
  --surface: #162126;
  --surface-alt: #223038;
  --input-bg: #1e2b32;
  --page-bg: linear-gradient(130deg, #0f171b 0%, #162126 45%, #17272f 100%);
  --table-row-even: #1c2a31;
  --table-row-hover: #23373f;
  --line: #2f424b;
  --accent: #39b6a3;
  --accent-strong: #74d5c6;
  --accent-soft: #1f4e49;
  --glow: rgba(57, 182, 163, 0.2);
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--page-bg);
  min-height: 100vh;
  position: relative;
}

body::before,
body::after {
  content: "";
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(0px);
  z-index: -1;
  opacity: 0.55;
}

body::before {
  top: -120px;
  right: -140px;
  background: radial-gradient(circle, #f6c48f 0%, rgba(246, 196, 143, 0) 70%);
}

body::after {
  bottom: -160px;
  left: -120px;
  background: radial-gradient(circle, #9dd3c9 0%, rgba(157, 211, 201, 0) 70%);
}

h1, h2, h3 {
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
  margin: 0;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.page-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.theme-toggle {
  min-width: 140px;
}

.hub-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.hub-header {
  text-align: center;
  margin-bottom: 64px;
}

.hero-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent-soft), #e8f5f2);
  color: var(--accent-strong);
  padding: 8px 20px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 20px;
  border: 1px solid rgba(15, 122, 107, 0.2);
}

.hub-header h1 {
  font-size: clamp(2.5rem, 5vw, 3.8rem);
  margin-bottom: 16px;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 750px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent);
  font-family: "Space Grotesk", sans-serif;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-item .stat-label {
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 500;
}

.widgets-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 48px;
}

.widgets-grid.single-tool {
  grid-template-columns: minmax(320px, 760px);
  justify-content: center;
}

/* Value Proposition Section */
.value-proposition {
  margin-bottom: 64px;
  padding: 48px 32px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 24px;
  border: 1px solid var(--line);
}

.section-title {
  text-align: center;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  margin-bottom: 16px;
  color: var(--ink);
  font-weight: 600;
}

.section-subtitle {
  text-align: center;
  font-size: 1.05rem;
  color: var(--muted);
  margin-bottom: 32px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.benefits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 32px;
  margin-top: 40px;
}

.benefit-item {
  text-align: center;
  padding: 24px;
}

.benefit-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.benefit-item h3 {
  font-size: 1.25rem;
  margin-bottom: 8px;
  color: var(--ink);
  font-weight: 600;
}

.benefit-item p {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

/* Tools Section */
.tools-section {
  margin-bottom: 32px;
  text-align: center;
}

.widget-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 32px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.widget-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), #1b9c8a);
  transform: scaleX(0);
  transition: transform 0.3s ease;
  transform-origin: left;
}

.widget-card:hover::before {
  transform: scaleX(1);
}

.widget-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
  border-color: var(--accent);
}

.widget-card.featured {
  border: 2px solid var(--accent);
  background: linear-gradient(135deg, rgba(207, 233, 227, 0.2), rgba(255, 255, 255, 1));
}

.widget-card.featured::before {
  height: 5px;
  transform: scaleX(1);
}

.widget-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  background: linear-gradient(135deg, #f6c48f, #f4a261);
  color: white;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 4px 12px rgba(246, 196, 143, 0.4);
}

.widget-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.widget-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--ink);
}

.widget-description {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.6;
  flex-grow: 1;
}

.widget-cta {
  margin-top: 1rem;
  color: var(--accent);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.widget-cta::after {
  content: "→";
}

.widget-features {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  margin-bottom: 8px;
}

.feature-tag {
  font-size: 0.75rem;
  background: var(--accent-soft);
  color: var(--accent-strong);
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 500;
}

/* About NAPIC Section */
.about-napic {
  margin-top: 64px;
  margin-bottom: 64px;
  padding: 48px 40px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 24px;
  border: 1px solid var(--line);
  text-align: center;
}

.about-napic .section-title {
  margin-bottom: 24px;
}

.about-content {
  max-width: 800px;
  margin: 0 auto 16px;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--muted);
}

.about-content strong {
  color: var(--ink);
  font-weight: 600;
}

/* Resources Section */
.resources-section {
  margin-top: 64px;
  margin-bottom: 64px;
  padding: 48px 40px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(147, 51, 234, 0.05));
  border-radius: 24px;
  border: 1px solid var(--line);
}

.resources-section .section-title {
  text-align: center;
  margin-bottom: 12px;
}

.resources-section .section-subtitle {
  text-align: center;
  color: var(--muted);
  margin-bottom: 40px;
  font-size: 1rem;
}

.resources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
  max-width: 1000px;
  margin: 0 auto;
}

.resource-category {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 10px 24px rgba(13, 27, 30, 0.06);
}

.resource-category h3 {
  font-size: 1.1rem;
  margin-bottom: 16px;
  color: var(--ink);
  font-weight: 600;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
}

.resource-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.resource-list li {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.resource-list a {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
  line-height: 1.5;
  display: inline-flex;
  align-items: center;
  transition: all 0.2s ease;
}

.resource-list a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.resource-list a::before {
  content: "→";
  margin-right: 8px;
  color: var(--accent);
  font-weight: bold;
}

.resource-desc {
  margin-top: 4px;
  margin-left: 22px;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.45;
}

.hub-footer {
  margin-top: 64px;
  padding: 48px 0 24px;
  border-top: 2px solid var(--line);
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  margin-bottom: 32px;
}

.footer-section h3 {
  font-size: 1.25rem;
  margin-bottom: 12px;
  color: var(--ink);
}

.footer-section h4 {
  font-size: 1rem;
  margin-bottom: 12px;
  color: var(--ink);
  font-weight: 600;
}

.footer-section p {
  color: var(--muted);
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
}

.footer-section p a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-section p a:hover {
  color: var(--accent);
}

.footer-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-section ul li {
  margin-bottom: 8px;
}

.footer-section ul li a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
  font-size: 0.95rem;
}

.footer-section ul li a:hover {
  color: var(--accent);
}

.tech-stack {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 8px;
}

.footer-bottom {
  text-align: center;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 32px;
  align-items: center;
  margin-bottom: 40px;
}

.hero-home {
  grid-template-columns: minmax(0, 1fr);
  max-width: none;
  justify-items: center;
  text-align: center;
}

.hero-home > div {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  text-align: center;
}

.hero-home p {
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.hero-home .eyebrow,
.hero-home h1,
.hero-home p {
  text-align: center !important;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
}

.back-link {
  display: inline-block;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 1rem;
  transition: color 0.2s ease;
}

.back-link:hover {
  color: var(--accent-strong);
}

.hero h1 {
  font-size: clamp(2.2rem, 3vw, 3.2rem);
  line-height: 1.05;
  margin-top: 12px;
}

.hero p {
  color: var(--muted);
  font-size: 1.05rem;
  margin-top: 12px;
}

.hero-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.stat-row:last-child {
  border-bottom: none;
}

.stat-label {
  color: var(--muted);
  font-size: 0.9rem;
}

.stat-value {
  font-weight: 600;
  font-size: 1.05rem;
}

.search-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--shadow);
  position: relative;
  z-index: 2;
}

.search-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
  align-items: end;
}

.search-grid.keyword-only {
  grid-template-columns: minmax(0, 1fr) auto;
}

.search-grid.keyword-only .input-stack.full {
  grid-column: auto;
}

.search-grid.keyword-only .button-row {
  grid-column: auto;
  align-self: end;
  padding-top: 0;
  justify-self: end;
}

.search-grid.keyword-only #search-input {
  pointer-events: auto;
  cursor: text;
}

/* ── Area Converter Widget ───────────────────────── */
.converter-card {
  padding: 28px;
  margin-top: 0;
  margin-bottom: 0;
}

.search-card + .converter-card {
  margin-top: 36px;
}

.converter-card + .results {
  margin-top: 36px;
}

.converter-body {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: nowrap;
  width: 100%;
}

.converter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 0;
  width: 100%;
  min-width: 0;
}

.converter-field input {
  width: 100%;
}

.converter-arrow {
  font-size: 1.35rem;
  color: var(--accent);
  font-weight: 700;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  user-select: none;
  flex: 0 0 44px;
}

.converter-clear {
  flex: 0 0 120px;
  min-width: 120px;
}

.input-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  grid-column: span 2;
}

.input-stack.full {
  grid-column: span 3;
}

label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

input, select {
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 14px;
  font-size: 0.95rem;
  background: var(--input-bg);
  color: var(--ink);
}

input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--glow);
}

.helper {
  font-size: 0.8rem;
  color: var(--muted);
}

.placeholder-note {
  text-align: center;
  color: var(--muted);
}

/* Page shell utilities for easy template reuse across new pages */
.page-header {
  margin-bottom: 40px;
}

.page-header h1 {
  font-size: clamp(2.2rem, 3vw, 3.2rem);
  line-height: 1.05;
  margin-top: 12px;
  margin-bottom: 0;
  color: var(--ink);
}

.page-header p {
  color: var(--muted);
  font-size: 1.05rem;
  margin-top: 12px;
  margin-bottom: 0;
}

.page-body {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--shadow);
  margin-bottom: 32px;
}

.page-footer {
  margin-top: 40px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.button-row {
  display: flex;
  gap: 12px;
  grid-column: span 2;
}

button {
  height: 44px;
  border-radius: 999px;
  border: none;
  font-weight: 600;
  padding: 0 20px;
  cursor: pointer;
  font-family: "Space Grotesk", sans-serif;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.button-primary {
  background: linear-gradient(120deg, var(--accent), #1b9c8a);
  color: white;
  box-shadow: 0 12px 24px rgba(15, 122, 107, 0.2);
}

.button-secondary {
  background: var(--surface-alt);
  color: var(--ink);
  border: 1px solid var(--line);
}

button:hover {
  transform: translateY(-2px);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.results {
  margin-top: 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.count-pill {
  background: var(--accent-soft);
  color: var(--accent-strong);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.status-note {
  color: var(--muted);
  font-size: 0.9rem;
}

.table-wrap {
  border-radius: 18px;
  overflow: auto;
  border: 1px solid var(--line);
}

.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

.table thead {
  background: var(--surface-alt);
}

.table th,
.table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}

.table tbody tr:nth-child(even) {
  background: var(--table-row-even);
}

.table tbody tr:hover {
  background: var(--table-row-hover);
}

.empty-state {
  text-align: center;
  padding: 32px 12px;
  color: var(--muted);
  font-style: italic;
}

.footer {
  margin-top: 40px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.loan-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.loan-grid .input-stack {
  grid-column: span 1;
}

.loan-grid .input-stack.full {
  grid-column: span 2;
}

.loan-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.loan-summary-item {
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}

.loan-summary-item h3 {
  margin: 0 0 8px;
  font-size: 0.9rem;
  color: var(--muted);
}

.loan-summary-item p {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}

.cost-table {
  min-width: 0;
}

.cost-table td:last-child,
.cost-table th:last-child {
  text-align: right;
}

.cost-table .total-row {
  font-weight: 700;
  background: #eaf6f2;
}

.bank-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.bank-link-pill {
  text-decoration: none;
  color: var(--accent-strong);
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 600;
}

.bank-table {
  min-width: 900px;
}

.bank-table td {
  vertical-align: middle;
}

.bank-links {
  display: flex;
  gap: 12px;
}

.bank-links a {
  color: var(--accent-strong);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 600;
}

.bank-links a:hover {
  text-decoration: underline;
}

.rate-btn {
  height: 36px;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 0.82rem;
}

.calculator-notes {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  color: var(--muted);
  line-height: 1.55;
}

.quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.prompt-btn {
  height: 38px;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 0.82rem;
}

.law-chat {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fcfbf8;
  padding: 14px;
  min-height: 260px;
  max-height: 520px;
  overflow: auto;
  display: grid;
  gap: 10px;
}

.chat-message {
  border-radius: 12px;
  padding: 12px;
  max-width: 92%;
}

.chat-message p {
  margin: 0;
  line-height: 1.55;
}

.assistant-message {
  background: #eef6f4;
  border: 1px solid #cde4de;
  justify-self: start;
}

.user-message {
  background: #fff7e8;
  border: 1px solid #f2d9a8;
  justify-self: end;
}

.law-chat-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.law-chat-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffaf2;
  padding: 12px 14px;
  font: inherit;
  resize: vertical;
}

.law-chat-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--glow);
}

.chat-sources {
  margin-top: 10px;
  border-top: 1px solid #d9e8e3;
  padding-top: 8px;
}

.chat-sources ul {
  margin: 6px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.chat-sources a {
  color: var(--accent-strong);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.reveal {
  opacity: 0;
  transform: translateY(10px);
  animation: rise 0.65s ease forwards;
  animation-delay: var(--delay, 0ms);
}

@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile-first responsive design */
@media (max-width: 768px) {
  body::before,
  body::after {
    width: 280px;
    height: 280px;
  }

  body::before {
    top: -80px;
    right: -100px;
  }

  body::after {
    bottom: -100px;
    left: -80px;
  }

  .page,
  .hub-container {
    padding: 24px 16px 60px;
  }

  .hub-header {
    margin-bottom: 32px;
  }

  .hub-header h1 {
    font-size: clamp(1.75rem, 6vw, 2.5rem);
  }

  .hero-subtitle {
    font-size: 1rem;
    line-height: 1.5;
  }

  .hero-badge {
    font-size: 0.75rem;
    padding: 6px 16px;
  }

  .hero-stats {
    gap: 24px;
  }

  .stat-number {
    font-size: 2rem;
  }

  .stat-item .stat-label {
    font-size: 0.8rem;
  }

  .value-proposition {
    padding: 32px 20px;
    margin-bottom: 48px;
  }

  .section-title {
    font-size: clamp(1.5rem, 5vw, 2rem);
    margin-bottom: 12px;
  }

  .section-subtitle {
    font-size: 0.95rem;
  }

  .benefits-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .benefit-item {
    padding: 16px;
  }

  .benefit-icon {
    font-size: 2.5rem;
  }

  .benefit-item h3 {
    font-size: 1.1rem;
  }

  .benefit-item p {
    font-size: 0.9rem;
  }

  .tools-section {
    margin-bottom: 24px;
  }

  .widgets-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .widget-card {
    padding: 24px;
  }

  .widget-card.featured {
    border-width: 2px;
  }

  .widget-badge {
    top: 12px;
    right: 12px;
    font-size: 0.7rem;
    padding: 3px 10px;
  }

  .widget-icon {
    font-size: 2rem;
  }

  .widget-title {
    font-size: 1.25rem;
  }

  .widget-description {
    font-size: 0.95rem;
  }

  .widget-features {
    margin-top: 12px;
    gap: 6px;
  }

  .feature-tag {
    font-size: 0.7rem;
    padding: 3px 8px;
  }

  .about-napic {
    padding: 32px 20px;
    margin-top: 48px;
    margin-bottom: 48px;
  }

  .about-content {
    font-size: 0.95rem;
  }

  .hub-footer {
    margin-top: 48px;
    padding: 32px 0 16px;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 32px;
    text-align: center;
  }

  .footer-section h3 {
    font-size: 1.1rem;
  }

  .footer-section h4 {
    font-size: 0.95rem;
  }

  .footer-section p,
  .footer-section ul li a {
    font-size: 0.9rem;
  }

  .footer-bottom {
    font-size: 0.8rem;
    padding-top: 20px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .hero h1 {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
  }

  .hero p {
    font-size: 1rem;
  }

  .hero-card {
    padding: 20px;
  }

  .search-card,
  .results,
  .page-body {
    border-radius: 16px;
    padding: 20px;
  }

  .search-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .loan-grid {
    grid-template-columns: 1fr;
  }

  .quick-prompts {
    flex-direction: column;
  }

  .prompt-btn {
    width: 100%;
    height: 42px;
  }

  .law-chat {
    min-height: 220px;
  }

  .chat-message {
    max-width: 100%;
  }


  .input-stack,
  .input-stack.full,
  .button-row {
    grid-column: span 1;
  }

  .loan-summary-grid {
    grid-template-columns: 1fr;
  }

  .button-row {
    flex-direction: column;
    gap: 10px;
  }

  button {
    width: 100%;
    height: 48px;
  }

  input, select {
    height: 48px;
    font-size: 16px; /* Prevents zoom on iOS */
  }

  label {
    font-size: 0.9rem;
  }

  .helper {
    font-size: 0.8rem;
  }

  .results-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .count-pill {
    align-self: flex-start;
  }

  .table-wrap {
    border-radius: 12px;
    /* Enable smooth scrolling on mobile */
    -webkit-overflow-scrolling: touch;
  }

  .table {
    min-width: 800px; /* Force horizontal scroll for wide tables */
  }

  .cost-table {
    min-width: 0;
  }

  .bank-toolbar {
    align-items: flex-start;
  }

  .bank-table {
    min-width: 760px;
  }

  .table th,
  .table td {
    padding: 10px 12px;
    font-size: 0.85rem;
    white-space: nowrap;
  }

  .empty-state {
    padding: 24px 12px;
    font-size: 0.9rem;
  }

  .stat-row {
    padding: 10px 0;
  }

  .stat-label,
  .stat-value {
    font-size: 0.9rem;
  }

  .footer,
  .hub-footer,
  .page-footer {
    font-size: 0.85rem;
    padding: 1.5rem 0;
  }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
  .hub-container,
  .page {
    padding: 40px 32px;
  }

  .value-proposition {
    padding: 40px 28px;
  }

  .benefits-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
  }

  .widgets-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  .footer-content {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
  }

  .hero {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }

  .search-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .loan-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .input-stack.full {
    grid-column: span 2;
  }
}

/* Small mobile phones */
@media (max-width: 375px) {
  .hub-header h1,
  .hero h1,
  .page-header h1 {
    font-size: 1.5rem;
  }

  .hero-subtitle,
  .hub-header p,
  .hero p,
  .page-header p {
    font-size: 0.9rem;
  }

  .hero-stats {
    gap: 20px;
  }

  .stat-number {
    font-size: 1.75rem;
  }

  .value-proposition {
    padding: 24px 16px;
  }

  .section-title {
    font-size: 1.4rem;
  }

  .benefit-icon {
    font-size: 2rem;
  }

  .widget-card,
  .search-card,
  .results,
  .page-body {
    padding: 16px;
  }

  .loan-summary-item p {
    font-size: 0.98rem;
  }

  .rate-btn {
    height: 34px;
  }

  .widget-badge {
    font-size: 0.65rem;
    padding: 2px 8px;
  }

  .about-napic {
    padding: 24px 16px;
  }

  .footer-content {
    gap: 24px;
  }

  .table th,
  .table td {
    padding: 8px 10px;
    font-size: 0.8rem;
  }
}

