/* Shared layout and touch refinements. No changes to request or ticket behavior. */
[class*="mobile-"] { -webkit-text-size-adjust: 100%; }
[class*="mobile-"] [hidden] { display: none !important; }
[class*="mobile-"] :where(img, input, select, textarea) { max-width: 100%; }
[class*="mobile-"] :where(input, select, textarea) { min-width: 0; }
[class*="mobile-"] :where(h1, h2, h3, h4, p, label, strong, small, a) { overflow-wrap: anywhere; }
[class*="mobile-"] :where(input, select, textarea, button, a) { touch-action: manipulation; }
[class*="mobile-"] :where(button, a):focus-visible { outline: 3px solid #0b7891; outline-offset: 3px; }
[class*="mobile-"] .staff-forms-navigation { margin: 16px 0; }
[class*="mobile-"] .staff-forms-navigation a { display: inline-flex; align-items: center; min-height: 44px; color: #005870; font-weight: 700; }
.mobile-ticket-back { display: none; }

/* Put these in an external stylesheet: inline styles are blocked on Help Desk. */
.mobile-form .urgency-options,
.mobile-form .category-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; margin: 6px 0 0; }
.mobile-form .grouped-control { margin-bottom: 28px; gap: 12px; }
.mobile-form .request-form { display: grid; gap: 22px; background: transparent; border: 0; box-shadow: none; }
.mobile-form .form-section { min-width: 0; padding: 30px; border: 1px solid #d7e0e6; border-radius: 14px; background: #fff; box-shadow: 0 8px 28px #00293a06; }
.mobile-form .branch-section { background: #f8fbfc; }
.mobile-form .section-heading { margin-bottom: 26px; }
.mobile-form .section-heading > div,
.mobile-form .field-grid > *,
.mobile-form .option-tile > span { min-width: 0; }
.mobile-form .section-heading h2 { line-height: 1.35; }
.mobile-form .section-heading p { line-height: 1.55; }
.mobile-form .field-grid { gap: 24px 20px; }
.mobile-form .option-tile { gap: 12px; line-height: 1.45; }
.mobile-form .option-tile input { flex-shrink: 0; margin: 0; }
.mobile-form .option-tile small { margin-top: 5px; line-height: 1.5; }
.mobile-form .confirmation-section { padding: 24px; border: 1px solid #d7e0e6; border-radius: 14px; background: #fff; line-height: 1.5; }
.mobile-form .form-message:empty { display: none; }
.mobile-form #requesterIdentity { display: block; line-height: 1.6; overflow-wrap: anywhere; }
.mobile-form input[type="file"] { white-space: normal; }

.mobile-admin .detail-actions { flex-wrap: wrap; gap: 12px; }
.mobile-admin .detail-actions > * { min-width: 0; }
.mobile-admin .draft-context > button { margin: 6px 8px 6px 0; }
.mobile-admin .panel p { line-height: 1.65; }
.mobile-admin .panel p[style*="white-space"] { white-space: pre-wrap; }
.mobile-admin .toolbar + .toolbar { margin-top: 16px; }
.mobile-admin .toolbar p { flex: 1 1 280px; margin: 0; }
.mobile-admin .toolbar button { flex-shrink: 0; }
.mobile-admin .toolbar > label { min-width: 0; }
.mobile-admin .ticket-top { flex-wrap: wrap; align-items: center; }
.mobile-admin .description,
.mobile-admin .byline,
.mobile-admin .effect { overflow-wrap: anywhere; }

@media (max-width: 900px) {
  .mobile-admin header { flex-wrap: wrap; gap: 18px 24px; }
  .mobile-admin header nav { flex-direction: row; flex-wrap: wrap; gap: 12px; }
  .mobile-admin .toolbar { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: end; gap: 16px; }
  .mobile-admin .toolbar .search { grid-column: 1 / -1; }
  .mobile-admin .toolbar[aria-label="IT Bot reply connection"] { grid-template-columns: 1fr; align-items: start; }
  .mobile-admin .workspace { grid-template-columns: minmax(0,1fr); }
}

@media (max-width: 720px) {
  [class*="mobile-"] :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea) { font-size: 16px; min-height: 48px; }
  [class*="mobile-"] :where(button, a.secondary) { min-height: 48px; line-height: 1.4; white-space: normal; }
  [class*="mobile-"] textarea { line-height: 1.55; }
  [class*="mobile-"] .staff-forms-navigation a { padding: 6px 0; }
  .mobile-form .page-shell { width: calc(100% - 28px); padding-top: 20px; padding-bottom: max(36px,env(safe-area-inset-bottom)); }
  .mobile-form .page-header { gap: 18px; padding-bottom: 22px; }
  .mobile-form .brand-logo { width: min(210px,54vw); max-width: 100%; }
  .mobile-form .basecamp-lockup,
  .mobile-form .basecamp-logo { width: 76px; }
  .mobile-form h1 { font-size: clamp(1.85rem,7.5vw,2.5rem); line-height: 1.12; }
  .mobile-form .header-title > a { display: inline-flex; align-items: center; min-height: 44px; margin-top: 8px; }
  .mobile-form .request-form { gap: 20px; margin-top: 20px; }
  .mobile-form .form-section { padding: 26px 18px; }
  .mobile-form .section-heading { grid-template-columns: 34px minmax(0,1fr); gap: 12px; margin-bottom: 24px; }
  .mobile-form .step-marker { width: 34px; height: 34px; }
  .mobile-form .field-grid,
  .mobile-form .access-options,
  .mobile-form .radio-options,
  .mobile-form .urgency-options,
  .mobile-form .category-options { grid-template-columns: minmax(0,1fr); gap: 14px; }
  .mobile-form .field-grid { row-gap: 24px; }
  .mobile-form label { font-size: 16px; line-height: 1.45; gap: 9px; }
  .mobile-form .option-tile { padding: 16px 14px; gap: 12px; }
  .mobile-form .option-tile small { font-size: 14px; }
  .mobile-form .grouped-control > small { font-size: 14px; line-height: 1.55; }
  .mobile-form .confirmation-section { padding: 22px 18px; gap: 20px; }
  .mobile-form .confirmation { align-items: start; }
  .mobile-form .confirmation input { margin-top: 3px; }
  .mobile-form .form-message { padding: 0 4px 20px; }
  .mobile-form button { padding: 13px 16px; }

  .mobile-admin header,
  .mobile-admin main { width: calc(100% - 28px); min-width: 0; }
  .mobile-admin header { display: grid; grid-template-columns: minmax(0,1fr); gap: 18px; padding: 22px 0; }
  .mobile-admin .brand img { width: 160px; max-width: 100%; }
  .mobile-admin header nav { margin: 0; display: flex; flex-direction: row; gap: 10px; }
  .mobile-admin header nav a { flex: 1 1 130px; display: flex; align-items: center; justify-content: center; padding: 12px; min-height: 48px; border: 1px solid #d8e3e6; border-radius: 9px; background: #fff; text-align: center; font-size: 14px; }
  .mobile-admin > .staff-forms-navigation { width: calc(100% - 28px); margin: 10px auto; }
  .mobile-admin .overview { margin: 24px 0 20px; gap: 12px; }
  .mobile-admin .overview h2 { font-size: 24px; line-height: 1.25; }
  .mobile-admin .metrics { gap: 12px; margin-bottom: 20px; }
  .mobile-admin .metrics > div { padding: 16px; }
  .mobile-admin .metrics strong { font-size: 28px; }
  .mobile-admin .toolbar { grid-template-columns: minmax(0,1fr); padding: 18px; gap: 18px; }
  .mobile-admin .toolbar > label { width: 100%; min-width: 0; font-size: 14px; }
  .mobile-admin .toolbar button { width: 100%; }
  .mobile-admin .toolbar p { font-size: 14px; line-height: 1.6; }
  .mobile-admin button { font-size: 15px; padding: 13px 15px; }
  .mobile-admin .workspace { gap: 16px; }
  .mobile-admin #tickets { max-height: 360px; overflow-y: auto; overscroll-behavior-y: contain; }
  .mobile-admin .ticket { padding: 18px; }
  .mobile-admin .ticket h3 { line-height: 1.35; }
  .mobile-admin .ticket small { display: block; line-height: 1.5; }
  .mobile-admin .detail { padding: 20px 16px; min-width: 0; overflow: visible; }
  .mobile-admin .detail-header h2 { font-size: 25px; line-height: 1.25; }
  .mobile-admin .detail-header .description { font-size: 16px; line-height: 1.65; }
  .mobile-admin .byline { font-size: 14px; line-height: 1.6; }
  .mobile-admin .panel { padding: 18px 14px; margin-top: 24px; }
  .mobile-admin .panel h3 { font-size: 18px; line-height: 1.35; margin-bottom: 16px; }
  .mobile-admin .panel p { font-size: 15px; }
  .mobile-admin .panel label { gap: 9px; margin-bottom: 18px; font-size: 14px; }
  .mobile-admin .panel textarea { min-height: 140px; }
  .mobile-admin .panel .draft-panel textarea { min-height: 200px; }
  .mobile-admin .detail-actions { flex-direction: column; align-items: stretch; gap: 12px; margin: 18px 0; }
  .mobile-admin .detail-actions > * { width: 100%; }
  .mobile-admin .detail-actions a { display: flex; align-items: center; min-height: 44px; }
  .mobile-admin .panel form > button,
  .mobile-admin .panel > button,
  .mobile-admin .draft-context > button { display: block; width: 100%; margin: 12px 0 0; }
  .mobile-admin .effect { padding: 14px; font-size: 14px; }
  .mobile-admin .activity { padding-left: 18px; line-height: 1.6; }
  .mobile-admin .empty { padding: 18px 4px; }
  .mobile-admin .mobile-ticket-back,
  .mobile-portal .mobile-ticket-back { display: flex; align-items: center; min-height: 48px; padding: 12px 16px; border: 1px solid #d7e0e6; border-radius: 10px; background: #fff; color: #005870; font-weight: 700; text-decoration: none; }
  .mobile-admin #detail,
  .mobile-admin #tickets,
  .mobile-portal #ticketDetail,
  .mobile-portal #ticketList { scroll-margin-top: 16px; }

  .mobile-portal .portal-shell { width: calc(100% - 28px); padding: 20px 0 max(28px,env(safe-area-inset-bottom)); }
  .mobile-portal .portal-header { grid-template-columns: minmax(0,1fr) auto; grid-template-areas: "brand action" "title title"; gap: 22px 14px; padding-bottom: 24px; }
  .mobile-portal .brand-link { grid-area: brand; width: 155px; }
  .mobile-portal .header-copy { grid-area: title; text-align: left; }
  .mobile-portal .header-copy h1 { font-size: 30px; line-height: 1.15; }
  .mobile-portal .new-request-link { grid-area: action; width: auto; padding: 12px; min-height: 48px; font-size: 14px; border-radius: 12px; }
  .mobile-portal .new-request-link span { display: none; }
  .mobile-portal .new-request-link::after { content: none; }
  .mobile-portal .portal-intro { padding: 24px 0; gap: 18px; flex-wrap: wrap; }
  .mobile-portal .identity-chip { max-width: 100%; }
  .mobile-portal .identity-avatar { flex-shrink: 0; }
  .mobile-portal .portal-layout { display: grid; grid-template-columns: minmax(0,1fr); gap: 16px; overflow: visible; border: 0; background: transparent; box-shadow: none; }
  .mobile-portal .ticket-sidebar { min-width: 0; padding: 20px 16px; border: 1px solid #d7e2e5; border-radius: 15px; }
  .mobile-portal .ticket-list { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: minmax(0,1fr); max-height: 360px; overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: contain; scroll-snap-type: none; padding: 0 2px 4px; }
  .mobile-portal .ticket-card h3 { white-space: normal; line-height: 1.4; }
  .mobile-portal .filter-tab { min-height: 44px; font-size: 14px; }
  .mobile-portal .ticket-detail { margin: 0; padding: 22px 16px; overflow: visible; }
  .mobile-portal .tracker-card { margin-top: 24px; padding: 20px 14px; }
  .mobile-portal .tracker-card:first-child { margin-top: 0; }
  .mobile-portal .progress-tracker { gap: 0; }
  .mobile-portal .progress-step strong { font-size: 12px; max-width: 65px; line-height: 1.4; }
  .mobile-portal .progress-dot { width: 30px; height: 30px; }
  .mobile-portal .progress-step::before,
  .mobile-portal .progress-step::after { top: 14px; }
  .mobile-portal .response-card textarea { min-height: 140px; }
  .mobile-portal .response-card button { width: 100%; }
  .mobile-portal .request-facts div { grid-template-columns: minmax(0,1fr); gap: 6px; }
  .mobile-portal .empty-state,
  .mobile-portal .error-state { min-height: 280px; padding: 24px 12px; }
  .mobile-portal footer { flex-wrap: wrap; gap: 12px 20px; }
  .mobile-portal footer a,
  .mobile-portal main > a { display: inline-flex; align-items: center; min-height: 44px; }

  .mobile-welcome .welcome { padding: 28px 16px max(32px,env(safe-area-inset-bottom)); }
  .mobile-welcome h1 { font-size: clamp(2rem,8vw,2.75rem); line-height: 1.15; }
  .mobile-welcome .lead { font-size: 17px; }
  .mobile-welcome .identity { max-width: 100%; border-radius: 12px; line-height: 1.5; }
  .mobile-welcome .steps { gap: 18px; margin: 26px 0; }
  .mobile-welcome .steps article,
  .mobile-welcome .registration { min-width: 0; padding: 22px 18px; }
  .mobile-welcome .registration h2 { font-size: 24px; line-height: 1.3; }
  .mobile-welcome .registration ol { padding-left: 22px; }
  .mobile-welcome .registration li + li { margin-top: 12px; }
  .mobile-welcome .actions { flex-direction: column; align-items: stretch; gap: 12px; margin: 20px 0; }
  .mobile-welcome :where(button, a.secondary) { width: 100%; text-align: center; padding: 14px; }
  .mobile-welcome .small { font-size: 14px; }
  .mobile-directory main { width: calc(100% - 32px); padding: 28px 0 max(36px,env(safe-area-inset-bottom)); }
  .mobile-directory .cards { gap: 20px; }
  .mobile-directory .card { min-width: 0; padding: 24px 22px; }
  .mobile-directory h1 { line-height: 1.12; }
}

@media (max-width: 360px) {
  .mobile-admin .metrics > div { padding: 14px 12px; }
  .mobile-admin .detail { padding: 18px 12px; }
  .mobile-admin .panel { padding: 18px 12px; }
  .mobile-portal .brand-link { width: 132px; }
  .mobile-portal .new-request-link { padding: 12px 10px; font-size: 13px; }
  .mobile-portal .progress-step strong { font-size: 11px; }
}
