/* Responsive app-shell and dashboard refinements. */
@media (max-width: 860px) {
  .main,
  .app.landing-mode .main {
    padding: 12px 12px calc(88px + env(safe-area-inset-bottom));
  }

  .dashboard-header { flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
  .dashboard-header h1 { font-size: 24px; }
  .dashboard-header .topbar-actions { width: 100%; justify-content: space-between; gap: 8px; }
  .dashboard-header .btn { min-height: 44px; }
  .dashboard-overview { gap: 16px; margin-block: 16px; }
  .dashboard-placements { gap: 16px; }
  .dashboard-section-heading .btn-textlink,
  .table-page-btn { min-width: 44px; min-height: 44px; }
  .dashboard-metric-band .card.stat-card { border-radius: 0; background: transparent; box-shadow: none; }
  .directory-clean.directory-hero { padding: 0 !important; gap: 12px !important; border-radius: 0 !important; }
  .directory-clean .directory-hero-copy h1 { font-size: 24px; }
  .directory-clean .directory-filter-panel { padding: 0; gap: 8px; }
  .directory-clean .directory-filter-grid .select { height: 44px; min-height: 44px; font-size: 16px; }
  .directory-clean .directory-search { min-height: 48px; }
  .directory-toolbar { gap: 8px 12px; }
  .directory-toolbar .directory-submit { flex: 0 0 auto; width: auto; min-width: 0; padding: 8px 12px; font-size: 13px; }
  .card.dir-card { padding: 16px; }
  .dir-card-top { gap: 8px; }
  .dir-member-tags .pill { font-size: 10px; padding: 3px 6px; }
  .app-footer-compact { margin-top: 24px; }

  .dash-hero {
    min-height: 0;
    margin-bottom: 16px;
    padding: 15px;
    border-radius: 14px;
    border-color: var(--dash-border);
    background: var(--surface-1);
  }
  .dash-hero canvas.dither { display: none; }
  .dash-hero .dither-scrim {
    clip-path: inset(0 round 14px);
    background: linear-gradient(135deg, rgba(120, 160, 255, 0.065), rgba(227, 185, 79, 0.05));
  }
  .dash-hero-inner { gap: 10px; }
  .dash-hero-inner .topbar-crest { width: 38px; height: 38px; }
  .dash-hero-inner .page-title h1 { font-size: clamp(21px, 6vw, 28px); line-height: 1.08; }
  .dash-hero-inner .page-title p { font-size: 12.5px; }
  .dash-hero-inner .topbar-actions { gap: 10px; }
  .dash-hero-inner .topbar-actions .btn-gold {
    min-height: 48px;
    width: 100%;
  }

  .dashboard-metric-band {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    padding: 4px;
  }
  .dashboard-metric-band .stat-card {
    min-height: 84px;
    padding: 13px 12px;
  }
  .dashboard-metric-band .stat-card + .stat-card { border-left: 0; }
  .dashboard-metric-band .stat-card:nth-child(even) { border-left: 1px solid var(--dash-border); }
  .dashboard-metric-band .stat-card:nth-child(n + 3) { border-top: 1px solid var(--dash-border); }
  .dashboard-metric-band .stat-icon { width: 36px; height: 36px; }
  .dashboard-metric-band .stat-value { font-size: 20px; }
  .dashboard-metric-band .stat-label { font-size: 10.5px; }

  .collapsible-section { margin: 13px 0; }
  .collapsible-summary { min-height: 50px; padding-bottom: 8px; }
  .dash-section h2 { font-size: 16px; }
  .dash-section p { font-size: 11.5px; }
  .collapsible-body { padding-top: 6px; }
  .collapsible-body .card { padding: 15px; border-radius: 12px; }

  .auth-notice {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    gap: 10px;
    min-height: 0;
    margin-bottom: 14px;
    padding: 10px;
    border-radius: 12px;
  }
  .auth-notice-text {
    display: block;
    font-size: 11.5px;
    line-height: 1.35;
  }
  .auth-notice-text strong,
  .auth-notice-text span { display: block; }
  .auth-notice-text small { display: none; }
  .auth-notice .btn { min-height: 34px; padding-inline: 11px; }

  .directory-hero,
  .page-hero {
    gap: 11px !important;
    margin-bottom: 16px;
    padding: 13px !important;
    border-radius: 16px !important;
  }
  .page-hero { min-height: 0; }
  .directory-hero-main { gap: 9px; }
  .directory-hero-copy h1 { font-size: clamp(23px, 7vw, 29px); }
  .directory-hero-copy p {
    margin-top: 4px;
    font-size: 11.5px;
    line-height: 1.35;
  }
  .page-hero-controls,
  .directory-control-panel { gap: 8px; }
  .page-hero-submit-row .btn,
  .directory-control-panel .directory-submit {
    min-height: 40px;
    padding-block: 8px;
    border-radius: 11px;
    font-size: 12.5px;
  }
  .page-hero-controls .directory-filter-panel,
  .directory-filter-panel {
    gap: 7px;
    padding: 7px;
    border-radius: 12px;
  }
  .directory-filter-panel .directory-search {
    min-height: 39px;
    padding-block: 7px;
    border-radius: 10px;
  }
  .directory-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 7px;
  }
  .directory-filter-grid .select {
    height: 38px;
    min-height: 38px;
    border-radius: 10px;
    font-size: 12px;
  }
  .directory-hero .dir-summary,
  .directory-command .dir-summary {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 5px;
  }
  .directory-hero .dir-summary div {
    min-width: 0;
    grid-column: auto !important;
    padding: 7px 3px;
    border-radius: 9px;
    text-align: center;
  }
  .directory-hero .dir-summary strong { font-size: 16px; }
  .directory-hero .dir-summary span {
    overflow: hidden;
    font-size: 8px;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .dir-year { margin-bottom: 22px; }
  .dir-year-head { margin-bottom: 10px; }
  .dir-grid,
  .alumni-grid { gap: 11px; }
  .dir-card:hover,
  .alumni-card:hover,
  .term-card:hover { transform: none; }

  .mobile-bottom-nav {
    gap: 3px;
    padding: 6px;
    border-radius: 16px;
    border-color: rgba(255, 255, 255, 0.09);
    background: rgba(11, 15, 25, 0.96);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.035);
  }
  .mobile-nav-item {
    position: relative;
    min-height: 52px;
    border-radius: 10px;
    font-size: 9.5px;
    font-weight: 700;
    transition: color var(--motion-fast), background var(--motion-fast), transform var(--motion-fast);
  }
  .mobile-nav-item.active {
    color: #bdccff;
    background: rgba(120, 160, 255, 0.12);
  }
  .mobile-more-sheet:not([hidden]) {
    animation: mobileSheetIn 240ms var(--motion-ease) both;
  }
  .mobile-more-sheet {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(15, 20, 32, 0.98);
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.4);
  }
  .mobile-more-item {
    border-radius: 10px;
    color: var(--text);
  }
  .mobile-more-item:hover,
  .mobile-more-item:focus-visible { background: rgba(120, 160, 255, 0.07); }
  @keyframes mobileSheetIn {
    from { opacity: 0; transform: translateY(8px) scale(0.99); }
  }
}

@media (max-width: 430px) {
  .directory-hero .dir-summary,
  .directory-command .dir-summary {
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    gap: 6px;
  }
  .directory-hero .dir-summary div,
  .directory-command .dir-summary div {
    grid-column: span 2 !important;
    padding: 8px 5px;
  }
  .directory-hero .dir-summary div:nth-child(n + 4),
  .directory-command .dir-summary div:nth-child(n + 4) {
    grid-column: span 3 !important;
  }
  .directory-hero .dir-summary span { font-size: 9px; }

  .dashboard-metric-band .stat-card { gap: 8px; }
  .dashboard-metric-band .stat-icon { width: 32px; height: 32px; }
  .dashboard-metric-band .stat-icon svg { width: 17px; height: 17px; }
  .dashboard-metric-band .stat-value { font-size: 18px; }
  .dashboard-metric-band .stat-label { line-height: 1.2; }

  .auth-notice { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  .auth-notice-ic { display: none; }
  .auth-notice-text strong { white-space: normal; }
  .auth-notice .btn {
    grid-column: auto;
    width: auto;
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-nav-item,
  .mobile-more-item,
  .mobile-more-sheet { animation: none !important; transition: none !important; }
}
