fieldset[hidden], label[hidden] { display: none !important; }
.routes { grid-template-columns: repeat(3, minmax(0, 1fr)); width: min(100%, 720px); margin-left: auto; justify-self: end; }
.routes .route { min-height: 146px; justify-content: flex-start; }
.routes .route > b { min-height: 2.4em; }
.routes .route > span:first-of-type { display: block; min-height: 2.8em; }
.routes .route > span:last-of-type { display: block; margin-top: auto; padding-top: 18px; }
.access .form { max-width: 720px; }
.access .checks { gap: 8px 12px; }
.access .checks label { min-height: 30px; }
.catalog > div:last-child p { max-width: 42ch; }
#gateway .gw-card { border-radius: 14px; }
#gateway .gw-card-top { padding-bottom: 22px; }
#gateway .gw-btn-google { background: transparent; color: var(--tx0); border: 1px solid var(--ln2); border-radius: 12px; }
#gateway .gw-btn-google:hover { background: var(--s2); opacity: 1; }
#gateway .gw-footer { letter-spacing: .06em; text-transform: lowercase; }
@media (max-width: 960px) {
  .routes { grid-template-columns: minmax(0, 320px); width: min(calc(100% - 64px), 320px); margin: 0 auto; justify-self: center; }
  .routes .route { min-height: 142px; }
}

/* Mobile-first dashboard shell. Every primary action remains visible and tappable. */
@media (max-width: 680px) {
  html, body { max-width: 100%; overflow-x: hidden; }
  * { min-width: 0; }
  #app, .main, .vscroll, .vwrap, .view, .home-panel, .card { max-width: 100%; }
  .tab-bar { overflow-x: auto; padding: 0 16px; gap: 4px; scrollbar-width: thin; }
  .tb { flex: 0 0 auto; min-height: 44px; display: inline-flex; align-items: center; }
  .g2, .g3 { grid-template-columns: minmax(0, 1fr); }
  .card, .admin-section, .push-new-card, .tool-card, .push-card, .brief-section, .ov-brief, .side-card, .guide-card { padding: 16px; border-radius: 10px; }
  .view { overflow-x: hidden; }
  .vwrap { padding-left: 16px; padding-right: 16px; }
  .ph {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    align-items: start !important;
    justify-items: start;
  }
  .ph > * { max-width: 100%; }
  .ph .btn, .ph a.btn {
    justify-self: start;
    max-width: 100%;
    white-space: normal !important;
  }
  .view h1, .view h2, .view h3, .card h1, .card h2, .card h3 {
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: normal;
  }
  .display {
    max-width: 100%;
    letter-spacing: 0;
  }
  #home-greet {
    font-size: clamp(32px, 11vw, 42px) !important;
    line-height: 1.12 !important;
    overflow-wrap: break-word;
  }
  #home-subline { max-width: 32ch; }
  .btn:not(.btn-sm), .cv-open-btn, .tnp-send { min-height: 44px; }
  .btn, .chip, .admin-tab, .tb, .wb-card {
    max-width: 100%;
    white-space: normal;
    text-align: left;
    overflow-wrap: break-word;
  }
  .push-input, .push-ta, .meshy-input, .image-studio-select { min-height: 44px; font-size: 16px; }
  .admin-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 8px; }
  .admin-tab { flex: 0 0 auto; min-height: 44px; display: inline-flex; align-items: center; }
  .admin-lb-row, .moola-row { align-items: flex-start; flex-wrap: wrap; }
  .admin-lb-last { text-align: left; min-width: 0; }
  .moola-hero { padding: 22px 16px; }
  .moola-balance { font-size: 38px; }
  .tnp-overlay { padding: 12px; }
  .tnp-panel { max-width: 100%; width: 100%; }

  .home-panel, .focus-card, .applicant-access-card { min-height: 0; }
  .home-panel .focus-card { justify-content: flex-start; padding: 16px; }
  .focus-label { font-size: 9px; letter-spacing: .11em; margin-bottom: 8px; }
  .focus-card h3 {
    font-size: 20px;
    line-height: 1.18;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .focus-card p {
    font-size: 14px;
    line-height: 1.45;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .asgn-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 12px;
    padding: 16px;
  }
  .asgn-title {
    font-size: 20px;
    line-height: 1.18;
    overflow-wrap: normal;
    word-break: normal;
  }
  .asgn-track { font-size: 13px; line-height: 1.5; }
  .asgn-r {
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }
  .deadline-badge, .pill {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    min-height: 34px;
    line-height: 1.2;
    white-space: normal;
    overflow-wrap: break-word;
  }

  .work-panel, .ad-layout, .serializer-studio, .meshy-studio, .image-studio-grid, .funding-shell, .community-layout, .acct-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .wp-main, .pi-main, .ad-main, .ad-side { min-width: 0; overflow-x: hidden; }
  .wp-tabs, .chips, .spec-chips, .lib-cats {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  .wp-tabs > *, .chips > *, .spec-chips > *, .lib-cats > * { flex: 0 0 auto; }

  table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .home-schedule table, .home-schedule tbody, .home-schedule tr, .home-schedule td {
    display: block;
    width: 100%;
  }
  .home-schedule thead { display: none; }
  .home-schedule tr {
    padding: 12px 0;
    border-bottom: 1px solid var(--ln1);
  }
  .home-schedule td {
    padding: 3px 0 !important;
    white-space: normal !important;
  }

  .push-card, .admin-lb-row, .tool-card, .book-card, .file-card, .output-card, .cv-card {
    width: 100%;
    max-width: 100%;
  }
  .push-card [style*="display:flex"], .card [style*="display:flex"], .admin-section [style*="display:flex"] {
    flex-wrap: wrap;
  }
  .push-card [style*="justify-content:space-between"], .card [style*="justify-content:space-between"], .admin-section [style*="justify-content:space-between"] {
    align-items: flex-start !important;
  }
  .push-card [style*="white-space:nowrap"], .card [style*="white-space:nowrap"], .admin-section [style*="white-space:nowrap"] {
    white-space: normal !important;
  }
  [style*="width:90px"], [style*="width:110px"], [style*="width:120px"], [style*="width:150px"], [style*="width:160px"], [style*="width:170px"], [style*="width:180px"], [style*="width:190px"], [style*="width:200px"],
  [style*="min-width:140px"], [style*="min-width:150px"], [style*="min-width:160px"], [style*="min-width:180px"], [style*="min-width:190px"], [style*="min-width:210px"], [style*="min-width:240px"] {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
  .proj-row-home h4, .hist-preview, .sl-audio-name, .file-card-name {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: break-word;
    text-overflow: clip;
  }
  .timeline, .sl-nav, .admin-tabs, .lib-cats {
    max-width: 100%;
    overflow-x: auto;
  }
  .meshy-options, .tool-grid, .projects-grid, .files-grid, .guide-grid, .funding-grid, .catalog-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  input, select, textarea { max-width: 100%; }
}
