/* Nessim Law Firm — nessimlawfirm
   Deep navy + gold · mobile-first · RTL/LTR */

:root {
  --navy-950: #060e1a;
  --navy-900: #0a1628;
  --navy-800: #122038;
  --navy-700: #1a2d4a;
  --gold-400: #d4af37;
  --gold-500: #c9a227;
  --gold-600: #a8841a;
  --cream: #f7f4ef;
  --cream-muted: #e8e2d8;
  --ink: #1a1a1a;
  --ink-soft: #2d3748;
  --white: #ffffff;
  --radius: 12px;
  --shadow: 0 12px 40px rgba(6, 14, 26, 0.12);
  --header-h: 72px;
  --font-ar: "Cairo", "Segoe UI", Tahoma, Arial, sans-serif;
  --font-en: "Inter", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --font-display: "Cairo", "Inter", "Segoe UI", system-ui, sans-serif;
  --transition: 0.25s ease;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
}

body {
  margin: 0;
  font-family: var(--font-ar);
  font-size: 1.12rem;
  font-weight: 500;
  line-height: 1.75;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: auto;
}

html[lang="en"] body {
  font-family: var(--font-en);
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

h1, h2, h3 {
  line-height: 1.25;
  font-weight: 700;
  margin: 0 0 0.6em;
}

html[lang="en"] h1,
html[lang="en"] .hero-title,
html[lang="en"] .brand-name {
  font-family: var(--font-display);
  letter-spacing: 0.02em;
}

.container {
  width: min(1120px, 100% - 2rem);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  inset-inline-start: 1rem;
  top: -100px;
  background: var(--gold-500);
  color: var(--navy-900);
  padding: 0.5rem 1rem;
  z-index: 1000;
  border-radius: 4px;
  font-weight: 600;
}

.skip-link:focus {
  top: 1rem;
}

.muted {
  color: var(--ink-soft);
  opacity: 1;
}

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-600);
  margin: 0 0 0.75rem;
}

html[dir="rtl"] .eyebrow {
  letter-spacing: 0.04em;
  text-transform: none;
  font-size: 0.9rem;
}

/* ——— Header ——— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(10, 22, 40, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(201, 162, 39, 0.2);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--white);
  min-width: 0;
}


.brand-logo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(201, 162, 39, 0.55), 0 4px 14px rgba(0,0,0,0.25);
}

.brand-mark {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--gold-400), var(--gold-600));
  color: var(--navy-900);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  border-radius: 8px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-name {
  font-weight: 700;
  font-size: 1.05rem;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
}

.brand-tag {
  font-size: 0.85rem;
  color: rgba(247, 244, 239, 0.92);
  font-weight: 500;
}

.nav {
  display: none;
  gap: 1.75rem;
}

.nav a {
  color: rgba(247, 244, 239, 0.98);
  font-size: 0.95rem;
  font-weight: 500;
  position: relative;
  padding: 0.25rem 0;
  transition: color var(--transition);
}

.nav a:hover,
.nav a:focus-visible {
  color: var(--gold-400);
}

.nav a::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: -2px;
  height: 2px;
  background: var(--gold-500);
  transform: scaleX(0);
  transition: transform var(--transition);
}

.nav a:hover::after,
.nav a:focus-visible::after {
  transform: scaleX(1);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lang-toggle {
  appearance: none;
  border: 1px solid rgba(201, 162, 39, 0.45);
  background: transparent;
  color: var(--gold-400);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.lang-toggle:hover,
.lang-toggle:focus-visible {
  background: var(--gold-500);
  color: var(--navy-900);
  border-color: var(--gold-500);
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 10px;
  border: none;
  background: transparent;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--cream);
  border-radius: 1px;
  transition: transform var(--transition), opacity var(--transition);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 899px) {
  .nav.is-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--header-h);
    inset-inline: 0;
    background: var(--navy-900);
    padding: 1.25rem 1.5rem 1.75rem;
    border-bottom: 1px solid rgba(201, 162, 39, 0.25);
    gap: 1rem;
    box-shadow: var(--shadow);
  }
}

@media (min-width: 900px) {
  .nav {
    display: flex;
  }
  .nav-toggle {
    display: none;
  }
  .brand-name {
    font-size: 1.1rem;
  }
}

/* ——— Hero ——— */
.hero {
  position: relative;
  background: var(--navy-900);
  color: var(--cream);
  padding: 4.5rem 0 4rem;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 70% 20%, rgba(201, 162, 39, 0.12), transparent),
    linear-gradient(165deg, var(--navy-900) 0%, var(--navy-800) 50%, var(--navy-950) 100%);
  pointer-events: none;
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset-inline-end: -10%;
  top: 10%;
  width: 50%;
  height: 80%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cpath fill='none' stroke='%23c9a227' stroke-opacity='0.08' stroke-width='0.5' d='M20 180 L100 20 L180 180 Z'/%3E%3Cpath fill='none' stroke='%23c9a227' stroke-opacity='0.06' stroke-width='0.5' d='M40 180 L100 50 L160 180 Z'/%3E%3C/svg%3E") center / contain no-repeat;
  opacity: 1;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  max-width: 720px;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.25rem);
  color: var(--white);
  margin-bottom: 1rem;
}

.hero-lead {
  font-size: 1.1rem;
  color: rgba(247, 244, 239, 0.82);
  margin: 0 0 2rem;
  max-width: 38em;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 3rem;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 0;
  padding-top: 2rem;
  border-top: 1px solid rgba(201, 162, 39, 0.25);
}

.hero-stats div {
  margin: 0;
}

.hero-stats dt {
  font-size: 0.75rem;
  color: rgba(247, 244, 239, 0.55);
  margin-bottom: 0.25rem;
}

.hero-stats dd {
  margin: 0;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--gold-400);
}

@media (max-width: 480px) {
  .hero-stats {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

/* ——— Buttons ——— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.4rem;
  border-radius: 8px;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition), opacity var(--transition);
}

.btn-primary {
  background: var(--gold-500);
  color: var(--navy-900);
  border-color: var(--gold-500);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--gold-400);
  border-color: var(--gold-400);
}

.btn-ghost {
  background: transparent;
  color: var(--cream);
  border-color: rgba(247, 244, 239, 0.35);
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  border-color: var(--gold-400);
  color: var(--gold-400);
}

.btn-whatsapp {
  background: #25d366;
  color: #fff;
  border-color: #25d366;
  margin-top: 0.75rem;
}

.btn-whatsapp:hover:not(.is-disabled),
.btn-whatsapp:focus-visible:not(.is-disabled) {
  background: #1ebe57;
  border-color: #1ebe57;
}

.btn-whatsapp.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

/* ——— Sections ——— */
.section {
  padding: 4.5rem 0;
}

.section-alt {
  background: var(--white);
}

.section-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 2.75rem;
}

.section-head.align-start {
  text-align: start;
  margin-inline: 0;
}

.section-head h2 {
  font-size: clamp(1.65rem, 3vw, 2.15rem);
  color: var(--navy-900);
}

.section-lead {
  margin: 0;
  color: var(--ink-soft);
}

/* ——— Cards ——— */
.cards {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}

@media (min-width: 700px) {
  .cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  background: var(--white);
  border: 1px solid var(--cream-muted);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  box-shadow: 0 4px 20px rgba(6, 14, 26, 0.04);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.section-alt .card,
.section .card {
  background: var(--white);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: rgba(201, 162, 39, 0.35);
}

.card-icon {
  width: 48px;
  height: 48px;
  color: var(--gold-500);
  margin-bottom: 1.1rem;
}

.card-icon svg {
  width: 40px;
  height: 40px;
}

.card h3 {
  color: var(--navy-900);
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.98rem;
}

/* ——— About ——— */
.about-grid {
  display: grid;
  gap: 2.5rem;
  align-items: start;
}

@media (min-width: 800px) {
  .about-grid {
    grid-template-columns: 1.2fr 0.9fr;
    gap: 3rem;
  }
}

.about-copy p {
  color: var(--ink-soft);
  margin: 0 0 1rem;
}

.about-panel {
  background: var(--navy-900);
  color: var(--cream);
  border-radius: var(--radius);
  padding: 1.75rem;
  border: 1px solid rgba(201, 162, 39, 0.3);
}

.facts li {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(247, 244, 239, 0.1);
}

.facts li:first-child {
  padding-top: 0;
}

.facts li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.fact-label {
  font-size: 0.8rem;
  color: rgba(247, 244, 239, 0.55);
}

.fact-value {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--gold-400);
}

/* ——— Contact ——— */
.contact-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}

@media (min-width: 700px) {
  .contact-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.contact-card {
  background: var(--white);
  border: 1px solid var(--cream-muted);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
}

.contact-card h3 {
  color: var(--navy-900);
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.contact-card p {
  margin: 0 0 0.5rem;
}

.wa-status {
  color: var(--ink-soft);
}

.contact-email-wrap {
  margin-top: 1rem !important;
}

.contact-cta-card {
  background: var(--navy-800);
  border-color: var(--navy-700);
  color: var(--cream);
}

.contact-cta-card h3 {
  color: var(--gold-400);
}

.contact-cta-card p {
  color: rgba(247, 244, 239, 0.75);
  margin-bottom: 1.25rem;
}

/* ——— Footer ——— */
.site-footer {
  background: var(--navy-950);
  color: rgba(247, 244, 239, 0.7);
  padding: 2.5rem 0;
  text-align: center;
  border-top: 1px solid rgba(201, 162, 39, 0.2);
}

.footer-brand {
  margin: 0 0 0.35rem;
  color: var(--gold-400);
  font-weight: 600;
  font-size: 1rem;
}

.footer-ar {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
}

.footer-note {
  margin: 0;
}

/* ——— Focus ——— */
:focus-visible {
  outline: 2px solid var(--gold-500);
  outline-offset: 3px;
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}


/* ——— About logo ——— */
.about-logo-wrap {
  background: var(--white);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.about-logo {
  margin-inline: auto;
  width: min(100%, 420px);
  height: auto;
  display: block;
}


/* ——— Hero logo ——— */
.hero-logo-wrap {
  display: flex;
  justify-content: center;
  margin: 0 auto 1.5rem;
}
.hero-logo {
  width: min(72vw, 280px);
  height: auto;
  border-radius: 50%;
  background: #fff;
  padding: 0.35rem;
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.65), 0 18px 40px rgba(0,0,0,0.35);
}
@media (min-width: 768px) {
  .hero-logo {
    width: 320px;
  }
  .brand-logo {
    width: 80px;
    height: 80px;
  }
}

/* ——— Footer admin link ——— */
.footer-admin {
  margin: 1rem 0 0;
  font-size: 0.9rem;
}
.footer-admin a {
  color: rgba(212, 175, 55, 0.85);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.footer-admin a:hover {
  color: var(--gold-400);
}

/* ——— Visually hidden ——— */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ——— Admin ——— */
.admin-body {
  min-height: 100vh;
}
.admin-main {
  padding: 2rem 0 3rem;
}
.admin-card {
  background: var(--white);
  border: 1px solid var(--cream-muted);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
}
.admin-card h1,
.admin-card h2,
.admin-dashboard h1 {
  color: var(--navy-900);
  margin-top: 0;
}
.admin-form label {
  display: block;
  margin-bottom: 1rem;
  font-weight: 600;
  color: var(--navy-800);
}
.admin-form label span {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.95rem;
}
.admin-form input,
.admin-form textarea,
.admin-search-row input {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--cream-muted);
  border-radius: 8px;
  font: inherit;
  background: var(--cream);
  color: var(--ink);
}
.admin-form textarea {
  resize: vertical;
  min-height: 140px;
}
.admin-row {
  display: grid;
  gap: 1rem;
}
@media (min-width: 700px) {
  .admin-row {
    grid-template-columns: 1fr 1fr;
  }
}
.admin-error {
  color: #b42318;
  background: #fef3f2;
  border: 1px solid #fecdca;
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  margin: 0 0 1rem;
}
.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.admin-toolbar h1 {
  margin: 0;
  font-size: 1.45rem;
}

.admin-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}
.admin-sync-status {
  margin: -0.35rem 0 1rem;
  min-height: 1.25em;
}
.admin-form-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.admin-search-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.admin-home-link {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.9rem;
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: 999px;
  color: var(--gold-400);
  font-size: 0.9rem;
}
.entries-list {
  display: grid;
  gap: 0.85rem;
}
.entry-item {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  padding: 1rem;
  border: 1px solid var(--cream-muted);
  border-radius: 10px;
  background: var(--cream);
}
.entry-item h3 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  color: var(--navy-900);
}
.entry-preview {
  margin: 0.35rem 0 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}
.entry-item-actions {
  display: flex;
  gap: 0.4rem;
  align-items: flex-start;
}
.btn-sm {
  padding: 0.35rem 0.7rem !important;
  font-size: 0.85rem !important;
}

/* ——— AI helper ——— */
.ai-helper {
  position: fixed;
  inset-inline-end: 1rem;
  bottom: 1rem;
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
  max-width: min(100vw - 2rem, 380px);
}
.ai-fab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--navy-800), var(--navy-950));
  color: var(--cream);
  border-radius: 999px;
  width: auto;
  height: auto;
  min-height: 3.6rem;
  padding: 0.65rem 1.15rem 0.65rem 0.9rem;
  gap: 0.55rem;
  box-shadow: 0 10px 30px rgba(6, 14, 26, 0.35);
  font: inherit;
  font-weight: 600;
  border: 1px solid rgba(212, 175, 55, 0.55);
}
.ai-fab .ai-fab-label {
  position: static;
  width: auto;
  height: auto;
  padding: 0;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: nowrap;
  border: 0;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #f0d78c;
}
.ai-panel[hidden] {
  display: none !important;
}
.ai-fab {
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.ai-fab::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 999px;
  border: 2px solid rgba(212, 175, 55, 0.45);
  animation: ai-fab-pulse 2.4s ease-out infinite;
  pointer-events: none;
}
@keyframes ai-fab-pulse {
  0% { transform: scale(1); opacity: 0.7; }
  70% { transform: scale(1.18); opacity: 0; }
  100% { opacity: 0; }
}
.ai-fab:hover {
  border-color: var(--gold-400);
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 14px 36px rgba(6, 14, 26, 0.42), 0 0 0 3px rgba(212, 175, 55, 0.25);
}

/* ——— AI FAB pill: always show ⚖ + Ask the lawyer label ——— */
.ai-fab .ai-fab-label {
  position: static !important;
  width: auto !important;
  height: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: visible !important;
  clip: auto !important;
  clip-path: none !important;
  white-space: nowrap !important;
  border: 0 !important;
  font-size: 0.95rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.01em;
  color: #f0d78c !important;
  display: inline !important;
}
.ai-fab-icon {
  color: var(--gold-400);
  font-size: 1.4rem;
  filter: drop-shadow(0 0 6px rgba(212, 175, 55, 0.55));
}
.ai-panel {
  width: min(100vw - 2rem, 380px);
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--cream-muted);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: min(78vh, 560px);
  max-height: min(78vh, 560px);
}
.ai-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  padding: 0.4rem 0.65rem;
  background: var(--navy-900);
  color: var(--cream);
  flex-shrink: 0;
  min-height: 0;
}
.ai-panel-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold-400);
  line-height: 1.35;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
}
.ai-close {
  background: transparent;
  border: none;
  color: var(--cream);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.15rem;
  flex-shrink: 0;
  opacity: 0.85;
}
.ai-disclaimer {
  margin: 0;
  padding: 0.45rem 0.75rem;
  font-size: 0.88rem;
  line-height: 1.45;
  border-bottom: 1px solid var(--cream-muted);
  background: var(--cream);
  flex-shrink: 0;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  color: var(--ink);
  font-weight: 500;
}
.ai-messages {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0.55rem 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 0;
}
.ai-bubble {
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  font-size: 0.92rem;
  white-space: pre-wrap;
  line-height: 1.55;
}
.ai-bubble.user {
  background: var(--navy-800);
  color: var(--cream);
  align-self: flex-end;
  max-width: 92%;
}
.ai-bubble.bot {
  background: var(--cream);
  border: 1px solid var(--cream-muted);
  color: var(--ink);
  align-self: flex-start;
  max-width: 100%;
}
.ai-form {
  padding: 0.5rem 0.7rem 0.65rem;
  border-top: 1px solid var(--cream-muted);
  background: var(--white);
  flex-shrink: 0;
}
.ai-form textarea {
  width: 100%;
  border: 1px solid var(--cream-muted);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  font: inherit;
  resize: none;
  background: var(--cream);
}
.ai-contact {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 0.65rem;
}
.ai-contact-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.ai-contact-row label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--navy-700, #0a1628);
}
.ai-contact-row input {
  width: 100%;
  border: 1px solid var(--cream-muted);
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  font: inherit;
  background: var(--cream);
}
.ai-contact-row input:invalid:not(:placeholder-shown),
.ai-contact-row input.is-missing {
  border-color: #b42318;
}
.ai-form.is-locked #aiInput,
.ai-form.is-locked .ai-actions {
  opacity: 0.55;
}
.ai-actions {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.55rem;
}
.ai-mic.is-listening {
  border-color: #b42318;
  color: #b42318;
}
.ai-status {
  margin: 0;
  padding: 0 1rem 0.75rem;
  font-size: 0.8rem;
}

/* ——— App nav emphasis ——— */
.nav a.nav-app {
  color: var(--gold-400);
  font-weight: 700;
}
.nav a.nav-app:hover,
.nav a.nav-app:focus-visible {
  color: var(--gold-500);
}
.nav-app-link {
  color: var(--gold-400) !important;
  border-color: rgba(212, 175, 55, 0.7) !important;
  font-weight: 700;
}

/* ——— Lawyer App inbox ——— */
.app-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}
.app-toolbar-actions select {
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--cream-muted);
  border-radius: 8px;
  font: inherit;
  background: var(--cream);
  color: var(--ink);
}
.app-inbox {
  display: grid;
  gap: 1.25rem;
}
.app-inquiry.is-pending {
  border-color: rgba(201, 162, 39, 0.55);
  box-shadow: 0 0 0 1px rgba(201, 162, 39, 0.2), var(--shadow);
}
.app-inquiry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.app-status-badge {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--cream);
  color: var(--navy-800);
  border: 1px solid var(--cream-muted);
}
.app-status-badge.status-pending {
  background: rgba(201, 162, 39, 0.18);
  color: var(--navy-900);
  border-color: rgba(201, 162, 39, 0.55);
}
.app-status-badge.status-replied {
  background: #ecfdf3;
  color: #067647;
  border-color: #abefc6;
}
.app-q-label,
.app-drafts-title {
  margin: 0.5rem 0 0.35rem;
  font-size: 1rem;
  color: var(--navy-900);
}
.app-question {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  background: var(--cream);
  border-radius: 10px;
  border: 1px solid var(--cream-muted);
  white-space: pre-wrap;
  line-height: 1.6;
}
.app-draft {
  margin-bottom: 0.85rem;
  border: 1px solid var(--cream-muted);
  border-radius: 10px;
  overflow: hidden;
  background: var(--white);
}
.app-draft-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.85rem;
  background: var(--navy-900);
  color: var(--gold-400);
}
.app-draft-body {
  margin: 0;
  padding: 0.85rem 1rem;
  white-space: pre-wrap;
  font: inherit;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--cream);
  max-height: 220px;
  overflow: auto;
}
.app-custom {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--cream-muted);
}
.app-custom label {
  display: block;
  margin-bottom: 0.75rem;
  font-weight: 600;
  color: var(--navy-800);
}
.app-custom label span {
  display: block;
  margin-bottom: 0.35rem;
}
.app-custom textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--cream-muted);
  border-radius: 8px;
  font: inherit;
  background: var(--cream);
  resize: vertical;
  min-height: 100px;
}
.app-chosen {
  margin-top: 0.75rem;
  padding: 0.75rem;
  border-radius: 10px;
  border: 1px solid #abefc6;
  background: #f6fef9;
}
.app-chosen h3 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  color: #067647;
}
.app-card-msg {
  margin: 0.75rem 0 0;
}
.ai-actions .btn {
  flex: 0 1 auto;
}
.ai-actions {
  flex-wrap: wrap;
}


/* ——— Sources (admin / app) ——— */
.sources-subhead {
  margin: 1.25rem 0 0.65rem;
  font-size: 1.05rem;
  color: var(--navy-900);
}
.sources-list {
  display: grid;
  gap: 0.5rem;
}
.source-chip-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.source-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--cream-muted);
  background: var(--cream);
  color: var(--navy-800);
  font-size: 0.82rem;
  text-decoration: none;
  line-height: 1.3;
  word-break: break-word;
}
a.source-chip:hover {
  border-color: var(--gold-400);
  color: var(--navy-950);
}
.source-chip.is-banned {
  background: #fef3f2;
  border-color: #fecdca;
  color: #b42318;
}
.app-sources {
  margin: 0.45rem 0 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.app-sources-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--navy-800);
  margin: 0;
}


/* ——— Inline PDF viewer ——— */
.pdf-modal[hidden] { display: none !important; }
.pdf-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.pdf-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 14, 26, 0.65);
}
.pdf-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(960px, 100%);
  height: min(88vh, 900px);
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--cream-muted);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.pdf-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.85rem;
  background: var(--navy-900);
  color: var(--cream);
  flex-shrink: 0;
}
.pdf-modal-head h2 {
  margin: 0;
  font-size: 0.95rem;
  color: var(--gold-400);
}
.pdf-modal-frame {
  flex: 1;
  width: 100%;
  border: 0;
  background: #f5f5f5;
  min-height: 0;
}
.btn-view-pdf {
  white-space: nowrap;
}

/* ——— New laws card ——— */
.new-laws-card {
  border-color: rgba(212, 175, 55, 0.55);
  box-shadow: 0 8px 28px rgba(10, 22, 40, 0.08);
}
.new-laws-card h2 {
  color: var(--navy-900);
  font-size: 1.2rem;
}
.new-law-item.is-unseen {
  border-color: rgba(212, 175, 55, 0.65);
  background: linear-gradient(180deg, #fffdf6, var(--cream));
}
.ai-sources-bubble .source-chip-row {
  margin-top: 0.35rem;
}



/* ——— Admin legal research card ——— */
.research-card {
  border-color: rgba(26, 86, 148, 0.45);
  box-shadow: 0 10px 32px rgba(10, 22, 40, 0.1);
  background: linear-gradient(180deg, #f7fbff 0%, var(--cream, #f7f3ea) 100%);
}
.research-card h2 {
  margin: 0 0 0.35rem;
  color: var(--navy-900, #0a1628);
  font-size: 1.25rem;
}
.research-ask-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.75rem;
}
.research-q-wrap {
  display: block;
  width: 100%;
}
.research-q-wrap textarea {
  width: 100%;
  min-height: 5.5rem;
  resize: vertical;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  border: 1px solid rgba(10, 22, 40, 0.18);
  font: inherit;
  background: #fff;
  box-sizing: border-box;
}
.research-ask-form > .btn {
  align-self: flex-start;
  min-width: 8rem;
}
.research-answer-wrap {
  margin-top: 1rem;
}
.research-answer {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(10, 22, 40, 0.12);
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.55;
  max-height: 28rem;
  overflow: auto;
}
.research-refs {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.35rem;
}
.research-ref-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: #fff;
  border: 1px solid rgba(10, 22, 40, 0.1);
}
.research-ref-meta {
  flex: 1 1 12rem;
  min-width: 0;
}
.research-ref-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.research-confirm-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.85rem;
}


/* ——— Admin link hub ——— */
.admin-hub h1 {
  margin: 0 0 0.35rem;
  font-size: 1.45rem;
}
.hub-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  margin-top: 1.1rem;
}
@media (min-width: 640px) {
  .hub-grid {
    grid-template-columns: 1fr 1fr;
  }
}
.admin-hub[hidden],
.admin-section[hidden] {
  display: none !important;
}
.hub-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 1.45rem 1.35rem;
  min-height: 8.5rem;
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1.5px solid rgba(10, 22, 40, 0.14);
  box-shadow: 0 8px 22px rgba(10, 22, 40, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.hub-card:hover {
  transform: translateY(-3px);
  border-color: rgba(212, 175, 55, 0.75);
  box-shadow: 0 14px 32px rgba(10, 22, 40, 0.12);
}
.hub-icon {
  font-size: 2rem;
  line-height: 1;
}
.hub-card-title {
  font-weight: 800;
  font-size: 1.28rem;
  color: var(--navy-900, #0a1628);
}
.hub-card-desc {
  font-size: 1.05rem;
  color: #334155;
  line-height: 1.5;
  font-weight: 500;
}
.btn-back-hub {
  font-weight: 700 !important;
  min-height: 2.6rem;
  padding-inline: 1rem !important;
}
.hub-card-research {
  border-color: rgba(26, 86, 148, 0.35);
  background: linear-gradient(180deg, #f7fbff, #fff);
}
.hub-card-newlaws {
  border-color: rgba(212, 175, 55, 0.45);
  background: linear-gradient(180deg, #fffdf6, #fff);
}
.admin-section .section-toolbar {
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
}
.admin-section .section-toolbar h1,
.admin-section .section-toolbar h2 {
  flex: 1 1 auto;
  min-width: 8rem;
}

/* ——— Ask the lawyer — showy CTA ——— */
.ai-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: stretch;
}
.ai-send-lawyer {
  flex: 1 1 100%;
  order: -1;
  position: relative;
  overflow: hidden;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.95rem 1.25rem !important;
  min-height: 3.1rem;
  border: none !important;
  border-radius: 999px !important;
  cursor: pointer;
  font: inherit;
  font-size: 1.08rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em;
  color: #0a1628 !important;
  background: linear-gradient(135deg, #f0d78c 0%, #d4af37 45%, #b8962e 100%) !important;
  box-shadow: 0 8px 22px rgba(184, 150, 46, 0.45), inset 0 1px 0 rgba(255,255,255,0.35);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.ai-send-lawyer::after {
  content: "";
  position: absolute;
  top: 0;
  left: -40%;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.45), transparent);
  transform: skewX(-20deg);
  animation: ai-lawyer-shine 3.2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes ai-lawyer-shine {
  0%, 55% { left: -40%; }
  85%, 100% { left: 120%; }
}
.ai-send-lawyer:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(184, 150, 46, 0.55), inset 0 1px 0 rgba(255,255,255,0.4);
}
.ai-send-lawyer:active {
  transform: translateY(0);
}
.ai-send-lawyer .ai-lawyer-icon {
  font-size: 1.25rem;
  line-height: 1;
}
.ai-panel {
  border: 1px solid rgba(212, 175, 55, 0.35);
  box-shadow: var(--shadow), 0 0 0 1px rgba(212, 175, 55, 0.12);
}
.ai-panel-head {
  background: linear-gradient(135deg, #0a1628, #132a4a);
  color: #f7f4ef;
  border-bottom: 1px solid rgba(212, 175, 55, 0.4);
}
.ai-panel-head h2 {
  color: #f0d78c;
}
.ai-close {
  color: #f0d78c !important;
}

.admin-mini-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 1rem;
  padding: 0.65rem;
  background: #fff;
  border: 1px solid rgba(10,22,40,.1);
  border-radius: 12px;
  position: sticky;
  top: 0.5rem;
  z-index: 20;
}
.admin-mini-nav a, .admin-mini-nav button {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(10,22,40,.12);
  background: #f7f4ef;
  color: #0a1628;
  text-decoration: none;
  cursor: pointer;
}
.admin-mini-nav a.is-active, .admin-mini-nav button.is-active {
  background: linear-gradient(135deg, #f0d78c, #d4af37);
  border-color: transparent;
}


.hub-card-analyze {
  border-color: rgba(180, 140, 40, 0.45);
  background: linear-gradient(145deg, rgba(255, 236, 179, 0.35), rgba(255,255,255,0.9));
}
.analyze-kind-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
  margin-top: 0.5rem;
}
.analyze-kind-label {
  font-weight: 600;
}
.analyze-kind-opt {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  cursor: pointer;
}
.analyze-upload-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}


.analyze-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 1rem;
}
.analyze-email-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.75rem;
}
.analyze-email-row input[type="email"],
.analyze-email-row input[type="text"] {
  flex: 1 1 160px;
  min-width: 140px;
  padding: 0.45rem 0.6rem;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 8px;
}
.analyze-print-heading {
  display: none;
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
}
@media print {
  body * { visibility: hidden !important; }
  #analyzeResultWrap, #analyzeResultWrap * { visibility: visible !important; }
  #analyzeResultWrap {
    position: absolute;
    left: 0; top: 0; width: 100%;
    padding: 0;
  }
  .no-print, .admin-mini-nav, .section-toolbar, .analyze-upload-row, .analyze-kind-row { display: none !important; }
  .analyze-print-heading { display: block !important; }
}

.research-confidence { font-weight: 600; margin: 0.5rem 0; }
.research-confidence.conf-high { color: #1b7a3d; }
.research-confidence.conf-medium { color: #9a6b00; }
.research-confidence.conf-low { color: #a33; }


/* Document analysis multi-file list */
.analyze-file-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.analyze-file-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0.65rem;
  background: var(--white);
  border: 1px solid var(--cream-muted);
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
}
.analyze-file-list .analyze-file-rm {
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: #b91c1c;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.9rem;
}
.analyze-upload-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
