/* Mobile & Tablet Responsive Optimization — Preserves Desktop 3-Column Cyber Matrix */

html, body {
  overflow-x: hidden;
  max-width: 100%;
}

.brand-block::before {
  max-width: 100%;
}

@media (max-width: 1080px) {
  .hero-matrix-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .hero-left-col {
    padding-top: 0.5rem;
    order: 2;
  }

  .hero-center-col {
    margin-top: 0;
    order: 1;
  }

  .hero-right-col {
    order: 3;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.85rem;
  }
}

@media (max-width: 820px) {
  .container {
    padding: 0 1rem;
  }

  .top-bar-grid {
    flex-direction: column;
    gap: 0.85rem;
  }

  .policy-banner-box {
    max-width: 100%;
    width: 100%;
  }

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

  .bottom-categories-strip {
    grid-template-columns: repeat(3, 1fr);
    row-gap: 0.85rem;
  }

  .cat-strip-item:nth-child(3n) {
    border-right: none;
  }

  .self-audit-grid {
    grid-template-columns: 1fr;
  }

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

  /* Touch-scrollable horizontal tab bar on tablets & phones */
  .nav-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding-bottom: 0.55rem;
  }

  .nav-tab {
    flex-shrink: 0;
    white-space: nowrap;
  }
}

@media (max-width: 560px) {
  .container {
    padding: 0 0.75rem;
  }

  .cyber-stage {
    padding-top: 0.85rem;
  }

  .brand-title {
    font-size: 2rem;
    gap: 0.45rem;
  }

  .brand-subtitle {
    margin-left: 0;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
  }

  .policy-banner-box {
    padding: 0.55rem 0.7rem;
    gap: 0.55rem;
  }

  .policy-banner-text {
    font-size: 0.68rem;
  }

  .imp-artwork {
    max-width: 265px;
  }

  .center-search-zone {
    margin-top: -0.35rem;
  }

  .search-input-row {
    gap: 0.45rem;
  }

  .terminal-input-box {
    height: 46px;
    padding: 0 0.75rem;
  }

  .text-input {
    font-size: 0.9rem;
  }

  .btn-search-square {
    width: 48px;
    height: 46px;
  }

  .btn-scan-target {
    width: calc(100% - 14px);
    max-width: 340px;
    height: 48px;
    font-size: 1rem;
    letter-spacing: 0.1em;
    gap: 0.6rem;
  }

  .btn-scan-target .scan-dash {
    width: 24px;
  }

  .bottom-categories-strip {
    grid-template-columns: repeat(2, 1fr);
    margin-top: 1.25rem;
    padding: 0.75rem 0;
  }

  .cat-strip-item:nth-child(3n) {
    border-right: 1px solid rgba(0, 255, 102, 0.25);
  }

  .cat-strip-item:nth-child(2n) {
    border-right: none;
  }

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

  .overview-grid .stat-card[style*="grid-column"] {
    grid-column: span 1 !important;
  }

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

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 0.65rem;
  }

  .filter-group {
    width: 100%;
  }

  .filter-select {
    width: 100%;
  }

  .export-actions {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
  }

  .export-actions button {
    width: 100%;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }
}
