/**
 * Consumer · enterprise polish v3.63
 * Static hero art · auto-loop fit modal · multi-file · lag-free.
 * Load last after premium / luxury / claim / desk / worlds.
 */

/* —— System —— */
html {
  -webkit-tap-highlight-color: transparent;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}
body {
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
  overflow-x: clip;
}
::selection {
  background: rgba(184, 149, 106, 0.28);
  color: #0c1222;
}
img, svg, video {
  max-width: 100%;
  height: auto;
}

/* Prefer consistent interactive size */
.btn,
button.btn,
a.btn {
  min-height: 2.75rem;
  padding-inline: 1rem;
  border-radius: 999px;
  font-weight: 650;
  letter-spacing: -0.01em;
  transition: transform .18s var(--ease, cubic-bezier(.22,1,.36,1)),
    box-shadow .18s ease, background .18s ease, border-color .18s ease, opacity .15s ease;
}
.btn-sm {
  min-height: 2.35rem;
  padding-inline: 0.75rem;
  font-size: 0.82rem;
}
.btn-lg {
  min-height: 3rem;
  padding-inline: 1.25rem;
}
.btn:active:not(:disabled) {
  transform: scale(0.985);
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn-primary {
  box-shadow: 0 8px 22px rgba(15, 26, 46, 0.18);
}
.btn-primary:hover:not(:disabled) {
  box-shadow: 0 12px 28px rgba(15, 26, 46, 0.22);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="tel"],
input[type="date"],
textarea,
select,
.modal-input,
.gate-input,
.q-search {
  min-height: 2.75rem;
  border-radius: 12px !important;
  transition: border-color .15s ease, box-shadow .15s ease;
  font-size: 16px; /* iOS: prevent zoom on focus */
}
textarea {
  min-height: 6.5rem;
  line-height: 1.5;
}
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(184, 149, 106, 0.28);
}

.panel,
.panel-lift,
.card,
.gate-card,
.hero-claim,
.evidence-musts,
.verdict,
.section {
  backdrop-filter: saturate(1.05);
}

/* ═══════════════════════════════════════════
   MOBILE SHELL · ≤900px
   ═══════════════════════════════════════════ */
@media (max-width: 900px) {
  .wrap,
  .hero-grid,
  .metrics,
  .m-nav .inner {
    width: min(100% - 1.35rem, 1140px) !important;
  }
  .section {
    padding-top: 2.1rem !important;
    padding-bottom: 2.1rem !important;
  }

  /* Bottom nav — only chrome on phone (sidebar killed in claim.css) */
  .bottom-nav {
    display: grid !important;
    padding: 0.22rem 0.28rem max(0.32rem, env(safe-area-inset-bottom, 0px));
    backdrop-filter: blur(20px) saturate(1.25);
    background: rgba(255, 255, 255, 0.94) !important;
    border-top: 1px solid rgba(15, 26, 46, 0.06);
    box-shadow: 0 -10px 40px rgba(12, 18, 34, 0.07);
  }
  .bn-item {
    min-height: 3rem;
    gap: 0.12rem;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    border-radius: 12px;
  }
  .bn-item svg {
    width: 20px;
    height: 20px;
    opacity: 0.88;
  }
  .bn-item.active {
    background: linear-gradient(
      165deg,
      rgba(26, 39, 68, 0.09),
      rgba(184, 149, 106, 0.12)
    ) !important;
  }

  .cta-block .btn-primary {
    bottom: calc(4.65rem + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* Claim app main — clear bottom nav */
  .main {
    padding: 0.65rem 0.85rem calc(5.75rem + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* Kill drawer chrome completely on phone */
  .sidebar,
  .side-scrim,
  .mobile-toggle,
  #menu-btn {
    display: none !important;
  }
  body.mode-operator::before {
    display: none !important;
  }

  /* Customer app topbar ONLY — never leak light chrome into .desk-body ops */
  body:not(.desk-body) .topbar {
    gap: 0.45rem !important;
    margin: -0.1rem -0.1rem 0.5rem !important;
    padding: 0.4rem 0.15rem 0.5rem !important;
    background: linear-gradient(
      180deg,
      rgba(247, 248, 251, 0.98) 0%,
      rgba(247, 248, 251, 0.9) 70%,
      transparent
    ) !important;
    backdrop-filter: blur(14px) saturate(1.1);
    border-bottom: 1px solid transparent;
    flex-wrap: nowrap !important;
  }
  body:not(.desk-body) .topbar h1 {
    font-size: 1.14rem !important;
    font-weight: 750;
    letter-spacing: -0.035em;
  }
  .page-sub,
  #page-sub {
    font-size: 0.72rem !important;
    color: var(--muted, #5a6472);
  }
  body:not(.desk-body) .topbar-actions {
    width: auto !important;
    display: flex !important;
    grid-template-columns: none !important;
  }
  body:not(.desk-body) .topbar-actions .btn {
    min-height: 2.3rem !important;
    font-weight: 650;
    width: auto !important;
  }

  /* Journey pills — tighter */
  .step-pills,
  .journey-strip {
    gap: 0.35rem !important;
    margin-bottom: 0.85rem !important;
  }
  .step-pill,
  .journey-step {
    font-size: 0.68rem !important;
    padding: 0.38rem 0.65rem !important;
    border-radius: 999px;
  }

  /* Hero claim card */
  .hero-claim {
    padding: 1.05rem 1.05rem 1.1rem !important;
    border-radius: 18px !important;
    margin-bottom: 0.85rem;
  }
  .hero-claim-title {
    font-size: 1.28rem !important;
    letter-spacing: -0.035em;
    line-height: 1.2;
  }
  .hero-claim-lead {
    font-size: 0.88rem !important;
    line-height: 1.45;
    margin-top: 0.35rem;
  }

  /* Evidence musts — denser, sophisticated */
  .evidence-musts {
    padding: 0.95rem 1rem 1rem !important;
    border-radius: 16px !important;
  }
  .evidence-musts-h {
    margin-bottom: 0.35rem !important;
  }
  .evidence-musts-badge {
    font-size: 0.58rem !important;
  }
  .evidence-musts h3,
  .evidence-musts .evidence-musts-title {
    font-size: 0.98rem !important;
    letter-spacing: -0.025em;
  }
  .evidence-musts-list,
  .evidence-musts ul {
    font-size: 0.84rem !important;
    line-height: 1.5 !important;
    gap: 0.25rem;
  }
  .evidence-musts .tip,
  .evidence-musts-tip {
    font-size: 0.76rem !important;
    margin-top: 0.55rem;
  }

  /* Mobile world switch under topbar */
  .mobile-world-switch.world-switch,
  .mobile-world-switch {
    margin: 0 0 0.75rem !important;
    padding: 0.26rem !important;
    border-radius: 14px !important;
    background: rgba(15, 26, 46, 0.04);
    border: 1px solid rgba(15, 26, 46, 0.06);
  }
  .mobile-world-switch .world-sw {
    min-height: 2.5rem !important;
    font-weight: 700 !important;
    font-size: 0.84rem !important;
    border-radius: 11px !important;
  }

  /* Dropzone */
  .dropzone {
    padding: 1.5rem 1rem !important;
    min-height: 8.75rem !important;
    border-radius: 18px !important;
    border-width: 1.5px !important;
  }

  /* Rail sources as clean list */
  .rail-sources {
    grid-template-columns: 1fr !important;
    gap: 0.45rem !important;
  }
  .rail-src {
    flex-direction: row !important;
    justify-content: flex-start !important;
    text-align: left !important;
    padding: 0.75rem 0.95rem !important;
    min-height: 3.15rem;
    border-radius: 14px !important;
  }

  /* Panels */
  .panel {
    border-radius: 18px !important;
  }
  .panel-h h2 {
    font-size: 1.05rem !important;
    letter-spacing: -0.03em;
  }

  /* Modal sheet — iOS style */
  .modal-root {
    align-items: flex-end !important;
    padding: 0 !important;
    background: rgba(8, 12, 20, 0.45) !important;
  }
  .modal-card {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 22px 22px 0 0 !important;
    max-height: min(92dvh, 780px) !important;
    padding: 1.15rem 1.15rem max(1.25rem, env(safe-area-inset-bottom, 0px)) !important;
    box-shadow: 0 -24px 64px rgba(0, 0, 0, 0.22) !important;
  }
  .modal-title {
    font-size: 1.28rem !important;
    letter-spacing: -0.03em;
  }
  .modal-lead {
    font-size: 0.88rem !important;
    line-height: 1.5;
  }
  .channel-btn {
    min-height: 3rem !important;
    border-radius: 14px !important;
  }
  .modal-check {
    font-size: 0.8rem !important;
    padding: 0.75rem 0.85rem !important;
    border-radius: 14px !important;
    line-height: 1.4;
  }
  .modal-cta {
    width: 100%;
    min-height: 3.05rem !important;
    margin-top: 0.65rem;
  }

  /* Side drawer */
  .sidebar {
    width: min(86vw, 300px) !important;
    box-shadow: 24px 0 64px rgba(12, 18, 34, 0.18) !important;
  }

  /* Scrim when menu open */
  .side-scrim.open,
  body.menu-open .side-scrim {
    background: rgba(8, 12, 20, 0.4);
  }
}

/* Mobile enrich + complement + cine stage breathing room */
@media (max-width: 900px) {
  .enrich-card {
    padding: 0.95rem 1rem !important;
    border-radius: 16px !important;
  }
  .enrich-found li,
  .enrich-gaps li {
    font-size: 0.74rem !important;
  }
  .rail-delay-box {
    padding: 1rem !important;
  }
  .rail-comp-cta {
    min-height: 2.85rem !important;
  }
  .facts-soft .fs-line {
    font-size: 1.05rem !important;
    letter-spacing: -0.03em;
  }
  .facts-soft .fs-sub {
    font-size: 0.82rem !important;
    line-height: 1.45;
  }

  /* Hero clean — demo is modal-only now */
  .cine-section.cine-hero-main.arrival-hero {
    padding-bottom: 0.5rem !important;
  }
  .hero-demo-cta {
    margin-top: 0.25rem !important;
    margin-bottom: 0.85rem !important;
  }
  .arrival-hero .wrap {
    padding-bottom: 0.15rem;
  }
}

/* ═══════════════════════════════════════════
   DESKTOP · ≥901px — spacious, pro claim desk
   ═══════════════════════════════════════════ */
@media (min-width: 901px) {
  .claim-stack {
    max-width: 760px;
  }
  .hero-claim {
    padding: 1.55rem 1.65rem 1.5rem !important;
  }
  .hero-claim-title {
    font-size: 1.75rem !important;
  }
  .enrich-card,
  .rail-delay-box,
  .evidence-musts {
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
  }
  .enrich-card:hover,
  .rail-delay-box:hover {
    box-shadow: 0 12px 36px rgba(12, 18, 34, 0.07);
  }
  .rail-comp-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
  .rail-comp-cta {
    width: auto;
    min-width: 12rem;
  }
  .steps-bar {
    gap: 0.5rem;
  }
  .step-pill {
    font-size: 0.82rem;
  }
  .panel-lift {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }
  .panel-lift:hover {
    transform: translateY(-1px);
  }
  .dropzone {
    min-height: 10rem;
  }
  /* Keep main content centered with air */
  .main {
    padding-bottom: 3rem !important;
  }
}

/* ═══════════════════════════════════════════
   SMALL PHONES · ≤420px
   ═══════════════════════════════════════════ */
@media (max-width: 420px) {
  .topbar h1 {
    font-size: 1.12rem !important;
  }
  .hero-claim-title {
    font-size: 1.18rem !important;
  }
  .bn-item {
    font-size: 0.6rem !important;
  }
  .step-pill span {
    display: none;
  }
  .main {
    padding-left: 0.8rem !important;
    padding-right: 0.8rem !important;
  }
  .evidence-musts-list li {
    margin-bottom: 0.2rem;
  }
}

/* ═══════════════════════════════════════════
   LANDING · banners that don't destroy the hero
   ═══════════════════════════════════════════ */
@media (max-width: 720px) {
  /* Cookie = compact bottom sheet */
  .cookie-banner {
    padding: 0.75rem 0.85rem max(0.75rem, env(safe-area-inset-bottom, 0px)) !important;
    z-index: 10040 !important;
  }
  .cookie-title {
    font-size: 0.92rem !important;
    margin-bottom: 0.2rem !important;
  }
  .cookie-copy p {
    font-size: 0.78rem !important;
    line-height: 1.4 !important;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .cookie-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem !important;
    width: 100%;
  }
  .cookie-actions .btn {
    min-height: 2.65rem !important;
    font-size: 0.82rem !important;
    width: 100%;
    justify-content: center;
  }

  /*
   * PWA install — LEFT card, never full-width under chat FAB.
   * Chat FAB owns bottom-right (z 10055). PWA stays clear.
   */
  .pwa-banner {
    left: max(0.55rem, env(safe-area-inset-left, 0px)) !important;
    right: auto !important;
    max-width: min(17.5rem, calc(100vw - 5.25rem)) !important;
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px)) !important;
    z-index: 10025 !important;
    width: auto !important;
  }
  body:has(.cookie-banner:not(.hidden)) .pwa-banner {
    /* cookie owns bottom sheet — hide PWA until cookies done (JS already sequences) */
    bottom: calc(11rem + env(safe-area-inset-bottom, 0px)) !important;
    max-width: min(17.5rem, calc(100vw - 5.25rem)) !important;
  }
  .pwa-inner {
    width: 100%;
    border-radius: 16px !important;
    padding: 0.55rem 0.55rem !important;
    gap: 0.45rem !important;
  }
  .pwa-copy strong {
    font-size: 0.8rem !important;
  }
  .pwa-copy span {
    font-size: 0.68rem !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .pwa-actions {
    flex-direction: column !important;
    gap: 0.25rem !important;
  }
  .pwa-actions .btn {
    min-height: 1.9rem !important;
    padding: 0.28rem 0.5rem !important;
    font-size: 0.7rem !important;
  }

  /* Ask AI dock — fixed BR, above everything except cookie sheet */
  body:has(.cookie-banner:not(.hidden)) .ask-ai-btn.is-docked,
  body:has(.cookie-banner:not(.hidden)) .ask-ai-btn {
    bottom: calc(10.5rem + env(safe-area-inset-bottom, 0px)) !important;
  }
  body:has(.pwa-banner:not(.hidden)) .ask-ai-btn.is-docked,
  body:has(.pwa-banner:not(.hidden)) .ask-ai-btn {
    /* keep FAB clear of left PWA card */
    right: max(0.75rem, env(safe-area-inset-right, 0px)) !important;
  }
  .ask-ai-btn.is-docked,
  .ask-ai-btn {
    bottom: max(1rem, calc(0.85rem + env(safe-area-inset-bottom, 0px))) !important;
    right: max(0.75rem, env(safe-area-inset-right, 0px)) !important;
    left: auto !important;
    width: 3.15rem !important;
    height: 3.15rem !important;
    border-radius: 999px !important;
    z-index: 10055 !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28) !important;
  }
  .ask-ai-btn .ask-ai-lab {
    display: none !important;
  }

  /* Hero density */
  .arrival-hero {
    padding-bottom: 1.25rem !important;
  }
  .speech-h1.cine-hero-h1,
  .arrival-hero .speech-h1 {
    font-size: clamp(1.55rem, 7.2vw, 2.05rem) !important;
    line-height: 1.12 !important;
    letter-spacing: -0.035em !important;
  }
  .hero-micro,
  .arrival-hero .hero-micro {
    font-size: 0.78rem !important;
    line-height: 1.45 !important;
    max-width: 34ch;
  }
  .m-nav .inner {
    gap: 0.45rem !important;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
  }
  .m-nav .btn-primary {
    min-height: 2.45rem !important;
    padding-inline: 0.95rem !important;
    font-size: 0.84rem !important;
  }
  /* Hide secondary nav chrome on tiny widths */
  .m-nav .m-links {
    display: none !important;
  }
}

@media (max-width: 480px) {
  h1,
  .hero-copy h1,
  .topbar h1,
  .modal-title {
    letter-spacing: -0.035em;
  }
  .journey-strip {
    gap: 0.28rem;
  }
  .stat-grid {
    gap: 0.4rem !important;
  }
  .main,
  .detail-col,
  .room-pad {
    overflow-x: clip;
  }
  /* Single primary CTA when cookie open — reduce chrome */
  body:has(.cookie-banner:not(.hidden)) .pwa-banner {
    display: none !important; /* one banner at a time on small phones */
  }
}

/* Landing section polish */
.m-nav {
  padding-top: max(0.35rem, env(safe-area-inset-top, 0px));
}
@media (max-width: 640px) {
  .social-bar {
    grid-template-columns: 1fr 1fr !important;
  }
  .cine-meter-label {
    font-size: 0.72rem;
  }
}

/* Claim polish */
body.mode-customer .sidebar {
  -webkit-overflow-scrolling: touch;
}
.dropzone {
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}
.dropzone:focus-visible {
  outline: 2px solid rgba(184, 149, 106, 0.5);
  outline-offset: 2px;
}
@media (hover: hover) {
  .dropzone:hover {
    border-color: rgba(184, 149, 106, 0.45);
  }
}
@media (max-width: 900px) {
  .side-foot .btn {
    width: 100%;
  }
  .chip {
    font-size: 0.72rem;
  }
}

/* Ops desk — dark solid chrome only (never customer light topbar) */
.desk-body .desk-topbar,
.desk-body .topbar {
  padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
  padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
  padding-top: max(0.55rem, env(safe-area-inset-top, 0px));
  gap: 0.65rem;
  background: #05070c !important;
  background-image: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  margin: 0 !important;
}
.desk-body .top-nav {
  flex-wrap: wrap;
  gap: 0.35rem;
}
.desk-body .nav-pill,
.desk-body .fchip {
  min-height: 2.25rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-weight: 650;
}
.desk-body .q-item {
  text-align: left;
  width: 100%;
  border-radius: 12px;
  transition: background .15s ease, border-color .15s ease;
}
.desk-body .gate-card {
  width: min(100% - 2rem, 380px);
  padding: 1.75rem 1.5rem;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(12, 16, 24, 0.92);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.45);
}
.desk-body .gate-input {
  width: 100%;
  text-align: center;
  letter-spacing: 0.35em;
  font-size: 1.15rem;
  margin: 1rem 0 0.85rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #eef1f7;
}
.desk-body .primary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.75rem 0 1rem;
}
@media (max-width: 900px) {
  /* Reinforce: no translucent white overlay on ops */
  .desk-body .desk-topbar,
  .desk-body .topbar {
    background: #05070c !important;
    background-image: none !important;
  }
  .desk-body .top-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.35rem;
    width: 100%;
  }
  .desk-body .stat-pill {
    padding: 0.4rem 0.35rem;
    text-align: center;
  }
  .desk-body .stat-n {
    font-size: 0.95rem;
  }
  .desk-body .stat-l {
    font-size: 0.58rem;
    letter-spacing: 0.02em;
  }
  .desk-body .queue-col {
    max-height: min(42vh, 360px);
  }
  .desk-body .filter-chips {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 0.35rem;
    padding-bottom: 0.25rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .desk-body .filter-chips::-webkit-scrollbar {
    display: none;
  }
  .desk-body .fchip {
    flex: 0 0 auto;
    white-space: nowrap;
  }
  .desk-body .detail-col {
    padding: 0.85rem 0.85rem 2rem;
  }
  .desk-body .verdict h2 {
    font-size: 1.15rem;
    word-break: break-word;
  }
  .desk-body .lp-grid {
    grid-template-columns: 1fr !important;
  }
}
@media (max-width: 480px) {
  .desk-body .top-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .desk-body .primary-actions .btn {
    flex: 1 1 calc(50% - 0.4rem);
    justify-content: center;
  }
}

/* Legal */
.legal-body {
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.legal-top {
  padding-left: max(1rem, env(safe-area-inset-left, 0));
  padding-right: max(1rem, env(safe-area-inset-right, 0));
}
@media (max-width: 640px) {
  .legal-wrap {
    padding: 1.75rem 1rem 3.5rem;
  }
  .legal-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .legal-foot {
    flex-direction: column;
    gap: 0.65rem;
  }
}

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

/* Print */
@media print {
  .m-nav,
  .bottom-nav,
  .side-scrim,
  .chat-root,
  #btn-unlock,
  .cookie-banner,
  .pwa-banner,
  .ask-ai-btn {
    display: none !important;
  }
  body {
    background: #fff !important;
    color: #000 !important;
  }
}
