/* Results.css — Skyline AI Results page */

:root {
  --bg-main: #05070a;
  --bg-card: #03192c;
  --bg-deep: #00152a;
  --blue-accent: #078bdf;
  --cyan: #08c8f5;
  --cyan-bright: #00dfff;
  --cyan-soft: #4cc9f0;
  --green: #00eac0;
  --lavender: #a9b9f5;
  --white: #f5f7ff;

  /* Toggle accent — deliberately distinct from cyan labels/links */
  --toggle: #FBBF24;
  --toggle-hover: #FCD34D;

  --border-blue: rgba(7, 143, 239, 0.55);
  --border-muted: rgba(145, 174, 245, 0.28);

  --nav-h: 88px;
  --content-max: 864px;
  --radius: 15px;
  --radius-sm: 12px;
  --radius-lg: 20px;
}

*, *::before, *::after {
  box-sizing: border-box;
  max-width: 100%;
}

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-main);
  color: var(--white);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
  overflow-x: hidden;
  width: 100%;
  position: relative;
}

body {
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 32px);
}

.thinking-card[hidden],
.results-list[hidden],
.failed-card[hidden],
#loadMoreContainer[hidden] {
  display: none !important;
}

/* ============================================================
   BACKGROUND
   ============================================================ */

.bg-sphere-top-right {
  position: fixed;
  top: -20%; right: -15%;
  width: 60vw; height: 60vw;
  max-width: 800px; max-height: 800px;
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(0, 110, 255, 0.15) 0%, transparent 60%);
  box-shadow: inset -20px -20px 100px rgba(0, 229, 255, 0.1);
  pointer-events: none; z-index: -1;
}

.bg-sphere-bottom-left {
  position: fixed;
  bottom: -20%; left: -15%;
  width: 50vw; height: 50vw;
  max-width: 700px; max-height: 700px;
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(0, 57, 199, 0.12) 0%, transparent 60%);
  box-shadow: inset 20px 20px 80px rgba(0, 229, 255, 0.08);
  pointer-events: none; z-index: -1;
}

.bg-grid {
  position: fixed; bottom: 0; left: 0;
  width: 100%; height: 50vh;
  background-image:
    linear-gradient(rgba(108, 166, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(108, 166, 255, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
  transform: perspective(500px) rotateX(60deg) translateY(100px) scale(2);
  pointer-events: none; z-index: -1;
  -webkit-mask-image: linear-gradient(to top, black 0%, transparent 80%);
  mask-image: linear-gradient(to top, black 0%, transparent 80%);
}

/* ============================================================
   SHELL
   ============================================================ */

.shell {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* ============================================================
   HEADER
   ============================================================ */

.site-header { padding: 30px 0 8px; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
}

.brand-logo { display: inline-flex; }

.skyline-s-logo {
  width: 66px; height: 62px;
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-name {
  font-size: clamp(22px, 4vw, 30px);
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--white);
}

.brand-sub {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 5px;
  color: var(--lavender);
  text-transform: uppercase;
}

/* ============================================================
   THINKING CARD
   ============================================================ */

.thinking-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-blue);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-bottom: 26px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
  position: relative;
  overflow: hidden;
}

.thinking-card::before {
  content: '';
  position: absolute;
  top: -50%; right: -20%;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 223, 255, 0.1), transparent 70%);
  pointer-events: none;
}

.thinking-stages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.thinking-stage {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 15px;
  font-weight: 500;
  color: var(--lavender);
  transition: color 0.25s ease;
}

.stage-icon {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(169, 185, 245, 0.4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.25s ease;
  position: relative;
}

.thinking-stage.is-pending .stage-icon {
  border-color: rgba(169, 185, 245, 0.3);
}

.thinking-stage.is-active { color: var(--cyan); }
.thinking-stage.is-active .stage-icon {
  border-color: var(--cyan);
  background: radial-gradient(circle, rgba(0, 223, 255, 0.35), transparent 70%);
  box-shadow: 0 0 0 0 rgba(0, 223, 255, 0.5);
  animation: stagePulse 1.4s infinite;
}
.thinking-stage.is-active .stage-icon::after {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--cyan);
}

.thinking-stage.is-complete { color: var(--white); }
.thinking-stage.is-complete .stage-icon {
  border-color: var(--green);
  background: var(--green);
}
.thinking-stage.is-complete .stage-icon::after {
  content: '';
  width: 5px; height: 9px;
  border: solid #001a15;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}

@keyframes stagePulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 223, 255, 0.45); }
  70% { box-shadow: 0 0 0 8px rgba(0, 223, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 223, 255, 0); }
}

.thinking-still {
  margin-top: 14px;
  font-size: 13px;
  color: var(--cyan-bright);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
  animation: stillPulse 1.6s ease-in-out infinite;
}

@keyframes stillPulse {
  0%, 100% { opacity: 0.6; }
  50%      { opacity: 1; }
}

/* ============================================================
   FAILED STATE
   ============================================================ */

.failed-card {
  border: 1.5px solid rgba(255, 107, 107, 0.5);
  border-radius: 14px;
  padding: 26px;
  background: rgba(3, 25, 44, 0.7);
  margin-bottom: 26px;
}
.failed-icon {
  display: inline-flex;
  width: 42px; height: 42px;
  align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(255, 107, 107, 0.12);
  color: #ff8f8f;
  margin-bottom: 10px;
}
.failed-title { margin: 0 0 6px; font-size: 18px; font-weight: 700; }
.failed-text { margin: 0 0 16px; color: var(--lavender); font-size: 14px; }
.failed-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-primary, .btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
}
.btn-primary {
  background: var(--cyan-bright);
  color: #001c27;
  border: 1px solid var(--cyan-bright);
}
.btn-primary:hover { background: var(--cyan); }
.btn-ghost {
  background: transparent;
  border: 1px solid rgba(169, 185, 245, 0.45);
  color: var(--lavender);
}
.btn-ghost:hover { color: var(--cyan); border-color: var(--cyan); }

/* ============================================================
   COMPANY CARD
   ============================================================ */

.results-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 26px;
}

.company {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-blue);
  border-radius: 14px;
  overflow: hidden;
}

.company-main {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 14px;
  padding: 16px;
}

.company-logo {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: rgba(8, 200, 245, 0.1);
  border: 1px solid var(--border-blue);
  color: var(--cyan);
  font-weight: 800;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.company-body { min-width: 0; }

.company-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}
.company-head .company-name { flex: 1; min-width: 0; }

.company-name {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--white);
}

.save-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: transparent;
  border: 1px solid rgba(169, 185, 245, 0.55);
  border-radius: 999px;
  color: #dfe6ff;
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}
.save-btn svg {
  width: 14px; height: 14px;
  flex-shrink: 0;
}
.save-btn:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(0, 223, 255, 0.06);
}
.save-btn.is-saved {
  border-color: var(--cyan-bright);
  color: var(--cyan-bright);
  background: rgba(0, 223, 255, 0.12);
  box-shadow: 0 0 14px rgba(0, 223, 255, 0.35);
}

.company-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.meta {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-muted);
  color: var(--lavender);
}

/* ─── Information / Summary blocks (card-level) ─── */

.company-block {
  margin: 10px 0 4px;
}

.company-block-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cyan);
  opacity: 0.85;
  margin-bottom: 4px;
}

.company-info,
.company-summary {
  margin: 0;
  color: var(--lavender);
  font-size: 13.5px;
  line-height: 1.55;
  word-break: break-word;
}

.company-block .company-info {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.company-block.is-expanded .company-info {
  -webkit-line-clamp: unset;
  display: block;
  overflow: visible;
}
.company-block .company-info.is-unclamped {
  -webkit-line-clamp: unset;
  display: block;
  overflow: visible;
}

.company-summary {
  color: #c9d6f5;
  font-style: italic;
  opacity: 0.92;
}

.company-size {
  display: inline-block;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0, 234, 192, 0.1);
  color: var(--green);
  margin-top: 8px;
}
.company-size.is-predicted {
  color: #ffcf70;
  background: rgba(255, 207, 112, 0.10);
  border: 1px solid rgba(255, 207, 112, 0.35);
}

.company-action-bar {
  display: flex;
  align-items: stretch;
  border-top: 1px solid rgba(8, 200, 245, 0.2);
  border-bottom: 2px solid #00DFFF;
  background: #030914;
  width: 100%;
}
.action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: transparent;
  border: none;
  padding: 14px 10px;
  color: #00DFFF;
  font-size: 13.5px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  min-width: 0;
}
.action-btn:hover { background: rgba(8, 200, 245, 0.08); color: #ffffff; }
.action-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.action-divider {
  width: 1px;
  background: rgba(0, 223, 255, 0.35);
  margin: 12px 0;
  flex-shrink: 0;
}

/* ============================================================
   SECTION DIVIDER
   ============================================================ */

.section-divider {
  border: 0;
  border-top: 1px solid rgba(7, 143, 239, 0.4);
  margin: 30px 0 26px;
}

/* ============================================================
   RECENT LEADS
   ============================================================ */

.recent-head { margin-bottom: 14px; }
.recent-title {
  margin: 0 0 4px;
  font-size: clamp(22px, 3.8vw, 28px);
  font-weight: 800;
}
.recent-sub { margin: 0; color: var(--lavender); font-size: 14px; }

.recent-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 30px;
}

.recent-empty {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
  border: 1px dashed rgba(145, 174, 245, 0.35);
  border-radius: 14px;
  color: var(--lavender);
  font-size: 13.5px;
}

/* ============================================================
   SKELETON
   ============================================================ */

.recent-skeleton {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.skeleton-row {
  display: grid;
  grid-template-columns: 68px 1fr 120px;
  gap: 16px;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-blue);
  border-radius: 13px;
  padding: 16px;
  opacity: 0.85;
  animation: sk-pulse 1.4s ease-in-out infinite;
}
.sk-icon {
  width: 68px; height: 68px;
  border-radius: 14px;
  background: rgba(0, 223, 255, 0.06);
  border: 1px solid var(--border-blue);
}
.sk-body { display: flex; flex-direction: column; gap: 10px; }
.sk-line { height: 12px; border-radius: 6px; background: rgba(169, 185, 245, 0.12); }
.sk-line-lg { width: 55%; }
.sk-line-sm { width: 35%; }
.sk-button { height: 40px; border-radius: 10px; background: rgba(169, 185, 245, 0.1); }

@keyframes sk-pulse {
  0%, 100% { opacity: 0.85; }
  50%      { opacity: 0.45; }
}

/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 10px 0 30px;
  font-size: 14px;
  color: var(--lavender);
}
.site-footer a { color: var(--lavender); text-decoration: none; }
.site-footer a:hover { color: var(--cyan); }
.site-footer .dot {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--lavender);
  opacity: 0.6;
}

/* ============================================================
   BOTTOM NAV
   ============================================================ */

.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(2, 17, 36, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid rgba(8, 200, 245, 0.45);
  box-shadow: 0 -10px 40px rgba(8, 200, 245, 0.1);
  z-index: 100;
  border-radius: 20px 20px 0 0;
}
@media (min-width: 900px) {
  .bottom-nav {
    left: 50%; right: auto;
    transform: translateX(-50%);
    width: min(620px, 88%);
    border: 1px solid rgba(8, 200, 245, 0.45);
    border-bottom: 0;
  }
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 0 12px;
  color: var(--lavender);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  position: relative;
}
.nav-item svg {
  width: 24px; height: 24px;
  color: var(--lavender);
  transition: color 0.18s ease;
}
.nav-item:hover svg,
.nav-item:hover { color: var(--cyan); }
.nav-item.active { color: var(--cyan); }
.nav-item.active svg {
  color: var(--cyan);
  filter: drop-shadow(0 0 8px rgba(8, 200, 245, 0.55));
}
.nav-item .active-bar {
  position: absolute;
  bottom: 4px; left: 50%;
  transform: translateX(-50%);
  width: 44px; height: 3px;
  border-radius: 999px;
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(8, 200, 245, 0.7);
}

/* ============================================================
   PAGINATION
   ============================================================ */

.pagination-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
  margin-bottom: 30px;
  padding: 20px 16px;
  background: rgba(7, 25, 44, 0.6);
  border: 1px solid rgba(8, 200, 245, 0.15);
  border-radius: 14px;
}
.pagination-counter {
  font-size: 13.5px;
  color: var(--lavender);
  font-weight: 500;
  text-align: center;
}
.pagination-counter strong {
  color: var(--cyan);
  font-weight: 800;
  font-size: 14px;
  margin: 0 2px;
}
.load-more-bar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 24px;
  background: transparent;
  border: 1px solid var(--cyan);
  border-radius: 10px;
  color: var(--cyan);
  font-size: 13.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}
.load-more-bar:hover:not(:disabled) {
  background: rgba(8, 200, 245, 0.08);
  box-shadow: 0 0 20px rgba(8, 200, 245, 0.25);
}
.load-more-bar:disabled { opacity: 0.6; cursor: not-allowed; }

/* ============================================================
   AVATAR GRADIENTS
   ============================================================ */

.company-modal-avatar[class*='avatar-g'],
.company-logo[class*='avatar-g'] {
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  font-weight: 800;
}
.avatar-g1  { background: linear-gradient(135deg, #7c5cff 0%, #4ea8ff 100%); }
.avatar-g2  { background: linear-gradient(135deg, #ff7ad9 0%, #ff5c5c 100%); }
.avatar-g3  { background: linear-gradient(135deg, #2ad4b0 0%, #7be495 100%); }
.avatar-g4  { background: linear-gradient(135deg, #ffc15e 0%, #ff8a3d 100%); }
.avatar-g5  { background: linear-gradient(135deg, #5b6bff 0%, #3de0f0 100%); }
.avatar-g6  { background: linear-gradient(135deg, #ff6b9e 0%, #ff9472 100%); }
.avatar-g7  { background: linear-gradient(135deg, #1fb88d 0%, #a0e44a 100%); }
.avatar-g8  { background: linear-gradient(135deg, #9a5cff 0%, #ff5cd0 100%); }
.avatar-g9  { background: linear-gradient(135deg, #3b82f6 0%, #7dd3fc 100%); }
.avatar-g10 { background: linear-gradient(135deg, #ffb37a 0%, #ff6f91 100%); }
.avatar-g11 { background: linear-gradient(135deg, #5eead4 0%, #3bc9f0 100%); }
.avatar-g12 { background: linear-gradient(135deg, #ef4444 0%, #f472b6 100%); }
.avatar-g13 { background: linear-gradient(135deg, #a3b54e 0%, #34d399 100%); }
.avatar-g14 { background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%); }
.avatar-g15 { background: linear-gradient(135deg, #facc15 0%, #f59e0b 100%); }
.avatar-g16 { background: linear-gradient(135deg, #e879f9 0%, #a855f7 100%); }
.avatar-g17 { background: linear-gradient(135deg, #64748b 0%, #94a3b8 100%); }
.avatar-g18 { background: linear-gradient(135deg, #06d6a0 0%, #118ab2 100%); }
.avatar-g19 { background: linear-gradient(135deg, #fb923c 0%, #ef4444 100%); }
.avatar-g20 { background: linear-gradient(135deg, #38bdf8 0%, #a78bfa 100%); }
.avatar-g21 { background: linear-gradient(135deg, #bef264 0%, #22d3ee 100%); }
.avatar-g22 { background: linear-gradient(135deg, #fb7185 0%, #fbbf24 100%); }
.avatar-g23 { background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%); }
.avatar-g24 { background: linear-gradient(135deg, #ff7e5f 0%, #feb47b 100%); }
.avatar-g25 { background: linear-gradient(135deg, #8b5cf6 0%, #38bdf8 100%); }
.avatar-g26 { background: linear-gradient(135deg, #14b8a6 0%, #84cc16 100%); }
.avatar-g27 { background: linear-gradient(135deg, #ff6fb5 0%, #ffb199 100%); }
.avatar-g28 { background: linear-gradient(135deg, #22d3ee 0%, #2563eb 100%); }
.avatar-g29 { background: linear-gradient(135deg, #10b981 0%, #fcd34d 100%); }
.avatar-g30 { background: linear-gradient(135deg, #d946ef 0%, #6366f1 100%); }
.avatar-g31 { background: linear-gradient(135deg, #2dd4bf 0%, #059669 100%); }
.avatar-g32 { background: linear-gradient(135deg, #f97316 0%, #ec4899 100%); }
.avatar-g33 { background: linear-gradient(135deg, #6366f1 0%, #14b8a6 100%); }
.avatar-g34 { background: linear-gradient(135deg, #fbbf24 0%, #84cc16 100%); }
.avatar-g35 { background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%); }
.avatar-g36 { background: linear-gradient(135deg, #ef4444 0%, #a855f7 100%); }
.avatar-g37 { background: linear-gradient(135deg, #34d399 0%, #22d3ee 100%); }
.avatar-g38 { background: linear-gradient(135deg, #f472b6 0%, #6366f1 100%); }
.avatar-g39 { background: linear-gradient(135deg, #f59e0b 0%, #ff6f61 100%); }
.avatar-g40 { background: linear-gradient(135deg, #7dd3fc 0%, #6ee7b7 100%); }
.avatar-g41 { background: linear-gradient(135deg, #a21caf 0%, #ec4899 100%); }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 640px) {
  .shell { padding: 0 16px; }
  .site-header { padding: 22px 0 6px; }
  .skyline-s-logo { width: 48px; height: 46px; }
  .brand-name { font-size: 20px; }
  .brand-sub { font-size: 10px; letter-spacing: 4px; }
  .thinking-card { padding: 18px 18px; }
  .thinking-stage { font-size: 14px; gap: 12px; }
  .failed-actions { flex-direction: column; }
  .btn-primary, .btn-ghost { width: 100%; }
  .skeleton-row { grid-template-columns: 48px 1fr; }
  .sk-icon { width: 48px; height: 48px; border-radius: 12px; }
  .sk-button { grid-column: 1 / -1; height: 36px; }
  .load-more-bar { width: 100%; font-size: 13px; }
}

@media (max-width: 480px) {
  .company-main {
    padding: 12px;
    gap: 10px;
    grid-template-columns: 42px 1fr;
  }
  .company-logo { width: 42px; height: 42px; font-size: 13px; }
  .company-name { font-size: 15px; }
  .save-btn {
    padding: 5px 10px;
    font-size: 11.5px;
    gap: 4px;
  }
  .save-btn svg { width: 12px; height: 12px; }
  .action-btn {
    font-size: 12.5px;
    gap: 8px;
    padding: 12px 8px;
  }
  .action-btn svg { width: 16px; height: 16px; }
}

@media (max-width: 400px) {
  .brand-sub { letter-spacing: 3px; }
  .nav-item { font-size: 11px; }
  .nav-item svg { width: 22px; height: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   FRESH PLACEHOLDER
   ============================================================ */

.fresh-placeholder {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 28px 26px;
  border: 1.5px dashed rgba(7, 143, 239, 0.55);
  border-radius: 14px;
  background: rgba(3, 25, 44, 0.55);
  margin-bottom: 26px;
}
.ph-icon {
  color: var(--lavender);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ph-text { color: var(--lavender); font-size: 15px; }
.ph-title { font-weight: 600; color: #c9d6f5; }
.ph-sub { margin-top: 2px; }

/* ============================================================
   MODAL
   ============================================================ */

.company-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(2, 8, 20, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: modal-fade-in 0.2s ease;
}
@keyframes modal-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.company-modal-card {
  background: linear-gradient(180deg, #04182b, #02101f);
  border: 1px solid var(--border-blue);
  border-radius: 20px;
  width: min(560px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  padding: 26px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  position: relative;
  animation: modal-slide-up 0.25s ease;
}
@keyframes modal-slide-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}
.company-modal-close {
  position: absolute;
  top: 14px; right: 16px;
  background: transparent;
  border: 0;
  color: var(--lavender);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
}
.company-modal-close:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.06);
}
.company-modal-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
  padding-right: 30px;
}
.company-modal-avatar {
  width: 64px; height: 64px;
  border-radius: 16px;
  background: rgba(8, 200, 245, 0.12);
  border: 1px solid var(--border-blue);
  color: var(--cyan);
  font-weight: 800;
  font-size: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.company-modal-headtext { min-width: 0; }
.company-modal-headtext h2 {
  font-size: clamp(19px, 3.4vw, 23px);
  font-weight: 800;
  margin: 0;
  word-break: break-word;
}

.company-modal-sub {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--lavender);
  opacity: 0.85;
  word-break: break-all;
  line-height: 1.4;
}

.company-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.company-modal-section { margin-bottom: 18px; }
.company-modal-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--lavender);
  margin-bottom: 8px;
}
.company-modal-desc {
  font-size: 14px;
  line-height: 1.6;
  color: var(--white);
  margin: 0;
  word-break: break-word;
}
.company-modal-value {
  font-size: 14px;
  color: var(--white);
  word-break: break-word;
}
.company-modal-value a {
  color: var(--cyan);
  text-decoration: none;
}
.company-modal-value a:hover { text-decoration: underline; }
@media (max-width: 640px) {
  .company-modal-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   MODAL — Information / Summary blocks
   ============================================================ */

.modal-block {
  margin-bottom: 20px;
}

.modal-block-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cyan);
  opacity: 0.85;
  margin-bottom: 8px;
}

.modal-info,
.modal-summary {
  margin: 0;
  color: var(--white);
  font-size: 14px;
  line-height: 1.6;
  word-break: break-word;
}

.modal-block .modal-info {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.modal-block.is-expanded .modal-info {
  -webkit-line-clamp: unset;
  display: block;
  overflow: visible;
}

.modal-summary {
  color: #c9d6f5;
  font-style: italic;
  opacity: 0.92;
}

/* ============================================================
   MODAL — ordered rows
   ============================================================ */

.modal-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 16px;
}

.modal-row-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--lavender);
  opacity: 0.85;
}

.modal-row-value {
  font-size: 14px;
  color: var(--white);
  word-break: break-word;
}

.modal-row-value a {
  color: var(--cyan);
  text-decoration: none;
}

.modal-row-value a:hover {
  text-decoration: underline;
}

.modal-muted {
  color: var(--lavender);
  opacity: 0.55;
  font-style: italic;
}

.modal-source-list {
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.modal-source-list li {
  font-size: 13px;
  word-break: break-all;
}

.modal-source-list a {
  color: var(--cyan);
  text-decoration: none;
}

.modal-source-list a:hover {
  text-decoration: underline;
}

.modal-source-refs {
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.modal-source-refs li {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.source-ref-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--lavender);
  opacity: 0.9;
}
.modal-source-refs a {
  font-size: 12.5px;
  color: var(--cyan);
  text-decoration: none;
  word-break: break-all;
}
.modal-source-refs a:hover {
  text-decoration: underline;
}

/* ============================================================
   WHY IT MATCHED — paragraphs + bullet list
   ============================================================ */

.modal-why {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--white);
  word-break: break-word;
}

.modal-why-p {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--white);
}

.modal-why-p:last-of-type {
  margin-bottom: 0;
}

.modal-why-list {
  margin: 8px 0 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  list-style: disc;
}

.modal-why-list li {
  font-size: 14px;
  line-height: 1.55;
  color: var(--white);
}

.modal-why-list li::marker {
  color: var(--cyan);
}

/* ============================================================
   FEEDBACK MODAL (SLIM BOTTOM-SHEET — CLEAR, PERSISTENT)
   ============================================================ */

.feedback-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(5, 7, 10, 0.3);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  pointer-events: none;
}

.feedback-modal-overlay[hidden] {
  display: none !important;
}

.feedback-card {
  background: linear-gradient(180deg, #0b1017 0%, #0d1117 100%);
  border: 1px solid rgba(8, 200, 245, 0.25);
  border-bottom: none;
  border-radius: 16px 16px 0 0;
  width: 100%;
  max-width: 480px;
  padding: 20px 24px calc(20px + env(safe-area-inset-bottom, 0px));
  position: relative;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4);
  pointer-events: auto;
  animation: feedbackSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes feedbackSlideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.feedback-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.feedback-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--white);
  margin: 0;
}

.feedback-cancel-btn {
  background: transparent;
  border: none;
  color: var(--lavender);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
}
.feedback-cancel-btn:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.06);
}

.feedback-stars {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.feedback-stars svg {
  width: 26px;
  height: 26px;
  cursor: pointer;
  color: var(--border-muted);
  transition: color 0.15s ease, transform 0.1s ease;
}
.feedback-stars svg:hover,
.feedback-stars svg.is-active {
  color: var(--toggle);
  transform: scale(1.1);
}

.feedback-input-wrap {
  position: relative;
  margin-bottom: 14px;
}

.input-icon {
  position: absolute;
  top: 10px;
  left: 10px;
  pointer-events: none;
  color: var(--lavender);
  opacity: 0.6;
}

#feedbackComment {
  width: 100%;
  height: 72px;
  background: rgba(2, 8, 20, 0.6);
  border: 1px solid rgba(145, 174, 245, 0.28);
  border-radius: 10px;
  padding: 10px 12px 10px 34px;
  color: var(--white);
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.5;
  resize: none;
  outline: none;
  transition: border-color 0.15s ease;
}
#feedbackComment:focus {
  border-color: var(--cyan);
}
#feedbackComment::placeholder {
  color: var(--lavender);
  opacity: 0.5;
}

.feedback-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.send-btn {
  background: var(--cyan-bright);
  color: #001c27;
  border: 1px solid var(--cyan-bright);
  border-radius: 8px;
  padding: 0 20px;
  height: 36px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease;
}
.send-btn:hover:not(:disabled) {
  background: var(--cyan);
}
.send-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (max-width: 640px) {
  .feedback-card {
    max-width: 100%;
    border-radius: 16px 16px 0 0;
  }
}

/* ══════════════════════════════════════
   FAILURE BANNER
   ══════════════════════════════════════ */
.failure-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  background: rgba(239, 68, 68, 0.12);
  border-bottom: 1px solid rgba(239, 68, 68, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  flex-wrap: wrap;
}

.failure-banner[hidden] { display: none !important; }

.failure-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.failure-icon {
  color: #f87171;
  flex-shrink: 0;
}

.failure-banner-text {
  min-width: 0;
}

.failure-banner-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}

.failure-banner-message {
  font-size: 12px;
  color: #fca5a5;
  word-break: break-word;
}

.failure-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.failure-home-link {
  padding: 6px 14px;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.6);
  border-radius: 8px;
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s ease;
}

.failure-home-link:hover {
  background: rgba(239, 68, 68, 0.35);
}

.failure-close {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 6px;
  color: #fca5a5;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.failure-close:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #fff;
}

/* NEW badge for fresh arrivals */
.new-badge {
  display: inline-block;
  background: #22c55e;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 8px;
  vertical-align: middle;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ============================================================
   MODAL: TRUNCATION CLAMPS
   ============================================================ */

.modal-summary {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
[data-modal-block-summary].is-expanded .modal-summary {
  -webkit-line-clamp: unset;
  display: block;
  overflow: visible;
}

.modal-why {
  max-height: 6.4em;
  overflow: hidden;
}
[data-modal-block-why].is-expanded .modal-why {
  max-height: none;
  overflow: visible;
}

/* ============================================================
   TOGGLES — AMBER
   ============================================================ */

.see-more-btn,
.modal-block .see-more-btn,
.source-toggle-btn {
  background: transparent;
  border: none;
  color: var(--toggle);
  font-size: 12.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s ease;
}

.see-more-btn,
.modal-block .see-more-btn {
  padding: 6px 0 0;
  display: inline-block;
}

.source-toggle-btn {
  padding: 4px 0 0;
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.see-more-btn:hover,
.modal-block .see-more-btn:hover,
.source-toggle-btn:hover {
  color: var(--toggle-hover);
}

.source-toggle-btn svg {
  width: 14px;
  height: 14px;
}

/* ============================================================
   REPORT INCORRECT INFORMATION
   ============================================================ */

.modal-report {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid rgba(145, 174, 245, 0.18);
}

.modal-report-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  border: none;
  padding: 0;
  color: var(--lavender);
  opacity: 0.75;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease, color 0.15s ease;
}
.modal-report-trigger:hover {
  opacity: 1;
  color: var(--white);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.modal-report-trigger svg { flex-shrink: 0; }
.modal-report-trigger[hidden] { display: none !important; }

.modal-report-form[hidden] { display: none !important; }

.modal-report-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 14px;
}

.modal-report-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--lavender);
  opacity: 0.85;
  margin-bottom: 6px;
}

.modal-report-select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  margin-bottom: 14px;
  background: rgba(2, 8, 20, 0.6);
  border: 1px solid rgba(145, 174, 245, 0.28);
  border-radius: 8px;
  color: var(--white);
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a9b9f5' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 36px;
}
.modal-report-select:focus { border-color: var(--cyan); }
.modal-report-select option {
  background: #04182b;
  color: var(--white);
}

.modal-report-textarea {
  width: 100%;
  min-height: 78px;
  padding: 10px 12px;
  background: rgba(2, 8, 20, 0.6);
  border: 1px solid rgba(145, 174, 245, 0.28);
  border-radius: 8px;
  color: var(--white);
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.5;
  resize: vertical;
  outline: none;
}
.modal-report-textarea:focus { border-color: var(--cyan); }
.modal-report-textarea::placeholder {
  color: var(--lavender);
  opacity: 0.5;
}

.modal-report-error {
  margin-top: 10px;
  font-size: 12.5px;
  color: #fca5a5;
  word-break: break-word;
}
.modal-report-error[hidden] { display: none !important; }

.modal-report-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.modal-report-cancel {
  background: transparent;
  border: none;
  padding: 8px 12px;
  color: var(--lavender);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 8px;
  transition: color 0.15s ease, background 0.15s ease;
}
.modal-report-cancel:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.05);
}

.modal-report-submit {
  background: var(--cyan-bright);
  border: 1px solid var(--cyan-bright);
  border-radius: 8px;
  padding: 9px 18px;
  color: #001c27;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}
.modal-report-submit:hover:not(:disabled) { background: var(--cyan); }
.modal-report-submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.modal-report-done {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  line-height: 1.5;
  color: #00eac0;
}
.modal-report-done[hidden] { display: none !important; }
.modal-report-done svg {
  flex-shrink: 0;
  margin-top: 2px;
  }
/* ════════════════════════════════════════════════════════════
   HEADER USAGE PILL (top right)
   ════════════════════════════════════════════════════════════ */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.site-header .brand { min-width: 0; flex-shrink: 1; }

.usage-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(8, 200, 245, 0.08);
  border: 1px solid rgba(8, 200, 245, 0.35);
  color: var(--cyan);
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.usage-pill:hover {
  background: rgba(8, 200, 245, 0.16);
  border-color: var(--cyan);
}
.usage-pill[hidden] { display: none !important; }
.usage-pill svg { flex-shrink: 0; }
.usage-count { font-variant-numeric: tabular-nums; }
.usage-label { font-weight: 500; opacity: 0.75; }

.usage-pill.is-low {
  background: rgba(251, 191, 36, 0.10);
  border-color: rgba(251, 191, 36, 0.45);
  color: #FBBF24;
}
.usage-pill.is-empty {
  background: rgba(239, 68, 68, 0.10);
  border-color: rgba(239, 68, 68, 0.45);
  color: #f87171;
}

@media (max-width: 480px) {
  .usage-pill { padding: 5px 10px; font-size: 11.5px; gap: 5px; }
  .usage-label { display: none; }
}

/* ════════════════════════════════════════════════════════════
   SEARCH LIMIT BANNER
   ════════════════════════════════════════════════════════════ */

.limit-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  background: rgba(251, 191, 36, 0.12);
  border-bottom: 1px solid rgba(251, 191, 36, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  flex-wrap: wrap;
}
.limit-banner[hidden] { display: none !important; }

.limit-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.limit-icon { color: #FBBF24; flex-shrink: 0; }
.limit-banner-text { min-width: 0; }
.limit-banner-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}
.limit-banner-message {
  font-size: 12px;
  color: #fcd34d;
  word-break: break-word;
}

.limit-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.limit-upgrade-link {
  padding: 7px 16px;
  background: linear-gradient(135deg, #08D28C, #00B982);
  border: 0;
  border-radius: 8px;
  color: #02160f;
  font-size: 12.5px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.15s ease;
}
.limit-upgrade-link:hover { opacity: 0.9; }

.limit-close {
  width: 28px; height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(251, 191, 36, 0.4);
  border-radius: 6px;
  color: #fcd34d;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.limit-close:hover {
  background: rgba(251, 191, 36, 0.2);
  color: #fff;
  }
