/* Rogabot Mobile Stylesheet (max-width: 768px) */
@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }

  .site-header {
    padding-top: env(safe-area-inset-top, 0px);
  }

  .site-header .container {
    padding-left: max(1rem, env(safe-area-inset-left, 0px));
    padding-right: max(1rem, env(safe-area-inset-right, 0px));
  }

  .nav-inner {
    height: 64px;
    gap: 0.5rem;
  }

  .nav-brand {
    margin: 0 !important;
    margin-right: 0 !important;
    margin-left: 0 !important;
    gap: 10px;
    flex-shrink: 1;
    min-width: 0;
  }

  .nav-logo-text {
    font-size: 1.15rem;
    white-space: nowrap;
  }

  .nav-logo-icon {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
  }

  .nav-links {
    display: none;
    /* Accessible mobile drawer handles this */
  }

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

  .lang-switch-btn {
    min-width: 44px;
    min-height: 44px;
    padding: 6px 10px;
    font-size: 0.8125rem;
    border-radius: var(--radius-full);
    flex-shrink: 0;
  }

  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    font-size: 1.35rem;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
  }

  .theme-toggle-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
  }

  .btn-nav-cta {
    padding: 8px 14px;
    min-height: 44px;
    font-size: 0.8125rem;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .btn-text-full {
    display: none;
  }

  .btn-text-mobile {
    display: inline;
  }
}

@media (max-width: 580px) {
  .site-header .container {
    padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
  }

  .nav-inner {
    gap: 0.35rem;
  }

  .nav-brand {
    gap: 8px;
  }

  .nav-logo-text {
    font-size: 1.1rem;
  }

  .nav-actions {
    gap: 6px;
  }

  .btn-nav-cta {
    display: none !important;
  }

  .simulator-section {
    padding: 4.5rem 0;
  }

  .sim-panel {
    padding: 1.75rem 1.25rem;
    border-radius: var(--radius-md);
  }

  .phone-mockup {
    max-width: 100%;
    height: 520px;
    border: 8px solid #1e293b;
    border-radius: 32px;
  }

  .phone-notch {
    width: 110px;
    height: 20px;
  }

  .phone-header {
    padding: 26px 14px 10px;
  }

  .phone-messages {
    padding: 12px 10px;
    gap: 10px;
  }

  .msg {
    max-width: 88%;
    font-size: 0.8rem;
    padding: 8px 12px;
  }

  .industry-tabs {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .four-q-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .hiw-flow {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .biz-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    width: 100%;
  }

  .biz-card {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 1.5rem 1.25rem;
  }

  .setup-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .pilot-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .privacy-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .video-timeline {
    grid-template-columns: 1fr;
  }

  .timeline-step-btn {
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
  }

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

  .footer-bottom-bar {
    flex-direction: column;
    text-align: center;
  }

  .sim-features-list {
    grid-template-columns: 1fr;
  }

  .calc-breakdown {
    grid-template-columns: 1fr;
  }

  .cal-times-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Responsive Comparison Table to Stacked Card View */
  .table-responsive-wrapper {
    overflow-x: visible;
    background: transparent;
    border: none;
    box-shadow: none;
    margin: 1.5rem 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .article-table,
  .article-table tbody,
  .article-table tr,
  .article-table td {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }

  .article-table thead {
    display: none;
  }

  .article-table tr {
    background: rgba(13, 19, 31, 0.85);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg, 12px);
    margin-bottom: 1.25rem;
    padding: 1rem 1.25rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  }

  .article-table tr:hover td {
    background: transparent;
  }

  .article-table td {
    padding: 0.65rem 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    text-align: left;
  }

  .article-table td:first-child {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 0.85rem;
    margin-bottom: 0.35rem;
  }

  .article-table td:nth-child(2)::before {
    content: "Rogabot (Native Code):";
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--accent-cyan);
    margin-bottom: 2px;
  }

  .article-table td:nth-child(3)::before {
    content: "Overlay Widgets:";
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #f87171;
    margin-bottom: 2px;
  }

  .article-table td:last-child {
    border-bottom: none;
    padding-bottom: 0.25rem;
  }

  .article-table td .badge-success,
  .article-table td .badge-danger {
    white-space: normal;
    text-align: left;
    width: 100%;
    border-radius: var(--radius-md, 8px);
    padding: 8px 12px;
    font-size: 0.875rem;
    line-height: 1.45;
  }

  html.theme-light .article-table tr {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
  }

  html.theme-light .article-table td {
    border-bottom-color: rgba(0, 0, 0, 0.06);
  }

  html.theme-light .article-table td:first-child {
    border-bottom-color: #e2e8f0;
    color: #0f172a;
  }

  html.theme-light .article-table td:nth-child(2)::before {
    color: #0284c7;
  }

  html.theme-light .article-table td:nth-child(3)::before {
    color: #dc2626;
  }
}

@media (max-width: 640px) {
  .hero-section {
    padding: 4.5rem 0 2.5rem;
  }

  .hero-badge {
    font-size: 0.75rem;
    padding: 5px 12px;
  }

  .hero-title {
    font-size: clamp(2rem, 8vw, 2.75rem);
    line-height: 1.15;
  }

  .hero-visual-container {
    margin: 2rem auto 2.5rem;
    padding: 6px;
  }

  .floating-glass-row {
    position: static;
    transform: none;
    margin-top: 1rem;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 100%;
  }

  .floating-glass-tag {
    font-size: 0.8125rem;
    padding: 7px 12px;
    gap: 6px;
    width: auto;
    max-width: 100%;
    white-space: nowrap;
  }

  .zero-install-bar {
    margin: 1.5rem auto 2.5rem;
    gap: 8px;
  }

  .zero-pill {
    font-size: 0.8125rem;
    padding: 8px 12px;
    width: 100%;
    justify-content: center;
  }

  .stat-bar {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .stat-card {
    padding: 1.5rem 1.25rem;
  }

  .stat-number {
    font-size: 2.25rem;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
    gap: 12px;
  }

  .hero-actions .btn {
    width: 100%;
    min-height: 48px;
    font-size: 0.95rem;
    padding: 12px 18px;
    white-space: nowrap;
  }

  .calc-card {
    padding: 1.5rem 1rem;
  }

  .calc-slider-group {
    padding: 1rem;
  }

  .supported-biz-section {
    padding: 4rem 0 2.5rem;
  }

  .biz-card {
    padding: 1.25rem 1rem;
    border-radius: var(--radius-md);
  }

  .biz-icon {
    width: 38px;
    height: 38px;
    font-size: 1.2rem;
  }

  .biz-name {
    font-size: 1.05rem;
  }

  .biz-desc {
    font-size: 0.875rem;
    margin-bottom: 1rem;
  }

  .biz-metric-box {
    padding: 8px 12px;
  }

  .biz-metric-label {
    font-size: 0.75rem;
  }

  .biz-metric-value {
    font-size: 1.05rem;
  }

  /* Modal Dialog Mobile Enhancements */
  .modal-overlay {
    padding: max(0.75rem, env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-right)) max(0.75rem, env(safe-area-inset-bottom)) max(0.75rem, env(safe-area-inset-left));
    align-items: center;
  }

  .modal-card {
    padding: 1.75rem 1.25rem;
    max-height: calc(100dvh - 1.5rem);
    border-radius: 16px;
    width: 100%;
  }

  .modal-card--nav {
    max-width: 320px;
  }

  .modal-header {
    padding-inline-end: 44px;
    margin-bottom: 1.15rem;
    padding-bottom: 1rem;
  }

  .modal-badge-row {
    flex-wrap: wrap;
    gap: 6px;
  }

  .modal-title {
    font-size: 1.25rem;
  }

  .modal-subtitle {
    font-size: 0.85rem;
  }

  .modal-close {
    top: 14px;
    right: 14px;
    width: 44px;
    height: 44px;
  }

  html[dir="rtl"] .modal-close {
    left: 14px;
    right: auto;
  }

  .input-field,
  .form-input,
  .form-select {
    font-size: 16px;
    /* Prevents automatic iOS zoom on focus */
    min-height: 44px;
  }

  .btn-modal-submit {
    min-height: 48px;
    font-size: 0.95rem;
  }
}

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

  .sim-panel {
    padding: 1.25rem 0.75rem;
  }

  .phone-mockup {
    height: 460px;
    border-width: 5px;
    border-radius: 22px;
  }

  .industry-tabs {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .cal-times-grid {
    grid-template-columns: 1fr;
  }

  .pilot-stats-row {
    grid-template-columns: 1fr;
  }

  .modal-card {
    padding: 1.5rem 1rem;
    max-height: calc(100dvh - 2rem);
  }

  /* Report Showcase Mobile */
  .report-showcase {
    padding: 1.25rem 0.875rem;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
  }

  .report-state-toggle {
    width: 100%;
    flex-direction: column;
    border-radius: var(--radius-lg);
  }

  /* Clean PDF Deliverables Previewer Mobile Responsiveness */
  .pdf-report-selector {
    flex-direction: column;
    width: 100%;
  }

  .pdf-report-tab {
    flex: 1 1 100%;
    max-width: 100%;
  }

  .pdf-viewer-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .pdf-viewer-actions {
    width: 100%;
    justify-content: space-between;
  }

  .pdf-preview-canvas {
    padding: 0.5rem;
  }

  .pdf-pagination-bar {
    justify-content: center;
    gap: 8px;
  }

  .pdf-page-pills {
    order: 1;
    width: 100%;
    justify-content: center;
    margin-bottom: 6px;
  }

  .pdf-page-pill {
    width: 34px;
    height: 34px;
    font-size: 0.88rem;
  }

  .pdf-nav-arrow {
    flex: 1;
    justify-content: center;
    order: 2;
  }

  .pdf-page-indicator {
    order: 3;
    width: 100%;
    text-align: center;
    margin-top: 4px;
  }

  .pdf-downloads-links {
    flex-direction: column;
    width: 100%;
  }

  .pdf-dl-link {
    width: 100%;
    justify-content: space-between;
  }
}


@media (max-width: 360px) {
  .site-header .container {
    padding-left: max(0.5rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.5rem, env(safe-area-inset-right, 0px));
  }

  .nav-inner {
    gap: 0.25rem;
  }

  .nav-brand {
    gap: 6px;
  }

  .nav-logo-text {
    font-size: 1rem;
  }

  .nav-logo-icon {
    width: 30px;
    height: 30px;
  }

  .nav-actions {
    gap: 4px;
  }

  .mobile-menu-btn,
  .theme-toggle-btn,
  .lang-switch-btn {
    min-width: 44px;
    min-height: 44px;
  }
}