:root {
  color-scheme: light;
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --bg: #edf2ff;
  --surface: #ffffff;
  --surface-soft: #f8faff;
  --primary: #1d3f95;
  --primary-soft: #dbeafe;
  --secondary: #7c3aed;
  --accent: #0f766e;
  --text: #111827;
  --muted: #4b5563;
  --border: #dbe1ef;
}

html {
  scroll-behavior: smooth;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  position: relative;
  overflow-x: hidden;
  background: radial-gradient(circle at 0% 0%, #c7d2fe 0%, transparent 35%),
    radial-gradient(circle at 100% 100%, #bfdbfe 0%, transparent 35%),
    var(--bg);
}

img {
  max-width: 100%;
  display: block;
}

.bg-orb {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(6px);
  opacity: 0.45;
  pointer-events: none;
  animation: floatDrift 14s ease-in-out infinite;
}

.orb-1 {
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, #7c3aed 0%, #c4b5fd 60%, transparent 100%);
  top: -70px;
  left: -70px;
}

.orb-2 {
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, #22d3ee 0%, #a5f3fc 60%, transparent 100%);
  bottom: 10%;
  right: -90px;
  animation-delay: 2.5s;
}

.orb-3 {
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, #34d399 0%, #a7f3d0 60%, transparent 100%);
  top: 38%;
  left: 55%;
  animation-delay: 5s;
}

@keyframes floatDrift {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(0, -16px, 0) scale(1.06);
  }
}

.top-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
  background: rgba(237, 242, 255, 0.82);
  border-bottom: 1px solid rgba(203, 213, 225, 0.8);
}

.nav-inner {
  width: min(1140px, 100%);
  margin: 0 auto;
  padding: 0.72rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.62rem;
  text-decoration: none;
  color: var(--text);
}

.brand-icon {
  width: 80px;
  height: 80px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #fff;
  border: 1px solid #bfdbfe;
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.2);
}

.brand-icon svg {
  width: 42px;
  height: 42px;
}

.brand-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-text {
  display: grid;
  line-height: 1.15;
}

.brand-text strong {
  font-size: 0.98rem;
}

.brand-text small {
  color: var(--muted);
  font-size: 0.79rem;
}

.nav-links {
  display: flex;
  gap: 0.25rem;
}

.nav-links a {
  color: #1e3a8a;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.48rem 0.8rem;
  border-radius: 999px;
  transition: background 0.2s ease;
  white-space: nowrap;
}

.nav-links a:hover {
  background: #dbeafe;
}

.lang-switch {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
}

.legal-notice-banner {
  background: linear-gradient(90deg, #fef9c3 0%, #ffedd5 100%);
  border-top: 1px solid #fde68a;
  border-bottom: 1px solid #fdba74;
}

.legal-notice-banner p {
  width: min(1140px, 100%);
  margin: 0 auto;
  padding: 0.62rem 1rem;
  color: #7c2d12;
  font-weight: 700;
  font-size: 0.92rem;
}

.page {
  width: min(1140px, 100%);
  margin: 0 auto;
  padding: 1.1rem 1rem 2rem;
  display: grid;
  gap: 1.2rem;
}

#home-top,
#services,
#assistant,
#about,
#directory-search,
#review-hub {
  scroll-margin-top: 96px;
}

.hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1rem;
  background: linear-gradient(130deg, #0f1d4a 0%, #1b3a8a 52%, #0f766e 100%);
  background-size: 180% 180%;
  animation: gradientFlow 9s ease infinite;
  border-radius: 20px;
  padding: 1.2rem;
  box-shadow: 0 18px 35px rgba(15, 29, 74, 0.22);
}

@keyframes gradientFlow {
  0% {
    background-position: 0% 40%;
  }
  50% {
    background-position: 100% 60%;
  }
  100% {
    background-position: 0% 40%;
  }
}

.hero-content {
  color: #f8fbff;
  padding: 0.45rem 0.3rem;
}

.eyebrow {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: #bfdbfe;
}

.hero h1 {
  margin: 0 0 0.75rem;
  line-height: 1.2;
  font-size: clamp(1.55rem, 4vw, 2.25rem);
}

.hero-text {
  margin: 0 0 1rem;
  line-height: 1.7;
  color: #dbeafe;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.hero-tags span {
  background: rgba(255, 255, 255, 0.17);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #f8fbff;
  font-size: 0.85rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
}

.hero-media img {
  width: 100%;
  height: 100%;
  min-height: 220px;
  border-radius: 14px;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.18);
}

.trust-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.trust-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.85rem;
  box-shadow: 0 8px 24px rgba(30, 41, 59, 0.07);
}

.trust-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.trust-icon svg {
  width: 20px;
  height: 20px;
}

.trust-item h2 {
  margin: 0 0 0.2rem;
  font-size: 1rem;
  color: var(--primary);
}

.trust-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.9rem;
}

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

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(30, 41, 59, 0.07);
}

.feature-card img {
  width: 100%;
  height: 170px;
  object-fit: cover;
}

.feature-card div {
  position: relative;
  padding: 0.95rem;
}

.feature-icon {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  color: #fff;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  margin-bottom: 0.52rem;
}

.feature-icon svg {
  width: 19px;
  height: 19px;
}

.feature-card h2 {
  margin: 0 0 0.45rem;
  font-size: 1.08rem;
  color: var(--primary);
}

.feature-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  font-size: 0.95rem;
}

.assistant-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1rem;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
}

.panel-head {
  margin-bottom: 0.8rem;
  padding: 0.8rem;
  border-radius: 14px;
  background: linear-gradient(90deg, #ecfeff 0%, #eff6ff 60%, #f5f3ff 100%);
  border: 1px solid #dbeafe;
}

.panel-head h2 {
  margin: 0 0 0.3rem;
  color: var(--primary);
}

.panel-head p {
  margin: 0;
  color: #334155;
}

.chat {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
  overflow-y: auto;
  max-height: 52vh;
}

.message {
  display: flex;
  margin-bottom: 0.9rem;
}

.message:last-child {
  margin-bottom: 0;
}

.message.user {
  justify-content: flex-end;
}

.bubble {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.7;
  padding: 0.85rem 0.95rem;
  border-radius: 12px;
  max-width: min(75ch, 92%);
}

.assistant .bubble {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
}

.assistant .bubble.ai-answer {
  background: linear-gradient(180deg, #eef2ff 0%, #f8faff 100%);
}

.assistant .bubble.ai-answer p {
  margin: 0 0 0.58rem;
}

.assistant .bubble.ai-answer p:last-child {
  margin-bottom: 0;
}

.assistant .bubble.ai-answer .ai-section-title {
  margin: 0.2rem 0 0.5rem;
  color: #1e3a8a;
  font-size: 0.96rem;
}

.assistant .bubble.ai-answer .ai-section {
  margin: 0.42rem 0 0.72rem;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #ffffff;
  overflow: hidden;
}

.assistant .bubble.ai-answer .ai-section[open] {
  box-shadow: 0 3px 10px rgba(30, 64, 175, 0.08);
}

.assistant .bubble.ai-answer .ai-section summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.42rem;
  margin: 0;
  padding: 0.5rem 0.62rem;
  background: #eef2ff;
  color: #1e3a8a;
  font-weight: 700;
  font-size: 0.91rem;
}

.assistant .bubble.ai-answer .ai-section.ai-section-conclusion summary {
  background: linear-gradient(90deg, #dcfce7 0%, #bbf7d0 100%);
  color: #166534;
}

.assistant .bubble.ai-answer .ai-section.ai-section-analysis summary {
  background: linear-gradient(90deg, #dbeafe 0%, #bfdbfe 100%);
  color: #1e3a8a;
}

.assistant .bubble.ai-answer .ai-section.ai-section-steps summary {
  background: linear-gradient(90deg, #ede9fe 0%, #ddd6fe 100%);
  color: #5b21b6;
}

.assistant .bubble.ai-answer .ai-section.ai-section-risk summary {
  background: linear-gradient(90deg, #ffedd5 0%, #fed7aa 100%);
  color: #9a3412;
}

.assistant .bubble.ai-answer .ai-section.ai-section-reference summary {
  background: linear-gradient(90deg, #cffafe 0%, #a5f3fc 100%);
  color: #155e75;
}

.assistant .bubble.ai-answer .ai-section.ai-section-evidence summary {
  background: linear-gradient(90deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e;
}

.assistant .bubble.ai-answer .ai-section.ai-section-timeline summary {
  background: linear-gradient(90deg, #e0f2fe 0%, #bae6fd 100%);
  color: #0c4a6e;
}

.assistant .bubble.ai-answer .ai-section.ai-section-cost summary {
  background: linear-gradient(90deg, #dcfce7 0%, #bbf7d0 100%);
  color: #166534;
}

.assistant .bubble.ai-answer .ai-section summary::-webkit-details-marker {
  display: none;
}

.assistant .bubble.ai-answer .ai-section-icon {
  font-size: 0.96rem;
  line-height: 1;
}

.assistant .bubble.ai-answer .ai-section-body {
  padding: 0.58rem 0.68rem 0.45rem;
}

.assistant .bubble.ai-answer .ai-paragraph {
  display: flex;
  align-items: flex-start;
  gap: 0.42rem;
  margin: 0 0 0.62rem;
  padding: 0.42rem 0.5rem;
  border-radius: 10px;
  border-left: 3px solid #c7d2fe;
  background: #ffffff;
}

.assistant .bubble.ai-answer .ai-paragraph-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.32rem;
  height: 1.32rem;
  border-radius: 999px;
  font-size: 0.83rem;
  background: linear-gradient(135deg, #dbeafe 0%, #ede9fe 100%);
  border: 1px solid #c7d2fe;
}

.assistant .bubble.ai-answer .ai-paragraph.ai-paragraph-conclusion {
  border-left-color: #22c55e;
  background: linear-gradient(90deg, rgba(220, 252, 231, 0.88) 0%, rgba(255, 255, 255, 0.9) 55%);
}

.assistant .bubble.ai-answer .ai-paragraph.ai-paragraph-analysis {
  border-left-color: #3b82f6;
  background: linear-gradient(90deg, rgba(219, 234, 254, 0.88) 0%, rgba(255, 255, 255, 0.9) 55%);
}

.assistant .bubble.ai-answer .ai-paragraph.ai-paragraph-steps {
  border-left-color: #8b5cf6;
  background: linear-gradient(90deg, rgba(237, 233, 254, 0.88) 0%, rgba(255, 255, 255, 0.9) 55%);
}

.assistant .bubble.ai-answer .ai-paragraph.ai-paragraph-risk {
  border-left-color: #f97316;
  background: linear-gradient(90deg, rgba(255, 237, 213, 0.9) 0%, rgba(255, 255, 255, 0.9) 55%);
}

.assistant .bubble.ai-answer .ai-paragraph.ai-paragraph-reference {
  border-left-color: #06b6d4;
  background: linear-gradient(90deg, rgba(207, 250, 254, 0.86) 0%, rgba(255, 255, 255, 0.9) 55%);
}

.assistant .bubble.ai-answer .ai-paragraph.ai-paragraph-evidence {
  border-left-color: #f59e0b;
  background: linear-gradient(90deg, rgba(254, 243, 199, 0.88) 0%, rgba(255, 255, 255, 0.9) 55%);
}

.assistant .bubble.ai-answer .ai-paragraph.ai-paragraph-timeline {
  border-left-color: #0284c7;
  background: linear-gradient(90deg, rgba(224, 242, 254, 0.88) 0%, rgba(255, 255, 255, 0.9) 55%);
}

.assistant .bubble.ai-answer .ai-paragraph.ai-paragraph-cost {
  border-left-color: #16a34a;
  background: linear-gradient(90deg, rgba(220, 252, 231, 0.8) 0%, rgba(255, 255, 255, 0.9) 55%);
}

.assistant .bubble.ai-answer .ai-paragraph-icon.ai-paragraph-icon-conclusion {
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
  border-color: #86efac;
}

.assistant .bubble.ai-answer .ai-paragraph-icon.ai-paragraph-icon-analysis {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  border-color: #93c5fd;
}

.assistant .bubble.ai-answer .ai-paragraph-icon.ai-paragraph-icon-steps {
  background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
  border-color: #c4b5fd;
}

.assistant .bubble.ai-answer .ai-paragraph-icon.ai-paragraph-icon-risk {
  background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 100%);
  border-color: #fdba74;
}

.assistant .bubble.ai-answer .ai-paragraph-icon.ai-paragraph-icon-reference {
  background: linear-gradient(135deg, #cffafe 0%, #a5f3fc 100%);
  border-color: #67e8f9;
}

.assistant .bubble.ai-answer .ai-paragraph-icon.ai-paragraph-icon-evidence {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-color: #fcd34d;
}

.assistant .bubble.ai-answer .ai-paragraph-icon.ai-paragraph-icon-timeline {
  background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
  border-color: #7dd3fc;
}

.assistant .bubble.ai-answer .ai-paragraph-icon.ai-paragraph-icon-cost {
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
  border-color: #86efac;
}

.assistant .bubble.ai-answer .ai-paragraph-text {
  flex: 1;
}

.assistant .bubble.ai-answer .ai-paragraph-badge {
  display: inline-block;
  margin: 0 0.42rem 0.24rem 0;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0.03rem 0.46rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.assistant .bubble.ai-answer .ai-paragraph-badge.ai-paragraph-badge-conclusion {
  background: #dcfce7;
  color: #166534;
  border-color: #86efac;
}

.assistant .bubble.ai-answer .ai-paragraph-badge.ai-paragraph-badge-analysis {
  background: #dbeafe;
  color: #1e3a8a;
  border-color: #93c5fd;
}

.assistant .bubble.ai-answer .ai-paragraph-badge.ai-paragraph-badge-steps {
  background: #ede9fe;
  color: #5b21b6;
  border-color: #c4b5fd;
}

.assistant .bubble.ai-answer .ai-paragraph-badge.ai-paragraph-badge-risk {
  background: #ffedd5;
  color: #9a3412;
  border-color: #fdba74;
}

.assistant .bubble.ai-answer .ai-paragraph-badge.ai-paragraph-badge-reference {
  background: #cffafe;
  color: #155e75;
  border-color: #67e8f9;
}

.assistant .bubble.ai-answer .ai-paragraph-badge.ai-paragraph-badge-evidence {
  background: #fef3c7;
  color: #92400e;
  border-color: #fcd34d;
}

.assistant .bubble.ai-answer .ai-paragraph-badge.ai-paragraph-badge-timeline {
  background: #e0f2fe;
  color: #0c4a6e;
  border-color: #7dd3fc;
}

.assistant .bubble.ai-answer .ai-paragraph-badge.ai-paragraph-badge-cost {
  background: #dcfce7;
  color: #166534;
  border-color: #86efac;
}

.assistant .bubble.ai-answer .ai-list {
  margin: 0.1rem 0 0.7rem;
  padding-left: 1.15rem;
}

.assistant .bubble.ai-answer .ai-list li {
  margin-bottom: 0.33rem;
}

.assistant .bubble.ai-answer code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New",
    monospace;
  font-size: 0.86em;
  background: #e2e8f0;
  color: #0f172a;
  border-radius: 6px;
  padding: 0.07rem 0.35rem;
}

.assistant .bubble.ai-answer .ai-legal-ref {
  display: inline-block;
  border-radius: 999px;
  background: #dbeafe;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  font-weight: 600;
  font-size: 0.86em;
  padding: 0.03rem 0.46rem;
}

.assistant .bubble.ai-answer .ai-keyword {
  display: inline-block;
  border-radius: 0.42rem;
  border: 1px solid transparent;
  padding: 0.01rem 0.28rem;
  margin: 0 0.04rem;
  font-weight: 700;
}

.assistant .bubble.ai-answer .ai-keyword.ai-keyword-conclusion {
  background: #dcfce7;
  color: #166534;
  border-color: #86efac;
}

.assistant .bubble.ai-answer .ai-keyword.ai-keyword-analysis {
  background: #dbeafe;
  color: #1e3a8a;
  border-color: #93c5fd;
}

.assistant .bubble.ai-answer .ai-keyword.ai-keyword-steps {
  background: #ede9fe;
  color: #5b21b6;
  border-color: #c4b5fd;
}

.assistant .bubble.ai-answer .ai-keyword.ai-keyword-risk {
  background: #ffedd5;
  color: #9a3412;
  border-color: #fdba74;
}

.assistant .bubble.ai-answer .ai-keyword.ai-keyword-reference {
  background: #cffafe;
  color: #155e75;
  border-color: #67e8f9;
}

.assistant .bubble.ai-answer .ai-keyword.ai-keyword-evidence {
  background: #fef3c7;
  color: #92400e;
  border-color: #fcd34d;
}

.assistant .bubble.ai-answer .ai-keyword.ai-keyword-timeline {
  background: #e0f2fe;
  color: #0c4a6e;
  border-color: #7dd3fc;
}

.assistant .bubble.ai-answer .ai-keyword.ai-keyword-cost {
  background: #dcfce7;
  color: #166534;
  border-color: #86efac;
}

.assistant .bubble.ai-answer a {
  color: #1d4ed8;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.assistant .bubble.typing-effect::after {
  content: "";
  display: inline-block;
  width: 0.52ch;
  height: 1em;
  margin-left: 0.15rem;
  vertical-align: -0.08em;
  border-radius: 2px;
  background: #4f46e5;
  animation: chatCaretBlink 1s steps(1) infinite;
}

.user .bubble {
  color: #fff;
  background: linear-gradient(145deg, var(--secondary), var(--primary));
  border: 1px solid #7c3aed;
}

@keyframes chatCaretBlink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

.lawyer-recommendation {
  margin-top: 0.9rem;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.82rem;
}

.lawyer-recommendation h3 {
  margin: 0 0 0.6rem;
  color: var(--primary);
  font-size: 1rem;
}

.recommendation-table-wrap {
  overflow-x: auto;
}

.recommendation-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
  border: 1px solid #dbe1ef;
  border-radius: 10px;
  overflow: hidden;
}

.recommendation-table th,
.recommendation-table td {
  padding: 0.62rem 0.7rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.9rem;
  line-height: 1.55;
}

.recommendation-table th {
  background: #eef2ff;
  color: #1e3a8a;
  font-weight: 700;
}

.recommendation-table tbody tr:nth-child(even) {
  background: #f8fafc;
}

#recommendation-empty {
  margin: 0.62rem 0 0;
  font-size: 0.88rem;
}

.ask-form {
  margin-top: 0.9rem;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.8rem;
  display: grid;
  gap: 0.72rem;
}

textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 0.85rem;
  font: inherit;
  line-height: 1.6;
  background: #fff;
}

button {
  justify-self: end;
  border: none;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  padding: 0.67rem 1.3rem;
  border-radius: 10px;
  font: inherit;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
}

button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.lang-switch button {
  justify-self: auto;
  min-width: 58px;
  padding: 0.4rem 0.62rem;
  border-radius: 999px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 0.82rem;
  font-weight: 700;
}

.lang-switch button.active {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  border-color: transparent;
}

.brand-showcase {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1rem;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
}

.showcase-media img {
  width: 100%;
  height: 100%;
  min-height: 260px;
  object-fit: cover;
  border-radius: 14px;
}

.showcase-content {
  padding: 0.3rem 0.2rem;
}

.showcase-content h2 {
  margin: 0 0 0.6rem;
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  color: var(--primary);
}

.showcase-content p {
  margin: 0 0 0.65rem;
  color: #334155;
  line-height: 1.72;
}

.icon-list {
  list-style: none;
  margin: 0.55rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.icon-list li {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  color: #334155;
  line-height: 1.6;
}

.icon-list li .icon-bullet {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  flex: 0 0 28px;
  display: inline-grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, var(--accent), #22c55e);
}

.icon-list li .icon-bullet svg {
  width: 16px;
  height: 16px;
}

.icon-list li .icon-text {
  display: inline;
  color: inherit;
}

.site-footer {
  margin-top: 0.4rem;
  background: linear-gradient(130deg, #0f172a 0%, #1e293b 100%);
  color: #e2e8f0;
  border-top: 1px solid #334155;
}

.footer-inner {
  width: min(1140px, 100%);
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.footer-brand {
  margin: 0 0 0.3rem;
  font-weight: 700;
}

.footer-meta {
  margin: 0;
  color: #94a3b8;
  font-size: 0.88rem;
}

.footer-links {
  margin-top: 0.58rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.8rem;
}

.footer-links a {
  color: #bfdbfe;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
}

.footer-links a:hover {
  text-decoration: underline;
}

.footer-email-link {
  color: #bfdbfe;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-icons {
  display: flex;
  gap: 0.5rem;
}

.footer-icons a {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  color: #e2e8f0;
  border: 1px solid #475569;
  text-decoration: none;
  background: rgba(148, 163, 184, 0.08);
}

.footer-icons a:hover {
  border-color: #93c5fd;
  color: #bfdbfe;
}

.footer-icons svg {
  width: 19px;
  height: 19px;
}

.static-content {
  display: grid;
  gap: 0.85rem;
}

.static-block {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-soft);
  padding: 0.9rem 0.95rem;
}

.static-block h2 {
  margin: 0 0 0.45rem;
  color: #1e3a8a;
  font-size: 1.02rem;
}

.static-block p {
  margin: 0;
  color: #334155;
  line-height: 1.68;
}

.hidden {
  display: none !important;
}

.full-width {
  width: 100%;
}

.muted {
  color: var(--muted);
}

.secondary-btn {
  border: 1px solid #cbd5e1;
  color: #1e3a8a;
  background: #eff6ff;
  font-weight: 600;
}

.secondary-btn:hover {
  background: #dbeafe;
}

.directory-page .directory-hero {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 1rem;
  background: linear-gradient(135deg, #172554 0%, #1d4ed8 60%, #0f766e 100%);
  background-size: 180% 180%;
  animation: gradientFlow 10s ease infinite;
  border-radius: 20px;
  padding: 1.1rem;
  box-shadow: 0 16px 28px rgba(30, 64, 175, 0.24);
}

.directory-page .directory-hero-content {
  color: #eff6ff;
}

.directory-page .directory-hero-content h1 {
  margin: 0 0 0.65rem;
  line-height: 1.2;
  font-size: clamp(1.45rem, 3.7vw, 2.1rem);
}

.directory-page .directory-hero-content p {
  margin: 0 0 0.7rem;
  color: #dbeafe;
  line-height: 1.65;
}

.directory-page .directory-hero-content .data-source-note {
  margin-bottom: 0.85rem;
  font-size: 0.92rem;
  color: #bfdbfe;
}

.directory-page .directory-hero-content ul {
  margin: 0;
  padding-left: 1.2rem;
  line-height: 1.75;
}

.directory-page .directory-hero img {
  width: 100%;
  height: 100%;
  min-height: 230px;
  object-fit: cover;
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, 0.25);
}

.lawyer-marquee {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.85rem 0.95rem;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  display: grid;
  gap: 0.55rem;
}

.lawyer-marquee h2 {
  margin: 0;
  color: var(--primary);
}

.lawyer-marquee p {
  margin: 0;
}

.lawyer-marquee-shell {
  overflow: hidden;
  border: 1px dashed #bfdbfe;
  border-radius: 12px;
  background: linear-gradient(90deg, #f8fbff 0%, #eef6ff 100%);
}

.lawyer-marquee-track {
  display: flex;
  align-items: stretch;
  gap: 0.7rem;
  width: max-content;
  padding: 0.55rem;
}

.lawyer-marquee-track.is-animated {
  animation: lawyerTicker var(--marquee-duration, 28s) linear infinite;
}

.lawyer-marquee-shell:hover .lawyer-marquee-track.is-animated {
  animation-play-state: paused;
}

.marquee-lawyer-card {
  min-width: 260px;
  max-width: 320px;
  border: 1px solid #cbd5e1;
  background: #fff;
  border-radius: 12px;
  padding: 0.6rem 0.7rem;
  display: grid;
  gap: 0.26rem;
  text-align: left;
  cursor: pointer;
  color: #0f172a;
  box-shadow: 0 4px 12px rgba(30, 41, 59, 0.08);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.marquee-lawyer-card:hover {
  transform: translateY(-1px);
  border-color: #93c5fd;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.16);
}

.marquee-lawyer-card:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 1px;
}

.marquee-lawyer-name {
  font-size: 0.93rem;
  font-weight: 700;
  color: #1e3a8a;
}

.marquee-lawyer-firm,
.marquee-lawyer-phone,
.marquee-lawyer-categories {
  font-size: 0.82rem;
  color: #334155;
}

.lawyer-marquee-empty {
  margin: 0;
  padding: 0.75rem;
  color: #64748b;
  font-size: 0.86rem;
}

@keyframes lawyerTicker {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(calc(-50% - 0.35rem));
  }
}

.directory-layout {
  display: grid;
  grid-template-columns: minmax(250px, 300px) 1fr;
  gap: 1rem;
}

.directory-filter-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.95rem;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  height: fit-content;
}

.directory-filter-card h2 {
  margin: 0 0 0.8rem;
  color: var(--primary);
}

.directory-filter-card label {
  display: block;
  margin: 0.5rem 0 0.28rem;
  font-weight: 600;
  color: #334155;
  font-size: 0.92rem;
}

.directory-filter-card input,
.directory-filter-card select {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 0.7rem 0.75rem;
  font: inherit;
  background: #fff;
}

.result-summary {
  margin: 0.85rem 0;
  color: #1e3a8a;
  font-weight: 600;
}

.pager {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.45rem;
}

.pager span {
  text-align: center;
  color: #334155;
  font-weight: 600;
}

.pager button {
  padding: 0.52rem 0.68rem;
}

.lawyer-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.results-column {
  display: grid;
  gap: 0.9rem;
}

.firm-spotlight.hidden {
  display: none;
}

.firm-spotlight-card {
  margin: 0;
}

.firm-spotlight-card h3 {
  margin: 0 0 0.65rem;
  color: #1e3a8a;
  font-size: 1.08rem;
}

.lawyer-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.88rem;
  box-shadow: 0 8px 20px rgba(30, 41, 59, 0.08);
  display: grid;
  gap: 0.45rem;
}

.lawyer-card.is-selected {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18), 0 8px 20px rgba(30, 41, 59, 0.08);
}

.lawyer-card-head h3 {
  margin: 0;
  font-size: 1.06rem;
  color: var(--primary);
  overflow-wrap: anywhere;
}

.lawyer-card-head p {
  margin: 0.2rem 0 0;
  color: #64748b;
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.lawyer-firm {
  margin: 0;
  color: #0f172a;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.category-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.category-tags span {
  background: #ede9fe;
  color: #5b21b6;
  border: 1px solid #ddd6fe;
  border-radius: 999px;
  font-size: 0.78rem;
  padding: 0.22rem 0.6rem;
}

.review-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.lawyer-detail-card,
.auth-review-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.95rem;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.lawyer-detail-card h2,
.auth-review-card h2 {
  margin: 0 0 0.7rem;
  color: var(--primary);
}

.detail-update-note {
  margin: 0 0 0.75rem;
  color: #475569;
  font-size: 0.86rem;
  line-height: 1.5;
}

.detail-update-note a {
  color: #1d4ed8;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
}

.detail-update-note a:hover {
  color: #1e40af;
}

.lawyer-detail-placeholder {
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  padding: 0.8rem;
  color: #334155;
  margin-bottom: 0.9rem;
}

.lawyer-detail-card h3 {
  margin: 0;
}

.lawyer-detail-card p {
  margin: 0.42rem 0;
}

.lawyer-firm-link {
  color: #1d4ed8;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
}

.lawyer-firm-link:hover {
  color: #1e40af;
}

.lawyer-external-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: #1d4ed8;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
}

.lawyer-external-link:hover {
  color: #1e40af;
}

.firm-profile {
  margin: 0.9rem 0 1rem;
  padding: 0.95rem 1rem;
  border: 1px solid #dbeafe;
  border-radius: 14px;
  background: #f8fbff;
}

.firm-profile h2,
.firm-profile h4 {
  margin: 0 0 0.65rem;
  color: #1e3a8a;
  font-size: 1rem;
}

.firm-profile p {
  margin: 0 0 0.75rem;
  color: #334155;
  line-height: 1.75;
}

.firm-profile p:last-child {
  margin-bottom: 0;
}

.review-list {
  display: grid;
  gap: 0.65rem;
}

.review-item {
  border: 1px solid #dbeafe;
  background: #f8fbff;
  border-radius: 12px;
  padding: 0.7rem;
}

.review-item-head {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 0.3rem;
}

.review-item p {
  margin: 0 0 0.35rem;
  white-space: pre-wrap;
  line-height: 1.6;
}

.review-item small {
  color: #64748b;
}

.auth-status {
  margin: 0 0 0.75rem;
  padding: 0.62rem 0.7rem;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #eff6ff;
  color: #1d4ed8;
}

.auth-form,
.review-form {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 0.72rem;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.74rem;
}

.auth-form h3,
.review-form h3 {
  margin: 0;
  color: #1e3a8a;
}

.auth-form input,
.review-form select,
.review-form textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 0.66rem 0.72rem;
  font: inherit;
}

.review-form label {
  font-weight: 600;
  color: #334155;
  font-size: 0.9rem;
}

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

@media (max-width: 940px) {
  .nav-inner {
    flex-wrap: wrap;
  }

  .nav-links {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .legal-notice-banner p {
    font-size: 0.86rem;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .trust-strip {
    grid-template-columns: 1fr;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .directory-page .directory-hero {
    grid-template-columns: 1fr;
  }

  .directory-layout,
  .review-layout {
    grid-template-columns: 1fr;
  }

  .lawyer-results {
    grid-template-columns: 1fr;
  }

  .brand-showcase {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (min-width: 941px) and (max-width: 1024px) {
  .page {
    padding: 0.95rem 0.85rem 1.6rem;
    gap: 1rem;
  }

  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .trust-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .directory-layout {
    grid-template-columns: minmax(220px, 280px) 1fr;
  }

  .review-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .top-nav {
    position: static;
  }

  .nav-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.68rem;
    align-items: center;
  }

  .brand-icon {
    width: 64px;
    height: 64px;
  }

  .brand {
    min-width: 0;
  }

  .brand-text strong {
    font-size: 0.9rem;
  }

  .brand-text small {
    font-size: 0.74rem;
  }

  .lang-switch {
    justify-self: end;
  }

  .nav-links {
    grid-column: 1 / -1;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.2rem;
  }

  .nav-links a {
    padding: 0.42rem 0.7rem;
    font-size: 0.84rem;
  }

  .legal-notice-banner p {
    padding: 0.56rem 0.85rem;
    font-size: 0.82rem;
  }

  .hero,
  .assistant-panel,
  .brand-showcase,
  .directory-page .directory-hero,
  .lawyer-marquee,
  .directory-filter-card,
  .lawyer-detail-card,
  .auth-review-card {
    border-radius: 14px;
    padding: 0.82rem;
  }

  .chat {
    max-height: 46vh;
    padding: 0.82rem;
  }

  .bubble {
    max-width: 100%;
    font-size: 0.92rem;
    line-height: 1.62;
  }

  .ask-form {
    padding: 0.7rem;
  }

  .ask-form button,
  .auth-form button,
  .review-form button,
  #logout-btn {
    width: 100%;
    justify-self: stretch;
  }

  .recommendation-table {
    min-width: 620px;
  }

  .directory-filter-card {
    position: static;
  }

  .directory-page .directory-hero-content ul {
    padding-left: 1rem;
  }

  .pager {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }

  .pager button {
    width: 100%;
    justify-self: stretch;
  }

  .review-item-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .marquee-lawyer-card {
    min-width: 220px;
  }
}

@media (max-width: 560px) {
  .page {
    padding: 0.75rem 0.62rem 1.3rem;
  }

  .hero h1,
  .directory-page .directory-hero-content h1 {
    font-size: 1.35rem;
  }

  .hero-text,
  .directory-page .directory-hero-content p,
  .directory-page .directory-hero-content ul {
    font-size: 0.9rem;
    line-height: 1.56;
  }

  .hero-media img,
  .directory-page .directory-hero img,
  .showcase-media img {
    min-height: 180px;
  }

  .feature-grid,
  .trust-strip,
  .lawyer-results {
    grid-template-columns: 1fr;
  }

  .feature-card img {
    height: 150px;
  }

  .panel-head h2,
  .lawyer-detail-card h2,
  .auth-review-card h2 {
    font-size: 1.1rem;
  }

  .recommendation-table {
    min-width: 560px;
  }

  .recommendation-table th,
  .recommendation-table td {
    padding: 0.52rem 0.56rem;
    font-size: 0.82rem;
    line-height: 1.42;
  }

  .footer-meta {
    font-size: 0.82rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .assistant .bubble.typing-effect::after {
    animation: none;
  }

  .bg-orb,
  .hero,
  .directory-page .directory-hero,
  .lawyer-marquee-track.is-animated {
    animation: none;
  }
}
