@media (max-width: 768px) {
  html, body {
    height: auto;
    font-size: 18px;
  }
  html { overflow-y: auto; }
  body { overflow: visible; }
  .app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    height: auto;
    overflow: visible;
  }
  /* Topbar: sticky identity bar */
  .topbar {
    position: sticky;
    top: 0;
    z-index: 60;
    height: 28px;
    padding: 0 10px;
    font-size: 14px;
    gap: 4px;
  }
  .topbar-right { display: none; }
  .topbar-name { display: block; margin-left: auto; font-size: 13px; color: var(--txt2); opacity: 0; transition: opacity 0.25s ease; }
  .topbar-name.visible { opacity: 1; }
  /* Banner: scrolls away — no sticky, no collapse. Logo scales down via
     CSS transform so the font stays at 13px (same as desktop) and avoids
     the sub-pixel advance-width inconsistency that misaligns box-drawing
     chars at small font sizes on iOS. */
  .banner {
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px 12px;
    text-align: center;
  }
  .banner-art {
    font-size: 13px;
    line-height: 1.25;
    transform: scale(0.76);
    transform-origin: top center;
    margin-bottom: -23px;
    display: inline-block;
    text-align: left;
  }
  .banner-meta { align-items: center; min-width: 0; gap: 4px; }
  .bm-name { font-size: 19px; white-space: normal; }
  .bm-title { font-size: 15px; }
  .bm-tags {
    justify-content: center;
    font-size: 13px;
    gap: 8px;
  }
  .main {
    display: flex;
    flex-direction: column;
    overflow: visible;
  }
  /* Sidebar: sticky horizontal nav strip, sits flush below topbar */
  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    position: sticky;
    top: 28px;
    z-index: 50;
  }
  .sidebar::-webkit-scrollbar { width: 0; height: 0; }
  .sb-header, .sb-stats, .fs-item.subentry { display: none; }
  .fs-item {
    padding: 8px 14px;
    font-size: 15px;
    border-bottom: none;
    border-right: 1px solid var(--border);
    flex-shrink: 0;
  }
  .fs-item.active {
    border-left: none;
    border-bottom: 2px solid var(--prompt);
    padding-left: 14px;
  }
  .fs-item .tree { display: none; }
  .content-wrap { overflow: visible; }
  .panels {
    overflow: visible;
    padding: 14px 14px 20px;
  }
  .info-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .ig-k { font-size: 13px; }
  .ig-v { font-size: 17px; }
  .ig-v[style*="font-size:18px"],
  .ig-v[style*="font-size:17px"] { font-size: 15px !important; }
  .bio-txt { font-size: 16px; }
  .skill-hdr { font-size: 15px; }
  .skill-group { font-size: 15px; gap: 8px; }
  .sg-cat { font-size: 13px; width: 70px; }
  .sg-items { font-size: 14px; }
  .job-header { padding: 7px 10px; gap: 6px; }
  .jh-title { font-size: 16px; }
  .jh-org { font-size: 14px; }
  .jh-date { font-size: 12px; margin-left: 0; flex-basis: 100%; }
  .job-body { padding: 8px 10px; font-size: 15px; }
  .proj-grid { grid-template-columns: 1fr; }
  .pc-name { font-size: 16px; }
  .pc-body { font-size: 14px; }
  /* Contact ASCII box shrinks to fit; redundant project-list box hidden */
  .ascii-box { font-size: 10px; }
  #sec-projects .ascii-box { display: none; }
  .sec-hdr { font-size: 17px; padding: 5px 10px; margin-bottom: 16px; }
  .contact-box { max-width: 100%; }
  .contact-row { font-size: 16px; padding: 8px 12px; gap: 10px; }
  .cr-label { width: 80px; font-size: 14px; }
  .adiv { font-size: 13px; overflow: hidden; }
  .section { scroll-margin-top: 70px; }
  .pub-card { padding: 8px 10px; }
  .pub-title { font-size: 15px; }
  .pub-authors { font-size: 13px; }
  .pub-meta { font-size: 13px; }
  .pub-badge { font-size: 11px; }
  .pc-desc { font-size: 14px; }
  .statusbar { font-size: 12px; padding: 0 8px; }
  .sb-mode { font-size: 12px; padding: 0 8px; margin-right: 6px; }
  .sb-right { gap: 8px; font-size: 12px; }
  /* Boot terminal fits small screens */
  .boot-term { font-size: 14px; }
  .boot-term pre { font-size: 10px; }
}
