/* ==========================================================================
   INSTA PRO APK (v15.90) - ULTRA HIGH PERFORMANCE COMPACT STYLESHEET
   - Strict 2-Color Logo Palette: Royal Purple (#6d28d9) & Crown Gold (#d97706)
   - Ultra Compact Spacing: Decreased margins & paddings, zero extra gaps
   - 100/100 Core Web Vitals Engineered (Zero CLS, Minimal Paint, Responsive)
   ========================================================================== */

:root {
  /* Logo Color 1: Royal Purple / Violet (Icon Body & PRO Badge) */
  --primary: #6d28d9;
  --primary-dark: #4c1d95;
  --primary-deep: #1a0933;
  --primary-darker: #100520;
  --primary-light: #f5f0ff;
  --primary-soft: #ebe2ff;
  --primary-border: #d8c7ff;

  /* Logo Color 2: Crown Gold / Amber (Golden Crown & Swoosh Ring) */
  --accent: #d97706;
  --accent-dark: #b45309;
  --accent-bright: #f59e0b;
  --accent-light: #fffbeb;
  --accent-soft: #fef3c7;
  --accent-border: #fcd34d;

  /* Neutral Surfaces & High-Contrast Text (Tinted with Logo Purple) */
  --bg-page: #faf8ff;
  --bg-surface: #ffffff;
  --bg-alt: #f3effc;
  --border: #e3dbf2;
  --text-main: #150826;
  --text-body: #2b1d3d;
  --text-muted: #58496b;

  /* Compact Layout Constants */
  --container-max: 1020px;
  --radius-sm: 5px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --transition: all 0.15s ease-in-out;
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15.5px;
  line-height: 1.46;
  color: var(--text-body);
  background-color: var(--bg-page);
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  background-color: var(--bg-page);
}

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

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 0.7rem;
}

/* ==========================================================================
   TYPOGRAPHY - SNUG & COMPACT (NO EXTRA SPACES)
   ========================================================================== */
h1, h2, h3, h4 {
  color: var(--text-main);
  font-weight: 800;
  line-height: 1.22;
  margin: 0 0 0.25rem 0;
  letter-spacing: -0.015em;
}

h1 {
  font-size: clamp(1.38rem, 2.7vw, 1.82rem);
  color: var(--primary-deep);
}

h2 {
  font-size: clamp(1.12rem, 2vw, 1.32rem);
  background: linear-gradient(90deg, var(--primary-deep) 0%, var(--primary-dark) 75%, var(--primary) 100%);
  color: #ffffff;
  padding: 0.42rem 0.72rem;
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--accent-bright);
  margin: 0 0 0.35rem 0;
}

h3 {
  font-size: 1rem;
  color: var(--primary-dark);
}

p {
  margin: 0 0 0.32rem 0;
  color: var(--text-body);
  font-size: 0.94rem;
  line-height: 1.46;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 700;
  transition: var(--transition);
}

a:hover {
  color: var(--accent-dark);
}

ul, ol {
  margin: 0 0 0.32rem 0;
  padding-left: 1.15rem;
  color: var(--text-body);
  font-size: 0.93rem;
}

li {
  margin-bottom: 0.16rem;
  line-height: 1.42;
}

li:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   PREMIUM COMPACT HEADER (Clean Brand Header - No Nav Pill Clutter)
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: linear-gradient(90deg, var(--primary-darker) 0%, var(--primary-deep) 55%, var(--primary-dark) 100%);
  border-bottom: 2px solid var(--accent-bright);
  box-shadow: 0 2px 10px rgba(16, 5, 32, 0.3);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  padding-top: 0.22rem;
  padding-bottom: 0.22rem;
  gap: 0.5rem;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none !important;
  color: #ffffff !important;
  font-weight: 800;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.brand-logo-img {
  width: 34px;
  height: 34px;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(245, 158, 11, 0.45);
}

.brand-text {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  letter-spacing: -0.01em;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.06rem 0.36rem;
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--primary-darker);
  background: linear-gradient(135deg, var(--accent-bright), var(--accent));
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-link {
  padding: 0.26rem 0.68rem;
  font-size: 0.84rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92) !important;
  border-radius: 999px;
  text-decoration: none !important;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
  background: rgba(255, 255, 255, 0.16);
  border-color: var(--accent-bright);
  color: #ffffff !important;
}

/* ==========================================================================
   TABLE OF CONTENTS (COMPACT, RESPONSIVE, ZERO EMPTY GAPS)
   ========================================================================== */
.toc-box {
  background-color: var(--bg-surface);
  border: 1.5px solid var(--primary-border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.7rem;
}

.toc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.toc-title {
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--primary-deep);
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.toc-toggle-btn {
  background: var(--primary-light);
  color: var(--primary-dark);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-sm);
  padding: 0.16rem 0.5rem;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
}

.toc-toggle-btn:hover {
  background: var(--accent-light);
  color: var(--accent-dark);
  border-color: var(--accent-border);
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0.4rem 0 0 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.26rem 0.45rem;
  counter-reset: toc-counter;
}

.toc-box.collapsed .toc-list {
  display: none;
}

.toc-list li {
  counter-increment: toc-counter;
  margin: 0;
  display: flex;
}

/* Ensure odd last item spans full width so there is zero empty space */
.toc-list li:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.toc-list a {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  padding: 0.28rem 0.5rem;
  background-color: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none !important;
  transition: var(--transition);
}

.toc-list a::before {
  content: counter(toc-counter, decimal-leading-zero);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 21px;
  height: 20px;
  padding: 0 0.2rem;
  border-radius: 4px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 0.72rem;
  font-weight: 800;
  flex-shrink: 0;
}

.toc-list li:nth-child(even) a::before {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.toc-list a:hover {
  background-color: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

@media (max-width: 640px) {
  .toc-list {
    grid-template-columns: 1fr;
  }
  .toc-list li:last-child:nth-child(odd) {
    grid-column: auto;
  }
}

/* ==========================================================================
   SECTIONS & ULTRA-SNUG CONTAINERS
   ========================================================================== */
main {
  padding: 0.4rem 0 0.5rem 0;
}

.section {
  margin-bottom: 0.45rem;
}

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

.section-box {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.75rem;
  box-shadow: 0 1px 3px rgba(21, 8, 38, 0.03);
}

/* ==========================================================================
   HERO SECTION & DOWNLOAD CTA
   ========================================================================== */
.breadcrumb-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--primary-border);
}

.breadcrumb-bar a {
  color: var(--primary);
  text-decoration: none;
}

.breadcrumb-bar a:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

.breadcrumb-sep {
  color: var(--accent);
  font-weight: 800;
}

.breadcrumb-current {
  color: var(--primary-deep);
}

.hero-box {
  background: linear-gradient(180deg, #ffffff 0%, var(--primary-light) 100%);
  border: 1.5px solid var(--primary-border);
  border-top: 3.5px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.8rem;
}

.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.hero-text-col {
  flex: 1;
  min-width: 0;
}

.hero-logo-col {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  background: var(--bg-surface);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-md);
  padding: 0.4rem 0.55rem;
}

.hero-app-logo {
  width: 72px;
  height: 72px;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.download-btn-wrap {
  margin: 0.3rem auto 0.18rem auto;
  text-align: center;
}

.download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  max-width: 440px;
  padding: 0.88rem 1.5rem;
  background: linear-gradient(90deg, var(--primary-dark) 0%, var(--primary) 55%, var(--accent) 100%);
  color: #ffffff !important;
  font-size: clamp(1.05rem, 2.4vw, 1.24rem);
  font-weight: 800;
  letter-spacing: 0.01em;
  border-radius: var(--radius-md);
  text-decoration: none !important;
  border: 1.5px solid var(--accent-bright);
  box-shadow: 0 4px 14px rgba(109, 40, 217, 0.32);
  transition: var(--transition);
  text-align: center;
}

.download-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(217, 119, 6, 0.4);
  filter: brightness(1.05);
}

.download-btn svg {
  width: 23px;
  height: 23px;
  stroke: var(--accent-bright);
  stroke-width: 2.6;
  fill: none;
  flex-shrink: 0;
}

.download-meta-note {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.15rem;
  margin-bottom: 0.45rem;
}

.download-meta-note small {
  font-size: inherit;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.14rem 0.45rem;
  font-size: 0.74rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  background-color: var(--primary-light);
  color: var(--primary-dark);
  border: 1px solid var(--primary-border);
  text-decoration: none !important;
}

a.badge:hover {
  background-color: var(--primary);
  color: #ffffff !important;
  border-color: var(--primary);
}

.badge-gold {
  background-color: var(--accent-light);
  color: var(--accent-dark);
  border-color: var(--accent-border);
}

.badge-solid {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #ffffff !important;
  border: none;
}

@media (max-width: 580px) {
  .hero-top {
    flex-direction: column-reverse;
    text-align: center;
    gap: 0.4rem;
  }
  .hero-box {
    padding: 0.55rem 0.65rem;
  }
  .download-btn {
    padding: 0.8rem 1rem;
    font-size: 1.05rem;
    max-width: 100%;
  }
}

/* ==========================================================================
   TEST NOTE / VERIFICATION CALLOUT BOXES (2-COLOR LOGO PALETTE)
   ========================================================================== */
.test-note {
  background-color: var(--accent-light);
  border: 1px solid var(--accent-border);
  border-left: 3.5px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 0.38rem 0.6rem;
  margin: 0.3rem 0;
  font-size: 0.86rem;
  color: var(--text-main);
  line-height: 1.4;
}

.test-note strong {
  color: var(--accent-dark);
}

.info-callout {
  background-color: var(--primary-light);
  border: 1px solid var(--primary-border);
  border-left: 3.5px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 0.38rem 0.6rem;
  margin: 0.3rem 0;
  font-size: 0.88rem;
  color: var(--text-main);
}

/* ==========================================================================
   GRIDS & CARDS (ZERO EMPTY SPACES - ORPHANS SPAN FULL WIDTH)
   ========================================================================== */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.4rem;
  margin-top: 0.3rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  margin-top: 0.3rem;
}

/* Prevent empty grid holes on odd/orphan items */
.grid-2 > :last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.grid-3 > :last-child:nth-child(3n + 1) {
  grid-column: 1 / -1;
}

.grid-3 > :last-child:nth-child(3n + 2) {
  grid-column: span 2;
}

@media (max-width: 780px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-3 > :last-child:nth-child(3n + 1),
  .grid-3 > :last-child:nth-child(3n + 2) {
    grid-column: auto;
  }
  .grid-3 > :last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
  .grid-2 > :last-child,
  .grid-3 > :last-child {
    grid-column: 1 / -1;
  }
}

.card {
  background-color: var(--bg-page);
  border: 1px solid var(--border);
  border-top: 2.5px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.65rem;
}

.card:nth-child(even) {
  border-top-color: var(--accent);
}

.card h3 {
  margin: 0 0 0.2rem 0;
  font-size: 0.96rem;
  color: var(--primary-deep);
}

/* ==========================================================================
   TABLES (COMPACT & RESPONSIVE)
   ========================================================================== */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin: 0.3rem 0;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
}

.data-table th {
  background: linear-gradient(90deg, var(--primary-deep), var(--primary-dark));
  color: #ffffff;
  font-weight: 800;
  padding: 0.38rem 0.6rem;
  border-bottom: 2px solid var(--accent-bright);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.data-table td {
  padding: 0.34rem 0.6rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-body);
  vertical-align: top;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:nth-child(even) td {
  background-color: var(--bg-page);
}

.data-table td:first-child {
  font-weight: 700;
  color: var(--primary-deep);
  width: 34%;
}

/* ==========================================================================
   PROS & CONS LISTS (STRICT 2-COLOR PALETTE)
   ========================================================================== */
.pros-card {
  background-color: var(--primary-light);
  border: 1px solid var(--primary-border);
  border-top: 3px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.65rem;
}

.cons-card {
  background-color: var(--accent-light);
  border: 1px solid var(--accent-border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.65rem;
}

.check-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.check-list li {
  position: relative;
  padding-left: 1.1rem;
  margin-bottom: 0.18rem;
  font-size: 0.9rem;
}

.check-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--primary);
  font-weight: 800;
}

.cons-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.cons-list li {
  position: relative;
  padding-left: 1.1rem;
  margin-bottom: 0.18rem;
  font-size: 0.9rem;
}

.cons-list li::before {
  content: "!";
  position: absolute;
  left: 0.15rem;
  top: 0;
  color: var(--accent-dark);
  font-weight: 800;
}

/* ==========================================================================
   FAQ ACCORDION
   ========================================================================== */
.faq-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.3rem;
  margin-top: 0.3rem;
}

.faq-item {
  background-color: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.faq-item.active {
  border-color: var(--primary);
  background-color: var(--bg-surface);
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  background: none;
  border: none;
  text-align: left;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--primary-deep);
  cursor: pointer;
}

.faq-question:hover {
  background-color: var(--primary-light);
  color: var(--primary);
}

.faq-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 0.85rem;
  font-weight: 800;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.faq-item.active .faq-icon {
  background: var(--accent-bright);
  color: var(--primary-darker);
  transform: rotate(45deg);
}

.faq-answer {
  padding: 0.38rem 0.65rem 0.48rem 0.65rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-body);
  background-color: var(--bg-surface);
}

.js-enabled .faq-item:not(.active) .faq-answer {
  display: none;
}

/* ==========================================================================
   PREMIUM COMPACT FOOTER (Clean Brand & Disclaimer Footer - No Nav Clutter)
   ========================================================================== */
.site-footer {
  background: linear-gradient(180deg, var(--primary-deep) 0%, var(--primary-darker) 100%);
  color: var(--primary-soft);
  border-top: 3px solid var(--accent-bright);
  padding: 0.65rem 0 0.5rem 0;
  margin-top: 0.4rem;
}

.footer-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(216, 199, 255, 0.16);
  margin-bottom: 0.4rem;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: #ffffff !important;
  font-size: 1.02rem;
  font-weight: 800;
  text-decoration: none !important;
  margin: 0;
}

.footer-brand img {
  width: 30px;
  height: 30px;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(245, 158, 11, 0.45);
}

.footer-desc {
  color: var(--primary-border);
  font-size: 0.8rem;
  line-height: 1.38;
  margin: 0;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.76rem;
  color: var(--primary-border);
}

.footer-disclaimer {
  font-size: 0.76rem;
  color: rgba(235, 226, 255, 0.82);
  line-height: 1.38;
  margin-bottom: 0.35rem;
}

.btn-top {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  background: rgba(109, 40, 217, 0.35);
  color: #ffffff;
  border: 1px solid var(--accent-bright);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.btn-top:hover {
  background: var(--accent);
  color: var(--primary-darker);
}

@media (max-width: 720px) {
  .footer-top-bar,
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}
