/* Loaded after the existing theme styles so both themes share mobile layout. */
.mobile-nav { display: none; }
.hero-main, .hero-panel, .layout > *, .download-panel, .download-card,
.step, .step-body, .tabs, .tab-panel, .media-grid, .shot, .guide-card,
.code-card, .notice > p { min-width: 0; }
.hero-main, .content, .contact-dialog, .footer { overflow-wrap: anywhere; }
.copy-chip { gap: 12px; word-break: break-word; }
.copy-chip::after { flex: 0 0 auto; }
.footer-ads {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}
.footer-ads-mobile { display: none; }
.footer-ad {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md, 16px);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}
.footer-ad-left { margin-right: auto; }
.footer-ad-center { margin-inline: auto; }
.footer-ad-right { margin-left: auto; }
.footer-ad a { display: block; }
.footer-ad img { display: block; width: 100%; height: var(--ad-desktop-height, auto); object-fit: contain; }
.footer-ad-label {
  position: absolute; top: 8px; right: 8px; z-index: 1; pointer-events: none;
  padding: 2px 8px; border-radius: 4px;
  background: rgba(0, 0, 0, .55); color: #fff; font-size: 11px;
}
.footer-ad a:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }

@media (max-width: 900px) {
  .footer-ads-top, .footer-ads-middle, .footer-ads-bottom { display: none; }
  .footer-ads-mobile { display: grid; gap: 18px; margin-bottom: 18px; }
  .footer-ad { width: 100%; margin-inline: 0; }
  .footer-ad img { height: auto; }
  html { scroll-padding-top: 16px; }
  .topbar, [data-theme="dark"] .topbar {
    position: relative; top: auto; min-height: 0;
    margin: 14px auto 16px;
  }
  .hero-copy, [data-theme="dark"] .hero-copy {
    grid-template-columns: minmax(0, 1fr); min-height: 0; gap: 24px;
    padding: 28px 24px;
  }
  .hero h1, [data-theme="dark"] .hero h1 {
    font-size: clamp(32px, 5.5vw, 44px); line-height: 1.18;
  }
  .hero-panel, [data-theme="dark"] .hero-panel {
    min-height: 0; padding: 56px 0 0; grid-template-rows: auto auto;
  }
  .support-panel-block, [data-theme="dark"] .support-panel-block { min-height: 0; }
  .layout, [data-theme="dark"] .layout {
    grid-template-columns: minmax(0, 1fr); gap: 16px; padding-bottom: 24px;
  }
  .layout > .side-nav { display: none; }
  .content { order: 0; }
  .mobile-nav {
    display: block; width: var(--shell-width); margin: 0 auto 16px;
    border: 1px solid var(--line); border-radius: 12px;
    background: var(--surface); color: var(--ink);
  }
  .mobile-nav summary {
    min-height: 48px; padding: 12px 16px; cursor: pointer; font-weight: 800;
    overflow-wrap: anywhere;
  }
  .mobile-nav-current { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; font-weight: 500; }
  .mobile-nav nav { display: grid; gap: 12px; padding: 0 12px 12px; }
  .mobile-nav .side-link, .mobile-nav .side-group a { min-height: 44px; }
  .download-grid, .download-panel .download-grid, .step-grid, .media-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .doc-section, [data-theme="dark"] .doc-section {
    padding: 72px 24px 24px;
  }
  .doc-section:first-child, [data-theme="dark"] .doc-section:first-child { padding-top: 72px; }
  .doc-section h2, [data-theme="dark"] .doc-section h2 { font-size: 30px; line-height: 1.25; }
  .contact-modal { overflow-y: auto; align-items: start; }
  .contact-dialog { margin: auto; max-width: 100%; }
}

@media (max-width: 680px) {
  .topbar, .hero, .mobile-nav, .layout, .footer { width: calc(100% - 24px); }
  .topbar, [data-theme="dark"] .topbar {
    padding: 14px 12px; gap: 14px; margin: 12px auto 16px;
  }
  .brand-wrap { gap: 10px; flex-wrap: wrap; width: 100%; }
  .brand-mark { flex: 0 0 36px; width: 36px; height: 36px; }
  .brand-title { font-size: 17px; }
  .topbar-badge { font-size: 11px; margin-left: auto; }
  .top-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ghost-link, [data-theme="dark"] .ghost-link {
    display: flex; align-items: center; justify-content: center;
    min-width: 0; min-height: 44px; padding: 8px; text-align: center;
    font-size: 12px; overflow-wrap: anywhere;
  }
  .theme-trigger, [data-theme="dark"] .theme-trigger {
    justify-content: center; min-height: 44px; max-height: none;
  }
  .hero-copy, [data-theme="dark"] .hero-copy { padding: 22px 16px; gap: 20px; }
  .hero h1, [data-theme="dark"] .hero h1 { font-size: clamp(28px, 7.8vw, 36px); }
  .hero-kicker { max-width: 100%; line-height: 1.5; }
  .hero-kicker::before { flex: 0 0 8px; }
  .hero-lede, [data-theme="dark"] .hero-lede { font-size: 15px; line-height: 1.75; }
  .hero-note, [data-theme="dark"] .hero-note { max-width: 100%; font-size: 14px; }
  .hero-software-links { display: grid; grid-template-columns: minmax(0, 1fr); }
  .hero-software-link, [data-theme="dark"] .hero-software-link { min-height: 44px; }
  .hero-panel, [data-theme="dark"] .hero-panel { padding-top: 52px; }
  .hero-panel::before, [data-theme="dark"] .hero-panel::before { min-height: 52px; }
  .hero-panel::after, [data-theme="dark"] .hero-panel::after { top: 21px; }
  .support-panel-block, [data-theme="dark"] .support-panel-block {
    grid-template-columns: minmax(0, 1fr); padding: 14px; min-height: 0;
  }
  .support-panel-button, [data-theme="dark"] .support-panel-button { width: 100%; min-height: 44px; }
  .doc-section, [data-theme="dark"] .doc-section { padding: 68px 14px 20px; }
  .doc-section:first-child, [data-theme="dark"] .doc-section:first-child { padding-top: 68px; }
  .doc-section h2, [data-theme="dark"] .doc-section h2 { font-size: 25px; }
  .doc-section h3, [data-theme="dark"] .doc-section h3 { font-size: 18px; }
  .section-title-wrap { gap: 12px; }
  .section-inline-btn { min-height: 44px; max-width: 100%; }
  .doc-section > .section-kicker, .section-head > .section-kicker { left: 14px; font-size: 13px; }
  .section-intro { font-size: 15px; }
  .step { grid-template-columns: minmax(0, 1fr); padding: 12px; gap: 12px; }
  .step-number { width: 30px; height: 30px; font-size: 14px; }
  .step-body { gap: 10px; }
  .download-panel { padding: 12px; }
  .download-panel h2, [data-theme="dark"] .download-panel h2 { font-size: 23px; }
  .download-card, .guide-card { padding: 14px; }
  .download-panel .download-card { padding: 12px; }
  .tab-button { flex: 1 1 auto; min-height: 44px; padding: 8px 10px; font-size: 14px; }
  .notice { gap: 10px; padding: 12px; }
  .code-head { flex-wrap: wrap; padding: 10px 12px; }
  .code-card pre { padding: 12px; -webkit-overflow-scrolling: touch; }
  .copy-chip { max-width: 100%; font-size: 12px; }
  .contact-modal, .lightbox { padding: 12px; }
  .contact-dialog { padding: 20px 16px; }
  .contact-dialog h2 { padding-right: 44px; font-size: 22px; }
  .contact-close, .lightbox button { top: 12px; right: 12px; }
  .contact-qr-grid { grid-template-columns: minmax(0, 1fr); }
  .contact-qr-grid img { max-width: 240px; margin: auto; object-fit: contain; }
  .footer-inner { padding: 16px; gap: 8px; font-size: 13px; border-radius: 16px; }
}
