/* Mobile-only refinements. Desktop presentation remains owned by the surface stylesheets. */
@media (max-width: 680px) {
    body { overflow-x: hidden; }
    main, section, article, form, fieldset { min-width: 0; }
    .dashboard-shell, .form-shell { padding-top: 2.2rem; padding-bottom: 3.5rem; }
    .dashboard-heading { gap: .8rem; margin-bottom: 1.5rem; }
    .dashboard-heading .button, .dashboard-actions .button { width: 100%; }
    .dashboard-actions { display: grid; grid-template-columns: 1fr; gap: .55rem; }
    .editor-form, .decision-form, .review-form { min-width: 0; padding: 1rem; }
    .editor-form fieldset { min-width: 0; padding: .8rem; }
    .review-notice, .queue-row > div:last-child { align-items: stretch; flex-direction: column; }
    .queue-row .button { width: 100%; }
    .moderation-card { min-width: 0; padding: 1rem; }
    .moderation-card pre { max-width: 100%; overflow-x: auto; }

    .publishing-shell { padding: 2rem .75rem 4rem; }
    .wizard-sidebar h1 { font-size: 2.35rem; }
    .wizard-steps { padding-bottom: .35rem; scroll-snap-type: x proximity; }
    .wizard-steps button { min-height: 44px; scroll-snap-align: start; }
    .publishing-wizard { min-height: 0; }
    .wizard-step, .description-field, .rich-editor, .crepe { max-width: 100%; min-width: 0; }
    .rich-editor { min-height: 320px; }
    .upload-dropzone { padding: 1rem; }
    .upload-preview-grid > *, .repository-field { min-width: 0; }
    .wizard-review-row { align-items: flex-start; flex-direction: column; }
    .wizard-review-row > * { max-width: 100%; overflow-wrap: anywhere; }

    .staff-shell { padding: 1.4rem .75rem 4rem; }
    .staff-navigation { margin: 0 -.75rem; padding: .55rem .75rem; border-right: 0; border-left: 0; border-radius: 0; scroll-snap-type: x proximity; }
    .staff-navigation a { min-height: 44px; display: flex; align-items: center; flex: 0 0 auto; scroll-snap-align: start; }
    .staff-heading { gap: .7rem; margin-bottom: 1.35rem; }
    .staff-heading h1 { font-size: 2.75rem; }
    .staff-heading > .button { width: 100%; }
    .staff-panel { padding: 1rem; }
    .staff-panel-heading { align-items: flex-start; flex-direction: column; }
    .staff-metric-grid { gap: .55rem; }
    .staff-metric-grid > a, .staff-metric-grid > article { padding: .9rem; }
    .staff-metric-grid strong { font-size: 1.35rem; }
    .staff-table-wrap { -webkit-overflow-scrolling: touch; }
    .staff-table { min-width: 560px; }
    .staff-plugin-card-copy p { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
    .staff-plugin-heading h1 { font-size: 2.2rem; }
    .staff-content-tabs { margin-right: -.75rem; margin-left: -.75rem; border-right: 0; border-left: 0; border-radius: 0; scroll-snap-type: x proximity; }
    .staff-content-tabs a { min-height: 42px; display: flex; align-items: center; scroll-snap-align: start; }
    .staff-content-section { padding: 1.4rem 0; }
    .audit-row header { align-items: flex-start; flex-direction: column; }
    .staff-error-dialog[open] { grid-template-columns: 1fr; padding: 1rem; }
    .staff-error-dialog form .button { width: 100%; }
    .ownership-transfer-panel, .impersonation-panel { grid-template-columns: 1fr; }
    .official-badge { font-size: .58rem; }
    body.is-impersonating { padding-top: 86px; }
    body.is-impersonating .site-header { top: 86px; }
    .impersonation-banner { min-height: 86px; align-items: stretch; flex-direction: column; gap: .35rem; padding: .5rem .75rem; }
    .impersonation-banner > div { display: grid; gap: 0; }
    .impersonation-banner form, .impersonation-banner button { width: 100%; }
    .chest-shell { padding: 2rem .75rem 4rem; }
    .chest-hero { align-items: flex-start; gap: .85rem; }
    .chest-hero-icon { width: 58px; height: 48px; border-width: 3px; }
    .chest-hero-icon::before { width: 16px; height: 13px; top: 13px; left: 18px; }
    .chest-hero-icon span { top: 11px; }
    .chest-hero h1 { font-size: 2.8rem; }
    .chest-filters { width: 100%; }
    .chest-filters a { min-height: 44px; flex: 1; display: grid; place-items: center; }
    .chest-grid { grid-template-columns: 1fr; }
    .chest-card-meta { grid-template-columns: 1fr 1fr; }
    .chest-card-meta div:last-child { grid-column: 1 / -1; }
    .chest-card-actions { display: grid; grid-template-columns: 1fr; }
    .chest-card-actions .button { width: 100%; }
    .checkout-confirmation { align-items: flex-start; }
}

@media (max-width: 480px) {
    .profile-shell, .settings-shell { padding: 2rem .75rem 4rem; }
    .profile-heading-copy h1 { font-size: 2.65rem; }
    .profile-meta { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; }
    .profile-following { align-items: stretch; flex-direction: column; }
    .profile-follow-counts { justify-content: space-between; }
    .profile-activity-column { padding: 1rem; }
    .profile-activity-column article > div:first-child { align-items: flex-start; flex-direction: column; gap: .25rem; }
    .settings-nav h1 { font-size: 2.2rem; }
    .settings-nav nav { padding-bottom: .35rem; scroll-snap-type: x proximity; }
    .settings-nav a { min-height: 44px; display: flex; align-items: center; flex: 0 0 auto; scroll-snap-align: start; }
    .connection-list article { align-items: stretch; flex-direction: column; }
    .connection-list .button { width: 100%; }
}
@media(max-width:700px){.github-import-panel form,.release-source-picker>div{grid-template-columns:1fr}.github-import-panel form .button{width:100%}.github-import-selected{align-items:flex-start;flex-direction:column}}
