/* Installed Native mobile shell only; classic and browser layouts are unchanged. */
.native-floating-actions, .native-search-slot, .native-search-clear, .native-sheet-grip, .native-public-support, .account-screen-avatar-fallback { display: none; }
.mobile-app-shell {
  --native-nav-height: calc(72px + env(safe-area-inset-bottom));
  overflow-x: clip;
  scrollbar-width: none;
}
.mobile-app-shell::-webkit-scrollbar, .mobile-app-shell body::-webkit-scrollbar { display: none; width: 0; }
.mobile-app-shell body { overflow-x: clip; scrollbar-width: none; }
.mobile-app-shell .page-stack { padding-bottom: calc(var(--native-nav-height) + 88px); }
.mobile-app-shell[data-native-tab="account"] .page-stack { padding-bottom: var(--native-nav-height); }
.mobile-app-shell .dashboard-workspace, .mobile-app-shell .tab-panel { min-height: calc(100dvh - var(--native-nav-height)); }
.mobile-app-shell .tab-panel > :not(header):not(dialog) { overflow-x: clip; }
.mobile-app-shell .dashboard-tabs {
  min-height: 0; height: auto; box-shadow: none;
  padding: 8px max(8px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
}
.mobile-app-shell .dashboard-tab, .mobile-app-shell .dashboard-tab-account { height: 56px; min-height: 56px; }
.mobile-app-shell.pwa-keyboard-open .page-stack { padding-bottom: calc(var(--native-nav-height) + 88px); }
.mobile-app-shell .native-floating-actions { position: fixed; inset: 0; z-index: 50; display: block; pointer-events: none; }
.mobile-app-shell .native-fab {
  position: absolute; right: calc(16px + env(safe-area-inset-right)); bottom: calc(var(--native-nav-height) + 16px);
  min-height: 52px; min-width: 112px; display: none; flex-direction: row; justify-content: center; align-items: center; gap: 8px;
  border: 1px solid color-mix(in srgb, var(--accent-ink) 20%, transparent); border-radius: 18px; padding: 10px 18px;
  background: var(--accent-soft); color: var(--accent-ink);
  box-shadow: 0 14px 30px color-mix(in srgb, var(--ink) 32%, transparent), 0 4px 8px color-mix(in srgb, var(--accent-ink) 26%, transparent);
  pointer-events: auto; transition: transform 130ms ease, background 130ms ease, box-shadow 130ms ease;
}
.mobile-app-shell .native-fab small { font-size: 0.88rem; font-weight: 800; }
.mobile-app-shell .native-fab > span { font-size: 1.5rem; line-height: 1; }
.mobile-app-shell[data-native-tab="repositories"] #mobileRepoCreateButton:not([hidden]),
.mobile-app-shell[data-native-tab="users"] #mobileInviteButton:not([hidden]),
.mobile-app-shell[data-native-tab="support"] #mobileSupportNewButton:not([hidden]) { display: flex; }
.mobile-app-shell.pwa-keyboard-open .native-floating-actions { visibility: hidden; pointer-events: none; }
.mobile-app-shell .native-fab:hover { box-shadow: 0 17px 36px color-mix(in srgb, var(--ink) 36%, transparent), 0 5px 10px color-mix(in srgb, var(--accent-ink) 30%, transparent); }
.mobile-app-shell .native-fab:active { transform: scale(.97); box-shadow: 0 8px 17px color-mix(in srgb, var(--ink) 28%, transparent), 0 2px 5px color-mix(in srgb, var(--accent-ink) 22%, transparent); }

.native-pull-refresh {
  --pull-distance: 0px;
  position: fixed; top: calc(64px + env(safe-area-inset-top)); left: 50%; z-index: 34;
  display: flex; align-items: center; gap: 8px; min-height: 34px; max-width: calc(100% - 32px);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 11px 6px 8px;
  background: color-mix(in srgb, var(--surface) 94%, transparent); color: var(--muted);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--ink) 28%, transparent), 0 2px 6px color-mix(in srgb, var(--ink) 18%, transparent); opacity: 0; pointer-events: none;
  transform: translate(-50%, calc(-100% + var(--pull-distance))); transition: transform 180ms ease, opacity 180ms ease;
  font-size: .7rem; font-weight: 800; backdrop-filter: blur(14px);
}
.native-pull-refresh.is-pulling { opacity: 1; transition: none; }
.native-pull-refresh.is-refreshing { opacity: 1; transform: translate(-50%, 12px); }
.native-pull-refresh-spinner { width: 18px; height: 18px; border: 2px solid color-mix(in srgb, var(--accent) 24%, transparent); border-top-color: var(--accent); border-radius: 50%; }
.native-pull-refresh.is-refreshing .native-pull-refresh-spinner { animation: native-pull-spin 700ms linear infinite; }
@keyframes native-pull-spin { to { transform: rotate(360deg); } }

:root[data-theme="dark"].mobile-app-shell .native-fab,
:root[data-theme="dark"] .native-pull-refresh { box-shadow: 0 9px 20px rgba(0, 0, 0, .30), 0 2px 5px rgba(0, 0, 0, .20); }
:root[data-theme="dark"].mobile-app-shell .native-fab:hover { box-shadow: 0 11px 25px rgba(0, 0, 0, .34), 0 3px 7px rgba(0, 0, 0, .24); }
:root[data-theme="dark"].mobile-app-shell .native-fab:active { box-shadow: 0 5px 11px rgba(0, 0, 0, .26), 0 2px 4px rgba(0, 0, 0, .18); }
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"].mobile-app-shell .native-fab,
  :root[data-theme="auto"] .native-pull-refresh { box-shadow: 0 9px 20px rgba(0, 0, 0, .30), 0 2px 5px rgba(0, 0, 0, .20); }
  :root[data-theme="auto"].mobile-app-shell .native-fab:hover { box-shadow: 0 11px 25px rgba(0, 0, 0, .34), 0 3px 7px rgba(0, 0, 0, .24); }
  :root[data-theme="auto"].mobile-app-shell .native-fab:active { box-shadow: 0 5px 11px rgba(0, 0, 0, .26), 0 2px 4px rgba(0, 0, 0, .18); }
}

.mobile-app-shell .mobile-screen-bar {
  z-index: 60; display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); grid-template-rows: 48px;
  height: calc(64px + env(safe-area-inset-top)); min-height: 0; align-content: center; align-items: center; gap: 10px;
  padding: calc(8px + env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 12px max(14px, env(safe-area-inset-left));
  text-align: left; overflow: visible;
}
.mobile-app-shell .mobile-screen-bar:has(.native-search-slot) { height: calc(64px + env(safe-area-inset-top)); }
.mobile-app-shell .mobile-screen-title { transition: opacity 160ms ease, transform 200ms ease; }
.mobile-app-shell .mobile-screen-title h1 { font-size: 1.45rem; text-align: left; }
.mobile-app-shell .mobile-screen-title > span, .mobile-app-shell .mobile-screen-actions,
.mobile-app-shell .section-heading .eyebrow, .mobile-app-shell .native-sheet > .eyebrow { display: none; }
.mobile-app-shell .section-heading { align-items: flex-start; text-align: left; }
.mobile-app-shell .native-search-slot { grid-column: 2; display: flex; min-width: 0; width: 100%; align-items: center; }
.mobile-app-shell .mobile-screen-bar [data-mobile-search-host] {
  position: relative; inset: auto; z-index: auto; display: flex; align-items: center; gap: 6px;
  width: 100%; min-height: 48px; margin: 0; padding: 0; border: 0; background: transparent;
  box-shadow: none; backdrop-filter: none; transition: width 200ms cubic-bezier(.2,.75,.25,1);
}
.mobile-app-shell .mobile-screen-bar.is-searching { z-index: 90; }
.mobile-app-shell .mobile-screen-bar.is-searching { grid-template-columns: minmax(0, 1fr); }
.mobile-app-shell .mobile-screen-bar.is-searching .mobile-screen-title { display: none; }
.mobile-app-shell .mobile-screen-bar.is-searching .native-search-slot { grid-column: 1; }
.mobile-app-shell .mobile-screen-bar.is-searching [data-mobile-search-host] { width: 100%; }
.mobile-app-shell .mobile-screen-bar .structured-search-shell {
  position: relative; min-width: 0; flex: 1 1 auto; min-height: 48px; flex-wrap: nowrap; gap: 4px; overflow: hidden; padding: 4px 6px; border-radius: 14px; background: var(--surface-2);
}
.mobile-app-shell .mobile-screen-bar .structured-search-shell input { min-width: 0; width: 0; flex: 1 1 7ch; min-height: 36px; font-size: 16px; }
.mobile-app-shell .mobile-screen-bar .search-tokens { min-width: 0; max-width: 48%; display: flex; flex: 0 1 48%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.mobile-app-shell .mobile-screen-bar .search-tokens:empty { display: none; }
.mobile-app-shell .mobile-screen-bar .search-token { min-height: 34px; flex-shrink: 0; white-space: nowrap; }
.mobile-app-shell .mobile-screen-bar [data-mobile-search-host]:not(.is-mobile-search-open).has-active-search .search-tokens { display: none; }
.mobile-app-shell .mobile-screen-bar [data-mobile-search-host]:not(.is-mobile-search-open).has-active-search .structured-search-shell::before { content: "Filtered"; position: absolute; inset: 0 auto 0 10px; display: flex; align-items: center; color: var(--accent-ink); font-size: .76rem; font-weight: 800; pointer-events: none; }
.mobile-app-shell .mobile-screen-bar [data-mobile-search-host]:not(.is-mobile-search-open).has-active-search .structured-search-shell input { color: transparent; caret-color: transparent; }
.mobile-app-shell .mobile-screen-bar [data-mobile-search-host]:not(.is-mobile-search-open).has-active-search .structured-search-shell input::placeholder { color: transparent; }
.mobile-app-shell .native-search-clear:not([hidden]) { display: grid; place-items: center; width: 36px; height: 44px; flex: 0 0 36px; padding: 0; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 1.3rem; cursor: pointer; }
.mobile-app-shell .mobile-screen-bar .mobile-search-close { display: none; width: auto; min-width: 48px; min-height: 44px; height: 44px; padding: 0 4px; border-radius: 10px; color: var(--accent-ink); font-size: .82rem; font-weight: 750; }
.mobile-app-shell .mobile-screen-bar.is-searching .mobile-search-close { display: block; }
.mobile-app-shell .mobile-screen-bar .search-suggestions {
  z-index: 95; top: calc(100% + 6px); margin: 0; max-height: max(100px, min(45dvh, calc(var(--native-viewport-height, 100dvh) - 148px - env(safe-area-inset-top))));
  overscroll-behavior: contain; border-radius: 16px; background: var(--surface); box-shadow: 0 4px 16px color-mix(in srgb, var(--ink) 10%, transparent);
}
.mobile-app-shell .search-suggestion { min-height: 48px; align-items: center; gap: 8px; padding: 10px; }
.mobile-app-shell .search-suggestion strong { overflow-wrap: anywhere; font-size: .8rem; }
.mobile-app-shell .search-suggestion span { text-align: right; }
.mobile-app-shell .search-suggestion[aria-selected="true"] { background: var(--accent-soft); }

.mobile-app-shell { scrollbar-gutter: auto; }
.native-underlay-frozen { overflow: hidden !important; }
.native-overlay-shield {
  position: fixed; inset: 0; width: 100%; height: 100dvh; max-width: none; max-height: none; margin: 0; border: 0; padding: 0;
  background: linear-gradient(to top, rgba(0,0,0,.18), rgba(0,0,0,.10) 40%, transparent 100%);
  animation: native-scrim-enter 160ms ease-out;
}
.native-overlay-shield-search { z-index: 80; background: linear-gradient(to bottom, rgba(0,0,0,.18), rgba(0,0,0,.08) 55%, transparent); }
@keyframes native-scrim-enter { from { opacity: 0; } to { opacity: 1; } }
.mobile-app-shell .repo-popover, .mobile-app-shell .repo-sort-popover, .mobile-app-shell .split-button-menu, .mobile-app-shell .user-popover {
  position: fixed; inset: auto 12px calc(12px + env(safe-area-inset-bottom) + var(--native-keyboard-inset, 0px)) !important;
  width: calc(100% - 24px); max-width: 620px; max-height: calc(var(--native-viewport-height, 100dvh) - 40px) !important;
  margin: 0 auto; overflow-y: auto; overscroll-behavior: contain; border-radius: 20px; padding: 14px;
  background: var(--surface); box-shadow: 0 4px 18px rgba(0,0,0,.12); transform-origin: bottom;
}
.mobile-app-shell .repo-popover::backdrop, .mobile-app-shell .repo-sort-popover::backdrop,
.mobile-app-shell .split-button-menu::backdrop, .mobile-app-shell .user-popover::backdrop { background: rgba(0, 0, 0, .25); pointer-events: auto; }
.mobile-app-shell .user-popover:popover-open { opacity: 1; pointer-events: auto; transform: none; }
.mobile-app-shell .repo-sort-popover > button, .mobile-app-shell .split-button-menu > button { min-height: 48px; }

.mobile-app-shell .native-sheet {
  position: fixed; inset: auto 0 var(--native-keyboard-inset, 0px); width: min(100%, 620px); max-width: none;
  max-height: min(86dvh, calc(var(--native-viewport-height, 100dvh) - 16px)); margin: 0 auto;
  overflow-y: auto; overscroll-behavior: contain; border-width: 1px 0 0; border-radius: 24px 24px 0 0;
  padding: 0 max(18px, env(safe-area-inset-right)) calc(18px + env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  background: var(--surface); opacity: 1; transform: none; animation: none !important; transition: none !important;
}
.mobile-app-shell .native-sheet::before { content: none !important; display: none !important; }
.mobile-app-shell .native-sheet[open]::backdrop { background: rgba(10,10,10,.52); backdrop-filter: blur(2px); opacity: var(--sheet-progress, 1); transition: opacity 220ms ease; }
.mobile-app-shell .native-sheet.is-dragging::backdrop { transition: none; }
.mobile-app-shell .native-sheet-grip {
  position: sticky; top: 0; z-index: 5; display: flex; justify-content: center; align-items: center;
  width: calc(100% - 48px); min-height: 44px; margin: 0 24px; border: 0; padding: 0; border-radius: 10px;
  background: var(--surface); cursor: grab; touch-action: none; user-select: none;
}
.mobile-app-shell .native-sheet-grip span { width: 38px; height: 4px; border-radius: 99px; background: var(--line-strong); }
.mobile-app-shell .native-sheet.is-dragging .native-sheet-grip { cursor: grabbing; }
.mobile-app-shell .native-sheet > h2 { margin: 4px 44px 16px 0; text-align: left; }
.mobile-app-shell .native-sheet .dialog-close { top: 6px; right: 8px; z-index: 6; }
.mobile-app-shell .native-sheet .mobile-sheet-actions { gap: 10px; }
.mobile-app-shell .native-sheet .mobile-sheet-actions > .button { display: flex; min-height: 48px; justify-content: center; border: 1px solid var(--line-strong); padding: 12px 16px; border-radius: 12px; font-size: .88rem; text-align: center; }
.mobile-app-shell .native-sheet .mobile-sheet-actions > .button-primary { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.mobile-app-shell .native-sheet .mobile-sheet-actions > .button-secondary { background: var(--surface-2); color: var(--ink); }
.mobile-app-shell .native-sheet .mobile-sheet-actions > .button-danger { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
.mobile-app-shell .native-sheet .mobile-sheet-actions > button:not(.button), .mobile-app-shell .native-public-support {
  display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 12px; min-height: 64px;
  border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; background: var(--surface-2); color: var(--ink); text-align: left; text-decoration: none;
}
.mobile-app-shell .native-public-support > span:nth-child(2) { display: grid; gap: 2px; }
.mobile-app-shell .native-public-support strong { font-size: .9rem; }
.mobile-app-shell .support-intro { display: none; }
.mobile-app-shell .native-invite-dialog .invitation-form { display: grid; grid-template-columns: minmax(0,1fr); gap: 14px; }
.mobile-app-shell .native-invite-dialog .form-actions, .mobile-app-shell .native-invite-dialog .split-button { width: 100%; }
.mobile-app-shell .native-sheet .button { min-height: 44px; }
.mobile-app-shell .native-sheet .button:active:not(:disabled) { transform: scale(.985); }
.mobile-app-shell .native-discard-dialog { position: fixed; inset: 0; width: min(360px, calc(100% - 32px)); max-height: max-content; margin: auto; padding: 24px; border: 1px solid var(--line); border-radius: 20px; }
.mobile-app-shell .native-discard-dialog::before { display: none; }
.mobile-app-shell .native-discard-dialog p { margin: 10px 0 20px; color: var(--muted); }
.mobile-app-shell .native-discard-dialog .dialog-actions { position: static; margin: 0; padding: 0; background: transparent; }

.mobile-app-shell .repo-detail-content { padding-top: calc(58px + env(safe-area-inset-top)); scrollbar-gutter: auto; }
.mobile-app-shell .repo-detail-content > .repo-detail-header { position: static; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding: 0 0 18px; margin: 0 0 16px; }
.mobile-app-shell .repo-detail-header .lead { white-space: normal; }
.mobile-app-shell .repo-header-actions { justify-content: flex-start; gap: 14px; }
.mobile-app-shell .repo-dialog-controls { top: calc(10px + env(safe-area-inset-top)); right: calc(14px + env(safe-area-inset-right)); }
.mobile-app-shell .repo-dialog .dialog-close { width: 44px; height: 44px; border-radius: 50%; background: var(--surface-2); }
.mobile-app-shell .theme-choice { position: relative; display: inline-grid; justify-self: start; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: max-content; width: max-content; max-width: 100%; gap: 2px; padding: 3px; isolation: isolate; }
.mobile-app-shell .theme-choice::before { content: ''; position: absolute; z-index: -1; top: 3px; bottom: 3px; left: 0; width: var(--selection-width, 0px); transform: translateX(var(--selection-left, 3px)); border-radius: 11px; background: var(--surface); transition: transform 200ms cubic-bezier(.2,.75,.25,1), width 200ms ease; }
.mobile-app-shell .theme-choice button { min-height: 44px; padding: 8px 14px; white-space: nowrap; }
.mobile-app-shell .theme-choice button[aria-pressed="true"] { background: transparent; box-shadow: none; color: var(--ink); }

/* Keep the native settings identity block intentional and card-like. */
.mobile-app-shell .account-profile-card {
  position: relative; isolation: isolate; overflow: hidden; align-items: center; gap: 15px;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--line)); border-radius: 22px;
  padding: 18px; background: linear-gradient(135deg, var(--surface-2), color-mix(in srgb, var(--accent-soft) 55%, var(--surface)));
  box-shadow: none;
}
.mobile-app-shell .account-profile-card::before {
  content: ""; position: absolute; z-index: -1; width: 150px; height: 150px; top: -82px; right: -48px;
  border-radius: 50%; background: color-mix(in srgb, var(--accent) 13%, transparent); pointer-events: none;
}
.mobile-app-shell .account-screen-avatar {
  width: 70px; height: 70px; border: 1px solid color-mix(in srgb, var(--surface) 88%, transparent);
  border-radius: 22px; box-shadow: none;
}
.mobile-app-shell .account-screen-avatar-fallback { display: grid; flex: 0 0 auto; place-items: center; background: var(--accent-soft); color: var(--accent-ink); font-size: 1.35rem; font-weight: 900; }
.mobile-app-shell .account-profile-card > div { position: relative; z-index: 1; gap: 4px; }
.mobile-app-shell .account-profile-card h2 { margin: 0; font-size: 1.13rem; letter-spacing: -0.025em; }
.mobile-app-shell .account-profile-card a { width: fit-content; display: inline-flex; align-items: center; gap: 4px; font-weight: 800; }
.mobile-app-shell .account-profile-card > div > span:first-of-type { width: fit-content; margin-top: 3px; border-radius: 999px; padding: 4px 8px; background: color-mix(in srgb, var(--accent-soft) 72%, transparent); color: var(--accent-ink); font-size: .66rem; font-weight: 850; letter-spacing: .03em; text-transform: uppercase; }
.mobile-app-shell .account-profile-card > div > span + span { overflow-wrap: anywhere; }

@media (max-width: 380px) {
  .mobile-app-shell .mobile-screen-bar { grid-template-columns: minmax(0, .78fr) minmax(0, 1.22fr); gap: 7px; padding-inline: max(10px, env(safe-area-inset-left)) max(10px, env(safe-area-inset-right)); }
  .mobile-app-shell .mobile-screen-title h1 { font-size: 1.22rem; }
  .mobile-app-shell .mobile-screen-bar [data-mobile-search-host] { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .native-overlay-shield, .mobile-app-shell .native-sheet::backdrop, .mobile-app-shell .mobile-screen-title,
  .mobile-app-shell [data-mobile-search-host], .mobile-app-shell .theme-choice::before { animation: none !important; transition: none !important; }
}
